DaemonSet

Daemonset can ensure that a copy of a Pod is running on all (or some) nodes.

Daemonset can ensure that a copy of Pod is running on all (or some) nodes. When a node joins the cluster, a Pod is added for them, and when a node is removed from the cluster, those Pods are reclaimed. Deleting a DaemonSet will delete all the Pods it created.

Typical usage of Daemonset is as follows.

  • Run the cluster storage daemonset on each node
  • Run the log collection daemonset on each node
  • Run monitoring daemonset on each node

Entry: In the cloud management platform click on the top left corner navigation menu, and click “Containers/Applications/DaemonSet” menu item in the left menu bar that pops up to enter the DaemonSet page.

View DaemonSet

This function is used to filter daemonset information based on clusters and namespaces.

  1. In the daemonset page, by default, you can view the daemonset information of all namespaces under a cluster.

  2. When there are multiple clusters in the environment, click the cluster input box on the right side of the list and select other clusters to view the daemonset information of all the namespaces under other clusters.

  3. When there are multiple namespaces under the cluster, click the input box on the right side of the namespace above the list, select the namespace, and view the daemonset information under the specified namespace.

Create DaemonSet

This function is used to create daemonset Daemonset by mirroring, which will run the pod created by the daemonset on each node.

  1. On the daemonset page, click the “Create” button at the top of the list to enter the Create daemonset page.

  2. Set the following parameters.

    • Name: The name of the deployment.
    • Cluster: Select the cluster to which the daemonset belongs.
    • Namespace: Select the namespace to which the daemonset belongs. The namespace is used to logically divide the cluster. deployment, pod, service, etc. all belong to a certain namespace. Kubernetes cluster will generate default, kube-system, kube-public and other namespaces by default after the cluster is created.
    • Number of container groups: Set the number of container group Pods, which corresponds to the spec.replicas value in the yaml file.
    • Image key: you need to set the key when accessing private repository, support new and select existing key.
    • Service: Set the access method of daemonset and container group, including internal access and external access of the cluster.
      • Internal: A ClusterIP will be automatically generated for access inside the cluster and between container groups.
        • Target port: The target port is the port on the pod.
        • Service port: The user access port.
        • Protocol: Select the protocol used by the application, including TCP and UDP.
      • External: will be used with the load balancing function for access outside the cluster. Before using external service, you need to create load balancing cluster and nodes in load balancing first. When creating external service, a load balancing instance will be created in load balancing synchronously.
        • Load balancing network: select IP subnet, the system will automatically assign an IP address from the IP subnet as the access IP.
        • Target port: The target port is the port on the pod.
        • Service port: The external user access port.
        • Protocol: Select the protocol used by the application, including TCP and UDP.
    • Restart Policy: Only supports always, which means the container always restarts the container when it exits.
    • Advanced configuration: Configure tags and notes according to requirements.
      • Tag: Customize to set the tag of the daemonset.
      • Remarks: Customize setting the remarks information of the daemonset.
    • Containers: You can create one or more containers for the daemonset according to the requirements, you can click to add several different containers.
      • Name: Customize the container name.

      • Container image: If you only enter the image name, the default is to use the image on dockerhub, if you need to use a private repository image, you need to set the repository/image. This example directly enter nginx.

      • CPU/Memory: set the CPU and memory size occupied by the container.

      • Container commands, command parameters: set the container commands and parameters. The container naming corresponds to spec.containers.command, and the parameters correspond to spec.containers.args. e.g. command: [“perl”, “-Mbignum=bpi”, “-wle”, “print bpi(2000)"] in the yaml file, you need to enter the following information in form container command to enter the following information.

        $ perl -Mbignum=bpi -wle print bpi(2000)
        
      • Data volume: Set the storage declaration and mount point for the container in Pod by key-value pair, you need to create the storage volume declaration in the namespace under the cluster in advance.

      • Environment variables: Configure environment variables for Pods in the form of key-value pairs. Used to add environment flags to Pods or pass configuration, etc.

      • Privileged mode: Privileged mode has the same privileges for processes inside the container as for processes outside the container.

  3. Click the “Deploy” button to deploy the nginx application.

Set Image

This function is used to modify the container image of the daemonset.

  1. On the daemonset page, click the “Set Image” button on the right action bar of the daemonset to bring up the Set Image dialog box.
  2. Set the image and click the “OK” button to modify the container image of the application.

View/Edit

This function is used to view or edit the daemonset’s yaml file.

  1. On the daemonset page, click the “More” button on the right action bar of the daemonset, select the drop-down menu “View/Edit” menu item to bring up the View/Update dialog box.
  2. Support to view and edit the yaml file information of the daemonset.
  3. After editing the yaml file, click the “OK” button to take effect.

Delete daemonset

This function is used to delete daemonsets, as well as container groups (pods) created by daemonsets.

Individual Deletion

  1. On the daemonset page, click the “Delete” button in the action column to the right of the daemonset, and the action confirmation dialog box will pop up.
  2. Click the “OK” button to delete the daemonset and related resources.

Batch delete

  1. Select one or more daemonsets in the daemonset list, and click the “Delete” button at the top of the list to bring up the action confirmation dialog.
  2. Click the “OK” button to delete the daemonsets and related resources.

View daemonset details

This function is used to view the daemonset details.

  1. On the daemonset page, click the daemonset name item to enter the daemonset details page.
  2. View the following information: Cloud ID, ID, name, status, cluster, namespace, container group, image, initialized image, tag, created at, etc.

View container group

This function is used to view the container groups created by the daemonset, and supports managing container groups.

View/Edit

This function is used to view the yaml file of a container group.

  1. On the daemonset page, click the daemonset name item to enter the daemonset details page.
  2. Click the “Container Groups” tab to enter the container groups page.
  3. Click the “View/Edit” button on the right column of the container group to bring up the View/Update dialog box.
  4. Support viewing and editing the yaml file information of the daemonset.
  5. After editing the yaml file, click the “OK” button to take effect.

Delete

This function is used to delete a container group. After the container group is deleted, a new container group will be redeployed according to the yaml file settings.

  1. On the daemonset page, click the daemonset name item to enter the daemonset details page.
  2. Click the “Container Groups” tab to enter the container groups page.
  3. Click the “Delete” button on the right action bar of the container group to bring up the action confirmation dialog.
  4. Click the “OK” button to complete the operation.

View Events

This function is used to record the occurrence of resource object events, including the content, source, cause, and created at, for troubleshooting.

  1. On the Daemon page, click the Daemon Name item to enter the Daemon Details page.
  2. Click the Events tab to enter the Events page. View the content, source, cause, and created at of the event.

View source information

This function is used to view and edit the yaml information of the daemonset.

  1. On the daemonset page, click the daemonset name item to enter the daemonset details page.
  2. Click the “Source Information” tab to enter the source information page.
  3. Click the “Copy Content” button to copy the yaml file information of the node.
  4. After updating the yaml file, click the “Update” button.

View Operation Log

This function is used to view the operation logs related to the daemonset.

  1. On the daemonset page, click the daemonset name item to enter the daemonset details page.
  2. Click the Operation Log tab to enter the Operation Log page.
    • Load More Logs: In the Operation Log page, the list shows 20 operation logs by default. To view more operation logs, please click the “Load More” button to get more log information.
    • View Log Details: Click the “View” button on the right column of the operation log to view the log details. Copy details are supported.
    • View logs of specified time period: If you want to view the operation logs of a certain time period, set the specific date in the start date and end date at the top right of the list to query the log information of the specified time period.
    • Export logs: Currently, only the logs displayed on this page are supported to be exported. Click the upper-right corner of icon, set the export data column in the pop-up export data dialog, and click the “OK” button to export the logs.