# Allows outgoing traffic on port 53 (DNS) as well as traffic to kube-dns/coredns pods.
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
  name: to-dns
  namespace: (( landscape.namespace ))
spec:
  podSelector:
    matchLabels:
      networking.gardener.cloud/to-dns: allowed
  policyTypes:
  - Egress
  egress:
  - ports:
    - port: 53
      protocol: UDP
    - port: 53
      protocol: TCP
  - to:
    - namespaceSelector:
        matchLabels:
          role: kube-system
      podSelector:
        matchExpressions:
        - key: k8s-app
          operator: In
          values:
          - kube-dns
          - coredns