apiVersion: apps/v1
kind: Deployment
metadata:
  name: postgres-deployment
  labels:
    app: postgres
spec:
  replicas: 1
  selector:
    matchLabels:
      app: postgres
  template:
    metadata:
      labels:
        app: postgres
    spec:
      containers:
      - name: postgres
        image: postgres:13.6
        imagePullPolicy: IfNotPresent
        ports:
        - containerPort: 5432
        envFrom:
            - configMapRef:
                name: postgres-config
        volumeMounts:
            - mountPath: /var/lib/postgresql-13.6/data
              name: postgredb-kong
        resources:
          limits:
            memory: "128Mi"
            cpu: "500m"
      volumes:
        - name: postgredb-kong
          persistentVolumeClaim:
            claimName: postgres-pv-claim-kong