Open rd-nikhil-singh opened 1 year ago
This is working as intended, although it's not documented well. The default pool in GKE is indistinguishable from other pools, and is identified by default-pool
as its name. If you delete the pool on a cluster, recreate a pool with the same name, and then poll the API, node_config
(configuration of the default pool) will report the attributes of the new pool you created.
Community Note
modular-magician
user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If an issue is assigned to a user, that user is claiming responsibility for the issue. If an issue is assigned tohashibot
, a community member has claimed the issue already.Terraform Version
Terraform v1.3.7 on darwin_amd64
Affected Resource(s)
Terraform Configuration Files
Debug Output
Sorry, I cannot share it not to reveal confidential details.
Expected Behavior
If you terraform import the existing cluster. For example,
You see the following changes with terraform plan:
Applying the above should not remove the "default-pool" node pool since it was created by the
resource "google_container_node_pool" "primary_nodes"
It does not do that if the name used is anything else except "default-pool". For example, "default" gives the expected result.
Actual Behavior
We observed the following message during the apply in Google Cloud Console:
It has removed the "default-pool" node pool even though it was defined separately by the
resource "google_container_node_pool" "primary_nodes"
Running terraform plan again shows the following:
We are seeing this because it was removed by "remove_default_node_pool = true" setting.
If you simply change the name from "default-pool" to "default" OR use "remove_default_node_pool = false". We do not experience this problem.
Steps to Reproduce
Copy the config from the above "Terraform Configuration Files". Alter it for your project and network settings and run:
terraform apply
terraform state rm google_container_cluster.primary
terraform import google_container_cluster.primary xyz/europe-west1/test-gke-cluster
terraform apply
Important Factoids
References
0000
b/299600729