kind: NetworkPolicy
apiVersion: networking.k8s.io/v1
metadata:
  namespace: "x"
  name: allow-to-ns-y-pod-a
spec:
  egress:
    - to:
        - namespaceSelector:
            matchLabels:
              ns: "y"
          podSelector:
            matchLabels:
              pod: a
      ports:
        - port: 80
          protocol: TCP
    - ports:
        - port: 53
          protocol: UDP
  podSelector:
    matchLabels:
      pod: a
  policyTypes:
    - Egress