McKube 0 requests sent

Zero-Trust Kubernetes NetworkPolicy: Default Deny + DNS Allow

How to lock down east-west pod traffic safely without breaking CoreDNS resolution.

Why default-deny-all breaks DNS unless you explicitly allow port 53

By default, every Pod in a Kubernetes cluster can reach every other Pod across all namespaces. Adding a namespace-wide NetworkPolicy with podSelector: {} and policyTypes: [Ingress, Egress] isolates all pods immediately, but also blocks outbound UDP/TCP port 53 to CoreDNS in kube-system. Always pair default-deny-all with an explicit egress rule allowing UDP and TCP port 53 to kube-system/k8s-app=kube-dns.

Verify your CNI enforces NetworkPolicy

Remember that Kubernetes API Server accepts NetworkPolicy YAML even if your CNI ignores it. Ensure your cluster runs a policy-enforcing CNI such as Cilium, Calico, or Antrea before relying on NetworkPolicy for tenant isolation.