kubernetes/kops · error
no InstanceGroup objects found
Error message
no InstanceGroup objects found
What it means
NewClusterValidator builds a ClusterValidator after fetching all InstanceGroups from the cluster's state store. If the InstanceGroup list is empty it refuses to construct a validator, because validation of nodes/instance groups is meaningless (and would produce misleading results) for a cluster with no IGs. This is an intentional guard, not a transient failure.
Source
Thrown at pkg/validation/validate_cluster.go:123
for _, h := range hostAddrs {
if h == dns.PlaceholderIP || h == dns.PlaceholderIPv6 {
return h, nil
}
}
return "", nil
}
func NewClusterValidator(cluster *kops.Cluster, cloud fi.Cloud, instanceGroupList *kops.InstanceGroupList, filterInstanceGroups func(ig *kops.InstanceGroup) bool, filterPodsForValidation func(pod *v1.Pod) bool, maxUnreadyNodes int, restConfig *rest.Config, k8sClient kubernetes.Interface) (ClusterValidator, error) {
var allInstanceGroups []*kops.InstanceGroup
for i := range instanceGroupList.Items {
ig := &instanceGroupList.Items[i]
allInstanceGroups = append(allInstanceGroups, ig)
}
if len(allInstanceGroups) == 0 {
return nil, fmt.Errorf("no InstanceGroup objects found")
}
// If no filter is provided, validate all instance groups
if filterInstanceGroups == nil {
filterInstanceGroups = func(ig *kops.InstanceGroup) bool {
return true
}
}
// If no filter is provided, validate all pods
if filterPodsForValidation == nil {
filterPodsForValidation = func(pod *v1.Pod) bool {
return true
}
}
return &clusterValidatorImpl{
cluster: cluster,View on GitHub (pinned to 4c8573c808)
Solutions
- Confirm you target the right state store and cluster: echo $KOPS_STATE_STORE and kops get instancegroups --name <cluster>
- If IGs are missing, recreate them (kops create ig / restore from the cluster YAML) and apply with kops update cluster --yes
- If the cluster is genuinely the wrong target, re-run with the correct --name and state store
- Check with kops get clusters that the cluster exists where you expect it
Example fix
// before KOPS_STATE_STORE=s3://wrong-bucket kops validate cluster --name prod.example.com # no InstanceGroup objects found // after export KOPS_STATE_STORE=s3://correct-bucket kops get instancegroups --name prod.example.com # lists IGs kops validate cluster --name prod.example.com
Defensive patterns
Strategy: validation
Validate before calling
igs, err := clientset.InstanceGroupsFor(cluster).List(ctx, metav1.ListOptions{})
if err != nil {
return err
}
if len(igs.Items) == 0 {
return fmt.Errorf("cluster %s has no instance groups; check KOPS_STATE_STORE and --name", cluster.Name)
} Try / catch
validator, err := NewClusterValidator(cluster, clientset, cloud, ...
if err != nil {
if strings.Contains(err.Error(), "no InstanceGroup objects found") {
return fmt.Errorf("wrong cluster/state store or IGs deleted: %w", err)
}
return err
} Prevention
- Pin KOPS_STATE_STORE and cluster --name in scripts/CI to avoid targeting the wrong store
- Keep IG definitions in version control so they can be recreated
- Run kops get instancegroups before mutating/validation commands
When it happens
Trigger: Building a validator (kops validate cluster, rolling-update, delete instance) for a cluster whose state store contains zero InstanceGroup objects.
Common situations: Running commands against the wrong KOPS_STATE_STORE / cluster name so the (existing but empty or wrong) cluster is loaded; a cluster spec where all IGs were accidentally deleted; a typo'd --name matching a non-existent cluster; fresh create before kops update/IG creation completed.
Related errors
- error querying cluster %q: %v
- spec.PublicKey is required
- adding keypair to %q is not supported
- unable to parse YAML %v: %v
- adding encryptionconfig secret: %v
AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05).
Data as JSON: /api/errors/054edd8fdb81d6ab.
Report an issue: GitHub.