apiVersion: v1
kind: Service
metadata:
  name: postgres-service
  namespace: postgres
spec:
  ports:
  - name: postgres-port
    nodePort: 30432
    protocol: TCP
    port: 5432
  selector:
    app: postgres
  type: NodePort