diff --git a/.changelog/2756.txt b/.changelog/2756.txt new file mode 100644 index 0000000000..3b2b9fc70c --- /dev/null +++ b/.changelog/2756.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +resource/tencentcloud_kubernetes_cluster: support param `ignore_service_cidr_conflict` +``` diff --git a/tencentcloud/services/tke/resource_tc_kubernetes_cluster.go b/tencentcloud/services/tke/resource_tc_kubernetes_cluster.go index e5b70bd859..4413252f3f 100644 --- a/tencentcloud/services/tke/resource_tc_kubernetes_cluster.go +++ b/tencentcloud/services/tke/resource_tc_kubernetes_cluster.go @@ -373,6 +373,14 @@ func ResourceTencentCloudKubernetesCluster() *schema.Resource { Description: "Indicates whether to ignore the cluster cidr conflict error. Default is false.", }, + "ignore_service_cidr_conflict": { + Type: schema.TypeBool, + Optional: true, + Computed: true, + ForceNew: true, + Description: "Indicates whether to ignore the service cidr conflict error. Only valid in `VPC-CNI` mode.", + }, + "cluster_max_pod_num": { Type: schema.TypeInt, Optional: true, @@ -1306,6 +1314,9 @@ func resourceTencentCloudKubernetesClusterCreate(d *schema.ResourceData, meta in if v, ok := d.GetOkExists("ignore_cluster_cidr_conflict"); ok { clusterCIDRSettings.IgnoreClusterCIDRConflict = helper.Bool(v.(bool)) } + if v, ok := d.GetOkExists("ignore_service_cidr_conflict"); ok { + clusterCIDRSettings.IgnoreServiceCIDRConflict = helper.Bool(v.(bool)) + } if v, ok := d.GetOkExists("cluster_max_service_num"); ok { clusterCIDRSettings.MaxClusterServiceNum = helper.IntUint64(v.(int)) } @@ -1510,6 +1521,10 @@ func resourceTencentCloudKubernetesClusterRead(d *schema.ResourceData, meta inte _ = d.Set("ignore_cluster_cidr_conflict", respData.ClusterNetworkSettings.IgnoreClusterCIDRConflict) } + if respData.ClusterNetworkSettings.IgnoreServiceCIDRConflict != nil { + _ = d.Set("ignore_service_cidr_conflict", respData.ClusterNetworkSettings.IgnoreServiceCIDRConflict) + } + if respData.ClusterNetworkSettings.MaxNodePodNum != nil { _ = d.Set("cluster_max_pod_num", respData.ClusterNetworkSettings.MaxNodePodNum) } diff --git a/website/docs/r/kubernetes_cluster.html.markdown b/website/docs/r/kubernetes_cluster.html.markdown index 1e747a2a32..dfb72dede9 100644 --- a/website/docs/r/kubernetes_cluster.html.markdown +++ b/website/docs/r/kubernetes_cluster.html.markdown @@ -830,6 +830,7 @@ The following arguments are supported: * `extra_args` - (Optional, List: [`String`], ForceNew) Custom parameter information related to the node. * `globe_desired_pod_num` - (Optional, Int, ForceNew) Indicate to set desired pod number in node. valid when enable_customized_pod_cidr=true, and it takes effect for all nodes. * `ignore_cluster_cidr_conflict` - (Optional, Bool, ForceNew) Indicates whether to ignore the cluster cidr conflict error. Default is false. +* `ignore_service_cidr_conflict` - (Optional, Bool, ForceNew) Indicates whether to ignore the service cidr conflict error. Only valid in `VPC-CNI` mode. * `is_non_static_ip_mode` - (Optional, Bool, ForceNew) Indicates whether non-static ip mode is enabled. Default is false. * `kube_proxy_mode` - (Optional, String) Cluster kube-proxy mode, the available values include: 'kube-proxy-bpf'. Default is not set.When set to kube-proxy-bpf, cluster version greater than 1.14 and with Tencent Linux 2.4 is required. * `labels` - (Optional, Map, ForceNew) Labels of tke cluster nodes.