apiVersion: v1
kind: Service
metadata:
  name: postgres-service
  labels:
    app: postgres
spec:
  ports:
    - name: postgres-port
      protocol: "TCP"
      port: 5432
      targetPort: 5432
  selector:
    app: postgres