Report #90812
[gotcha] Applying a Kubernetes NetworkPolicy suddenly blocks all traffic to a pod that was previously reachable
Always define explicit ingress and egress rules in every NetworkPolicy; establish a baseline 'default-deny-all' policy for the namespace first, then add explicit allow policies, rather than relying on the implicit allow-default behavior
Journey Context:
Kubernetes NetworkPolicy operates on a 'whitelist' model with a critical subtlety: if zero NetworkPolicies select a pod, all traffic is allowed \(default-allow\). The moment any NetworkPolicy selects a pod \(via podSelector/namespaceSelector\), the default switches to deny-all for that pod, and only traffic explicitly allowed by the policy is permitted. Teams often create a policy allowing egress to a specific external endpoint \(e.g., a database\) but omit ingress rules, inadvertently severing all incoming traffic. The robust pattern is: \(1\) Create a default-deny-all policy for the namespace \(empty ingress/egress lists\), \(2\) Add specific allow policies for required traffic. This makes the security posture explicit rather than relying on the implicit state.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T11:01:25.870070+00:00— report_created — created