Adding a Node

Last updated: 2021-08-18 11:01:00

    Overview

    You can add a node to your cluster in the following ways.

    Prerequisites

    You have logged in to the TKE Console.

    Directions

    Creating a Node

    1. Click Cluster in the left sidebar to go to the "Cluster Management" page.
    2. Click the ID of the cluster in which the CVM instance is to be created to go to the details page of the cluster.
    3. Choose Node Management > Node in the left sidebar to go to the node list page, and click Create Node.
    4. On the “Create Node” page, configure the related parameters as needed, as shown in the figure below:

      The main parameters are described as follows:
      • Billing Mode: pay-as-you-go and monthly subscription are supported. For details, see Billing Plans.
      • Availability Zone: this parameter is used to filter the available subnet list under the available zone.
      • Cluster Network: select the subnet that assigns IP to the created node. A single node creation only supports a single subnet.
      • Model Configuration: click Select a model. On the “Model Configuration” page, select the values as needed based on the following descriptions:
        • Model: you can select the model by specifying the number of CPU cores, memory size, and instance type. For more information, see Instance Types.
        • System disk: controls the storage and schedules the operating of Cloud Virtual Machines (CVMs). You can view the system disk types available for the selected model and select the system disk as needed. For more information, see Cloud Disk Types.
        • Data Disk: stores all user data.
      • Instance Name: the CVM instance name displayed on the console, which is determined by the naming mode of host name. The following two naming methods are provided:
        • Auto-generated: the host name will be automatically named. It supports sequential numbering or custom format for multiple instances. Up to 60 characters allowed. The instance name is automatically generated by default in the format of tke_cluster id_worker.
        • Custom Name: the host name is manually configured. The instance name is the same as the host name without reconfiguration.
      • Login Method: you can select any one of the following login methods as required:
        • SSH Key Pair: a key pair is a pair of parameters generated by using an algorithm. Using a key pair to log in to a CVM instance is more secure than using regular passwords. For more information, see SSH Key.
          • SSH Key: this parameter displays only when SSH Key Pair is selected. Select an existing key in the drop-down list. For how to create a key, see Creating a SSH key.
        • Random Password: the system sends an automatically generated password to your Message Center.
        • Custom Password: set a password as prompted.
      • Security Groups: the default value is the security group specified when the cluster is created. You can replace the security group or add a security group as required.
      • Amount: the number of instances to create. You can specify this value as needed.
    5. (Optional) Click More Settings on “Create Node” page to view or configure more information, as shown in the following figure.
      • CAM Role: you can bind all the nodes created this time to the same CAM role, and grant the authorization policy bound to the role to the nodes. For more information, see Managing Roles.
      • Container Directory: check this option to set up the container and image storage directory. We recommend that you store to the data disk, such as /var/lib/docker.
      • Security Services: free DDoS Protection, Web Application Firewall (WAF), and Cloud Workload Protection are activated by default. For more information, see Cloud Workload Protection.
      • Cloud Monitor: free monitoring, analysis, and alarms are activated by default, and components are installed to obtain CVM monitoring metrics. For more information, see Cloud Monitor.
      • Cordon initial nodes: after you check Cordon this node, new Pods cannot be scheduled to this node. You can uncordon the node manually, or execute the uncordon command in custom data as needed.
      • Label: click New Label to custom a label, which is used to filter or manage nodes.
      • Custom data: specify custom data to configure node, that is, to run the configured script when the node is started up. You need to ensure the reentrant and retry logic of the script. The script and its log files can be viewed at the node path: /usr/local/qcloud/tke/userscript.

    Adding an existing node

    Note:

    • Currently, you can only add CVM instances in the same VPC.
    • Do not add public gateway CVMs to the cluster. A DNS exception occurs when this type of CVM is reinstalled and added to the cluster, and the node becomes unavailable.
    1. Click Cluster in the left sidebar to go to the "Cluster Management" page.
    2. Click the ID of the cluster to which an existing node is to be added to go to the details page of the cluster.
    3. Choose Node Management > Node and click Add Existing Node as shown in the figure below:
    4. On the "Select Nodes" page, select the node to add and click Next.
    5. On the "CVM Configuration" page, configure the CVM instance to add to the cluster.
      The main parameters are described as follows:
      • Mount Data Disk: the related settings for formatting the mounting. Enter the device name and mount point, and select whether to format the system or not.
        • Do not check: do not set the data disk mounting. You can manually mount or use the script to mount.
        • Check: you need to set the device name, format system (you can select “Do not format”), and mount point.
          If you want to format the device “/dev/vdb” into “ext4” and mount it to the “/var/lib/docker” directory, you can set it like this:
          You can set the device name as /dev/vdb, select ext4 for the format system, and set the mount point as /var/lib/docker.
          Note
          • Back up the important data in advance. If you have formatted the disk, you don’t need to format the system, just enter the mount point.
          • The settings for formatting the mounting will take effect for the selected nodes. Please ensure that the entered device name, for example, /dev/vdb meets your expectations (If you have performed hot swapping and other operations on CBS, the device name may change).
          • If you have created partitions or are using LVM, please enter the partition name or logical volume name in the device name, and configure the corresponding parameters for formatting the mounting.
          • If you enter the incorrect device name, an error will occur and the node initialization will be terminated.
          • If the entered mount point does not exist, a corresponding directory will be created, and no error will occur.
      • Container Directory: set up the container and image storage directory. It's recommended to store to the data disk.
      • Operating System: you can modify the OS setting in the cluster details page. After the modification, the newly added or reinstalled nodes will use the new operating system.
      • Login Method:
        • Custom Password: set a password as prompted.
        • SSH Key Pair: a key pair is a pair of parameters generated by an algorithm. Logging in to a CVM using a key pair is more secure than using regular passwords. For more information, see SSH Keys.
        • Random Password: a password will be automatically generated and sent to you through the Message Center.
      • Security Group: configure network access control for the CVM instance as needed. You can click Add Security Group to open other ports to the internet.
    6. Click Done.