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.
If an issue is assigned to a user, that user is claiming responsibility for the issue.
Customers working with a Google Technical Account Manager or Customer Engineer can ask them to reach out internally to expedite investigation and resolution of this issue.
Terraform Version
1.5.6
Affected Resource(s)
google_container_node_pool
Terraform Configuration
resource "google_container_node_pool" "main" {
project = "PROJECT-ID"
cluster = "CLUSTER-NAME"
location = "CLUSTER-LOCATION"
name_prefix = "general-large-pool-"
# When updating a nodepool it may take a long time to roll all the nodes in the pool
# so setting a long timeout for the update action
timeouts {
update = "600m"
}
Debug Output
# module.node_pool_large.google_container_node_pool.main will be created
+ resource "google_container_node_pool" "main" {
+ cluster = "CLUSTER-NAME"
+ id = (known after apply)
+ initial_node_count = (known after apply)
+ instance_group_urls = (known after apply)
+ location = "CLUSTER-LOCATION"
+ managed_instance_group_urls = (known after apply)
+ max_pods_per_node = (known after apply)
+ name = (known after apply)
+ name_prefix = "general-large-pool-"
+ node_count = (known after apply)
+ node_locations = (known after apply)
+ operation = (known after apply)
+ project = "PROJECT-ID"
+ version = (known after apply)
....
module.node_pool_large.google_container_node_pool.main: Creating...
╷
│ Error: error creating NodePool: googleapi: Error 400: Node_pool.name must be less than 40 characters.
│ Details:
│ [
│ {
│ "@type": "type.googleapis.com/google.rpc.RequestInfo",
│ "requestId": "0x5146f7488b204957"
│ }
│ ]
│ , badRequest
│
│
Expected Behavior
name_prefix respects upstream limits and generates an appropriate random ID for the name.
Actual Behavior
API failure
Steps to reproduce
Create a node pool using the name_prefix option with a semi-long entry.
Important Factoids
The API docs don't have a documented max length so I can understand why this would be unknown information.
Confirmed issue: If the name_prefix exceed 40 characters trigger the error. There isn't any info about the max length of this field in any official source including:
Community Note
Terraform Version
1.5.6
Affected Resource(s)
google_container_node_pool
Terraform Configuration
Debug Output
Expected Behavior
name_prefix
respects upstream limits and generates an appropriate random ID for the name.Actual Behavior
API failure
Steps to reproduce
name_prefix
option with a semi-long entry.Important Factoids
The API docs don't have a documented max length so I can understand why this would be unknown information.
References
API Docs: https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1/projects.locations.clusters.nodePools
b/328653939