apiVersion: apps/v1
kind: Deployment
metadata:
  name: apy1-deployment
  labels:
    app: apy1-backend
spec:
  replicas: 1
  selector:
    matchLabels:
      tier: tier-apy1-backend
  template:
    metadata:
      labels:
        tier: tier-apy1-backend
    spec:
      containers:
      - name: cont-app1-backend
        image: 435606335423.dkr.ecr.eu-west-1.amazonaws.com/john-axel-apy:1.0.9
        env:
          - name: POST_USER
            valueFrom:
              secretKeyRef:
                # The secret containing the value you want to assign to SPECIAL_LEVEL_KEY
                name: postgres-login
                # Specify the key associated with the value
                key: special.postuser
          - name: POST_PASSWORD
            valueFrom:
              secretKeyRef:
                name: postgres-login
                key: special.postpassword
          - name: URI_POSTGRES
            valueFrom:
              secretKeyRef:
                name: postgres-login
                key: special.uripostgres
          - name: POST_PORT
            valueFrom:
              secretKeyRef:
                name: postgres-login
                key: special.postport
          - name: DBASE
            valueFrom:
              secretKeyRef:
                name: postgres-login
                key: special.dbase
        ports:
          - name: web
            containerPort: 5000
            protocol: TCP