kubernetes/kops · error
no instance types were returned because the criteria specifi
Error message
no instance types were returned because the criteria specified was too narrow
What it means
Filter() succeeded but returned zero instance types, meaning the supplied criteria (vCPU:memory ratio, flexible window, usage class, zones) match no EC2 instance type. kOps treats an empty result as a user-input error rather than a system failure.
Source
Thrown at cmd/kops/toolbox_instance-selector.go:300
if filters.VCpusToMemoryRatio == nil {
defaultStartRatio := float64(2.0)
mutatedFilters.VCpusToMemoryRatio = &defaultStartRatio
}
}
newInstanceGroups := []*kops.InstanceGroup{}
for i := 0; i < igCount; i++ {
igNameForRun := options.InstanceGroupName
if igCount != 1 {
igNameForRun = fmt.Sprintf("%s%d", options.InstanceGroupName, i+1)
}
selectedInstanceTypes, err := instanceSelector.Filter(ctx, mutatedFilters)
if err != nil {
return fmt.Errorf("error finding matching instance types: %w", err)
}
if len(selectedInstanceTypes) == 0 {
return fmt.Errorf("no instance types were returned because the criteria specified was too narrow")
}
usageClass := *filters.UsageClass
ig := createInstanceGroup(igNameForRun, options.ClusterName, igSubnets)
ig = decorateWithInstanceGroupSpecs(ig, options)
ig, err = decorateWithMixedInstancesPolicy(ig, usageClass, selectedInstanceTypes)
if err != nil {
return err
}
if options.ClusterAutoscaler {
ig = decorateWithClusterAutoscalerLabels(ig, options.ClusterName)
}
ig, err = cloudup.PopulateInstanceGroupSpec(cluster, ig, cloud, channel)
if err != nil {
return err
}
newInstanceGroups = append(newInstanceGroups, ig)View on GitHub (pinned to 4c8573c808)
Solutions
- Widen the --vcpus-to-memory-ratio range or remove it entirely.
- Increase --flexible so more candidate shapes can qualify.
- Allow more zones (more subnets) instead of one AZ.
- Switch usage class from spot to regular, or vice versa, if that is the binding constraint.
Example fix
// before kops toolbox instance-selector --vcpus 4 --memory 4 --flexible 1 --zones us-east-1a // after kops toolbox instance-selector --vcpus 2 --memory 8 --flexible 5
Defensive patterns
Strategy: fallback
Validate before calling
func filtersTooNarrow(f selector.Filters) bool {
return (f.Flexible != nil && *f.Flexible < 2) ||
(f.VCpusToMemoryRatio != nil && (*f.VCpusToMemoryRatio < 1 || *f.VCpusToMemoryRatio > 16))
} Try / catch
selected, err := instanceSelector.Filter(ctx, mutatedFilters)
if err == nil && len(selected) == 0 {
mutatedFilters.Flexible = ptr.To(10) // widen and retry
selected, err = instanceSelector.Filter(ctx, mutatedFilters)
} Prevention
- Prefer omitting --vcpus-to-memory-ratio unless you need it.
- Use --flexible >= 3 so multiple shapes can match.
- Target multiple zones instead of a single AZ.
When it happens
Trigger: instanceSelector.Filter returns a non-empty-nil slice (len == 0) for the mutated filters — e.g. a very narrow vcpus-to-memory ratio with small flexible bounds, or spot-only requests in a zone with no matching families.
Common situations: Specifying an extreme ratio like 1:16 or 16:1 with --flexible 1; targeting a single zone with limited families; requesting spot capacity with tight constraints during spot shortages.
Related errors
- error finding matching instance types: %w
- --name is required
- must specify name of instance group to create
- can only create one instance group at a time
- cannot select instance types from non-aws cluster
AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05).
Data as JSON: /api/errors/d9582d3ec04eb96c.
Report an issue: GitHub.