K8s by Example: Debugging Pods
| When a Pod fails, work through this systematic checklist: check status, read events, inspect logs, then get inside. Most issues fall into three categories: image problems, application crashes, or resource constraints. |
| terminal | |
| Start here. Status tells you where to look next. | |
| terminal | |
| Events section at the bottom is gold. It shows the sequence of what happened. For | |
| terminal | |
| For | |
| terminal | |
|
| |
| terminal | |
| Pod is Running but something’s wrong? Get inside. Check if the process is listening, test network connectivity, verify mounted files exist. Use | |
| terminal | |
| Can’t exec because container keeps crashing? Use ephemeral debug containers. This attaches a new container to the Pod’s namespaces so you can inspect the environment even when the main container won’t start. | |
| terminal | |
| Debug at the node level. Useful for checking kubelet logs, disk space, or network issues that affect all Pods on a node. The debug Pod gets host PID/network namespace access. | |
| terminal | |
| Network debugging needs tools most app images don’t have. | |
| terminal | |
| Cluster-wide view of what’s happening. Events disappear after 1 hour by default. Filter by namespace, type, or involved object. Warnings are usually the interesting ones. | |
| terminal | |
| Resource issues cause OOMKills and throttling. | |
| terminal | |
| Need to connect to a Pod directly? Port-forward creates a tunnel from localhost. Useful for database access, testing endpoints, or connecting debuggers. Stays open until Ctrl+C. | |
Index | Use arrow keys to navigate