Managed node pools can automate O&M tasks and help reduce your O&M workload. This topic describes how to create, clone, and delete a managed node pool. This topic also describes how to adjust the number of nodes in a node pool.

Prerequisites

A Container Service for Kubernetes (ACK) Pro cluster whose Kubernetes version is later than 1.9 is created. For more information, see Upgrade the Kubernetes version of an ACK cluster.

Prerequisites

  • Managed node pools perform upgrades on nodes by replacing the system disks of nodes. This deletes the data on the previous system disks. Data disks are not affected. Do not use system disks to persist data.
  • Before the system disk of a node is replaced, ACK disables and drains the node. This may restart pods and interrupt persistent connections.
  • When exceptions occur on a node in a managed node pool, ACK may restart the node to fix the exceptions. This restarts pods on the node.

Create a managed node pool

  1. Log on to the ACK console.
  2. In the left-side navigation pane of the ACK console, click Clusters.
  3. On the Clusters page, find the cluster that you want to manage and click the name of the cluster or click Details in the Actions column. The details page of the cluster appears.
  4. In the left-side navigation pane of the details page, choose Nodes > Node Pools.
  5. In the upper-right corner of the Node Pools page, click Create Managed Node Pool.
  6. In the Create Managed Node Pool dialog box, set the parameters of the managed node pool.
    For more information about the parameters, see Create a professional managed Kubernetes cluster. The following list describes some of the parameters:
    • Auto Scaling: Specify whether to enable auto scaling for the managed node pool. For more information, see Auto scaling of nodes.
    • Expected Nodes: Specify the expected number of nodes in the node pool. If you do not want to add nodes to the node pool, set this parameter to 0.
    • Operating System: Select an operating system for the nodes. The following operating systems are supported: ContainerOS, CentOS, Alibaba Cloud Linux, and Windows.
      Note The ContainerOS operating system supports only the containerd runtime.
    • Node Label: You can add labels to nodes.
    • ECS Label: You can add labels to Elastic Compute Service (ECS) instances.
    • Custom Resource Group: You can specify the resource group to which the nodes in the node pool belong.
  7. Click Confirm Order.
    On the Node Pools page, check the status of the node pool. If the node pool is in the Initializing state, the node pool is being created. After the node pool is created, the node pool is in the Active state.

Specify a maintenance window

ACK automatically performs specific maintenance operations on the managed node pool during the maintenance window. For more information about the automatic maintenance of managed node pools, see Overview.

  1. Log on to the ACK console.
  2. In the left-side navigation pane of the ACK console, click Clusters.
  3. On the Clusters page, find the cluster that you want to manage and click the name of the cluster or click Details in the Actions column. The details page of the cluster appears.
  4. In the left-side navigation pane of the details page, choose Nodes > Node Pools.
  5. In the upper-right corner of the Node Pools page, click Create Managed Node Pool.
    For an existing managed node pool, click Edit in the Actions column.
  6. In the Create Managed Node Pool or Modify Node Pool dialog box, click Set in the Maintenance Window section.
    Maintenance Window.png
  7. In the Maintenance Window dialog box, set the maintenance schedule.

You can also go to the cluster details page and click the Basic Information tab. In the Cluster Maintenance section, you can view, enable, modify, and disable the maintenance window. For more information about how to perform operations on the cluster details page, see View cluster information.

Update a managed node pool

If the operating systems of nodes in a managed node pool are updatable, you can update the managed node pool.

  1. Log on to the ACK console.
  2. In the left-side navigation pane of the ACK console, click Clusters.
  3. On the Clusters page, find the cluster that you want to manage and click the name of the cluster or click Details in the Actions column. The details page of the cluster appears.
  4. In the left-side navigation pane of the details page, choose Nodes > Node Pools.
  5. Find the managed node pool that you want to update and click Upgrade in the Actions column.
  6. In the Upgrade Node Pool dialog box, set the following parameters.
    Parameter Description
    Required Version By default, OS Image and Container Runtime are selected.
    • OS Image: After you select this check box, the operating systems of all nodes are updated to the required version.
    • Container Runtime: After you select this check box, the container runtimes of all nodes are updated to the required version.
    Maximum Unschedulable Nodes Specifies the maximum number of nodes that can be in the unschedulable state.
    Additional Nodes Specifies the number of additional nodes that are automatically added before the node pool is updated. These additional nodes are automatically removed after the node pool is updated. Additional nodes are used to host workloads from updatable nodes when they are drained.
    Note The sum of the values of Maximum Unschedulable Nodes and Additional Nodes equals the number of nodes that can be updated in parallel.

Adjust the expected number of nodes in a node pool

The expected number of nodes specifies the number of nodes that a node pool must keep. After you specify the expected number of nodes in a node pool, the nodes in the node pool are automatically scaled to the specified number. For more information about the scaling rules, see Rules for changes to the expected number of instances.

