Skip to content

Commit 0b82607

Browse files
author
hellertang
authored
nodepool support multi az (#851)
1 parent 2674f2c commit 0b82607

File tree

3 files changed

+49
-9
lines changed

3 files changed

+49
-9
lines changed

CHANGELOG.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,27 @@
1+
## 1.61.6 (February 5, 2022)
2+
3+
ENHANCEMENTS:
4+
5+
* resource `tencentcloud_kubernetes_node_pool` support set `multi_zone_subnet_policy`
6+
7+
8+
## 1.61.5 (January 29, 2022)
9+
10+
ENHANCEMENTS:
11+
12+
* resource `tencentcloud_redis_instance` remove change redis mem_size limit
13+
14+
## 1.61.4 (January 27, 2022)
15+
16+
ENHANCEMENTS:
17+
18+
* resource `tencentcloud_dayu_eip` support create new ddos eip rules
19+
* resource `tencentcloud_dayu_l4_rule_v2` support create new ddos l4 rules
20+
* resource `tencentcloud_dayu_l7_rule_v2` support create new ddos l7 rules
21+
* data source `tencentcloud_dayu_eip` support query new ddos eip rules
22+
* data source `tencentcloud_dayu_l4_rules_v2` support query new ddos l4 rules
23+
* data source `tencentcloud_dayu_l7_rules_v2` support query new ddos l7 rules
24+
125
## 1.61.3 (January 25, 2022)
226

327
ENHANCEMENTS:

tencentcloud/resource_tc_kubernetes_node_pool.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ resource "tencentcloud_kubernetes_node_pool" "mynodepool" {
4747
retry_policy = "INCREMENTAL_INTERVALS"
4848
desired_capacity = 4
4949
enable_auto_scale = true
50+
multi_zone_subnet_policy = "EQUALITY"
5051
5152
auto_scaling_config {
5253
instance_type = var.default_instance_type
@@ -332,6 +333,14 @@ func ResourceTencentCloudKubernetesNodePool() *schema.Resource {
332333
" If the number of instances is still lower than the expected number of instances after the startup, the instance will be created, and the method of destroying the instance will still be used for shrinking)" +
333334
".",
334335
},
336+
"multi_zone_subnet_policy": {
337+
Type: schema.TypeString,
338+
Optional: true,
339+
ForceNew: true,
340+
ValidateFunc: validateAllowedStringValue([]string{MultiZoneSubnetPolicyPriority,
341+
MultiZoneSubnetPolicyEquality}),
342+
Description: "Multi-availability zone/subnet policy. Valid values: PRIORITY and EQUALITY. Default value: PRIORITY.",
343+
},
335344
"node_config": {
336345
Type: schema.TypeList,
337346
Optional: true,
@@ -507,6 +516,10 @@ func composeParameterToAsScalingGroupParaSerial(d *schema.ResourceData) (string,
507516
request.ServiceSettings = &as.ServiceSettings{ScalingMode: helper.String(v.(string))}
508517
}
509518

519+
if v, ok := d.GetOk("multi_zone_subnet_policy"); ok {
520+
request.MultiZoneSubnetPolicy = helper.String(v.(string))
521+
}
522+
510523
result = request.ToJsonString()
511524

512525
return result, errRet
@@ -893,6 +906,7 @@ func resourceKubernetesNodePoolRead(d *schema.ResourceData, meta interface{}) er
893906
_ = d.Set("vpc_id", asg.VpcId)
894907
_ = d.Set("retry_policy", asg.RetryPolicy)
895908
_ = d.Set("subnet_ids", helper.StringsInterfaces(asg.SubnetIdSet))
909+
_ = d.Set("multi_zone_subnet_policy", asg.MultiZoneSubnetPolicy)
896910
}
897911

898912
taints := make([]map[string]interface{}, len(nodePool.Taints))

website/docs/r/kubernetes_node_pool.html.markdown

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,16 @@ resource "tencentcloud_kubernetes_cluster" "managed_cluster" {
4747
4848
//this is one example of managing node using node pool
4949
resource "tencentcloud_kubernetes_node_pool" "mynodepool" {
50-
name = "mynodepool"
51-
cluster_id = tencentcloud_kubernetes_cluster.managed_cluster.id
52-
max_size = 6
53-
min_size = 1
54-
vpc_id = data.tencentcloud_vpc_subnets.vpc.instance_list.0.vpc_id
55-
subnet_ids = [data.tencentcloud_vpc_subnets.vpc.instance_list.0.subnet_id]
56-
retry_policy = "INCREMENTAL_INTERVALS"
57-
desired_capacity = 4
58-
enable_auto_scale = true
50+
name = "mynodepool"
51+
cluster_id = tencentcloud_kubernetes_cluster.managed_cluster.id
52+
max_size = 6
53+
min_size = 1
54+
vpc_id = data.tencentcloud_vpc_subnets.vpc.instance_list.0.vpc_id
55+
subnet_ids = [data.tencentcloud_vpc_subnets.vpc.instance_list.0.subnet_id]
56+
retry_policy = "INCREMENTAL_INTERVALS"
57+
desired_capacity = 4
58+
enable_auto_scale = true
59+
multi_zone_subnet_policy = "EQUALITY"
5960
6061
auto_scaling_config {
6162
instance_type = var.default_instance_type
@@ -117,6 +118,7 @@ The following arguments are supported:
117118
* `desired_capacity` - (Optional) Desired capacity ot the node. If `enable_auto_scale` is set `true`, this will be a computed parameter.
118119
* `enable_auto_scale` - (Optional) Indicate whether to enable auto scaling or not.
119120
* `labels` - (Optional) Labels of kubernetes node pool created nodes. The label key name does not exceed 63 characters, only supports English, numbers,'/','-', and does not allow beginning with ('/').
121+
* `multi_zone_subnet_policy` - (Optional, ForceNew) Multi-availability zone/subnet policy. Valid values: PRIORITY and EQUALITY. Default value: PRIORITY.
120122
* `node_config` - (Optional) Node config.
121123
* `node_os_type` - (Optional) The image version of the node. Valida values are `DOCKER_CUSTOMIZE` and `GENERAL`. Default is `GENERAL`. This parameter will only affect new nodes, not including the existing nodes.
122124
* `node_os` - (Optional) Operating system of the cluster, the available values include: `tlinux2.4x86_64`, `ubuntu18.04.1x86_64`, `ubuntu16.04.1 LTSx86_64`, `centos7.6.0_x64` and `centos7.2x86_64`. Default is 'tlinux2.4x86_64'. This parameter will only affect new nodes, not including the existing nodes.

0 commit comments

Comments
 (0)