Open pregnor opened 5 years ago
Instead of names worker_pool = "pool_b2c_8x32" zone = "${var.datacenter}" We should use the ID of the resources so that resources will wait until all the dependent resources are provisioned and available.
Here is the sample example which list how to use the id's of resources https://github.com/IBM-Cloud/terraform-provider-ibm/blob/master/examples/ibm-cluster/cluster-worker-pool-zone/main.tf
So if the value of worker_pool
in the ibm_container_worker_pool_zone_attachment
definition is a worker pool name instead of a worker pool ID then the waiting mechanism doesn't kick in, yet if the value is a worker pool ID then the waiting mechanism works as expected?
In the example you have linked the default pool zone attachment uses pool name instead of pool ID as far as I can see which may cause confusion regarding the pool name being permissible to be used in the zone attachment: https://github.com/IBM-Cloud/terraform-provider-ibm/blob/master/examples/ibm-cluster/cluster-worker-pool-zone/main.tf#L32 I can see what you meant at https://github.com/IBM-Cloud/terraform-provider-ibm/blob/master/examples/ibm-cluster/cluster-worker-pool-zone/main.tf#L53, but still it is not clarified whether there is any difference between pool names and IDs in case of any pool, default or not.
In the documentation (https://ibm-cloud.github.io/tf-ibm-docs/v0.17.3/r/container_worker_pool_zone_attachment.html / Argument Reference
/ worker_pool
) the documentation states worker_pool - (Required, string) The name or id of the worker pool.
which doesn't highlight any difference between names and IDs, in case it does matter I would be glad to have this included in the documentation to avoid such easily preventable issues.
Terraform Version
Terraform v0.11.13 IBM Cloud Terraform provider version: v0.17.3
Affected Resource(s)
Please list the resources as a list, for example:
Terraform Configuration Files
Debug Output
https://gist.github.com/pregnor/cead3f27ed46b15ffbf37f5f4c8bf059
Panic Output
-
Expected Behavior
What should have happened?
No error, successful Terraform apply. As the cluster was created successfully and the worker pool was created successfully we had expected for the worker pool zone attachment to be able to be created successfully as well.
Actual Behavior
What actually happened?
Pool zone attachment creation failed with
* ibm_container_worker_pool_zone_attachment.pool_b2c_8x32: Error waiting for workers of worker pool (pool_b2c_8x32) of cluster ([redacted]) to become ready: Error retrieving workers for cluster: Request failed with status code: 404, ServerErrorResponse: {"incidentID":"51959db082777bbe-PRG","code":"G0004","description":"The specified cluster could not be found. If you use resource groups, make sure that you target the correct resource group.","type":"General","recoveryCLI":"To list the clusters you have access to, run 'ibmcloud ks clusters'. To list the resource groups that you have access to, run 'ibmcloud resource groups'. To target the resource group, run 'ibmcloud target -g \u003cresource_group\u003e'."}
even though the cluster and the worker pool had been created successfully beforehand.
As later on a simple replan + reapply resolved the issue, from a user's perspective it felt like it's a concurrency or redundancy issue - waiting for the workers to be available or retrying sporadic failures. But this is just a wild guess.
Steps to Reproduce
Please list the steps required to reproduce the issue, for example:
terraform apply
the changes all at once.terraform apply
once again.Important Factoids
Are there anything atypical about your accounts that we should know? For example: Running in EC2 Classic? Custom version of OpenStack? Tight ACLs?
-
References
Are there any other GitHub issues (open or closed) or Pull Requests that should be linked here? For example:
I had run this search: https://github.com/IBM-Cloud/terraform-provider-ibm/issues?utf8=%E2%9C%93&q=is%3Aissue+pool.
Checked out issues:
but none of those seemed to produce the exact issue I'm having, that's why I'm only mentioning their numbers without referencing them directly with a hashtag.