Kubernetes Workloads
Cheat sheet · https://pcornel.dk/topic.php?topic=6080
Answer
Kubernetes workloads are controllers that manage pods: Deployments (stateless, rolling updates), StatefulSets (stable identity and storage), DaemonSets (one pod per node), Jobs and CronJobs (run to completion).
Remember
Do not create bare pods for services — use a controller so they are recreated. Check the controller's status (replicas, updated, available) and its events.
First checks
kubectl get deploy,sts,ds,job -n <ns>— first check for this topickubectl get pods -o wide— pods, status, node, IPkubectl describe pod <pod>— events and conditionskubectl logs <pod> [-c <c>] [--previous]— container logs (incl. previous crash)kubectl get events --sort-by=.lastTimestamp— recent cluster events
Verify in this order
workload spec → controller creates ReplicaSets/pods → scheduler → running → status updated
Where it usually breaks
Common errors include editing controller-owned Pods directly, using Deployment semantics for stateful identity, confusing readiness with rollout completion, blocked rollouts caused by probes/resources, and CronJob concurrency/history behavior that creates unexpected overlap.
Kubernetes Workloads verification boundary matrix
| Boundary | Inspect | Healthy interpretation | Do not infer |
|---|---|---|---|
| Intent | Pod | Intended object/scope is explicit and versioned where relevant | Intent is already effective |
| Owning runtime/control plane | ReplicaSet / Deployment | Owner accepts and reports the expected object state | Downstream dependencies are healthy |
| Effective state | StatefulSet | Independent read-back matches the intended state | Every client sees the same result |
| Consumer outcome | DaemonSet | The original bounded check succeeds in the same time window | Production correctness outside this scope |
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=6080