{"record":{"id":"db5a33676655448c","repo":"kubernetes/kops","slug":"getting-control-plane-vmss-name-for-api-ingress-st","errorCode":null,"errorMessage":"getting control plane VMSS name for API ingress status","messagePattern":"getting control plane VMSS name for API ingress status","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/azure/azure_cloud.go","lineNumber":336,"sourceCode":"\t\t}\n\t} else {\n\t\t// Get scale sets in cluster resource group and find masters scale set\n\t\tscaleSets, err := c.vmscaleSetsClient.List(context.TODO(), rg)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"getting cluster control plane VMSS for API ingress status: %w\", err)\n\t\t}\n\t\tvar vmssName string\n\t\tfor _, scaleSet := range scaleSets {\n\t\t\tval, ok := scaleSet.Tags[TagClusterName]\n\t\t\tval2, ok2 := scaleSet.Tags[TagNameRolePrefix+TagRoleControlPlane]\n\t\t\tval3, ok3 := scaleSet.Tags[TagNameRolePrefix+TagRoleMaster]\n\t\t\tif ok && *val == cluster.Name && (ok2 && *val2 == \"1\" || ok3 && *val3 == \"1\") {\n\t\t\t\tvmssName = *scaleSet.Name\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif vmssName == \"\" {\n\t\t\treturn nil, fmt.Errorf(\"getting control plane VMSS name for API ingress status\")\n\t\t}\n\n\t\t// Get masters scale set network interfaces and append to api ingress status\n\t\tnis, err := c.NetworkInterface().ListScaleSetsNetworkInterfaces(context.TODO(), rg, vmssName)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"getting control plane VMSS network interfaces for API ingress status: %w\", err)\n\t\t}\n\t\tfor _, ni := range nis {\n\t\t\tif ni.Properties == nil || ni.Properties.Primary == nil || !*ni.Properties.Primary {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tfor _, i := range ni.Properties.IPConfigurations {\n\t\t\t\tif i.Properties == nil || i.Properties.PrivateIPAddress == nil {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tingresses = append(ingresses, fi.ApiIngressStatus{\n\t\t\t\t\tIP: *i.Properties.PrivateIPAddress,\n\t\t\t\t})","sourceCodeStart":318,"sourceCodeEnd":354,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/azure/azure_cloud.go#L318-L354","documentation":"After listing scale sets in the cluster resource group, kOps searches for a scale set tagged as the control plane (via TagClusterName plus control-plane/master role tags). If no scale set matches — i.e. vmssName stays empty — GetApiIngressStatus returns this error. It means the cluster resource group contains no scale set carrying the expected control plane tags.","triggerScenarios":"GetApiIngressStatus runs, scale set listing succeeds, but none of the returned VMSS have a TagClusterName tag equal to the cluster name AND a control-plane/master role tag (kops.k8s.io/role.control-plane or role.master) equal to \"1\".","commonSituations":"Tags on the control plane VMSS were manually removed or edited in the Azure portal; cluster renamed so the TagClusterName value no longer matches; using an older kOps cluster whose control plane used VMs instead of VMSS while the new code path expects a scale set; querying the wrong resource group.","solutions":["Inspect the control plane VMSS tags in Azure (az vmss list -g <rg> -o table) and restore the missing kops tags (kops.k8s.io/cluster-name and kops.k8s.io/role.control-plane=\"1\").","Confirm you are querying the correct cluster: run kops get clusters and compare the cluster name.","Verify the cluster was actually created with VMSS-based control plane (kOps 1.24+ on Azure); older VM-based control planes will not be found by this path.","Recreate the control plane via `kops update cluster` if tags cannot be repaired.","Check the resource group actually corresponds to this cluster (TagClusterName matching)."],"exampleFix":"null","handlingStrategy":"validation","validationCode":"// Go: confirm a tagged control plane VMSS exists before calling GetApiIngressStatus\nvmssClient, _ := armcompute.NewVirtualMachineScaleSetsClient(subID, cred, nil)\npager := vmssClient.NewListPager(clusterResourceGroup, nil)\nfound := false\nfor pager.More() {\n    page, err := pager.NextPage(ctx)\n    if err != nil { return err }\n    for _, ss := range page.Value {\n        if ss.Tags[\"kops.k8s.io/cluster-name\"] != nil &&\n            (*ss.Tags[\"kops.k8s.io/cluster-name\"] == clusterName) {\n            found = true\n        }\n    }\n}\nif !found { return fmt.Errorf(\"no control-plane VMSS tagged for cluster %s\", clusterName) }","typeGuard":"func hasTag(tags map[string]*string, key, want string) bool {\n    v, ok := tags[key]\n    return ok && v != nil && *v == want\n}","tryCatchPattern":"status, err := cloud.GetApiIngressStatus(cluster)\nif err != nil && strings.Contains(err.Error(), \"getting control plane VMSS name\") {\n    log.Printf(\"control plane VMSS not found by tags; check kops.k8s.io/cluster-name and role tags: %v\", err)\n    return err\n}","preventionTips":["Never manually edit or remove kops.k8s.io/* tags on control plane VMSS resources.","Keep the cluster name in the spec stable; avoid renaming clusters post-creation.","Confirm the control plane topology (VMSS vs legacy VM) matches your kOps version's expectations.","Double-check you run kOps against the correct cluster name / KOPS_STATE_STORE.","Use `kops validate cluster` regularly to catch tag drift early."],"tags":["azure","vmss","tags","control-plane"],"backgroundTag":"missing-resource-tag","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"}