Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(tke): [120885420] tencentcloud_kubernetes_node_pool update doc and code #2986

Merged
merged 2 commits into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/2986.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
resource/tencentcloud_kubernetes_node_pool: update doc and code
```

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions tencentcloud/services/tke/resource_tc_kubernetes_node_pool.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Provide a resource to create an auto scaling group for kubernetes cluster.

~> **NOTE:** In order to ensure the integrity of customer data, if the cvm instance was destroyed due to shrinking, it will keep the cbs associate with cvm by default. If you want to destroy together, please set `delete_with_instance` to `true`.

~> **NOTE:** There are two parameters `wait_node_ready` and `scale_tolerance` to ensure better management of node pool scaling operations. If this parameter is set, when creating resources, if the set criteria are not met, the resources will be marked as `tainted`.
~> **NOTE:** There are two parameters `wait_node_ready` and `scale_tolerance` to ensure better management of node pool scaling operations. If this parameter is set when creating a resource, the resource will be marked as `tainted` if the set conditions are not met.

Example Usage

Expand Down Expand Up @@ -145,7 +145,7 @@ resource "tencentcloud_kubernetes_node_pool" "example" {
}
```

Set `wait_node_ready` and `scale_tolerance`
Wait for all scaling nodes to be ready with wait_node_ready and scale_tolerance parameters.

```hcl
resource "tencentcloud_kubernetes_node_pool" "example" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1438,7 +1438,7 @@ func waitNodePoolInitializing(ctx context.Context, clusterId, nodePoolId string)
nodePoolDetailrequest := tke.NewDescribeClusterNodePoolDetailRequest()
nodePoolDetailrequest.ClusterId = common.StringPtr(clusterId)
nodePoolDetailrequest.NodePoolId = common.StringPtr(nodePoolId)
err = resource.Retry(1*tccommon.ReadRetryTimeout, func() *resource.RetryError {
err = resource.Retry(10*tccommon.ReadRetryTimeout, func() *resource.RetryError {
result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseTkeV20180525Client().DescribeClusterNodePoolDetailWithContext(ctx, nodePoolDetailrequest)
if e != nil {
return tccommon.RetryError(e)
Expand Down Expand Up @@ -1501,8 +1501,10 @@ func waitNodePoolInitializing(ctx context.Context, clusterId, nodePoolId string)
})

if err != nil {
return fmt.Errorf("Node pool scaling failed, Reason: %s\nPlease check your resource inventory, Or adjust `desired_capacity`, `scale_tolerance` and `instance_type`, Then try again.", errFmt)
return fmt.Errorf("Describe auto scaling activities failed: %s", err)
}

return fmt.Errorf("Node pool scaling failed, Reason: %s\nPlease check your resource inventory, Or adjust `desired_capacity`, `scale_tolerance` and `instance_type`, Then try again.", errFmt)
} else {
return fmt.Errorf("Node pool scaling failed, Desired value: %d, Actual value: %d, Scale tolerance: %d%%\nPlease check your resource inventory, Or adjust `desired_capacity`, `scale_tolerance` and `instance_type`, Then try again.", desiredCapacity, currentNormal, scaleTolerance)
}
Expand Down
6 changes: 3 additions & 3 deletions website/docs/r/kubernetes_node_pool.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Provide a resource to create an auto scaling group for kubernetes cluster.

~> **NOTE:** In order to ensure the integrity of customer data, if the cvm instance was destroyed due to shrinking, it will keep the cbs associate with cvm by default. If you want to destroy together, please set `delete_with_instance` to `true`.

~> **NOTE:** There are two parameters `wait_node_ready` and `scale_tolerance` to ensure better management of node pool scaling operations. If this parameter is set, when creating resources, if the set criteria are not met, the resources will be marked as `tainted`.
~> **NOTE:** There are two parameters `wait_node_ready` and `scale_tolerance` to ensure better management of node pool scaling operations. If this parameter is set when creating a resource, the resource will be marked as `tainted` if the set conditions are not met.

## Example Usage

Expand Down Expand Up @@ -156,7 +156,7 @@ resource "tencentcloud_kubernetes_node_pool" "example" {
}
```


### Wait for all scaling nodes to be ready with wait_node_ready and scale_tolerance parameters.

```hcl
resource "tencentcloud_kubernetes_node_pool" "example" {
Expand Down Expand Up @@ -254,7 +254,7 @@ The following arguments are supported:
* `taints` - (Optional, List) Taints of kubernetes node pool created nodes.
* `termination_policies` - (Optional, List: [`String`]) Policy of scaling group termination. Available values: `["OLDEST_INSTANCE"]`, `["NEWEST_INSTANCE"]`.
* `unschedulable` - (Optional, Int, ForceNew) Sets whether the joining node participates in the schedule. Default is '0'. Participate in scheduling.
* `wait_node_ready` - (Optional, Bool) Whether to wait for all expansion resources to be ready. Default is false. Only can be set if `enable_auto_scale` is `false`.
* `wait_node_ready` - (Optional, Bool) Whether to wait for all desired nodes to be ready. Default is false. Only can be set if `enable_auto_scale` is `false`.
* `zones` - (Optional, List: [`String`]) List of auto scaling group available zones, for Basic network it is required.

The `annotations` object supports the following:
Expand Down
Loading