Creating a CCE Cluster
Related Resources
Procedure
- Create a VPC and subnet. For details, see Configuring the Network.
- Create the cce.tf file, enter the following information, and save the file:
resource "huaweicloud_vpc" "myvpc" { name = "myvpc" cidr = "192.168.0.0/16" } resource "huaweicloud_vpc_subnet" "mysubnet" { name = "mysubnet" cidr = "192.168.0.0/16" gateway_ip = "192.168.0.1" //dns is required for cce node installing primary_dns = "100.125.1.250" secondary_dns = "100.125.21.250" vpc_id = huaweicloud_vpc.myvpc.id }
- Run terraform init to initialize the environment.
- Run terraform plan to view resources.
- After you confirm that the resource information is correct, run terraform apply to start resource creation.
- Run terraform show to view the created VPC and subnet.
- Create the cce.tf file, enter the following information, and save the file:
- Assign an EIP. If the cluster does not use the public network, skip this step.
- Add the following information to the cce.tf file:
resource "huaweicloud_vpc_eip" "myeip" { publicip { type = "5_bgp" } bandwidth { name = "mybandwidth" size = 8 share_type = "PER" charge_mode = "traffic" } }
- Run terraform plan to view resources.
- After you confirm that the resource information is correct, run terraform apply to start resource creation.
- Run terraform show to view the created EIP.
- Add the following information to the cce.tf file:
- Create a CCE cluster.
- Add the following information to the cce.tf file:
resource "huaweicloud_cce_cluster" "mycce" { name = "mycce" flavor_id = "cce.s1.small" vpc_id = huaweicloud_vpc.myvpc.id subnet_id = huaweicloud_vpc_subnet.mysubnet.id container_network_type = "overlay_l2" eip = huaweicloud_vpc_eip.myeip.address // If you choose not to use EIP, skip this line. }
- Run terraform plan to view resources.
- After you confirm that the resource information is correct, run terraform apply to start resource creation.
- Run terraform show to view the created CCE cluster.
- Add the following information to the cce.tf file:
Resource Name |
Parameter |
Description |
---|---|---|
huaweicloud_cce_cluster |
name |
(Mandatory) Cluster name.
|
flavor_id |
(Mandatory) Cluster flavor.
|
|
vpc_id |
(Mandatory) ID of the VPC used to create a master node. |
|
subnet_id |
(Mandatory) Network ID of the subnet used to create a master node. |
|
container_network_type |
(Mandatory) Container network type.
|
|
eip |
(Optional) EIP. |
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.