kubernetes/kops · error

cannot get InstanceGroups for

Error message

cannot get InstanceGroups for %q: %v

What it means

Wraps a failure of the InstanceGroups List API call in RunValidateCluster: the cluster was found, but its instance groups could not be listed from the state store. Validation needs the instance groups to enumerate expected nodes.

Solutions

  1. Check state store access and permissions
  2. Verify the cluster name
  3. Run kops get instancegroups to reproduce
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at cmd/kops/validate_cluster.go:148 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05). Data as JSON: /api/errors/c915be75605c354f. Report an issue: GitHub.

Appendix: source

Thrown at cmd/kops/validate_cluster.go:148

func RunValidateCluster(ctx context.Context, f *util.Factory, out io.Writer, options *ValidateClusterOptions) (*validation.ValidationCluster, error) {
	clientSet, err := f.KopsClient()
	if err != nil {
		return nil, err
	}

	cluster, err := GetCluster(ctx, f, options.ClusterName)
	if err != nil {
		return nil, err
	}

	cloud, err := cloudup.BuildCloud(cluster)
	if err != nil {
		return nil, err
	}

	list, err := clientSet.InstanceGroupsFor(cluster).List(ctx, metav1.ListOptions{})
	if err != nil {
		return nil, fmt.Errorf("cannot get InstanceGroups for %q: %v", cluster.ObjectMeta.Name, err)
	}

	if options.output == OutputTable {
		fmt.Fprintf(out, "Validating cluster %v\n\n", cluster.ObjectMeta.Name)
	}

	var instanceGroups []kopsapi.InstanceGroup
	for _, ig := range list.Items {
		instanceGroups = append(instanceGroups, ig)
		klog.V(2).Infof("instance group: %#v\n\n", ig.Spec)
	}

	if len(instanceGroups) == 0 {
		return nil, fmt.Errorf("no InstanceGroup objects found")
	}

	restConfig, err := f.RESTConfig(ctx, cluster, options.CreateKubecfgOptions)
	if err != nil {

View on GitHub (pinned to 4c8573c808)