kubernetes/kops · error
error finding default machine type: %v
Error message
error finding default machine type: %v
What it means
defaultMachineType for AWS delegates to awsup.AWSCloud.DefaultInstanceType(cluster, ig), which probes the region for a suitable default instance type. This error wraps its failure when no default could be determined for the AWS cloud.
Source
Thrown at upup/pkg/fi/cloudup/populate_instancegroup_spec.go:336
igKubeletConfig.AnonymousAuth = new(false)
}
ig.Spec.Kubelet = igKubeletConfig
return ig, nil
}
// defaultMachineType returns the default MachineType for the instance group, based on the cloudprovider
func defaultMachineType(cloud fi.Cloud, cluster *kops.Cluster, ig *kops.InstanceGroup) (string, error) {
switch cluster.GetCloudProvider() {
case kops.CloudProviderAWS:
if ig.Spec.Manager == kops.InstanceManagerKarpenter {
return "", nil
}
instanceType, err := cloud.(awsup.AWSCloud).DefaultInstanceType(cluster, ig)
if err != nil {
return "", fmt.Errorf("error finding default machine type: %v", err)
}
return instanceType, nil
case kops.CloudProviderGCE:
switch {
case ig.Spec.Role.HasControlPlane():
return defaultMasterMachineTypeGCE, nil
case ig.Spec.Role.HasNode():
return defaultNodeMachineTypeGCE, nil
case ig.Spec.Role.HasBastion():
return defaultBastionMachineTypeGCE, nil
}
case kops.CloudProviderDO:
switch {
case ig.Spec.Role.HasControlPlane():View on GitHub (pinned to 4c8573c808)
Solutions
- Set spec.machineType explicitly on the InstanceGroup
- Confirm the region supports the candidate defaults (try `aws ec2 describe-instance-type-offerings --region <region>`)
- Check AWS credentials and EC2 API access from the machine running kOps
- Upgrade kOps so defaults match current AWS offerings
Example fix
// before kops create cluster ... --zones us-east-1a // after kops create cluster ... --zones us-east-1a --set spec.nodes.machineType=m5.large
Defensive patterns
Strategy: validation
Validate before calling
// Ensure a machineType is set for AWS IGs to skip DefaultInstanceType entirely
if cluster.GetCloudProvider() == kops.CloudProviderAWS && ig.Spec.MachineType == "" {
ig.Spec.MachineType = "t3.medium" // node default; use m5.large/c5.large for control-plane
} Prevention
- Pass --set spec.nodes.machineType=... on create cluster for reproducibility
- Confirm region availability of instance types with the AWS CLI before creating clusters
- Keep AWS credentials valid where kOps runs (DefaultInstanceType queries EC2)
- Prefer modern families (t3/m5) that exist in all commercial regions
When it happens
Trigger: PopulateInstanceGroupSpec (or NewCluster) with an empty machineType on AWS, where DefaultInstanceType fails — e.g. it can't validate candidate instance types against the region (EC2 API failure), or the IG role/bastion defaults are unavailable in the region.
Common situations: AWS regions where the built-in default candidates (e.g. t3.medium) aren't offered (opt-in regions); EC2 API credential/throttling problems; very old kOps defaults retired by AWS; control-plane defaults blocked by regional availability.
Related errors
- error assigning default machine type for nodes: %v
- unhandled LoadBalancer type %q
- subnet %q had unknown type %q
- unhandled bastion LoadBalancer type %q
- subnet %q had unknown type %q
AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05).
Data as JSON: /api/errors/2a5ac0259a505303.
Report an issue: GitHub.