File tree Expand file tree Collapse file tree
modules/compute/gke-node-pool Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -386,6 +386,13 @@ locals {
386386 supported_machine_types_for_install_dependencies = [" a3-highgpu-8g" , " a3-megagpu-8g" ]
387387}
388388
389+ # Replicates GKE's naming logic for its instance templates. The full
390+ # pattern is "gke-{cluster_name}-{nodepool_name}-{hash}".
391+ #
392+ # This code builds the "{cluster_name}-{nodepool_name}" prefix, which is
393+ # capped at 32 characters plus a dash '-' in between, by truncating names if needed:
394+ # - If both names > 16 chars, both are cut to 16.
395+ # - If one name > 16, it's shortened so the combined name length is 32.
389396data "google_compute_region_instance_template" "instance_template" {
390397 for_each = { for idx , np in google_container_node_pool . node_pool : idx => np }
391398 project = var. project_id
You can’t perform that action at this time.
0 commit comments