apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
  name: app2-network-policy
  namespace: app2
spec:
  podSelector: {}
  policyTypes:
  - Ingress
  - Egress
  ingress:
  - from:
    - namespaceSelector:
        matchLabels:
          zone: app1
    - podSelector:
        matchLabels:
          app: app2-b
    ports:
    - protocol: TCP
      port: 80
  egress:
  - to:
    - ipBlock:
        cidr: 172.16.0.0/16
    ports:
    - protocol: TCP
      port: 80