A NetworkPolicy that should block traffic has no effect at all.
BeginnerTroubleshootingServices, DNS, Ingress and NetworkPolicy
Answer
Likely causes → The CNI does not enforce NetworkPolicy (Flannel alone, older kubenet, VPC CNI without network policy enabled), so the objects are accepted by the API server but ignored. Or the podSelector matches no Pods.
Diagnose →
kubectl get pods -n kube-system | grep -Ei 'calico|cilium|aws-node|flannel'
kubectl get networkpolicy deny-all -n shop -o yaml | yq '.spec.podSelector'
kubectl get pods -n shop -l <selector>
Fix → Use a policy-capable CNI (Calico, Cilium) or, on EKS, enable the VPC CNI network policy agent (enableNetworkPolicy: "true" in the add-on config).
Prevent → Cluster acceptance test: apply deny-all and assert a connection fails.
More on Services, DNS, Ingress and NetworkPolicy
`curl http://orders.shop.svc.cluster.local` hangs, and `kubectl get endpointslices -l kubernetes.io/service-name=orders` shows `ENDPOINTS <unset>`.BeginnerEndpoints exist, but `curl orders:80` returns `Connection refused`.BeginnerA Service works when you curl the Pod IP but times out on the ClusterIP from every node.IntermediateInside a Pod, `nslookup orders` returns `;; connection timed out; no servers could be reached`.BeginnerCoreDNS Pods are in CrashLoopBackOff with `[FATAL] plugin/loop: Loop (127.0.0.1:41823 -> :53) detected for zone "."`.IntermediateCalls to `api.stripe.com` from Pods are slow, and CoreDNS logs show `api.stripe.com.payments.svc.cluster.local`, `api.stripe.com.svc.cluster.local` … all `NXDOMAIN`.Intermediate