kubernetes/kops · error

digital ocean cloud provider does not support deleting cloud

Error message

digital ocean cloud provider does not support deleting cloud groups at this time

What it means

The DigitalOcean cloud implementation does not implement DeleteGroup for instance groups; calling it (e.g. `kops delete instancegroup` or rolling-update flows that need to remove a group) always returns this explicit unsupported-operation error. The klog.V(8) message explicitly says the feature is not implemented yet.

Source

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

	tokenSource := oauth2.StaticTokenSource(&oauth2.Token{AccessToken: accessToken})
	client := godo.NewClient(oauth2.NewClient(context.TODO(), tokenSource))

	return &doCloudImplementation{
		Client: client,
		dns:    dns.NewProvider(client),
		region: region,
	}, nil
}

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

// DeleteGroup is not implemented yet, is a func that needs to delete a DO instance group.
func (c *doCloudImplementation) DeleteGroup(g *cloudinstances.CloudInstanceGroup) error {
	klog.V(8).Info("digitalocean cloud provider DeleteGroup not implemented yet")
	return fmt.Errorf("digital ocean cloud provider does not support deleting cloud groups at this time")
}

// DeregisterInstance drains a cloud instance and loadbalancers.
func (c *doCloudImplementation) DeregisterInstance(i *cloudinstances.CloudInstance) error {
	klog.V(8).Info("DO DeregisterInstance not implemented")
	return nil
}

func (c *doCloudImplementation) DeleteInstance(i *cloudinstances.CloudInstance) error {
	dropletID, err := strconv.Atoi(i.ID)
	if err != nil {
		return fmt.Errorf("failed to convert droplet ID to int: %s", err)
	}

	_, _, err = c.Client.DropletActions.Shutdown(context.TODO(), dropletID)
	if err != nil {
		return fmt.Errorf("error stopping instance %d: %v", dropletID, err)
	}

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Do not delete instance groups on DO clusters; instead reduce the group to minSize 0 via `kops set instancegroup`/spec edit and update, or delete the droplets directly in the DO console
  2. Perform group removal manually: delete droplets with doctl, edit the cluster spec to remove the InstanceGroup, then `kops update cluster`
  3. Track upstream kOps for DO DeleteGroup implementation and upgrade when available
  4. Use a provider with full group lifecycle support (AWS/GCP) if deleting groups is a hard requirement

Example fix

// before
kops delete instancegroup nodes --yes   # fails on DO
// after
# scale the group down instead
kops set instancegroup nodes cluster.example.com --count 0
kops update cluster --yes
# then remove the group from the spec manually once droplets are gone
Defensive patterns

Strategy: validation

Validate before calling

if cloud.ProviderID() == "digitalocean" && operation == "delete-instancegroup" {
    return errors.New("DO does not support deleting cloud groups; scale to 0 instead")
}

Try / catch

if err := c.DeleteGroup(g); err != nil {
    if strings.Contains(err.Error(), "does not support deleting cloud groups") {
        return fallbackScaleToZero(g) // reduce group count instead
    }
    return err
}

Prevention

When it happens

Trigger: Invoking any kOps operation that removes a cloud instance group on a DigitalOcean cluster: `kops delete instancegroup <name> --yes`, or rolling update withsurge/remove flows that require deleting a group.

Common situations: User tries to scale down by deleting an instance group on a DO cluster; automation built for AWS clusters applied unchanged to DO clusters.

Related errors


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