kubernetes/kops · error

error getting cloud instance group %q: %v

Error message

error getting cloud instance group %q: %v

What it means

Error returned while building CloudInstanceGroup objects for OpenStack during GetCloudInstanceGroups. For each kops InstanceGroup, osBuildCloudInstanceGroup reconciles cloud instances with cluster nodes; a failure is wrapped with the instance group's name.

Source

Thrown at upup/pkg/fi/cloudup/openstack/cloud.go:706

			}
			break
		}
	}
	return nil
}

func (c *openstackCloud) GetCloudGroups(cluster *kops.Cluster, instancegroups []*kops.InstanceGroup, warnUnmatched bool, nodes []v1.Node) (map[string]*cloudinstances.CloudInstanceGroup, error) {
	return getCloudGroups(c, cluster, instancegroups, warnUnmatched, nodes)
}

func getCloudGroups(c OpenstackCloud, cluster *kops.Cluster, instancegroups []*kops.InstanceGroup, warnUnmatched bool, nodes []v1.Node) (map[string]*cloudinstances.CloudInstanceGroup, error) {
	nodeMap := cloudinstances.GetNodeMap(nodes, cluster)
	groups := make(map[string]*cloudinstances.CloudInstanceGroup)
	for _, ig := range instancegroups {
		var err error
		groups[ig.ObjectMeta.Name], err = osBuildCloudInstanceGroup(c, cluster, ig, nodeMap)
		if err != nil {
			return nil, fmt.Errorf("error getting cloud instance group %q: %v", ig.ObjectMeta.Name, err)
		}
	}
	return groups, nil
}

func (c *openstackCloud) GetCloudTags() map[string]string {
	return c.tags
}

func (c *openstackCloud) UseLoadBalancerVIPACL() (bool, error) {
	if c.useVIPACL != nil {
		return *c.useVIPACL, nil
	}
	use, err := useLoadBalancerVIPACL(c)
	if err != nil {
		return false, err
	}
	c.useVIPACL = &use

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Check the inner error from osBuildCloudInstanceGroup for the root cause
  2. Verify instance metadata keys 'k8s' and 'KopsRole' are intact on the servers
  3. Re-run after nodes register if the cluster was just created
  4. Confirm `openstack server list` shows all expected instances for the group
Defensive patterns

Strategy: validation

Validate before calling

for _, inst := range instances {
    if inst.Metadata["k8s"] == "" || inst.Metadata["KopsRole"] == "" {
        return fmt.Errorf("instance %s missing k8s/KopsRole metadata", inst.ID)
    }
}

Type guard

func hasKopsMetadata(inst servers.Server) bool {
    v, ok := inst.Metadata["k8s"]; r, ok2 := inst.Metadata["KopsRole"]
    return ok && ok2 && v != "" && r != ""
}

Try / catch

if err != nil {
    return nil, fmt.Errorf("error getting cloud instance group %q: %v", ig.Name, err) // check inner cause
}

Prevention

When it happens

Trigger: osBuildCloudInstanceGroup fails when listing group instances or matching instances to nodes in the nodeMap — e.g. Nova list failure or an instance missing expected metadata (k8s / KopsRole tags).

Common situations: Instance group references instances whose metadata was modified or stripped; nodes not yet registered so nodeMap lookups misalign; Nova API partial failure while enumerating servers.

Related errors


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