Key Concepts
Pod
A group of one or more containers with shared storage and network.
Container
A running instance of a container image within a pod.
Init Container
Containers that run to completion before app containers start.
Pod Status
Current state of the pod (Running, Pending, Failed, etc.).
Required Permissions
| Action | Permission |
|---|---|
| View pods | iam:project:infrastructure:kubernetes:read |
| View logs | iam:project:infrastructure:kubernetes:logs |
| Exec into container | iam:project:infrastructure:kubernetes:logs |
| Create pod | iam:project:infrastructure:kubernetes:write |
| Edit pod | iam:project:infrastructure:kubernetes:write |
| Delete pod | iam:project:infrastructure:kubernetes:delete |
Pod Status Values
| Status | Description |
|---|---|
| Running | All containers started and at least one is running |
| Pending | Pod accepted but containers not yet running |
| Succeeded | All containers terminated successfully (exit code 0) |
| Failed | All containers terminated, at least one failed |
| CrashLoopBackOff | Container repeatedly crashing after restart |
| ImagePullBackOff | Failed to pull container image |
| Init:N/M | Init containers running (N of M completed) |
| Init:Error | Init container failed |
| Terminating | Pod is being deleted |
| Unknown | Pod state cannot be determined |
How to View Pods
How to View Pod Details
How to View Container Logs
How to Exec into a Container
How to Create a Pod
Pods are typically created by controllers (Deployments, StatefulSets, Jobs). Direct pod creation is mainly for testing or one-off tasks.
How to Edit a Pod
Editable pod fields:
spec.containers[*].image- Container imagespec.activeDeadlineSeconds- Maximum pod lifetimespec.tolerations- Node tolerations (limited)metadata.labels- Pod labelsmetadata.annotations- Pod annotations
How to Delete a Pod
Select Delete Option
Choose Delete for graceful termination or Force Delete for immediate termination.
| Option | Behavior |
|---|---|
| Delete | Graceful termination with default grace period (usually 30 seconds) |
| Force Delete | Immediate termination (grace_period=0) |
Understanding Restarts
High restart counts indicate problems:| Restart Count | Indication |
|---|---|
| 0 | Normal - pod stable |
| 1-5 | May be normal or recovering from transient issue |
| >5 | Investigation needed - likely crash loop |
- Application crashes (check logs)
- Out of memory (OOMKilled)
- Liveness probe failures
- Failed startup commands
Troubleshooting
Pod stuck in Pending
Pod stuck in Pending
- Insufficient resources: Node doesn’t have enough CPU/memory
- Node selector mismatch: No node matches the selector
- Taints and tolerations: Pod lacks required tolerations
- PVC pending: Persistent volume claim not bound
- Image pull issues: Check image name and pull secrets
Pod in CrashLoopBackOff
Pod in CrashLoopBackOff
- Application is crashing repeatedly
- Check container logs for error messages
- Verify command and arguments are correct
- Check if required environment variables are set
- Ensure mounted secrets/configmaps exist
Pod in ImagePullBackOff
Pod in ImagePullBackOff
- Image name or tag is incorrect
- Image doesn’t exist in registry
- Registry authentication failed (check imagePullSecrets)
- Network connectivity to registry blocked
Cannot view logs
Cannot view logs
- Pod must have started at least once
- Container must exist (check init containers for init phase)
- Use “previous” option for crashed container logs
- Verify you have logs permission
Exec connection fails
Exec connection fails
- Pod must be in Running state
- Container must be running (not init phase)
- Network connectivity to node required
- Verify you have logs permission
Pod evicted
Pod evicted
- Node under resource pressure (memory, disk, PID)
- Check node conditions for pressure status
- Review pod resource requests and limits
- Consider adding pod priority class
OOMKilled container
OOMKilled container
- Container exceeded memory limit
- Increase memory limit in pod spec
- Profile application memory usage
- Check for memory leaks
FAQ
What's the difference between pod phase and status?
What's the difference between pod phase and status?
Phase is the high-level lifecycle state (Pending, Running, Succeeded, Failed, Unknown). Status provides more detail including container-specific states like CrashLoopBackOff or ImagePullBackOff.
Why can't I edit most pod fields?
Why can't I edit most pod fields?
Pods are designed to be immutable for reliability. To change configuration, update the parent controller (Deployment, StatefulSet) which will create new pods with the updated spec.
How do I get logs from a crashed container?
How do I get logs from a crashed container?
Use the “previous” option when viewing logs to see output from the previous container instance before it crashed.
What happens when I delete a pod managed by a Deployment?
What happens when I delete a pod managed by a Deployment?
The Deployment’s ReplicaSet will automatically create a replacement pod to maintain the desired replica count.
Why is my pod restarting repeatedly?
Why is my pod restarting repeatedly?
Common causes include application crashes, OOM kills, and liveness probe failures. Check container logs and events for specific error messages.
How do I find which node a pod is running on?
How do I find which node a pod is running on?
The node name is displayed in the pod list and detail view. You can also filter or sort by node.
What is QoS class?
What is QoS class?
Quality of Service class determines pod eviction priority: Guaranteed (highest), Burstable, BestEffort (lowest). Set resource requests and limits to control QoS.
Can I exec into an init container?
Can I exec into an init container?
Yes, but only while the init container is running. Once it completes, you can only view its logs (using previous container option if needed).