apiVersion: apps/v1
kind: Deployment
metadata:
  name: server-deployment
spec:
  replicas: 3
  selector:
    matchLabels:
      component: api
  template:
    metadata:
      labels:
        component: api
    spec:
      containers:
      - name: server
        image: server-image
        ports:
        - containerPort: 5000
        env:
          - name: PGUSER
            value: postgres
          - name: PGHOST
            value: postgres-cluster-ip-service
          - name: PGPORT
            value: '5432'
          - name: PGDATABASE
            value: postgres
          - name: PGPASSWORD
            valueFrom:
              secretKeyRef:
                name: pgpassword
                key: PGPASSWORD
