kubernetes/kops · error
getting control plane VMSS name for API ingress status
Error message
getting control plane VMSS name for API ingress status
What it means
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.
Source
Thrown at upup/pkg/fi/cloudup/azure/azure_cloud.go:336
}
} else {
// Get scale sets in cluster resource group and find masters scale set
scaleSets, err := c.vmscaleSetsClient.List(context.TODO(), rg)
if err != nil {
return nil, fmt.Errorf("getting cluster control plane VMSS for API ingress status: %w", err)
}
var vmssName string
for _, scaleSet := range scaleSets {
val, ok := scaleSet.Tags[TagClusterName]
val2, ok2 := scaleSet.Tags[TagNameRolePrefix+TagRoleControlPlane]
val3, ok3 := scaleSet.Tags[TagNameRolePrefix+TagRoleMaster]
if ok && *val == cluster.Name && (ok2 && *val2 == "1" || ok3 && *val3 == "1") {
vmssName = *scaleSet.Name
break
}
}
if vmssName == "" {
return nil, fmt.Errorf("getting control plane VMSS name for API ingress status")
}
// Get masters scale set network interfaces and append to api ingress status
nis, err := c.NetworkInterface().ListScaleSetsNetworkInterfaces(context.TODO(), rg, vmssName)
if err != nil {
return nil, fmt.Errorf("getting control plane VMSS network interfaces for API ingress status: %w", err)
}
for _, ni := range nis {
if ni.Properties == nil || ni.Properties.Primary == nil || !*ni.Properties.Primary {
continue
}
for _, i := range ni.Properties.IPConfigurations {
if i.Properties == nil || i.Properties.PrivateIPAddress == nil {
continue
}
ingresses = append(ingresses, fi.ApiIngressStatus{
IP: *i.Properties.PrivateIPAddress,
})View on GitHub (pinned to 4c8573c808)
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).
Example fix
null
Defensive patterns
Strategy: validation
Validate before calling
// Go: confirm a tagged control plane VMSS exists before calling GetApiIngressStatus
vmssClient, _ := armcompute.NewVirtualMachineScaleSetsClient(subID, cred, nil)
pager := vmssClient.NewListPager(clusterResourceGroup, nil)
found := false
for pager.More() {
page, err := pager.NextPage(ctx)
if err != nil { return err }
for _, ss := range page.Value {
if ss.Tags["kops.k8s.io/cluster-name"] != nil &&
(*ss.Tags["kops.k8s.io/cluster-name"] == clusterName) {
found = true
}
}
}
if !found { return fmt.Errorf("no control-plane VMSS tagged for cluster %s", clusterName) } Type guard
func hasTag(tags map[string]*string, key, want string) bool {
v, ok := tags[key]
return ok && v != nil && *v == want
} Try / catch
status, err := cloud.GetApiIngressStatus(cluster)
if err != nil && strings.Contains(err.Error(), "getting control plane VMSS name") {
log.Printf("control plane VMSS not found by tags; check kops.k8s.io/cluster-name and role tags: %v", err)
return err
} Prevention
- 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.
When it happens
Trigger: 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".
Common situations: 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.
Related errors
- expected exactly one subnet for InstanceGroup %q; subnets wa
- unexpected subnet type: for InstanceGroup %q; type was %s
- instance group must have the same min and max size in Azure,
- malformed format of image urn: %s
- creating VMSS VMs client: %w
AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05).
Data as JSON: /api/errors/db5a33676655448c.
Report an issue: GitHub.