Updated on 2023-12-21 GMT+08:00

Creating a CCE Node

Procedure

  1. Create a CCE cluster. For details, see Creating a CCE Cluster.
  2. Create a CCE node.

    1. Add the following content to the cce.tf file created in Creating a CCE Cluster.
      data "huaweicloud_availability_zones" "myaz" {}
      
      resource "huaweicloud_compute_keypair" "mykeypair" {
        name       = "mykeypair"
      }
      
      resource "huaweicloud_cce_node" "mynode" {
        cluster_id        = huaweicloud_cce_cluster.mycce.id
        name              = "mynode"
        flavor_id         = "t6.large.2"
        availability_zone = data.huaweicloud_availability_zones.myaz.names[0]
        key_pair          = huaweicloud_compute_keypair.mykeypair.name
      
        root_volume {
          size       = 40
          volumetype = "SAS"
        }
        data_volumes {
          size       = 100
          volumetype = "SAS"
        }
      }
    2. Run terraform plan to view resources.
    3. After you confirm that the resource information is correct, run terraform apply to start resource creation.
    4. Run terraform show to view the created CCE node.

Table 1 Parameter description

Resource Name

Parameter

Description

huaweicloud_cce_node

cluster_id

(Mandatory) Cluster ID.

name

(Optional) Node name.

  • Enter 1 to 56 characters, starting with a lowercase letter and not ending with a hyphen (-). Only lowercase letters, digits, and hyphens (-) are allowed.

flavor_id

(Mandatory) Node flavor.

availability_zone

(Mandatory) Name of the AZ to which a node belongs.

  • Select an AZ that exists at the underlying layer and is in the physical AZ group of the user.

key_pair

(Optional) Key pair used for login.

  • You must select either key pair or password for login.

root_volume

size

(Mandatory) Disk size in GB.

  • For the system disk, the value ranges from 40 to 1024.

volumetype

(Mandatory) Disk type.

  • Options:
    • SATA: common I/O disk type
    • SATA: high I/O disk type
    • SSD: ultra-high I/O disk type

data_volume

size

(Mandatory) Disk size in GB.

  • For a data disk, the value ranges from 100 to 32768.

volumetype

(Mandatory) Disk type.

  • Options:
    • SATA: common I/O disk type
    • SATA: high I/O disk type
    • SSD: ultra-high I/O disk type