Kubernetes and Cloud Native Associate (KCNA)Kubernetes FundamentalsEasy
A developer wants to create a Kubernetes object that ensures a single instance of a specific Pod runs on every worker node in the cluster, primarily for collecting logs or monitoring metrics. Which Kubernetes object is designed for this use case?
- ADeployment
- BJob
- CDaemonSet
- DStatefulSet
Show answer & explanationAnswer & explanation
Correct answer: C. DaemonSet
A DaemonSet ensures that all (or some) nodes run a copy of a Pod. This is ideal for cluster-level services that must run on every node, such as log collectors (e.g., Fluentd) or monitoring agents (e.g., Prometheus Node Exporter).
Why the other options are wrong
- A. A Deployment manages stateless applications and focuses on maintaining a desired replica count across the cluster, not necessarily one per node.
- B. A Job runs a Pod to completion for a finite task and is not designed for continuous, node-specific agents.
- D. A StatefulSet is for stateful applications requiring stable identifiers and persistent storage, not for node-specific agents.
Kubernetes DaemonSet
A Kubernetes object that ensures a copy of a specific Pod runs on all (or some) nodes in a cluster, typically used for cluster-level services like log collection or monitoring agents.
- One Pod instance per node (or selected nodes).
- Ideal for node-level agents.
- Ensures continuous presence on nodes.
Memory trick: DaemonSet: Demons on every node!