kubernetes/kops · error

error creating cloud instance group member: %v

Error message

error creating cloud instance group member: %v

What it means

Fires in registerCloudInstances when adding an instance to the CloudInstanceGroup member list fails (the wrapped error comes from cloudinstances.NewCloudInstanceGroupMember, e.g. a nil node where the master flag disagrees) while registering spotinst instances into instance groups.

Source

Thrown at pkg/resources/spotinst/resources.go:386

		}

		// If the instance was created before the last update, mark it as `NeedUpdate`.
		newInstanceGroupName := currentInstanceGroupName
		if instance.CreatedAt().Before(instanceGroupUpdatedAt) {
			newInstanceGroupName = fmt.Sprintf("%s:%d", currentInstanceGroupName, time.Now().Nanosecond())
		}

		klog.V(2).Infof("Adding instance %q (created at: %s) to instance group: %q (updated at: %s)",
			instance.Id(), instance.CreatedAt().Format(time.RFC3339),
			currentInstanceGroupName, instanceGroupUpdatedAt.Format(time.RFC3339))

		status := cloudinstances.CloudInstanceStatusUpToDate
		if newInstanceGroupName != currentInstanceGroupName {
			status = cloudinstances.CloudInstanceStatusNeedsUpdate
		}
		if _, err := instanceGroup.NewCloudInstance(
			instance.Id(), status, nodeMap[instance.Id()]); err != nil {
			return fmt.Errorf("error creating cloud instance group member: %v", err)
		}
	}

	return nil
}

func findInstanceGroupFromResource(cluster *kops.Cluster, instanceGroups []*kops.InstanceGroup,
	resource *resources.Resource) (*kops.InstanceGroup, error,
) {
	var instanceGroup *kops.InstanceGroup
	for _, ig := range instanceGroups {
		name := getGroupNameByRole(cluster, ig)
		if name == "" {
			continue
		}

		if name == resource.Name {
			if instanceGroup != nil {

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Check the wrapped %v error for the specific member-construction cause
  2. Verify the instance's node exists in nodeMap when expected to be a master/non-master
  3. Re-run GetCloudGroups so nodes and instances are re-synced
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at pkg/resources/spotinst/resources.go:386 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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