KCNA ยท Kubernetes core concepts
StatefulSets, DaemonSets, Jobs and CronJobs
When to use each workload controller and what each guarantees.
Key points
- Pick the controller by what the workload needs.
- StatefulSet: stable, unique Pod identity and per-Pod storage, ordered by default.
- DaemonSet: one Pod on every (or selected) node, for agents like log collectors.
- Job: run Pods until the work completes.
- CronJob: create Jobs on a time schedule.
Source: https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/
Practice questions
Which controller runs one Pod on every node, which suits a log-collecting agent?
- Deployment
- DaemonSet
- CronJob
- StatefulSet
Show answer
Answer: B. DaemonSet
DaemonSet ties Pod count to node count. A Deployment spreads a chosen number of replicas without regard to every node.
Which statements about Jobs and CronJobs are correct?
- A Job runs Pods until the task completes
- A CronJob creates Jobs on a schedule
- A Job suits one-off batch work
- A Job restarts its Pods forever even after success
- A CronJob keeps one Pod on every node
Show answer
Answer: A. A Job runs Pods until the task completes, B. A CronJob creates Jobs on a schedule, C. A Job suits one-off batch work
Jobs end when the work is done and CronJobs repeat them on a schedule. One Pod per node is a DaemonSet.
Scaling a StatefulSet down deletes the PersistentVolumeClaims of the removed Pods.
Show answer
Answer: False
By default the volumes are kept so data is protected; they must be cleaned up deliberately.
Practice 8 questions on this topic in Bitzu
Short lessons, instant explanations and spaced review of what you get wrong. Free on iOS and Android.
