{"record":{"id":"a9b032ddaef0fef5","repo":"kubernetes/kops","slug":"unknown-instancegroup-role-s","errorCode":null,"errorMessage":"unknown InstanceGroup Role %s","messagePattern":"unknown InstanceGroup Role (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/model/defaults/volumes.go","lineNumber":46,"sourceCode":"\t// DefaultVolumeSizeMaster is the default root disk size of a master\n\tDefaultVolumeSizeMaster = 64\n\t// DefaultVolumeSizeNode is the default root disk size of a node\n\tDefaultVolumeSizeNode = 128\n)\n\n// DefaultInstanceGroupVolumeSize returns the default volume size for nodes in an InstanceGroup with the specified role\nfunc DefaultInstanceGroupVolumeSize(role kops.InstanceGroupRole) (int32, error) {\n\tswitch role {\n\tcase kops.InstanceGroupRoleControlPlane:\n\t\treturn DefaultVolumeSizeMaster, nil\n\tcase kops.InstanceGroupRoleAPIServer:\n\t\treturn DefaultVolumeSizeNode, nil\n\tcase kops.InstanceGroupRoleNode:\n\t\treturn DefaultVolumeSizeNode, nil\n\tcase kops.InstanceGroupRoleBastion:\n\t\treturn DefaultVolumeSizeBastion, nil\n\tdefault:\n\t\treturn -1, fmt.Errorf(\"unknown InstanceGroup Role %s\", role)\n\t}\n}\n","sourceCodeStart":28,"sourceCodeEnd":49,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/pkg/model/defaults/volumes.go#L28-L49","documentation":"DefaultInstanceGroupVolumeSize in pkg/model/defaults/volumes.go:46 returns the default root volume size per InstanceGroup role (Master/Node/Bastion). If the role is none of the known kops InstanceGroupRole values, it returns -1 with 'unknown InstanceGroup Role'. This guards against a corrupt or future-role spec that the current kOps version does not recognize.","triggerScenarios":"Calling DefaultInstanceGroupVolumeSize with an InstanceGroupRole not in {Master, Node, Bastion} — e.g. an IG spec with a role string like 'APIServer' or 'Worker' from a newer/older kOps version, or a hand-edited manifest with a typo like 'master' lowercase.","commonSituations":"Downgrading kOps so specs using newer roles (APIServer-only) are no longer understood; hand-edited cluster manifests with mistyped roles; generated specs from tooling that emits unknown role names.","solutions":["Run 'kops get ig <name> -o yaml' and confirm spec.role is one of Master|ControlPlane, Node, Bastion (or APIServer on supported versions)","Fix the role value's spelling/casing in the manifest","Use a kOps version that supports the role present in the spec (upgrade if the spec was produced by a newer kOps)","Rebuild the IG with 'kops create ig' instead of hand-editing the role field"],"exampleFix":"// before (instance group yaml)\nrole: master\n// after\nrole: ControlPlane","handlingStrategy":"type-guard","validationCode":"switch role {\ncase kops.InstanceGroupRoleControlPlane, kops.InstanceGroupRoleMaster,\n\t kops.InstanceGroupRoleNode, kops.InstanceGroupRoleBastion, kops.InstanceGroupRoleAPIServer:\n\t// ok\ndefault:\n\treturn fmt.Errorf(\"IG %q has unsupported role %q for this kOps version\", ig.Name, role)\n}","typeGuard":"func knownRole(role kops.InstanceGroupRole) bool {\n\tswitch role {\n\tcase kops.InstanceGroupRoleControlPlane, kops.InstanceGroupRoleMaster,\n\t\t kops.InstanceGroupRoleNode, kops.InstanceGroupRoleBastion,\n\t\t kops.InstanceGroupRoleAPIServer:\n\t\treturn true\n\t}\n\treturn false\n}","tryCatchPattern":null,"preventionTips":["Never hand-edit spec.role; use 'kops create ig' / 'kops edit ig'","Match the kOps CLI version to the cluster spec version (kops upgrade apply)","Validate generated manifests against the kops API schema of your installed version","Check casing: roles are exact enum values like 'ControlPlane', not 'master'"],"tags":["kops","instance-group","volume-size","roles"],"backgroundTag":"unknown-instance-group-role","analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T07:17:12.445Z"}