@@ -135,7 +135,6 @@ resource "tencentcloud_kubernetes_cluster" "example" {
135135 "test2" = "test2",
136136 }
137137}
138-
139138```
140139
141140Create an empty cluster with a node pool
@@ -261,7 +260,6 @@ resource "tencentcloud_kubernetes_node_pool" "example" {
261260 ]
262261 }
263262}
264-
265263````
266264
267265Create a cluster with a node pool and open the network access with cluster endpoint
@@ -715,17 +713,16 @@ variable "default_instance_type" {
715713}
716714
717715resource "tencentcloud_kubernetes_cluster" "managed_cluster" {
718- vpc_id = var.vpc
719- cluster_max_pod_num = 32
720- cluster_name = "test"
721- cluster_desc = "test cluster desc"
722- cluster_max_service_num = 256
723- cluster_internet = true
724- # managed_cluster_internet_security_policies = ["3.3.3.3", "1.1.1.1"]
725- cluster_deploy_type = "MANAGED_CLUSTER"
726- network_type = "VPC-CNI"
727- eni_subnet_ids = ["subnet-bk1etlyu"]
728- service_cidr = "10.1.0.0/24"
716+ vpc_id = var.vpc
717+ cluster_max_pod_num = 32
718+ cluster_name = "test"
719+ cluster_desc = "test cluster desc"
720+ cluster_max_service_num = 256
721+ cluster_internet = true
722+ cluster_deploy_type = "MANAGED_CLUSTER"
723+ network_type = "VPC-CNI"
724+ eni_subnet_ids = ["subnet-bk1etlyu"]
725+ service_cidr = "10.1.0.0/24"
729726
730727 worker_config {
731728 count = 1
@@ -746,8 +743,8 @@ resource "tencentcloud_kubernetes_cluster" "managed_cluster" {
746743 enhanced_security_service = false
747744 enhanced_monitor_service = false
748745 user_data = "dGVzdA=="
749- # password = "ZZXXccvv1212" // Optional, should be set if key_ids not set.
750746 key_ids = "skey-11112222"
747+ # password = "ZZXXccvv1212" // Optional, should be set if key_ids not set.
751748 }
752749
753750 labels = {
@@ -783,30 +780,57 @@ resource "tencentcloud_kubernetes_cluster" "managed_cluster" {
783780```
784781
785782Create a CDC scenario cluster
783+
786784```
787785resource "tencentcloud_kubernetes_cluster" "cdc_cluster" {
788- cdc_id = "cluster-xxxxx"
789- vpc_id = "vpc-xxxxx"
790- cluster_cidr = "192.168.0.0/16"
791- cluster_max_pod_num = 64
792- cluster_name = "test-cdc"
793- cluster_desc = "test cluster desc"
794- cluster_max_service_num = 1024
795- cluster_version = "1.30.0"
796-
797- cluster_os = "tlinux3.1x86_64"
798- cluster_level = "L20"
799- cluster_deploy_type = "INDEPENDENT_CLUSTER"
800-
801- container_runtime = "containerd"
802- runtime_version = "1.6.9"
803- pre_start_user_script = "aXB0YWJsZXMgLUEgSU5QVVQgLXAgdGNwIC1zIDE2OS4yNTQuMC4wLzE5IC0tdGNwLWZsYWdzIFNZTixSU1QgU1lOIC1qIFRDUE1TUyAtLXNldC1tc3MgMTE2MAppcHRhYmxlcyAtQSBPVVRQVVQgLXAgdGNwIC1kIDE2OS4yNTQuMC4wLzE5IC0tdGNwLWZsYWdzIFNZTixSU1QgU1lOIC1qIFRDUE1TUyAtLXNldC1tc3MgMTE2MAoKZWNobyAnCmlwdGFibGVzIC1BIElOUFVUIC1wIHRjcCAtcyAxNjkuMjU0LjAuMC8xOSAtLXRjcC1mbGFncyBTWU4sUlNUIFNZTiAtaiBUQ1BNU1MgLS1zZXQtbXNzIDExNjAKaXB0YWJsZXMgLUEgT1VUUFVUIC1wIHRjcCAtZCAxNjkuMjU0LjAuMC8xOSAtLXRjcC1mbGFncyBTWU4sUlNUIFNZTiAtaiBUQ1BNU1MgLS1zZXQtbXNzIDExNjAKJyA+PiAvZXRjL3JjLmQvcmMubG9jYWw="
804- exist_instance {
805- node_role = "MASTER_ETCD"
806- instances_para {
807- instance_ids = ["ins-eeijdk16", "ins-84ku5rba", "ins-8oa3im2s"]
786+ cdc_id = "cluster-262n63e8"
787+ vpc_id = "vpc-0m6078eb"
788+ cluster_cidr = "192.168.0.0/16"
789+ cluster_max_pod_num = 64
790+ cluster_name = "test-cdc"
791+ cluster_desc = "test cluster desc"
792+ cluster_max_service_num = 1024
793+ cluster_version = "1.30.0"
794+ cluster_os = "tlinux3.1x86_64"
795+ cluster_level = "L20"
796+ cluster_deploy_type = "INDEPENDENT_CLUSTER"
797+ container_runtime = "containerd"
798+ runtime_version = "1.6.9"
799+ pre_start_user_script = "aXB0YWJsZXMgLUEgSU5QVVQgLXAgdGNwIC1zIDE2OS4yNTQuMC4wLzE5IC0tdGNwLWZsYWdzIFNZTixSU1QgU1lOIC1qIFRDUE1TUyAtLXNldC1tc3MgMTE2MAppcHRhYmxlcyAtQSBPVVRQVVQgLXAgdGNwIC1kIDE2OS4yNTQuMC4wLzE5IC0tdGNwLWZsYWdzIFNZTixSU1QgU1lOIC1qIFRDUE1TUyAtLXNldC1tc3MgMTE2MAoKZWNobyAnCmlwdGFibGVzIC1BIElOUFVUIC1wIHRjcCAtcyAxNjkuMjU0LjAuMC8xOSAtLXRjcC1mbGFncyBTWU4sUlNUIFNZTiAtaiBUQ1BNU1MgLS1zZXQtbXNzIDExNjAKaXB0YWJsZXMgLUEgT1VUUFVUIC1wIHRjcCAtZCAxNjkuMjU0LjAuMC8xOSAtLXRjcC1mbGFncyBTWU4sUlNUIFNZTiAtaiBUQ1BNU1MgLS1zZXQtbXNzIDExNjAKJyA+PiAvZXRjL3JjLmQvcmMubG9jYWw="
800+ instance_delete_mode = "retain"
801+ exist_instance {
802+ node_role = "MASTER_ETCD"
803+ instances_para {
804+ instance_ids = ["ins-mam0c7lw", "ins-quvwayve", "ins-qbffk8iw"]
805+ enhanced_security_service = true
806+ enhanced_monitor_service = true
807+ password = "Password@123"
808+ security_group_ids = ["sg-hjs685q9"]
809+ master_config {
810+ mount_target = "/var/data"
811+ docker_graph_path = "/var/lib/containerd"
812+ unschedulable = 0
813+ labels {
814+ name = "key"
815+ value = "value"
816+ }
817+ data_disk {
818+ file_system = "ext4"
819+ auto_format_and_mount = true
820+ mount_target = "/var/data"
821+ disk_partition = "/dev/vdb"
808822 }
823+ extra_args {
824+ kubelet = ["root-dir=/root"]
825+ }
826+ taints {
827+ key = "key"
828+ value = "value"
829+ effect = "NoSchedule"
830+ }
831+ }
809832 }
833+ }
810834}
811835```
812836
0 commit comments