# kubectl label ns default nsname=default

apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
  name: isolate-namespace
  namespace: default
spec:
  podSelector: {}
  policyTypes:
  - Ingress
  - Egress
  ingress:
  - from:
    - namespaceSelector:
        matchLabels:
          nsname: default
  egress:
  - to:
    - namespaceSelector:
        matchLabels:
          nsname: default
