apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
  name: team-a-egress
  namespace: team-a
spec:
  # pod(s) this policy "applies" to
  podSelector:
    matchLabels:
      app: ta
  policyTypes:
  - Egress
  egress:
  - to:
    - namespaceSelector:
        matchLabels:
          name: team-b
      podSelector:
        matchLabels:
          app: tb
  - to:
    - ipBlock:
        cidr: 10.0.0.0/8
    ports:
    - protocol: UDP
      port: 53
