{"record":{"id":"0a1ae49170b011a8","repo":"kubernetes/kops","slug":"no-zones-found-for-instance-group-q-0a1ae4","errorCode":null,"errorMessage":"no zones found for instance group %q","messagePattern":"no zones found for instance group %q","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/template_functions.go","lineNumber":1130,"sourceCode":"\tfor _, ig := range tf.KopsModelContext.InstanceGroups {\n\t\tif ig.Spec.Role.HasNode() && (ig.Spec.Autoscale == nil || fi.ValueOf(ig.Spec.Autoscale)) {\n\t\t\tgroup := ClusterAutoscalerNodeGroup{\n\t\t\t\tAutoScale: ig.Spec.Autoscale,\n\t\t\t\tMinSize:   fi.ValueOf(ig.Spec.MinSize),\n\t\t\t\tMaxSize:   fi.ValueOf(ig.Spec.MaxSize),\n\t\t\t}\n\t\t\tif cluster.GetCloudProvider() == kops.CloudProviderGCE {\n\t\t\t\t// On GCE, kOps creates one zonal InstanceGroupManager per zone of the\n\t\t\t\t// instance group, so each zonal MIG must be registered with\n\t\t\t\t// cluster-autoscaler as its own node group. The min/max sizes are\n\t\t\t\t// split across zones the same way the MIG target sizes are.\n\t\t\t\tcloud := tf.cloud.(gce.GCECloud)\n\t\t\t\tzones, err := apiModel.FindZonesForInstanceGroup(cluster, ig)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\tif len(zones) == 0 {\n\t\t\t\t\treturn nil, fmt.Errorf(\"no zones found for instance group %q\", ig.ObjectMeta.Name)\n\t\t\t\t}\n\t\t\t\tminSizeByZone := gcemodel.SplitCountAcrossZones(int(group.MinSize), zones)\n\t\t\t\tmaxSizeByZone := gcemodel.SplitCountAcrossZones(int(group.MaxSize), zones)\n\t\t\t\tformat := \"https://www.googleapis.com/compute/v1/projects/%s/zones/%s/instanceGroups/%s\"\n\t\t\t\tfor _, zone := range zones {\n\t\t\t\t\t// A zone whose max size is zero can never hold an instance.\n\t\t\t\t\tif len(zones) > 1 && maxSizeByZone[zone] == 0 {\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\tzoneGroup := group\n\t\t\t\t\tzoneGroup.MinSize = int32(minSizeByZone[zone])\n\t\t\t\t\tzoneGroup.MaxSize = int32(maxSizeByZone[zone])\n\t\t\t\t\tzoneGroup.Other = fmt.Sprintf(format, cloud.Project(), zone, gce.NameForInstanceGroupManager(cluster.ObjectMeta.Name, ig.ObjectMeta.Name, zone))\n\t\t\t\t\tkey := ig.Name\n\t\t\t\t\tif len(zones) > 1 {\n\t\t\t\t\t\tkey = ig.Name + \"-\" + zone\n\t\t\t\t\t}\n\t\t\t\t\tgroups[key] = zoneGroup","sourceCodeStart":1112,"sourceCodeEnd":1148,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/template_functions.go#L1112-L1148","documentation":"In GetClusterAutoscalerNodeGroups, for GCE autoscaling instance groups, kOps resolves the zones the instance group will span via FindZonesForInstanceGroup. If the resulting zone list is empty, it cannot build per-zone instance group URLs for the autoscaler and returns this error.","triggerScenarios":"GCE cluster with an autoscaling instance group whose zones resolve to an empty set — typically ig.Spec.Zones empty AND cluster/subnet configuration yields no zones, or FindZonesForInstanceGroup filters everything out.","commonSituations":"Instance group missing spec.zones on GCE; region/multizone configuration mismatch; cluster spec with subnets that map to no zones; typos in zone names filtered out during resolution.","solutions":["Set spec.zones explicitly on the autoscaling instance group.","Verify the cluster's subnets/region resolve to valid GCE zones.","Check that cluster.Spec.Networking/subnet config is consistent with the zones in the cluster spec.","Re-run kops update after fixing the spec."],"exampleFix":"// before\nmetadata:\n  name: nodes\nspec:\n  autoscale: true\n// after\nmetadata:\n  name: nodes\nspec:\n  autoscale: true\n  zones: [us-central1-a, us-central1-b]","handlingStrategy":"validation","validationCode":"// Go: ensure autoscaling GCE instance groups define resolvable zones\nif fi.ValueOf(ig.Spec.Autoscale) && len(ig.Spec.Zones) == 0 {\n    return fmt.Errorf(\"instance group %q: autoscaling requires explicit spec.zones on GCE\", ig.Name)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always set spec.zones on autoscaling instance groups","Validate zone names against the GCE region in use","Verify subnets map to at least one zone"],"tags":["gce","autoscaler","zones","config"],"backgroundTag":"no-zones-resolved","analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T07:17:12.445Z"}