Example Documentation: Ephemeral Debug Container
Goal
Inspect a faulty Pod with kubectl debug.
What Is Done
The lab creates an NGINX Pod with a broken readiness probe. An ephemeral container can then be injected into the Pod.
Typical Commands
kubectl apply -f manifests/
kubectl describe pod broken-web -n debug-lab
kubectl debug -n debug-lab -it broken-web --image=busybox:1.36.1 --target=web
Validate Success
- The Pod runs but does not become ready.
describeshows failed readiness probes.kubectl debugstarts a temporary debug container.
Common Mistakes
- RBAC does not allow
pods/ephemeralcontainers. - Debug containers are confused with normal sidecars.
- Not every runtime or cluster setup allows the same debug features.