kubectl Essentials
- Get & Describe
- Logs
- Exec & Port-Forward
- Apply & Delete
Pod Troubleshooting Workflow
When a pod isn’t behaving, follow this sequence:1
Check pod status
STATUS and RESTARTS. Common problem states:CrashLoopBackOff— the container keeps crashing; check logsOOMKilled— container exceeded its memory limit; checkdescribePending— scheduler can’t place the pod; check events indescribeImagePullBackOff— registry credentials or image name issue
2
Describe the pod for events
3
Read the logs
4
Exec in if the container is running
5
Run a debug pod if exec isn't possible
For distroless or minimal images where
sh doesn’t exist:6
Check node-level issues
ConfigMaps and Secrets
- ConfigMaps
- Secrets
ConfigMaps store non-sensitive configuration. They can be consumed as environment variables or mounted as files.
Resource Limits & Requests
Setting resource requests and limits is one of the most impactful things you can do for cluster stability. Without them, a noisy neighbour pod can starve everything else on the same node.requests = what the scheduler reserves on the node. limits = the hard ceiling. Set
requests accurately to get good bin-packing; set limits conservatively to prevent OOM kills cascading across pods.LimitRange (Namespace Defaults)
Avoid the “forgot to set resources” footgun with aLimitRange:
Readiness & Liveness Probes
Probes are the mechanism by which Kubernetes knows whether your pod is healthy and ready to receive traffic.Rolling Updates
Kubernetes Deployments perform rolling updates by default. These fields control the rollout behaviour:Useful One-Liners
Related Pages
Docker Essentials
Build the container images that Kubernetes runs — Dockerfiles, multi-stage builds, and Compose.
GitLab CI/CD
Automate
kubectl apply and Helm deployments from a GitLab pipeline.Cloud & Terraform
Provision EKS, GKE, or AKS clusters and the supporting infrastructure with Terraform.
Linux Troubleshooting
Many pod-level issues trace back to OS-level networking, DNS, or filesystem problems.