Skip to content

Commit a50f66e

Browse files
authored
Merge pull request #490 from orangeholic/master
Data Source: `tencentcloud_kubernetes_clusters`add new arguments.
2 parents f9b177a + 503234b commit a50f66e

File tree

4 files changed

+99
-2
lines changed

4 files changed

+99
-2
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## 1.40.3 (Unreleased)
2+
3+
ENHANCEMENTS:
4+
5+
* Data Source: `tencentcloud_kubernetes_clusters`add new attributes `cluster_as_enabled`,`node_name_type`,`cluster_extra_args`,`network_type`,`is_non_static_ip_mode`,`kube_proxy_mode`,`service_cidr`,`eni_subnet_ids`,`claim_expired_seconds` and `deletion_protection`.
6+
17
## 1.40.2 (August 08, 2020)
28

39
BUG FIXES:

tencentcloud/data_source_tc_kubernetes_clusters.go

Lines changed: 79 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,79 @@ func tkeClusterInfo() map[string]*schema.Schema {
9292
Computed: true,
9393
Description: "The maximum number of services in the cluster.",
9494
},
95+
"cluster_as_enabled": {
96+
Type: schema.TypeBool,
97+
Computed: true,
98+
Description: "Indicates whether to enable cluster node auto scaler.",
99+
},
100+
"node_name_type": {
101+
Type: schema.TypeString,
102+
Computed: true,
103+
Description: "Node name type of Cluster.",
104+
},
105+
"cluster_extra_args": {
106+
Type: schema.TypeList,
107+
Computed: true,
108+
Elem: &schema.Resource{
109+
Schema: map[string]*schema.Schema{
110+
"kube_apiserver": {
111+
Type: schema.TypeList,
112+
Computed: true,
113+
Elem: &schema.Schema{Type: schema.TypeString},
114+
Description: "The customized parameters for kube-apiserver.",
115+
},
116+
"kube_controller_manager": {
117+
Type: schema.TypeList,
118+
Computed: true,
119+
Elem: &schema.Schema{Type: schema.TypeString},
120+
Description: "The customized parameters for kube-controller-manager.",
121+
},
122+
"kube_scheduler": {
123+
Type: schema.TypeList,
124+
Computed: true,
125+
Elem: &schema.Schema{Type: schema.TypeString},
126+
Description: "The customized parameters for kube-scheduler.",
127+
},
128+
},
129+
},
130+
Description: "Customized parameters for master component.",
131+
},
132+
"network_type": {
133+
Type: schema.TypeString,
134+
Computed: true,
135+
Description: "Cluster network type.",
136+
},
137+
"is_non_static_ip_mode": {
138+
Type: schema.TypeBool,
139+
Computed: true,
140+
Description: "Indicates whether static ip mode is enabled.",
141+
},
142+
"kube_proxy_mode": {
143+
Type: schema.TypeString,
144+
Computed: true,
145+
Description: "Cluster kube-proxy mode.",
146+
},
147+
"service_cidr": {
148+
Type: schema.TypeString,
149+
Computed: true,
150+
Description: "The network address block of the cluster.",
151+
},
152+
"eni_subnet_ids": {
153+
Type: schema.TypeList,
154+
Computed: true,
155+
Elem: &schema.Schema{Type: schema.TypeString},
156+
Description: "Subnet Ids for cluster with VPC-CNI network mode.",
157+
},
158+
"claim_expired_seconds": {
159+
Type: schema.TypeInt,
160+
Computed: true,
161+
Description: "The expired seconds to recycle ENI.",
162+
},
163+
"deletion_protection": {
164+
Type: schema.TypeBool,
165+
Computed: true,
166+
Description: "Indicates whether cluster deletion protection is enabled.",
167+
},
95168
"cluster_node_num": {
96169
Type: schema.TypeInt,
97170
Computed: true,
@@ -227,7 +300,12 @@ LOOP:
227300
infoMap["cluster_ipvs"] = info.Ipvs
228301
infoMap["cluster_as_enabled"] = info.AsEnabled
229302
infoMap["node_name_type"] = info.NodeNameType
230-
infoMap["cluster_extra_args"] = info.ExtraArgs
303+
304+
infoMap["cluster_extra_args"] = []map[string]interface{}{{
305+
"kube_apiserver": info.ExtraArgs.KubeAPIServer,
306+
"kube_controller_manager": info.ExtraArgs.KubeControllerManager,
307+
"kube_scheduler": info.ExtraArgs.KubeScheduler,
308+
}}
231309
infoMap["network_type"] = info.NetworkType
232310
infoMap["is_non_static_ip_mode"] = info.IsNonStaticIpMode
233311
infoMap["deletion_protection"] = info.DeletionProtection

tencentcloud/service_tencentcloud_tke.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ package tencentcloud
33
import (
44
"context"
55
"fmt"
6-
"github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common"
76
"log"
87
"strings"
98

109
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
10+
"github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common"
1111
tke "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tke/v20180525"
1212
"github.com/terraform-providers/terraform-provider-tencentcloud/tencentcloud/connectivity"
1313
"github.com/terraform-providers/terraform-provider-tencentcloud/tencentcloud/internal/helper"

website/docs/d/kubernetes_clusters.html.markdown

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,16 @@ In addition to all arguments above, the following attributes are exported:
3737

3838
* `list` - An information list of kubernetes clusters. Each element contains the following attributes:
3939
* `certification_authority` - The certificate used for access.
40+
* `claim_expired_seconds` - The expired seconds to recycle ENI.
41+
* `cluster_as_enabled` - Indicates whether to enable cluster node auto scaler.
4042
* `cluster_cidr` - A network address block of the cluster. Different from vpc cidr and cidr of other clusters within this vpc.
4143
* `cluster_deploy_type` - Deployment type of the cluster.
4244
* `cluster_desc` - Description of the cluster.
4345
* `cluster_external_endpoint` - External network address to access.
46+
* `cluster_extra_args` - Customized parameters for master component.
47+
* `kube_apiserver` - The customized parameters for kube-apiserver.
48+
* `kube_controller_manager` - The customized parameters for kube-controller-manager.
49+
* `kube_scheduler` - The customized parameters for kube-scheduler.
4450
* `cluster_ipvs` - Indicates whether ipvs is enabled.
4551
* `cluster_max_pod_num` - The maximum number of Pods per node in the cluster.
4652
* `cluster_max_service_num` - The maximum number of services in the cluster.
@@ -49,12 +55,19 @@ In addition to all arguments above, the following attributes are exported:
4955
* `cluster_os` - Operating system of the cluster.
5056
* `cluster_version` - Version of the cluster.
5157
* `container_runtime` - (**Deprecated**) It has been deprecated from version 1.18.1. Container runtime of the cluster.
58+
* `deletion_protection` - Indicates whether cluster deletion protection is enabled.
5259
* `domain` - Domain name for access.
60+
* `eni_subnet_ids` - Subnet Ids for cluster with VPC-CNI network mode.
5361
* `ignore_cluster_cidr_conflict` - Indicates whether to ignore the cluster cidr conflict error.
62+
* `is_non_static_ip_mode` - Indicates whether static ip mode is enabled.
63+
* `kube_proxy_mode` - Cluster kube-proxy mode.
64+
* `network_type` - Cluster network type.
65+
* `node_name_type` - Node name type of Cluster.
5466
* `password` - Password of account.
5567
* `pgw_endpoint` - The Intranet address used for access.
5668
* `project_id` - Project Id of the cluster.
5769
* `security_policy` - Access policy.
70+
* `service_cidr` - The network address block of the cluster.
5871
* `tags` - Tags of the cluster.
5972
* `user_name` - User name of account.
6073
* `vpc_id` - Vpc Id of the cluster.

0 commit comments

Comments
 (0)