inventory-api started failing after an egress policy rollout. Pods are Running, but the application cannot resolve redis.cache.svc.cluster.local.
Separate name resolution from TCP reachability using a test inside the affected Pod.
Try: kubectl exec deployment/inventory-api -- nslookup redis.cache.svc.cluster.local
Service discovery works without opening egress broadly.
inventory-api can resolve and reach Redis while the default-deny boundary remains in place.
Lesson
Network policies fail at dependency boundaries. Isolate DNS from direct IP reachability, then add the narrowest rule that permits the missing dependency—both UDP and TCP 53 to the actual cluster DNS Pods.
Edit networkpolicy/inventory-egress
Preserve default-deny and the Redis rule. Add DNS egress only to kube-dns on UDP and TCP 53.