Creating DaemonSets

DaemonSet is a Kubernetes controller object 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 cluster-wide infrastructure services.

WARNING

DaemonSet Operational Notes

  1. Behavior Characteristics

    • Pod Distribution

      • Deploys exactly one Pod replica per schedulable node matching:
        • nodeSelector criteria
        • Not in NotReady state
        • No NoSchedule/NoExecute taints (unless tolerations are configured)
      • Pod Count Formula:
        Number of Pods = Number of qualified nodes
    • Dual-Role Node Handling

      • Nodes serving both control plane and worker roles will only run one Pod instance regardless of role labels.
  2. Key Constraints: ❌ Excluded Nodes

    • Nodes with Unschedulable: true flag
    • Nodes with NotReady status
    • Nodes having incompatible taints without matching tolerations

Prerequisites

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.

Procedure

  1. Container Platform, navigate to Workloads > DaemonSets in the left sidebar.

  2. Click Create DaemonSets.

  3. Select or Input an image, and click Confirm.

INFO

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.

Configure Basic info

In the Basic Info section, configure declarative parameters for Deployment workloads:

ParametersDescription
More > Update StrategyConfigures the rollingUpdate strategy for zero-downtime deployments:
Max surge (maxSurge):
  • Maximum number of Pods that can exceed the desired replica count during an update.
  • Accepts absolute values (e.g., 2) or percentages (e.g., 20%).
  • Percentage calculation: ceil(current_replicas × percentage).
  • Example: 4.1 → 5 when calculated from 10 replicas.
Max unavailable (maxUnavailable):
  • Maximum number of Pods that can be temporarily unavailable during an update.
  • Percentage values cannot exceed 100%.
  • Percentage calculation: floor(current_replicas × percentage).
  • Example: 4.9 → 4 when calculated from 10 replicas.
Notes:
1. Default values: maxSurge=1, maxUnavailable=1 if not explicitly set.
2. Non-running Pods (e.g., in Pending/CrashLoopBackOff states) are considered unavailable.
3. Simultaneous constraints:
  • maxSurge and maxUnavailable cannot both be 0 or 0%.
  • If percentage values resolve to 0 for both parameters, Kubernetes forces maxUnavailable=1 to ensure update progress.
Example:
For a Deployment with 10 replicas:
  • maxSurge=2 → Total Pods during update: 10 + 2 = 12.
  • maxUnavailable=3 → Minimum available Pods: 10 - 3 = 7.
  • This ensures availability while allowing controlled rollout.

Configure Pod

In the Pod section, please refer to Creating Deployment - Configure Pod

Configure Containers

In the Container section, please refer to Creating Deployment - Configure Containers

Create

Click Create. After clicking Create, the DaemonSet will:

✅ Automatically deploy Pod replicas to all eligible nodes meeting:

  • nodeSelector criteria (if defined)
  • tolerations configuration
  • Node in Ready state & Schedulable: true

Excluded Nodes:

  • Nodes with NoSchedule taint (unless tolerated)
  • Manually cordoned nodes (kubectl cordon)
  • Nodes in NotReady/Unschedulable state