apiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: name: allow-cas-postgres spec: podSelector: matchLabels: app: cas policyTypes: - Ingress ingress: - from: - podSelector: matchLabels: app: postgres ports: - protocol: TCP port: 5432