Skip to main content
Kubernetes is the de-facto runtime for containerised workloads at scale, but its surface area is enormous. These notes focus on the operational slice — the commands and manifest patterns you reach for when deploying, debugging, and maintaining services day-to-day. Theory is kept to a minimum; working YAML and shell commands are kept to a maximum.

kubectl Essentials

Pod Troubleshooting Workflow

When a pod isn’t behaving, follow this sequence:
1

Check pod status

Look at STATUS and RESTARTS. Common problem states:
  • CrashLoopBackOff — the container keeps crashing; check logs
  • OOMKilled — container exceeded its memory limit; check describe
  • Pending — scheduler can’t place the pod; check events in describe
  • ImagePullBackOff — registry credentials or image name issue
2

Describe the pod for events

Scroll to the Events section at the bottom. This is the fastest way to diagnose scheduling failures, image pull errors, and liveness probe failures.
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 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 a LimitRange:

Readiness & Liveness Probes

Probes are the mechanism by which Kubernetes knows whether your pod is healthy and ready to receive traffic.
Use three separate endpoints/healthz/ready, /healthz/live, and optionally /healthz/startup. The readiness endpoint should check downstream dependencies (DB connectivity, cache warmup). The liveness endpoint should check only internal process health — never external dependencies, or a dependency outage will cause a cascade of unnecessary pod restarts.

Rolling Updates

Kubernetes Deployments perform rolling updates by default. These fields control the rollout behaviour:

Useful One-Liners

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.
Last modified on June 9, 2026