---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
  name: netpol-default-deny-allow-dns
spec:
  podSelector:
    matchLabels: {}
  policyTypes:
  - Ingress
  - Egress
  egress:
  - to:
    - namespaceSelector:
        matchLabels:
          name: kube-system
      podSelector:
        matchLabels:
          name: kube-dns
  - ports:
    - protocol: TCP
      port: 53
    - protocol: UDP 
      port: 53