Updated on 2024-03-11 GMT+08:00

Creating a Node Pool

Scenario

This section describes how to create a node pool and perform operations on the node pool. For details about how a node pool works, see Node Pool Overview.

Constraints

  • The Autoscaler add-on needs to be installed for node auto scaling. For details about the add-on installation and parameter configuration, see CCE Cluster Autoscaler.
  • Auto scaling is available only for pay-per-use node pools, not for those billed by year or month.
  • Only clusters of v1.19 or later support custom security groups.

Procedure

  1. Log in to the CCE console.
  2. Click the cluster name to access the cluster console. Choose Nodes in the navigation pane and click the Node Pools tab on the right.
  3. In the upper right corner of the page, click Create Node Pool.

    Basic Settings

    Table 1 Basic settings

    Parameter

    Description

    Node Pool Name

    Name of a node pool. By default, the name is in the format of Cluster name-nodepool-Random number. If you do not want to use the default name format, you can customize the name.

    Expected Initial Nodes

    Number of nodes to be created in this node pool. A maximum of 50 nodes that can be created at a time.

    Configurations

    You can configure the flavor and OS of a cloud server, on which your containerized applications run.
    Table 2 Node configuration parameters

    Parameter

    Description

    Billing Mode

    The following billing modes are supported:
    • Yearly/Monthly

      You must specify the required duration if Yearly/Monthly is selected. You can choose whether to select Auto-renew based on site requirements. Your order will automatically renew on a monthly or yearly basis, depending on if you purchased by month or by year.

    • Pay-per-use

      Resources will be billed based on usage duration. You can provision or delete resources at any time.

    Node Type

    Select a node type based on service requirements. Then, you can select a proper flavor from the node flavor list.

    CCE standard clusters support the following node types:
    • ECS (VM): A virtualized ECS is used as a cluster node.
    • ECS (physical machine): A QingTian-backed bare metal server is used as a cluster node.
    • BMS: A traditional bare metal server is used as a cluster node. Local disks of bare metal servers can be used as data disks.
    CCE Turbo clusters support the following node types:
    • ECS (VM): Containers run on virtual cloud servers. Only the ECSs that can be bound with multiple NICs are supported.
    • ECS (physical machine): A QingTian-backed bare metal server is used as a cluster node.

    Specifications

    Select a node flavor based on service requirements. The available node flavors vary depending on regions or AZs. For details, see the CCE console.

    Container Engine

    CCE clusters support Docker and containerd in some scenarios.
    • Nodes running CentOS, Ubuntu, or EulerOS 2.9 support containerd. Arm nodes running EulerOS 2.5 or EulerOS 2.8 do not support containerd.
    • VPC network clusters of v1.23 and later versions support containerd. Tunnel network clusters of v1.23.2-r0 and later versions support containerd.
    • For a CCE Turbo cluster, both Docker and containerd are supported. For details, see Mapping between Node OSs and Container Engines.

    OS

    Select an OS type. Different types of nodes support different OSs.
    • Public image: Select a public image for the node.
    • Private image: Select a private image for the node. For details about how to create a private image, see Creating a Custom CCE Node Image.
    NOTE:
    • Service container runtimes share the kernel and underlying calls of nodes. To ensure compatibility, select a Linux distribution version that is the same as or close to that of the final service container image for the node OS.

    Login Mode

    • Password

      The default username is root. Enter the password for logging in to the node and confirm the password.

      Be sure to remember the password as you will need it when you log in to the node.

    • Key Pair

      Select the key pair used to log in to the node. You can select a shared key.

      A key pair is used for identity authentication when you remotely log in to a node. If no key pair is available, click Create Key Pair. For details about how to create a key pair, see Creating a Key Pair.

    Storage Settings

    Configure storage resources on a node for the containers running on it. Set the disk size according to site requirements.
    Table 3 Configuration parameters

    Parameter

    Description

    System Disk

    System disk used by the node OS. The value ranges from 40 GiB to 1024 GiB. The default value is 50 GiB.

    Encryption: System disk encryption safeguards your data. Snapshots generated from encrypted disks and disks created using these snapshots automatically inherit the encryption setting. This function is available only in certain regions.
    • Encryption is not selected by default.
    • After selecting Encryption, you can select an existing key in the displayed dialog box. If no key is available, click View Key List and create a key. After the key is created, click the refresh icon next to the Encryption text box.

    Data Disk

    At least one data disk is required for the container runtime and kubelet. The data disk cannot be deleted or uninstalled. Otherwise, the node will be unavailable.

    • First data disk: used for container runtime and kubelet components. The value ranges from 20 GiB to 32768 GiB. The default value is 100 GiB.
    • Other data disks: You can set the data disk size to a value ranging from 10 GiB to 32768 GiB. The default value is 100 GiB.
    NOTE:

    If the node flavor is disk-intensive or ultra-high I/O, one data disk can be a local disk.

    Local disks may break down and do not ensure data reliability. Store your service data in EVS disks, which are more reliable than local disks.

    Advanced Settings

    Click Expand to configure the following parameters:

    • Data Disk Space Allocation: After selecting Set Container Engine Space, you can specify the proportion of the space for the container engine, image, and ephemeral storage on the data disk. The container engine space is used to store the working directory, container image data, and image metadata for the container runtime. The remaining space of the data disk is used for pod configuration files, keys, and EmptyDir. For details about how to allocate data disk space, see Data Disk Space Allocation.
    • Encryption: Data disk encryption safeguards your data. Snapshots generated from encrypted disks and disks created using these snapshots automatically inherit the encryption setting. This function is available only in certain regions.
      • Encryption is not selected by default.
      • After selecting Encryption, you can select an existing key in the displayed dialog box. If no key is available, click View Key List and create a key. After the key is created, click the refresh icon next to the Encryption text box.

    Adding data disks

    A maximum of four data disks can be added. By default, raw disks are created without any processing. You can also click Expand and select any of the following options:

    • Default: By default, a raw disk is created without any processing.
    • Mount Disk: The data disk is attached to a specified directory.
    • Use as PV: applicable when there is a high performance requirement on PVs. The node.kubernetes.io/local-storage-persistent label is added to the node with PV configured. The value is linear or striped.
    • Use as ephemeral volume: applicable when there is a high performance requirement on EmptyDir.
    NOTE:
    • Local PVs are supported only when the cluster version is v1.21.2-r0 or later and the Everest add-on version is 2.1.23 or later. Version 2.1.23 or later is recommended.
    • Local EVs are supported only when the cluster version is v1.21.2-r0 or later and the Everest add-on version is 1.2.29 or later.
    Local Persistent Volumes and Local EVs support the following write modes:
    • Linear: A linear logical volume integrates one or more physical volumes. Data is written to the next physical volume when the previous one is used up.
    • Striped: A striped logical volume stripes data into blocks of the same size and stores them in multiple physical volumes in sequence, allowing data to be concurrently read and written. A storage pool consisting of striped volumes cannot be scaled-out. This option can be selected only when multiple volumes exist.

    Network Settings

    Configure networking resources to allow node and containerized application access.
    Table 4 Configuration parameters

    Parameter

    Description

    Virtual Private Cloud

    The VPC to which the cluster belongs by default, which cannot be changed.

    Node Subnet

    The node subnet selected during cluster creation is used by default. You can choose another subnet instead.

    • Multiple subnets: You can select multiple subnets in the same VPC for your node pool. Newly added nodes for a scale-out will preferentially consume the IP addresses of the subnets in the top order.
    • Single subnet: Only one subnet is configured for your node pool. If the IP addresses of a single subnet are insufficient, configure multiple subnets. Otherwise, a node pool scale-out may fail.

    Node IP Address

    Random allocation is supported.

    Associate Security Group

    Security group used by the nodes created in the node pool. A maximum of 5 security groups can be selected.

    When a cluster is created, a node security group named {Cluster name}-cce-node-{Random ID} is created and used by default.

    Traffic needs to pass through certain ports in the node security group to ensure node communications. Ensure that you have enabled these ports if you select another security group. For details, see Configuring Cluster Security Group Rules.

    NOTE:

    After a node pool is created, its associated security group cannot be modified.

    Advanced Settings

    Configure advanced node capabilities such as labels, taints, and startup command.
    Table 5 Advanced configuration parameters

    Parameter

    Description

    (Optional) Resource Tag

    You can add resource tags to classify resources.

    You can create predefined tags on the TMS console. The predefined tags are available to all resources that support tags. You can use predefined tags to improve the tag creation and resource migration efficiency. For details, see Creating Predefined Tags.

    CCE will automatically create the "CCE-Dynamic-Provisioning-Node=Node ID" tag.

    Kubernetes Label

    A Kubernetes label is a key-value pair added to a Kubernetes object (such as a pod). After specifying a label, click Add. A maximum of 20 labels can be added.

    Labels can be used to distinguish nodes. With workload affinity settings, container pods can be scheduled to a specified node. For more information, see Labels and Selectors.

    Taint

    This parameter is left blank by default. You can add taints to configure configure anti-affinity for the node. A maximum of 20 taints are allowed for each node. Each taint contains the following parameters:
    • Key: A key must contain 1 to 63 characters, starting with a letter or digit. Only letters, digits, hyphens (-), underscores (_), and periods (.) are allowed. A DNS subdomain name can be used as the prefix of a key.
    • Value: A value must start with a letter or digit and can contain a maximum of 63 characters, including letters, digits, hyphens (-), underscores (_), and periods (.).
    • Effect: Available options are NoSchedule, PreferNoSchedule, and NoExecute.

    For details, see Managing Node Taints.

    NOTE:

    For a cluster of v1.19 or earlier, the workload may have been scheduled to a node before the taint is added. To avoid such a situation, select a cluster of v1.19 or later.

    Synchronization for Existing Nodes

    After the options are selected, changes to Kubernetes labels/taints in the node pool will be synchronized to existing nodes.

    Max. Pods

    Maximum number of pods that can run on the node, including the default system pods. Value range: 16 to 256

    This limit prevents the node from being overloaded with pods.

    This number is also decided by other factors. For details, see Maximum Number of Pods That Can Be Created on a Node.

    ECS Group

    An ECS group logically groups ECSs. The ECSs in the same ECS group comply with the same policy associated with the ECS group.

    Anti-affinity: ECSs in an ECS group are deployed on different physical hosts to improve service reliability.

    Select an existing ECS group, or click Add ECS Group to create one. After the ECS group is created, click the refresh icon.

    Pre-installation Command

    Pre-installation script command, in which Chinese characters are not allowed. The script command will be transcoded using Base64, and the number of characters after transcoding cannot exceed 2048.

    The script will be executed before Kubernetes software is installed. Note that if the script is incorrect, Kubernetes software may fail to be installed.

    Post-installation Command

    Pre-installation script command, in which Chinese characters are not allowed. The script command will be transcoded using Base64, and the number of characters after transcoding cannot exceed 2048.

    The script will be executed after Kubernetes software is installed, which does not affect the installation.

    NOTE:

    Do not run the reboot command in the post-installation script to restart the system immediately. To restart the system, run the shutdown -r 1 command to restart with a delay of one minute.

    Agency

    An agency is created by the account administrator on the IAM console. By creating an agency, you can share your cloud server resources with another account, or entrust a more professional person or team to manage your resources.

    If no agency is available, click Create Agency on the right to create one.

    User-defined node name prefix and suffix

    Custom name prefix and suffix of a node in a node pool. After the configuration, the nodes in the node pool will be named with the configured prefix and suffix. For example, if the prefix is prefix- and the suffix is -suffix, the nodes in the node pool will be named in the format of "prefix-Node pool name with five-digit random characters-suffix".

    NOTICE:
    • A prefix and suffix can be customized only when a node pool is created, and they cannot be modified after the node pool is created.
    • A prefix can end with a special character, and a suffix can start with a special character.
    • A node name consists of a maximum of 56 characters in the format of "Prefix-Node pool name with five-digit random characters-Suffix".
    • A node name does not support the combination of a period (.) and special characters (such as .., .-, or -.).
    • This function is available only in clusters of v1.28.1, v1.27.3, v1.25.6, v1.23.11, v1.21.12, or later.

    Kubernetes Node Name

    The Kubernetes node name is the value of metadata.labels.kubernetes.io/hostname in the YAML file of the node. The following two values are supported:

    • Node private IP: The value must be the same as the private IP address of the node (default value).
    • Cloud server name: Use the custom cloud server name configured in Table 1. Cloud server names may be duplicate. To prevent name conflicts, CCE randomly adds a five-digit random suffix to the end of each cloud server name.
      NOTICE:
      • A cloud server name can be specified as the name of a Kubernetes node only when the cloud server is created or managed. After the server is created or accepted into the cluster, the name of the Kubernetes node cannot be changed. For details, see ECS Names, Node Names, and Kubernetes Node Names.
      • Existing nodes in the cluster still use the private IP address as the Kubernetes node name. Newly created or accepted nodes can use cloud server names.

        In this scenario, some Kubernetes node names may be inconsistent with node private IP addresses, and adaptation is required. For example, when configuring node affinity, you cannot use the node private IP address as the node name to configure a scheduling policy.

        If you want to change the Kubernetes node name to cloud server name, you can remove this node from the cluster and accept it again. Before doing so, learn about the possible impacts on services when removing and accepting a node.

  4. Click Next: Confirm. Ensure that you have read and understood the Image Management Service Statement .
  5. Click Submit.