kind: NetworkPolicy
apiVersion: networking.k8s.io/v1
metadata:
  name: allow-a-to-b
spec:
  podSelector:
    matchLabels:
      app: web-server
  ingress:
  - from:
    - podSelector:
        matchLabels:
          env: A
  egress:
  - to:
    - podSelector:
        matchLabels:
          env: B
