kind: NetworkPolicy
apiVersion: networking.k8s.io/v1
metadata:
  name: allow-from-ingress-namespace
spec:
  podSelector:
    matchLabels:
      app.kubernetes.io/component: web
  ingress:
  - from:
    - namespaceSelector:
        matchLabels:
          name: ingress
---
kind: NetworkPolicy
apiVersion: networking.k8s.io/v1
metadata:
  name: allow-from-same-namespace
spec:
  podSelector: {}
  ingress:
  - {}
  policyTypes:
  - Ingress
---
kind: NetworkPolicy
apiVersion: networking.k8s.io/v1
metadata:
  name: default-deny-all
spec:
  podSelector: {}
  policyTypes:
  - Ingress
