kubernetes
networking_error
ai_generated
true
connection refused / connection timed out due to NetworkPolicy
ID: kubernetes/k8s-network-policy-block
85%Fix Rate
85%Confidence
55Evidence
2023-01-01First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 8 | active | — | — | — |
Root Cause
NetworkPolicy is blocking traffic between pods. Once a NetworkPolicy selects a pod, all non-allowed traffic is denied by default.
genericWorkarounds
-
92% success Add allow rules for the required traffic: create ingress/egress rules matching the source/destination pods
kubectl get networkpolicy -n <ns> -o yaml, then add podSelector/namespaceSelector rules for allowed traffic
Sources: https://kubernetes.io/docs/concepts/services-networking/network-policies/
-
85% success Verify the CNI plugin supports NetworkPolicy (not all do)
Calico, Cilium, and Weave support NetworkPolicy; Flannel does NOT by default
Sources: https://kubernetes.io/docs/concepts/cluster-administration/addons/#networking-and-network-policy
Dead Ends
Common approaches that don't work:
-
Delete all NetworkPolicies in the namespace
70% fail
Removes security controls — exposes all pods to unrestricted network access
-
Use hostNetwork: true to bypass NetworkPolicy
85% fail
Bypasses all network isolation — major security risk and port conflicts
Error Chain
Preceded by:
Frequently confused with: