apiVersion: apps/v1
kind: Deployment
metadata:
  name: todofehristapi-deployment
spec:
  selector:
    matchLabels:
      app: todofehristapi
  replicas: 2 # tells deployment to run 2 pods matching the template
  template:
    metadata:
      labels:
        app: todofehristapi
    spec:
      containers:
      - name: todofehristapi
        image: z4id/todofehrist:v3
        env:
          - name: DB_VENDOR
            value: "postgres"
          - name: DB_HOST
            valueFrom: { secretKeyRef: { name: hippo-pguser-hippo, key: host } }
          - name: DB_PORT
            valueFrom: { secretKeyRef: { name: hippo-pguser-hippo, key: port } }
          - name: DB_NAME
            valueFrom: { secretKeyRef: { name: hippo-pguser-hippo, key: dbname } }
          - name: DB_USER
            valueFrom: { secretKeyRef: { name: hippo-pguser-hippo, key: user } }
          - name: DB_PASSWORD
            valueFrom: { secretKeyRef: { name: hippo-pguser-hippo, key: password } }
        envFrom:
          - configMapRef:
              name: todofehristapi-dev-env-cm