Node management

更新时间:
复制 MD 格式

Nodes are the basic building blocks of a cluster that run application workloads. A node can be a virtual machine or a physical machine, depending on your business needs. Each node contains the components required to run pods, such as Kubelet, Kube-proxy, and a container runtime. You can manage nodes in the Container Service for Kubernetes (ACK) console.

Note

This topic applies only to clusters created in the new version of ACK after August 15, 2020.

Set node scheduling

You can configure node scheduling in the console to distribute workloads across nodes.

Prerequisites

An ACK cluster is created.

Disable scheduling

After you disable scheduling for a node, pods are no longer scheduled to that node during application deployments.

  1. Log on to the ACK console. In the navigation pane on the left, click Cluster Management.

  2. On the Cluster Details page, click the Nodes tab.

  3. Select a node, choose More > Disable Scheduling, and then click OK in the dialog box that appears.

    Return to the node list page. The node status is now unschedulable.

Resume scheduling

  1. Log on to the ACK console. In the navigation pane on the left, click Cluster Management.

  2. On the Cluster Details page, click the Nodes tab.

  3. Select a node, choose More > Resume Scheduling, and then click OK in the dialog box that appears.

    Return to the node list page and verify that the node status is Schedulable.

View node details

Prerequisites

An ACK cluster is created.

Procedure

  1. Log on to the ACK console. In the navigation pane on the left, click Cluster Management.

  2. On the Cluster Details page, click the Nodes tab.

  3. In the node list, click a node name to open the node details page. You can view the following information on the page.

    Information Module

    Details

    Basic Information

    Node server IP address

    Node creation time

    Scheduling Status:

    • Schedulable

    • Unschedulable

    Machine Details: Click View to go to the Elastic Compute Service console. You can view detailed information about the node server, such as basic information, configuration, billing, and monitoring data.

    Annotations: System annotation information.

    System-defined node labels that can be used for node grouping.

    Pod List

    A list of pods on the node. The list includes the pod name, IP address, namespace, status, and creation time. Click a pod name to go to the pod details page.

    Node Events

    Event logs that reflect the node lifecycle and health status. The logs include the event name, count, reason, and content.

    YAML

    The YAML file of the node. You can copy the content with one click.

Manage labels

You can use the containerized application service to add and remove tags.

Procedure

  1. Log on to the ACK console. In the navigation pane on the left, click Cluster Management.

  2. On the Cluster Details page, click the Nodes tab.

  3. Find the target node and in the Actions column, choose More > Edit Labels.

  4. In the Edit Labels dialog box, add or remove labels as needed:

    • Add a label:

      1. You can click Add a row of data below.

      2. Enter a key and a value.

      3. After you enter the information, click Submit.

    • Remove a label:

      1. Find the label to remove and click Delete in the Actions column. The label is removed from the list.

      2. Click Submit.

Manage taints

A taint marks a node to prevent certain pods from being scheduled onto it. You can apply one or more taints to each node.

Procedure

  1. Log on to the ACK console. In the navigation pane on the left, click Cluster Management.

  2. On the Cluster Details page, click the Nodes tab.

  3. Find the target node and in the Actions column, choose More > Edit Taints.

  4. In the Edit Taints dialog box, add or remove taints as needed:

    • Add a taint:

      1. Click Add a Row of Data.

      2. Enter a Key (required) and a Value (optional). For Effect, select NoSchedule, NoExecute, or PreferNoSchedule.

        Note

        When you add multiple taints, the keys must be unique. The values can be duplicates or empty.

      3. After you finish the configuration, click Submit.

    • Remove a taint:

      1. Find the taint to remove and click Delete in the Actions column. The taint is removed from the list.

      2. Click Submit.

Monitor nodes

ACK clusters are integrated with Cloud Monitor. This lets you view monitoring metrics for Kubernetes nodes and their underlying ECS instances.

Note

Basic resource monitoring in Cloud Monitor is enabled by default for ACK clusters. You can also view monitoring metrics for Kubernetes workloads in the Cloud Monitor console. For more information, see Basic resource monitoring.

Procedure

  1. Log on to the ACK console. In the navigation pane on the left, click Cluster Management.

  2. On the Cluster Details page, click the Nodes tab.

  3. Find the target node and in the Actions column, choose More > Monitoring to go to the Cloud Monitor console.

  4. You can view basic monitoring information for the corresponding ECS instance. The information includes metrics such as CPU utilization, inbound bandwidth, outbound bandwidth, system disk BPS, and system disk IOPS.

Delete nodes

If you no longer need a node, you can remove it.

Prerequisites

An ACK cluster is created.

Precautions

  • Deleting a node causes pod migration, which may affect your services. Perform this operation during off-peak hours.

  • This operation is risky. We recommend that you back up your data before you proceed.

  • During this operation, the system marks the node as unschedulable.

  • You can remove only worker nodes, not master nodes.

  • We recommend that you remove nodes from the console. If you manually remove a node by running the sudo kubectl delete node command, note the following:

    • The removed node cannot be added to other clusters.

    • If you delete the cluster later, the ECS instance that corresponds to the node is also released.

Procedure

  1. In the navigation pane on the left, click Cluster Management to go to the cluster details page.

  2. Click the Nodes tab, find the node to delete, and then in the Actions column, choose More > Delete.

  3. In the Warning dialog box that appears, select a deletion option and click OK.

    • Automatically drain the node: This option moves the pods from the node to other nodes in the cluster. Make sure that other nodes in the cluster have sufficient resources. You can also run the sudo kubectl drain node-name command locally to move the pods.

      Note

      The format of node-name is your-region-name.node-id. your-region-name is the region where your cluster is located. node-id is the ID of the ECS instance of the node. For example, cn-hangzhou.i-xxx.

    • Release the ECS instance at the same time: This option immediately releases pay-as-you-go ECS instances. Subscription ECS instances are automatically released only after their subscription expires. To release a subscription instance sooner, you can perform one of the following operations:

      Note

      If you do not select this option, the ECS instance that corresponds to the node continues to be billed.