apiVersion: apps/v1
kind: Deployment
metadata:
  name: demo-api
  namespace: web
  labels:
    app: demo-man
    svc: api
spec:
  selector:
    matchLabels:
      app: demo-man
      svc: api
  template:
    metadata:
      labels:
        app: demo-man
        svc: api
    spec:
      restartPolicy: Always
      imagePullSecrets:
      - name: github
      - name: gitlab
      containers:
      - name: api
        imagePullPolicy: Always
        image: registry.git.rwth-aachen.de/z-cloud/demo-man/api:latest
        env:
        - name: MONGOURL
          value: "mongodb://demo-mongodb:27017"
        - name: DB
          value: "demo"
        - name: WAVE_ENDPOINT
          value: http://demo-waveman:8083/
        - name: API_ENDPOINT
          value: https://demo.zoomoid.de/api/v1/demo
        - name: PORT
          value: "8080"
        - name: TOKEN 
          valueFrom:
            secretKeyRef:
              name: demo-man-api-token
              key: token
        ports:
        - containerPort: 8080
        resources:
          limits:
            memory: "512Mi"
            cpu: "300m"