Intermediate

Debugging Production Clusters

Learn the non-disruptive toolkit for diagnosing broken workloads in a live cluster — event triage, log inspection, and kubectl debug's ephemeral containers and pod-copy modes — without editing the original manifest or restarting production traffic.

~3h
0 / 7 steps
🚀
Intro

Before We Start

Prerequisites: completion of Deployments, Services, and Ingress, and ConfigMaps and Secrets.

Version note: verified against kubernetes.io/docs/tasks/debug docs, July 2026. Ephemeral containers, the mechanism behind most of kubectl debug's running-pod features, have been stable/GA since Kubernetes 1.25 — no feature gate needed on any currently supported version (1.34+).

The instinct when something's broken in production is to kubectl exec in and poke around — but that assumes the container has a shell and debugging tools, which minimal or distroless production images deliberately don't have (that's the point of them: smaller attack surface). And if the container is crash-looping, there may be nothing running to exec into at all.

kubectl debug solves both problems without editing the original workload: it can inject a temporary, fully-tooled ephemeral container into a running Pod, or spin up a copy of a broken Pod with a different image/command so you can investigate a crash-loop in isolation. Neither approach touches the original Deployment's manifest or disrupts the Pods still serving traffic. This project builds the triage habits and the exact commands for both.

🔨

Start with events and describe, not logs

🔨

Add a debugging tool to a running Pod with an ephemeral container

🔨

Debug a crash-looping Pod with a copy

🔨

Debug at the node level

🎯
Secret Mission

Secret Mission: diagnose a deliberately broken app, hands-off the manifest

🧹
Wrap Up

Before You Go

Pro

Test what you just learned

Self-testing is one of the best ways to retain new skills. Unlock project quizzes to check your understanding.

Log in to unlock