kubernetes/kops · error

unable to determine machine architecture for InstanceGroup

Error message

unable to determine machine architecture for InstanceGroup %q: %v

What it means

When ig.Spec.Image is empty, kOps must pick a default image matching the machine's CPU architecture. It calls MachineArchitecture(cloud, ig.Spec.MachineType); if that lookup fails (unsupported machine type string or cloud API error), this error is returned.

Solutions

  1. Set spec.image explicitly so architecture inference is skipped
  2. Correct the spec.machineType value (verify it exists for your cloud/region)
  3. Upgrade kOps to gain support for newer instance families/architectures
  4. Inspect the wrapped error for the underlying cloud API failure (credentials, region)

Example fix

// before
spec:
  machineType: t3.medium
// after
spec:
  machineType: t3.medium
  image: ubuntu/images/hvm-ssd/ubuntu-jammy-22.04-amd64-server-*
Defensive patterns

Strategy: validation

Validate before calling

// Validate machine type + image pair before populating
if ig.Spec.Image == "" {
    // only omit image when machineType is a known, supported family
    known := []string{"t3.", "m5.", "c5.", "n1-", "Standard_D"}
    ok := false
    for _, p := range known {
        if strings.HasPrefix(ig.Spec.MachineType, p) { ok = true; break }
    }
    if !ok { return fmt.Errorf("set spec.image explicitly for machineType %q", ig.Spec.MachineType) }
}

Prevention

When it happens

Trigger: Creating/updating an InstanceGroup with no spec.image set and a machine type whose architecture cannot be resolved — e.g. unknown/typo'd instance type, or cloud (GCE/Azure/etc.) whose MachineArchitecture implementation cannot parse or query the type.

Common situations: Typo in machineType; machine type not valid for the cloud provider; custom machine types the architecture mapper doesn't recognize; older kOps versions lacking support for new instance families (e.g. ARM Graviton types).

Related errors


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

Appendix: source

Thrown at upup/pkg/fi/cloudup/populate_instancegroup_spec.go:152

			ig.Spec.MachineType, err = defaultMachineType(cloud, cluster, ig)
			if err != nil {
				return nil, fmt.Errorf("error assigning default machine type for nodes: %v", err)
			}
		}
		if ig.Spec.Manager != kops.InstanceManagerKarpenter {
			if ig.Spec.MinSize == nil {
				ig.Spec.MinSize = new(int32(2))
			}
			if ig.Spec.MaxSize == nil {
				ig.Spec.MaxSize = new(int32(2))
			}
		}
	}

	if ig.Spec.Image == "" {
		architecture, err := MachineArchitecture(cloud, ig.Spec.MachineType)
		if err != nil {
			return nil, fmt.Errorf("unable to determine machine architecture for InstanceGroup %q: %v", ig.ObjectMeta.Name, err)
		}
		ig.Spec.Image, err = defaultImage(cluster, channel, architecture)
		if err != nil {
			return nil, fmt.Errorf("unable to determine default image for instance group %q: %v", ig.ObjectMeta.Name, err)
		}
	}

	if ig.Spec.Tenancy != "" && ig.Spec.Tenancy != "default" {
		switch cluster.GetCloudProvider() {
		case kops.CloudProviderAWS:
			if _, ok := awsDedicatedInstanceExceptions[ig.Spec.MachineType]; ok {
				return nil, fmt.Errorf("invalid dedicated instance type: %s", ig.Spec.MachineType)
			}
		default:
			klog.Warning("Trying to set tenancy on non-AWS environment")
		}
	}

View on GitHub (pinned to 4c8573c808)