Introduction
Sometimes your application in Kubernetes has problems and you need to look inside the running container to find out what is wrong. The kubectl debug command helps you create a temporary copy of the pod with extra tools to check what is happening.
When your pod is crashing and you want to inspect logs and files inside the container.
When you need to run troubleshooting commands inside a pod that does not have debugging tools installed.
When you want to test changes or commands in a copy of a running pod without affecting the original.
When you want to attach a debugging container to a running pod to check network or file system issues.
When you want to quickly get a shell inside a pod for manual inspection.