apiVersion: apps/v1
kind: Deployment
metadata:
  name: zipcode
spec:
  selector:
    matchLabels:
      app: zipcode
  replicas: 1
  template:
    metadata:
      labels:
        app: zipcode
    spec:
      containers:
      - name: zipcode
        image: tdmanville/zipcode:tom-test
        imagePullPolicy: Always
        ports:
        - containerPort: 8000
        env:
          - name: PG_HOST
            valueFrom:
              configMapKeyRef:
                name: dbconfig
                key: postgres.host
          - name: PG_PORT
            valueFrom:
              configMapKeyRef:
                name: dbconfig
                key: postgres.port
          - name: PG_DBNAME
            valueFrom:
              configMapKeyRef:
                name: dbconfig
                key: postgres.databases
          - name: PG_USER
            valueFrom:
              configMapKeyRef:
                name: dbconfig
                key: postgres.user
          - name: PG_PASSWORD
            valueFrom:
              secretKeyRef:
                name: dbcreds
                key: password
