apiVersion: apps/v1
kind: Deployment
metadata:
  name: jobmanager-centos-sen2agri-worker
spec:
  selector:
    matchLabels:
      app: jobmanager-centos-sen2agri-worker
  replicas: 2
  template:
    metadata:
      labels:
        app: jobmanager-centos-sen2agri-worker
    spec:
      containers:
        - name: jobmanager-task-runner
          image: zeus684440.agr.gc.ca/jobmanager-centos7:ver7
          command: ["/bin/sh"]
          args: ["-c", "/code/common/start_worker.sh"]
          env:
            - name: USGS_EE_PASS
              valueFrom:
                secretKeyRef:
                  name: usgs-ee-pass
                  key: password
            - name: S3_SECRET_KEY
              valueFrom:
                secretKeyRef:
                  name: minio-s3-secret-key
                  key: password
            - name: PSQL_DB_PASS
              valueFrom:
                secretKeyRef:
                  name: jobmanager-psql-db-password
                  key: password
          envFrom:
            - configMapRef:
                name: jobmanager-config
          imagePullPolicy: IfNotPresent
          volumeMounts:
            - name: nfsvol
              mountPath: /mnt/zeusdrobo
            - mountPath: /code/testdir/
              name: testing-volume-mounts
            - mountPath: /code/config.yaml
              subPath: config.yaml
              name: jobmanager-config-volume
        - name: jobmanager-celery-worker
          image: zeus684440.agr.gc.ca/jobmanager-centos7:ver7
          command: ["/bin/sh"]
          args: ["-c", "/code/common/celery_worker.sh"]
          env:
            - name: USGS_EE_PASS
              valueFrom:
                secretKeyRef:
                  name: usgs-ee-pass
                  key: password
            - name: S3_SECRET_KEY
              valueFrom:
                secretKeyRef:
                  name: minio-s3-secret-key
                  key: password
            - name: PSQL_DB_PASS
              valueFrom:
                secretKeyRef:
                  name: jobmanager-psql-db-password
                  key: password
          envFrom:
            - configMapRef:
                name: jobmanager-config
          imagePullPolicy: IfNotPresent
          volumeMounts:
            - name: nfsvol
              mountPath: /mnt/zeusdrobo
            - mountPath: /code/testdir/
              name: testing-volume-mounts
            - mountPath: /code/config.yaml
              subPath: config.yaml
              name: jobmanager-config-volume
        - name: jobmanager-celery-beat
          image: zeus684440.agr.gc.ca/jobmanager-centos7:ver7
          command: ["/bin/sh"]
          args: ["-c", "/code/common/start_celery_beat.sh"]
          env:
            - name: USGS_EE_PASS
              valueFrom:
                secretKeyRef:
                  name: usgs-ee-pass
                  key: password
            - name: S3_SECRET_KEY
              valueFrom:
                secretKeyRef:
                  name: minio-s3-secret-key
                  key: password
            - name: PSQL_DB_PASS
              valueFrom:
                secretKeyRef:
                  name: jobmanager-psql-db-password
                  key: password
          envFrom:
            - configMapRef:
                name: jobmanager-config
          imagePullPolicy: IfNotPresent
          volumeMounts:
            - name: nfsvol
              mountPath: /mnt/zeusdrobo
            - mountPath: /code/testdir/
              name: testing-volume-mounts
            - mountPath: /code/config.yaml
              subPath: config.yaml
              name: jobmanager-config-volume
      imagePullSecrets:
        - name: registrypullsecret
      volumes:
        - name: nfsvol
          persistentVolumeClaim:
            claimName: nfs-pvc
        - emptyDir: {}
          name: testing-volume-mounts
        - configMap:
            name: jobmanager-config
            items:
              - key: config.yaml
                path: config.yaml
          name: jobmanager-config-volume
