apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    service: backend-feed
  name: backend-feed
spec:
  replicas: 1
  selector:
    matchLabels:
      service: backend-feed
  template:
    metadata:
      labels:
        service: backend-feed
    spec:
      containers:
      - image: ismaelbernal83/udagram-api-feed:v1
        name: udagram-api-feed
        imagePullPolicy: Always
        ports:
        - containerPort: 80
        env:
        - name: ENV
          valueFrom:
            configMapKeyRef:
              name: common-config
              key: ENV  
        - name: ORIGIN
          valueFrom:
            configMapKeyRef:
              name: common-config
              key: ORIGIN  
        - name: POSTGRES_DATABASE
          valueFrom:
            configMapKeyRef:
              name: common-config
              key: POSTGRES_DATABASE 
        - name: POSTGRES_USERNAME
          valueFrom:
            configMapKeyRef:
              name: common-secrets
              key: POSTGRES_USERNAME 
        - name: POSTGRES_PASSWORD
          valueFrom:
            configMapKeyRef:
              name: common-secrets
              key: POSTGRES_PASSWORD 
        - name: POSTGRES_HOST
          valueFrom:
            configMapKeyRef:
              name: common-config
              key: POSTGRES_HOST 
        - name: DIALECT
          valueFrom:
            configMapKeyRef:
              name: common-config
              key: DIALECT 
        - name: AWS_PROFILE
          valueFrom:
            configMapKeyRef:
              name: common-config
              key: AWS_PROFILE 
        - name: AWS_REGION
          valueFrom:
            configMapKeyRef:
              name: common-config
              key: AWS_REGION
        - name: AWS_MEDIA_BUCKET
          valueFrom:
            configMapKeyRef:
              name: common-config
              key: AWS_MEDIA_BUCKET
        - name: JWT_SECRET
          valueFrom:
            configMapKeyRef:
              name: common-secrets
              key: JWT_SECRET 