All Products
Search
Document Center

Container Service for Kubernetes:Manage taints

Last Updated:Mar 01, 2024

Pods repel nodes that have specified taints when pods are scheduled. You can add one or more taints to a node. This topic describes how to add a taint to multiple nodes at a time and delete a taint from a node.

Prerequisites

A Container Service for Kubernetes (ACK) cluster is created. For more information, see Create an ACK managed cluster.

Add a taint to multiple nodes at a time

  1. Log on to the ACK console. In the left-side navigation pane, click Clusters.

  2. On the Clusters page, click the name of the cluster that you want to manage and choose Nodes > Nodes in the left-side navigation pane.

  3. On the Nodes page, click Manage Labels and Taints in the upper-right corner.

  4. Click the Taints tab, select multiple nodes, and then click Add Taint.

  5. In the dialog box that appears, configure Name, Value, and Effect. For more information, see Taints and toleration rules.

    Parameter

    Description

    Name

    The name must be 1 to 63 characters in length, and can contain letters, digits, hyphens (-), underscores (_), and periods (.). It must start and end with a letter or a digit.

    If you want to specify a prefixed taint name, the prefix must be a subdomain name. A subdomain name consists of DNS labels that are separated by periods (.), and cannot exceed 253 characters in length. It must end with a forward slash (/). For more information about subdomain names, see Subdomain names.

    Value

    The value cannot exceed 63 characters in length. It must start and end with a letter or digit. It can contain letters, digits, hyphens (-), underscores (_), and periods (.). You can also leave the parameter empty.

    Effect

    Valid values: NoSchedule, NoExecute, and PreferNoSchedule.

    • NoSchedule: If a node has a taint whose effect is NoSchedule, the system does not schedule pods to the node.

    • NoExecute: Pods that do not tolerate this taint are evicted after this taint is added to a node. Pods that tolerate this taint are not evicted after this taint is added to a node.

    • PreferNoSchedule: The system attempts to avoid scheduling pods to nodes with taints that are not tolerated by the pods.

  6. Click OK.

    On the Taints tab, you can verify that the taint is added to the selected nodes.

Filter nodes by taint

  1. Log on to the ACK console. In the left-side navigation pane, click Clusters.

  2. On the Clusters page, click the name of the cluster that you want to manage and choose Nodes > Nodes in the left-side navigation pane.

  3. On the Nodes page, click Manage Labels and Taints in the upper-right corner.

  4. Click the Taints tab, select a node, and then click a taint in the Actions column to filter nodes by taint.

    The page automatically refreshes and displays the nodes that have the specified taint.

    筛选污点

Delete a taint

  1. Log on to the ACK console. In the left-side navigation pane, click Clusters.

  2. On the Clusters page, click the name of the cluster that you want to manage and choose Nodes > Nodes in the left-side navigation pane.

  3. On the Nodes page, click Manage Labels and Taints in the upper-right corner.

  4. On the Manage Labels and Taints page, click the Taints tab and click 删除 next to the taint that you want to delete. In the message that appears, click Confirm.

    After the taint is deleted, it disappears from the Taints column.