Open FranAguiar opened 5 months ago
Seeing this behavior as well for a cluster that deletes the default pool and uses only node auto-provisioning. We've had success ignoring changes to node_config
as @Montana does in #17252, but this may not be appropriate for all users.
resource "google_container_cluster" "cluster" {
[ ... ]
remove_default_node_pool = true
cluster_autoscaling {
enabled = true
auto_provisioning_defaults {
service_account = var.node_service_account
oauth_scopes = ["https://www.googleapis.com/auth/cloud-platform"]
}
}
node_config {
service_account = var.node_service_account
oauth_scopes = ["https://www.googleapis.com/auth/cloud-platform"]
}
lifecycle {
// Suppress permanent diff in "node_config" block that forces cluster recreation.
ignore_changes = [node_config]
}
}
Community Note
Description
As explained by @volodymyr-stoiko in issue #12070, the cluster is recreated whenever the default node pool includes a node_config block.
The creation of the cluster fails because the default service account is disabled, preventing the initial node pool from being created. However, adding the node_config block to specify a custom service account leads to a conflict with container_node_pool, resulting in the cluster being recreated every time.
Would it be possible to introduce a default_service_account_override variable to avoid the need for a node_config block?
New or Affected Resource(s)
Potential Terraform Configuration
b/330175568