This policy will allow DNS requests to be made in the namespace if the default deny policy was previously applied:
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: default-allow-dns
spec:
podSelector: {}
policyTypes:
- Egress
egress:
- ports:
- port: 53
protocol: TCP
- port: 53
protocol: UDP