terraform-provider-tencentcloud icon indicating copy to clipboard operation
terraform-provider-tencentcloud copied to clipboard

When creating a node pool, wait for all expected nodes to be ready before returning

Open ldming opened this issue 2 years ago • 1 comments

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

When creating a k8s cluster containing a node pool, after the cluster is created, the nodes in the node pool are still being created and cannot be used normally. Expected node pool to wait for all expected nodes to be ready before returning.

I have reviewed the code and found that when creating a node pool, it will wait for the node pool to reach normal state and return.

	// wait for status ok
	err = resource.Retry(5*readRetryTimeout, func() *resource.RetryError {
		nodePool, _, errRet := service.DescribeNodePool(ctx, clusterId, nodePoolId)
		if errRet != nil {
			return retryError(errRet, InternalError)
		}
		if nodePool != nil && *nodePool.LifeState == "normal" {
			return nil
		}
		return resource.RetryableError(fmt.Errorf("node pool status is %s, retry...", *nodePool.LifeState))
	})

However, normal state does not necessarily mean that all the expected nodes are already ready. IMO, before the expected nodes are ready, set the state to normal is incorrect, keep the creating state should be more reasonable.

It's like, when I go to a restaurant for dinner, the waiter gives me an empty plate and says the meal is ready, but it's an empty plate. Where is my meal? The waiter should tell me that my meal is being prepared and will be ready later, rather than giving me an empty plate and telling me that it is ready.

New or Affected Resource(s)

  • resource_tc_kubernetes_node_pool.go

Potential Terraform Configuration

N/A

References

N/A

ldming avatar May 08 '23 01:05 ldming

When deleting nodepool as well they didn't wait all node instances to be destroy and return :(

Khuicque avatar Nov 26 '24 04:11 Khuicque