Daemonsets

更新时间:
复制 MD 格式

A DaemonSet runs a copy of a pod on all or some nodes. It adds pods to new nodes as they join the cluster. You can use the LHC console to create, update, and delete Daemonsets.

Note

Daemonsets are a native Kubernetes concept. For more information, see the official Kubernetes documentation.

Create a Daemonset

  1. Log on to the LHC console. In the left navigation pane, click Cluster Management > Clusters Details to go to the cluster list page.

  2. Click the name of the destination cluster. On the Cluster Details page, click the Workloads tab.

  3. In the left-side menu, select Daemonsets, and then click Create Daemonset.

  4. In the dialog box that appears, enter the YAML content and click Submit.

    The following is a YAML sample:

    kind: DaemonSet
    metadata:
      name: daemonset-example
      labels:
        k8s-app: daemonset-example
      namespace: default
    spec:
      selector:
        matchLabels:
          k8s-app: daemonset-example
      template:
        metadata:
          labels:
            k8s-app: daemonset-example
        spec:
          containers:
          - name: nginx
            image: reg-cnsh.cloud.alipay.com/library/nginx:latest

Result

After creation, the Daemonset named daemonset-example appears in the list.

Related operations

  • To view the details of a Daemonset, click its name in the Daemonsets list. The details page displays basic information, the pod list, events, and the YAML configuration.

  • To search for Daemonsets, enter a keyword from a Daemonset name in the search bar in the upper-right corner of the page.

  • To update a Daemonset, click View/Edit in the Actions column of the list. In the Edit Daemonset dialog box, edit the YAML information and click Submit.

  • To delete a Daemonset, click the More icon in the Actions column of the list and select Delete. In the confirmation dialog box, click OK.