Kubernetes Pod Cannot Reach DNS/API After Applying NetworkPolicy
Default-deny egress NetworkPolicy lacked explicit UDP/TCP port 53 rule for CoreDNS.
Runs locally in browser
Free · No login
Independently Verified 2026-11-25
v4.1.0
Identifier: Kubernetes Pod Cannot Reach DNS/API After Applying NetworkPolicy
Platform: Kubernetes
Common Root Causes:
- Default-deny egress NetworkPolicy lacked explicit UDP/TCP port 53 rule for CoreDNS.
Interactive Diagnostic Checklist
Verified Solutions:
- Allow egress to `kube-system` CoreDNS on UDP/TCP 53 alongside intended service ports.
Safe Diagnostic Command:
kubectl get networkpolicy -n <ns> -o yaml
Warning: Verify configuration changes in staging or with dry-run flags (e.g. nginx -t) before reloading production services.
Technical Explanation
Default-deny egress NetworkPolicy lacked explicit UDP/TCP port 53 rule for CoreDNS. Recommended diagnostic: `kubectl get networkpolicy -n <ns> -o yaml`. Remediation: Allow egress to `kube-system` CoreDNS on UDP/TCP 53 alongside intended service ports.
Worked Examples
- Run `kubectl get networkpolicy -n <ns> -o yaml` to verify root cause before applying the remediation.
Limitations & Assumptions
- Always verify configuration changes in staging or with dry-run flags (e.g. `nginx -t`) before reloading production services.
Source References & Verification
Resource ID: err-k8s-networkpolicy-blocked-egress · Independently verified: 2026-11-25