Manage DaemonSets

Last updated:2021-05-11 10:41:40

Overview

A DaemonSet ensures that all or some nodes run a pod. It is suitable for deploying cluster storage, log collection, and monitoring daemons on each node. This topic describes how to manage the lifecycle of a Kubernetes-native DaemonSet, for example, how to create, configure, and delete a DaemonSet.

Create a DaemonSet

To create a DaemonSet, perform the following steps:

  1. Log in to the KCE console.
  2. In the left navigation pane, click Cluster.
  3. Click the ID of the cluster in which you want to create a DaemonSet. The cluster details page appears.
  4. In the left navigation pane, choose Workload > DaemonSet. The DaemonSet list page appears.
  5. Click Create in the upper-left corner. On the Create DaemonSet page, complete the required configuration and click Create.

The configuration items are described as follows:

Set Basic Information

  • Name: the name of the DaemonSet, which can be up to 63 characters in length, and can contain lowercase letters, digits, and hyphens (-). The name must start with a lowercase letter and end with a lowercase letter or a digit.
  • Region: the region to which the DaemonSet belongs.
  • Cluster: the cluster to which the DaemonSet belongs.
  • Namespace: the namespace of the cluster to which the DaemonSet belongs.
  • Description: the description about the DaemonSet. Enter a custom description.

Deployment Configuration

Volume

Currently, the following types of volumes are available: HostPath, EmptyDir, Kingsoft Cloud Elastic Block Storage, File Storage, Existing PVC, ConfigMap, and Secret.
image.png

  • Type: the type of the volume. HostPath, EmptyDir, Kingsoft Cloud Elastic Block Storage, File Storage, Existing PVC, ConfigMap, and Secret are available.
  • Volume Name: the name of the volume.
  • Resource Name: the name of the storage resource.
  • Other Information: the hostpath to which the container is to be mounted.

Notes:

If you use a local disk volume without specifying a source path, a temporary path (corresponding to EmptyDir in Kubernetes storage) is allocated by default.

If you select Kingsoft Cloud Elastic Block Storage, the volume name is the ID of the EBS volume and cannot be modified.

Container configuration

Create containers:
image.png

  • Name: the name of the container, which can be up to 63 characters in length, and can contain lowercase letters, digits, and hyphens (-). The name must start with a lowercase letter and end with a lowercase letter or a digit.
  • Image: the image of the container. You can enter the address of an image repository or click Select Image to select an image from an image repository.
  • Tag: the tag of the image.
  • Resources: the limits on the CPU and memory resources for the container.
  • Environment Variable: the environment variable of the container. You can manually add environment variables to set parameters.
  • Pod Count: the number of pods. A pod is composed of one or more containers.
Image Access Credential

This item is available when you pull images from a private image repository. This item corresponds to imagePullSecret in the YAML file.
image.png

  • ksyunregistrykey is available by default. It matches the private images in the Kingsoft Cloud image repository.
  • To use images from a third-party private image repository, create an access credential for the image repository by performing the following operations: Click Add Image Access Credential, select Use New Access Credential, and then click Configure Access Credential. In the dialog box that appears, set the name of the new access credential, enter the repository domain, set the username and password for accessing the image repository, and then click Create Secret.

Access Settings

  • Associated Service: If Enabled is cleared, no entry to the container is provided for frontend Service access requests.
  • Public Access(LoadBalancer): This option allows Services to be exposed through a public SLB instance so that the Services can be accessed over the Internet.
  • Via VPC(LoadBalancer): This option allows Services to be exposed to the VPC where the Kubernetes cluster resides through a private SLB instance so that the Services can be accessed by other Kubernetes clusters or KEC instances in the VPC.
  • Intra-Cluster(ClusterIP): This option allows Services to be exposed through a private IP address of the Kubernetes cluster so that the Services can be accessed only within the cluster.
  • NodePort(NodePort): This option allows Services to be exposed through the IP address and port number of a node so that the Services can be accessed by other Kubernetes clusters or KEC instances outside the Kubernetes cluster.

After the configuration is completed, click Create and check the status of the DaemonSet on the DaemonSet list page.

Basic operations

Update a DaemonSet

On the DaemonSet list page, click Update for a DaemonSet. On the Update DaemonSet page, update the DaemonSet configuration based on your business requirements.

Update Policy:

  • Rolling Update: This option updates the pods one by one without interrupting your business. You can specify the parameters for a rolling update.
  • OnDelete: This option triggers creation of a pod when you manually delete a pod after the template is updated.

Delete a DaemonSet

On the DaemonSet list page, move your pointer over More and click Delete for a DaemonSet. In the message that appears, click OK.

Did you find the above information helpful?

Unhelpful
Mostly Unhelpful
A little helpful
Helpful
Very helpful

What might be the problems?

Insufficient
Outdated
Unclear or awkward
Redundant or clumsy
Lack of context for the complex system or functionality

More suggestions

0/200

Please give us your feedback.

Submitted

Thank you for your feedback.

问题反馈