kubernetes/kops · error

could not determine etcd cluster type for volume: %s

Error message

could not determine etcd cluster type for volume: %s

What it means

getEtcdClusterSpec classifies an etcd volume purely by substring matching its name: 'etcd-main' maps to the main cluster, 'etcd-events' to the events cluster. If the volume name contains neither, the etcd cluster type cannot be determined and it returns this error, which the caller wraps with tag/volume context.

Source

Thrown at upup/pkg/fi/cloudup/do/cloud.go:394

	}

	status := make([]kops.EtcdClusterStatus, 0, len(statusMap))
	for _, v := range statusMap {
		status = append(status, *v)
	}

	return status, nil
}

func (c *doCloudImplementation) getEtcdClusterSpec(volumeName string, dropletName string) (*etcd.EtcdClusterSpec, error) {
	var clusterKey string
	switch {
	case strings.Contains(volumeName, "etcd-main"):
		clusterKey = "main"
	case strings.Contains(volumeName, "etcd-events"):
		clusterKey = "events"
	default:
		return nil, fmt.Errorf("could not determine etcd cluster type for volume: %s", volumeName)
	}

	return &etcd.EtcdClusterSpec{
		ClusterKey: clusterKey,
		NodeName:   dropletName,
		NodeNames:  []string{dropletName},
	}, nil
}

func getCloudGroups(c *doCloudImplementation, 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)
	instanceGroups, err := findInstanceGroups(c, cluster.ObjectMeta.Name)
	if err != nil {
		return nil, fmt.Errorf("unable to find autoscale groups: %v", err)
	}

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Rename the volume so its name contains 'etcd-main' or 'etcd-events' as appropriate.
  2. Remove the kOps cluster tags from volumes that are not actually kOps etcd volumes.
  3. Confirm only expected etcd volumes carry the cluster tag: `doctl compute volume list` and audit names/tags.
  4. If a new etcd cluster type is legitimately in use, upgrade kOps to a version that recognizes it.

Example fix

// before
volume.Name = "mycluster-data-1"
// after
volume.Name = "mycluster-dyn-etcd-main-1"  // must contain etcd-main or etcd-events
Defensive patterns

Strategy: validation

Validate before calling

if !strings.Contains(volumeName, "etcd-main") && !strings.Contains(volumeName, "etcd-events") {
    return fmt.Errorf("volume %q will not be recognized as kOps etcd", volumeName)
}

Try / catch

if err != nil && strings.Contains(err.Error(), "could not determine etcd cluster type") {
    return renameOrUntagVolume(volume) // fix name or remove cluster tags
}

Prevention

When it happens

Trigger: A volume whose tags claim it belongs to this kOps cluster (has cluster + index tags) but whose Name has no 'etcd-main'/'etcd-events' substring — renamed volumes, foreign volumes accidentally tagged, or volumes created with non-kOps naming.

Common situations: Manual volume renaming during recovery/DR; volumes from an unrelated system that inherited the cluster tag; introducing a third etcd type that this kOps version doesn't recognize.

Related errors


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