{"record":{"id":"58791915a1cf9c24","repo":"kubernetes/kops","slug":"must-configure-at-least-one-node-instancegroup","errorCode":null,"errorMessage":"must configure at least one Node InstanceGroup","messagePattern":"must configure at least one Node InstanceGroup","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/apis/kops/validation/legacy.go","lineNumber":295,"sourceCode":"\t\treturn fmt.Errorf(\"must configure at least one InstanceGroup\")\n\t}\n\n\tcontrolPlaneGroupCount := 0\n\tnodeGroupCount := 0\n\tfor _, g := range groups {\n\t\tif g.IsControlPlane() {\n\t\t\tcontrolPlaneGroupCount++\n\t\t} else {\n\t\t\tnodeGroupCount++\n\t\t}\n\t}\n\n\tif controlPlaneGroupCount == 0 {\n\t\treturn fmt.Errorf(\"must configure at least one ControlPlane InstanceGroup\")\n\t}\n\n\tif nodeGroupCount == 0 {\n\t\treturn fmt.Errorf(\"must configure at least one Node InstanceGroup\")\n\t}\n\n\tfor _, g := range groups {\n\t\terrs := CrossValidateInstanceGroup(g, c, cloud, strict)\n\n\t\t// Additional cloud-specific validation rules\n\t\tif c.GetCloudProvider() != kops.CloudProviderAWS && len(g.Spec.Volumes) > 0 {\n\t\t\terrs = append(errs, field.Forbidden(field.NewPath(\"spec\", \"volumes\"), \"instancegroup volumes are only available with aws at present\"))\n\t\t}\n\n\t\tif len(errs) != 0 {\n\t\t\treturn errs.ToAggregate()\n\t\t}\n\t}\n\n\treturn nil\n}\n","sourceCodeStart":277,"sourceCodeEnd":313,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/pkg/apis/kops/validation/legacy.go#L277-L313","documentation":"DeepValidate in pkg/apis/kops/validation/legacy.go rejects a cluster spec whose InstanceGroups do not include at least one group with role Node. A kOps cluster must have worker (Node) InstanceGroups in addition to (or besides) control-plane groups so workloads can be scheduled. The count is computed from the groups passed in, after counting control-plane groups.","triggerScenarios":"Calling DeepValidate (directly or via `kops create cluster` / `kops update cluster` / `kops update --yes`) with a cluster whose InstanceGroup list contains zero groups whose Spec.Role is RoleNode — e.g. only control-plane groups, or the groups were filtered out before validation.","commonSituations":"Hand-editing the cluster spec and deleting all node groups; creating a cluster with only --control-plane-count and no --node-count/--node-size; a tooling script that removes node InstanceGroups when scaling to zero but forgets the cluster still needs one for validation.","solutions":["Add a Node InstanceGroup (role: Node) to the cluster, e.g. `kops create instancegroup nodes --role Node` then `kops update cluster`.","If regenerating from scratch, re-run `kops create cluster` with --node-count/--node-size (defaults create a `nodes` group).","If you intentionally want no worker nodes, confirm your kOps version supports it via a different mechanism; otherwise keep at least one Node group."],"exampleFix":"# before (instancegroups: only one, role ControlPlane)\n# after\napiVersion: kops.k8s.io/v1alpha2\nkind: InstanceGroup\nmetadata:\n  name: nodes\nspec:\n  role: Node\n  machineType: t3.medium\n  minSize: 2\n  maxSize: 4","handlingStrategy":"validation","validationCode":"nodeGroups := 0\nfor _, g := range groups {\n    if g.Spec.Role == kops.InstanceGroupRoleNode {\n        nodeGroups++\n    }\n}\nif nodeGroups == 0 {\n    return fmt.Errorf(\"cluster has no Node InstanceGroup; add one before validation\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always define at least one Node InstanceGroup (e.g. `nodes`) in every cluster spec.","Use `kops get instancegroups` to confirm roles before update/create.","Never script InstanceGroup deletion without re-checking role counts afterwards."],"tags":["kops","validation","instancegroup","cluster-spec"],"backgroundTag":"missing-required-cluster-resource","analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T12:17:11.808Z"}