apiVersion: apps/v1
kind: Deployment
metadata:
  name: jobregistry
spec:
  replicas: 1
  selector:
    matchLabels:
       app: jobregistry
  template:
    metadata:
      labels:
        app: jobregistry
    spec:
      containers:
        - name: jobregistry
          image: '{{ repository }}/jobregistry:{{ image_version }}'
          env:
          ## PG Environment variables
          - name: PGHOST
            value: postgres
          - name: PGPORT
            value: '5432'
          - name: PGDATABASE
            value: postgres
          - name: OPSDATABASE
            value: ops
          - name: PGUSER
            value: postgres
          - name: PGPASSWORD
            valueFrom:
              secretKeyRef:
                name: pg-secret
                key: PGPASSWORD
          - name: DOWNLOAD_FOLDER
            value: './download'
          - name: LOG_LEVEL
            value: DEBUG
          - name: PYTHONPATH
            value: /opt/cobra-python-packages
          imagePullPolicy: "IfNotPresent"
          ports:
            - containerPort: 80
          command: ["python3", "main.py"]
          volumeMounts:
            - mountPath: /opt/cobra-python-packages
              name: devlibs
            - mountPath: /download
              name: download
      volumes:
        - name: devlibs
          hostPath:
            path: '{{ local_lib_path }}/python'
            type: DirectoryOrCreate
        - name: download
          persistentVolumeClaim:
            claimName: download-claim
 
