---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: worker
spec:
  replicas: 1
  template:
    metadata:
      annotations:
        alpha.image.policy.openshift.io/resolve-names: '*'
      labels:
        service: worker
    spec:
      containers:
        - name: worker
          image: kindlyops/havenworker
          env:
            - name: FAKTORY_URL
              valueFrom:
                secretKeyRef:
                  name: haven-faktory-credentials
                  key: url
            - name: KC_ADMIN
              value: "admin"
            - name: KC_PW
              valueFrom:
                secretKeyRef:
                  name: haven-database-credentials
                  key: password
            - name: KC_HOST
              value: http://keycloak
            - name: KC_PORT
              value: "8080"
          volumeMounts:
            - mountPath: "/home/rstudio/kitematic"
              name: worker-vol
      volumes:
        - name: worker-vol
          persistentVolumeClaim:
          claimName: worker-volume
      restartPolicy: Always
  strategy:
    type: "Recreate"
  paused: false
  revisionHistoryLimit: 2
  minReadySeconds: 0
status: {}

---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: worker
spec:
  replicas: 1
  template:
    metadata:
      annotations:
        alpha.image.policy.openshift.io/resolve-names: '*'
      labels:
        service: worker
    spec:
      containers:
        - name: worker
          image: kindlyops/havenworker
          env:
            - name: DATABASE_NAME
              value: "havenstage"
            - name: DATABASE_HOST
              value: "db"
            - name: DATABASE_USERNAME
              valueFrom:
                secretKeyRef:
                  name: haven-database-credentials
                  key: username
            - name: DATABASE_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: haven-database-credentials
                  key: password
            - name: FAKTORY_URL
              valueFrom:
                secretKeyRef:
                  name: haven-faktory-credentials
                  key: url
            - name: KC_ADMIN
              value: "admin"
            - name: KC_PW
              valueFrom:
                secretKeyRef:
                  name: haven-database-credentials
                  key: password
            - name: KC_HOST
              value: http://keycloak
            - name: KC_PORT
              value: "8080"
          volumeMounts:
            - mountPath: "/home/rstudio/kitematic"
              name: worker-vol
      volumes:
        - name: worker-vol
          persistentVolumeClaim:
          claimName: worker-volume
      restartPolicy: Always
  strategy:
    type: "Recreate"
  paused: false
  revisionHistoryLimit: 2
  minReadySeconds: 0
status: {}

Refactor to add DB env vars to worker.
Refactor to add DB env vars to worker.

Fixes db cred errors.

Signed-off-by: Christopher Mundus <711c73f64afdce07b7e38039a96d2224209e9a6c@kindlyops.com>
