Ephemeral Containers — For a More Civilized Debugging Age
Introduction
Have you ever faced a scenario where you are deploying a new application, maybe for the first time, and things are not working as expected? Maybe the Pod keeps restarting, or enters CrashLoopBackOff or simply does not boot with the expected parameters? I am sure you have!
Well, the traditional solution was to exec into the failing pod to try and diagnose the issue and get it running properly. However, most containers nowadays, if you are following best practices, are distroless or scratch.
Distroless containers do not have sh (shell) or bash, or any of the core gnu tools used for troubleshooting, making this process tedious, painful and annoying at best.
Enter Ephemeral Containers!
Ephemeral Containers — The Silver Bullet?
Ephemeral Containers is not a new feature and has been around for a while. However, it has finally graduated to BETA in the Kubernetes v1.23 release and is enabled by default.
Up until now you were told that Pods are mostly immutable, intended to be created and disposed of when no longer needed.
With this new capability, the user is able to attach an ephemeral container to an already existent Pod. The…