You can scale in or out a node pool by changing the expected number of nodes:
  • Scale out the node pool: Set the expected number of nodes to a value that is greater than the current value. Then, the node pool is automatically scaled out. We recommend that you use this method if you want to scale out a node pool. This way, the system can automatically add nodes to the node pool if you fail to manually add nodes to the node pool.
  • Scale in the node pool: Set the expected number of nodes to a value that is smaller than the current value. Then, the node pool is automatically scaled in.
    Notice If you use the ECS or Auto Scaling console or use the ECS or Auto Scaling API to remove nodes or release instances in a node pool, the node pool automatically scales to the expected number of nodes. A node pool also scales to the expected number of nodes when the subscription instances in the node pool expire and are automatically released. Therefore, if you want to change the number of nodes in a node pool, modify the expected number of nodes or manually remove nodes from the node pool in the ACK console. For more information, see Remove a node.
  1. Log on to the ACK console.
  2. In the left-side navigation pane of the ACK console, click Clusters.
  3. On the Clusters page, find the cluster that you want to manage and click the name of the cluster or click Details in the Actions column. The details page of the cluster appears.
  4. In the left-side navigation pane of the details page, choose Nodes > Node Pools.
  5. On the Node Pools page, find the node pool that you want to manage and click Scale in the Actions column.
  6. Grant ACK the permissions to access cloud resources.
    1. Click AliyunOOSLifecycleHook4CSRole.
    2. On the Cloud Resource Access Authorization page, click Confirm Authorization Policy.
  7. In the dialog box that appears, set Expected Nodes to the expected number of nodes in the node pool and click Confirm.
    Note If you want to modify the configurations of the node pool, click Modify Node Pool Settings. For more information, see Create a managed node pool.
    • On the Node Pools page, the status of the node pool is Scaling Out. This indicates that the scale-out activity is in progress. After the scale-out activity is completed, the node pool is in the Active state.
    • On the Node Pools page, the status of the node pool is Removing. This indicates that the scale-in activity is in progress. After the scale-in activity is completed, the node pool is in the Active state.

Clone a managed node pool

You can create a node pool by cloning an existing node pool. The new node pool has the same configurations as the existing one.

  1. On the Node Pools page, find the node pool that you want to clone and click Clone in the Actions column.
  2. In the dialog box that appears, enter a name for the new node pool, set the parameters, and then click Submit.
    On the Node Pools page, the node pool is in the Initializing state when it is being created. After the cloning process is completed, the node pool is in the Active state.

Delete a managed node pool

Before you delete a managed node pool, we recommend that you remove nodes from the managed node pool to avoid service disruptions caused by user errors.

  1. On the Node Pools page, find and click the node pool that you want to delete.
  2. In the Node Configurations section, select all nodes on the Nodes tab and click Remove Node.
  3. In the Remove Node dialog box, select Release ECS Instance and Drain the Node, and then click OK.
    • Release ECS Instance:
      • Only pas-as-you-go ECS instances are released. The system continues to bill ECS instances that are not released.
      • Subscription ECS instances are automatically released after the subscription expires.
      • If you do not select Release ECS Instance, you are still charged for the ECS instance where the node is deployed.
    • Drain the Node: Select this option to migrate pods that run on the nodes to be removed to other nodes in the cluster. If you select this option, make sure that the other nodes have sufficient resources for these pods.
      You can also run the kubectl drain node-name command to migrate pods that run on the nodes to be removed to other nodes in the cluster.
      Note
      • node-name must be in the format of your-region-name.node-id.

        your-region-name specifies the region where the cluster that you want to manage is deployed. node-id specifies the ID of the ECS instance where the node to be removed is deployed. Example: cn-hangzhou.i-xxx.

      • options specifies the optional parameters of the command. Example: --force --ignore-daemonsets --delete-local-data. You can run the kubectl drain --help command to view help information.
  4. Go to the Node Pools page, find the node pool that you want to delete and then click Delete in the Actions column.
  5. In the Delete Node Pool message, click OK.

Enable and disable the managed node pool feature

You can enable the managed node pool feature to convert a default node pool, custom node pool, or elastic node pool into a managed node pool. You can also disable the managed node pool feature for a managed node pool. This section describes how to enable and disable the managed node pool feature.

  1. Log on to the ACK console.
  2. In the left-side navigation pane of the ACK console, click Clusters.
  3. On the Clusters page, find the cluster that you want to manage and click the name of the cluster or click Details in the Actions column. The details page of the cluster appears.
  4. In the left-side navigation pane of the details page, choose Nodes > Node Pools.
  5. Find the node pool that you want to manage and perform the following operations in the Actions column.
    • Click Enable Managed Node Pool to convert the node pool into a managed node pool.
    • Click Disable Managed Node Pool to convert the managed node pool into another type of node pool.

      After you disable the managed node pool feature for a managed node pool, the managed node pool is converted based on its original node pool type. If the original node pool type is managed node pool, the managed node pool is converted into a custom node pool. Otherwise, it is converted into the original node pool type. For example, a default node pool can be converted into a managed node pool after you enable the managed node pool feature. Then, if you disable the managed node pool feature, it is converted into a default node pool.