terraform-google-kubernetes-engine
terraform-google-kubernetes-engine copied to clipboard
support name_prefix for node pool creation
TL;DR
Currently the module requires 'name' to be specified but container_node_pool supports an alternative via name_prefix to allow for node pool's to be created with a prefix and a randomly generated suffix. The purpose is to allow for the alteration of node pool's while allowing workloads to migrate before the old node pool's are destroyed. Can the module be updated to support this functionality. Currently we manage this by multi-stage changes where new node pools are created, workloads migrated, then the old node pool is removed from terraform. This creates a higher burden on change than is necessary when managing a large amount of clusters.
Terraform Resources
https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/container_node_pool#name_prefix
variables_defaults.tf line 27, in locals:
│ 27: [for node_pool in var.node_pools : node_pool["name"]],
main.tf line 48, in locals:
│ 48: node_pool_names = [for np in toset(var.node_pools) : np.name]
variables_defaults.tf line 47, in locals:
│ 47: [for node_pool in var.node_pools : node_pool["name"]],
variables_defaults.tf line 57, in locals:
│ 57: [for node_pool in var.node_pools : node_pool["name"]],
variables_defaults.tf line 67, in locals:
│ 67: [for node_pool in var.node_pools : node_pool["name"]],
Detailed design
No response
Additional information
No response
@dodwmd thanks for the report! An alternative for this use case could be using the update variant modules https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/tree/master/modules/beta-public-cluster-update-variant#node-pool-update-variant
@dodwmd thanks for the report! An alternative for this use case could be using the update variant modules https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/tree/master/modules/beta-public-cluster-update-variant#node-pool-update-variant
Are there plans to implement this for private clusters as well? Current immutable node pool situation is extremely annoying, it is impossible to make any change without disruption. This is a real disappointment, aws eks module doesn't have such problems, it is easy to add nodes to node pools. I can't even import node pools to a gke cluster, current gke terraform module is unusable in production until this fix is implemented.