Bitzu

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

Single choice

Which controller runs one Pod on every node, which suits a log-collecting agent?

  1. Deployment
  2. DaemonSet
  3. CronJob
  4. 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.

Select all that apply

Which statements about Jobs and CronJobs are correct?

  1. A Job runs Pods until the task completes
  2. A CronJob creates Jobs on a schedule
  3. A Job suits one-off batch work
  4. A Job restarts its Pods forever even after success
  5. 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.

True or false

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.

Download on the App StoreGet it on Google Play

More KCNA topics in this module