The cluster was live, but exposed. Pods could talk to anything. That power felt dangerous.
Kubernetes Network Policies bring order to this chaos. They control which pods can communicate with each other and with external endpoints. Without them, your workloads are open across the cluster’s flat network. With them, you define strict ingress and egress rules that enforce boundaries.
The MVP for Kubernetes Network Policies is simple: create a policy that denies all traffic by default, then allow only the flows you need. This minimal set protects critical services while keeping the configuration small enough to maintain. Focus on these core steps:
1. Enable the Network Policy API
Your cluster must run a CNI plugin that supports NetworkPolicy, such as Calico, Cilium, or Kube-router. Without this, policies are ignored.
2. Write a deny-all policy
A policy with no podSelector and no ingress or egress rules blocks all traffic. Apply it to namespaces where you want strict control.