apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
  name: db
  namespace: voting-app-prd
spec:
  podSelector:
    matchLabels:
      name: db
  policyTypes:
  - Ingress
  ingress:
  - from:
    - podSelector:
        matchLabels:
          name: result
    - podSelector:
        matchLabels:
          name: worker
    ports:
    - protocol: TCP
      port: 5432
