Kubernetes coreLesson 4 of 13
Workload Types
A Pod is the smallest unit of execution, but users rarely create Pods directly. Usually you create a managing resource (a workload) that decides "how and how many Pods to run", and that resource creates the Pods for you. Compare how three managers handle Pods differently.
Workload in viewDeployment
Pod name—
What sets the countreplicas value
RequestAppears in a later step
What you will learn
- The Deployment → ReplicaSet → Pod ownership chain
- A recreated Pod gets a new name and IP
- StatefulSet fixed names and dedicated volumes
- A DaemonSet's count is set by the number of nodes
When to use what
| If the application is | Workload to use | What sets the count |
|---|---|---|
| Like a web front end or API server, where any of several copies can take a request | Deployment | Replica count |
| Like a database or message queue, where each copy holds its own data | StatefulSet | Replica count (ordinal names) |
| A collector or agent that must run on every node | DaemonSet | Node count |
| A migration or computation that runs once and ends | Job | Number of required successes |
| A task repeated at set times daily or weekly | CronJob | One Job per schedule |
The Job and CronJob flow continues in Run Once and Finish (Job · CronJob), and Deployment version changes in Zero-Downtime Deploys (Rolling Update).
Try it yourself
kubectl get deploy,rs,pod -n <namespace> # Deployment → ReplicaSet → Pod chain
kubectl get pod <pod> -o jsonpath='{.metadata.ownerReferences[0].kind}{"\n"}' # Who created this Pod
kubectl get statefulset,pvc -n <namespace> # Ordinal Pods and their volumes
kubectl get daemonset -A # DESIRED/READY vs node count
kubectl logs deploy/<name> # Logs by the higher resource name
Check yourself
Further reading: Workloads (Kubernetes docs) · Deployments · StatefulSets · DaemonSet