apiVersion: networking.k8s.io/v1
kind: GlobalNetworkPolicy
metadata:
  name: deny-all-but-kube-dns
spec:
  podSelector: {}
  policyTypes:
    - Ingress
    - Egress
  ingress: []
  egress:
    - to:
        - namespaceSelector: {}
          podSelector:
            matchLabels:
              k8s-app: kube-dns
      ports:
        - port: 53
          protocol: UDP
