Interview Prep/Kubernetes/Services, DNS, Ingress and NetworkPolicy

You need to prove whether a NetworkPolicy is dropping a connection, not the app. How?

AdvancedTroubleshootingServices, DNS, Ingress and NetworkPolicy
Answer

Likely causes → Policy drops look like timeouts (no RST), which are easy to confuse with app hangs or security groups.

Diagnose →

# Cilium
kubectl -n kube-system exec ds/cilium -- cilium-dbg monitor --type drop
hubble observe --namespace shop --verdict DROPPED
# Calico
kubectl get networkpolicies.projectcalico.org,globalnetworkpolicies -A
# Generic: compare from an allowed vs a blocked source
kubectl run probe -n web --rm -it --image=nicolaka/netshoot --restart=Never -- nc -zv -w3 orders.shop 8080

Fix → If drops show your source and port, add the matching allow rule. If no drops are recorded, look elsewhere (security groups, app).

Prevent → Use a CNI with flow visibility (Hubble, Calico flow logs) and keep a policy-test suite.

All Kubernetes questions Roadmap: Kubernetes networking, storage & scaling

More on Services, DNS, Ingress and NetworkPolicy