apiVersion: "apps/v1"
kind: "Deployment"
metadata:
  name: "simpleapi"
  namespace: "default"
  labels:
    app: "simpleapi"
spec:
  replicas: 1
  selector: 
    matchLabels:
      app: "simpleapi"
  template:
    metadata:
      labels:
        app: "simpleapi"
    spec:
      containers:
      - name: "simpleapi"
        image: $IMAGE_NAME
        imagePullPolicy: Always
        env:
        - name: "APP_HOST"
          valueFrom:
            configMapKeyRef:
              key: "APP_HOST"
              name: "api-config"
        - name: "APP_PORT"
          valueFrom:
            configMapKeyRef:
              key: "APP_PORT"
              name: "api-config"
        - name: "DB_HOST"
          valueFrom:
            configMapKeyRef:
              key: "DB_HOST"
              name: "api-config"
        - name: "DB_PORT"
          valueFrom:
            configMapKeyRef:
              key: "DB_PORT"
              name: "api-config"
        - name: "POSTGRES_DB"
          valueFrom:
            configMapKeyRef:
              key: "POSTGRES_DB"
              name: "postgres-config"
        - name: "POSTGRES_USER"
          valueFrom:
            configMapKeyRef:
              key: "POSTGRES_USER"
              name: "postgres-config"
        - name: "POSTGRES_PASSWORD"
          valueFrom:
            configMapKeyRef:
              key: "POSTGRES_PASSWORD"
              name: "postgres-config"
