- Inspect
- Diagnose
- Apply fix
- Verify
Your mission
inventory-api started failing after an egress policy rollout. Pods are Running, but the application cannot resolve redis.cache.svc.cluster.local.
- workload
- deployment/inventory-api
- status
- degraded
- symptom
- service names time out while direct IP connectivity works
Current objective
Separate name resolution from TCP reachability using a test inside the affected Pod.
Show a hint
Try: kubectl exec deployment/inventory-api -- nslookup redis.cache.svc.cluster.local Scoped DNS egress
- to:
- namespaceSelector: { matchLabels: { kubernetes.io/metadata.name: kube-system } }
podSelector: { matchLabels: { k8s-app: kube-dns } }
ports:
- { protocol: UDP, port: 53 }
- { protocol: TCP, port: 53 } Restart clears this attempt. Completed labs are remembered in this browser.
Incident review
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.
Choose another scenarioCommand transcript
Your commands and their output will appear here.
Edit networkpolicy/inventory-egress
Preserve default-deny and the Redis rule. Add DNS egress only to kube-dns on UDP and TCP 53.