5.9 Ephemeral Containers: Debugging Running Pods
Right, so your pod is running. Or, more accurately, it’s doing something that is not “working correctly.” It’s crashing, it’s slow, it’s returning 500s for reasons known only to the eldritch gods of distributed systems. The classic, knee-jerk reaction is to kubectl exec into it and start poking around with top, curl, or your favorite debugging tool. But what if the pod’s container is a stripped-down, distroless nightmare that doesn’t even have a shell? No /bin/bash. No /bin/sh. Not even ls. It’s just your application, sitting in a bare-bones runtime, mocking you. Or worse, what if the application has crashed and the container is now in a CrashLoopBackOff, meaning you can’t exec into it at all because there’s no running process to latch onto?