apiVersion: apps/v1
kind: Deployment
metadata:
  name: recipe-app
  labels:
    app: recipe-app
spec:
  replicas: 1
  selector:
    matchLabels:
      app: recipe-app
  template:
    metadata:
      labels:
        app: recipe-app
    spec:
      containers:
      - name: recipe-app
        image: shreeda/recipeapi:latest 
        ports:
        - containerPort: 8000
          name: gunicorn
        env:
            - name: POSTGRES_USER
              valueFrom:
                secretKeyRef:
                  name: postgres-credentials
                  key: user

            - name: POSTGRES_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: postgres-credentials
                  key: password

            - name: POSTGRES_HOST
              value: postgres-service

              