Refer to the official Kubernetes documentation: DaemonSets
A DaemonSet is a Kubernetes controller that ensures all (or a subset of) cluster nodes run exactly one replica of a specified Pod. Unlike Deployments, DaemonSets are node-centric rather than application-centric, making them ideal for deploying cluster-wide infrastructure services such as log collectors, monitoring agents, or storage daemons.
DaemonSet Operational Notes
Behavior Characteristics
Pod Distribution: A DaemonSet deploys exactly one Pod replica per schedulable Node that matches its criteria:
nodeSelector
or nodeAffinity
criteria (if specified).NotReady
state.NoSchedule
or NoExecute
Taints unless corresponding Tolerations are configured in the Pod Template.Pod Count Formula: The number of Pods managed by a DaemonSet equals the number of qualified Nodes.
Dual-Role Node Handling: Nodes serving both Control Plane and Worker Node roles will only run one Pod instance of the DaemonSet, regardless of their role labels, provided they are schedulable.
Key Constraints (Excluded Nodes)
Unschedulable: true
(e.g., via kubectl cordon
).NotReady
status.kubectl
configured and connected to your cluster.Obtain the image address. The source of the images can be from the image repository integrated by the platform administrator through the toolchain or from third-party platforms' image repositories.
For the former, the Administrator typically assigns the image repository to your project, and you can use the images within it. If the required image repository is not found, please contact the Administrator for allocation.
If it is a third-party platform's image repository, ensure that images can be pulled directly from it in the current cluster.
Container Platform, navigate to Workloads > DaemonSets in the left sidebar.
Click Create DaemonSet.
Select or Input an image, and click Confirm.
Note: When using images from the image repository integrated into web console, you can filter images by Already Integrated. The Integration Project Name, for example, images (docker-registry-projectname), which includes the project name projectname in this web console and the project name containers in the image repository.
In the Basic Info section, configure declarative parameters for DaemonSet workloads:
Parameters | Description |
---|---|
More > Update Strategy | Configures the rollingUpdate strategy for zero-downtime updates of DaemonSet Pods. Max unavailable ( maxUnavailable ): The maximum number of Pods that can be temporarily unavailable during an update. Accepts absolute values (e.g., 1) or percentages (e.g., 10%). Example: If there are 10 nodes and maxUnavailable is 10%, then floor(10 * 0.1) = 1 Pod can be unavailable. Notes:
|
Pod section, please refer to Deployment - Configure Pod
Containers section, please refer to Deployment - Configure Containers
Click Create.
After clicking Create, the DaemonSet will:
✅ Automatically deploy Pod replicas to all eligible Nodes meeting:
nodeSelector
criteria (if defined).tolerations
configuration (allowing scheduling on tainted nodes).Ready
state and Schedulable: true
.❌ Excluded Nodes:
NoSchedule
taint (unless explicitly tolerated).kubectl cordon
).NotReady
or Unschedulable
states.When you modify the Pod Template of a DaemonSet (e.g., changing the container image or adding a volume mount), Kubernetes automatically performs a rolling update by default (if updateStrategy.type
is RollingUpdate
, which is the default).
example-daemonset.yaml
) with the desired changes, then apply it:To delete a DaemonSet and all the Pods it manages:
Replicas
, image
, updateStrategy
, etc.