apiVersion: apps/v1 kind: Deployment metadata: name: postgres-deployment spec: replicas: 1 selector: matchLabels: app: postgres template: metadata: labels: app: postgres spec: containers: - name: postgres image: postgis/postgis:16-3.4 env: - name: POSTGRES_USER value: "postgres" - name: POSTGRES_PASSWORD value: "password" - name: POSTGRES_DB value: "gis" ports: - containerPort: 5432 volumeMounts: - mountPath: /var/lib/postgresql/data name: pgdata - mountPath: /docker-entrypoint-initdb.d name: schema volumes: - name: pgdata persistentVolumeClaim: claimName: pgdata-pvc - name: schema hostPath: path: ${PGDATA}