{"record":{"id":"7d1a2657609b71d6","repo":"kubernetes/kops","slug":"digital-ocean-cloud-provider-does-not-support-surg","errorCode":null,"errorMessage":"digital ocean cloud provider does not support surging","messagePattern":"digital ocean cloud provider does not support surging","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/do/cloud.go","lineNumber":177,"sourceCode":"\t\t}\n\n\t\ttime.Sleep(time.Minute * 1)\n\t}\n\n\t_, err = c.Client.Droplets.Delete(context.TODO(), dropletID)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error stopping instance %d: %v\", dropletID, err)\n\t}\n\n\tklog.V(8).Infof(\"deleted droplet instance %d\", dropletID)\n\n\treturn nil\n}\n\n// DetachInstance is not implemented yet. It needs to cause a cloud instance to no longer be counted against the group's size limits.\nfunc (c *doCloudImplementation) DetachInstance(i *cloudinstances.CloudInstance) error {\n\tklog.V(8).Info(\"digitalocean cloud provider DetachInstance not implemented yet\")\n\treturn fmt.Errorf(\"digital ocean cloud provider does not support surging\")\n}\n\n// ProviderID returns the kops api identifier for DigitalOcean cloud provider\nfunc (c *doCloudImplementation) ProviderID() kops.CloudProviderID {\n\treturn kops.CloudProviderDO\n}\n\n// Region returns the DO region we will target\nfunc (c *doCloudImplementation) Region() string {\n\treturn c.region\n}\n\nfunc (c *doCloudImplementation) DNS() (dnsprovider.Interface, error) {\n\tprovider, err := dnsprovider.GetDnsProvider(dns.ProviderName, nil)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error building DNS provider: %v\", err)\n\t}\n\treturn provider, nil","sourceCodeStart":159,"sourceCodeEnd":195,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/do/cloud.go#L159-L195","documentation":"DetachInstance is intentionally unimplemented in the DigitalOcean cloud provider. kOps calls it when performing 'surging' rolling updates (adding a new node before detaching/removing the old one); the DO provider only supports in-place replacement, so it always returns this error. It is a hard capability limitation, not a transient fault.","triggerScenarios":"Any kOps rolling-update on a DigitalOcean cluster that runs with surging enabled (e.g. `kops rolling-update cluster --instance-group X` where the group is configured to surge / the update policy builds a new instance before detaching the old).","commonSituations":"Users switching rolling-update strategy on DO clusters expecting AWS-like detach/attach behavior; automation that calls cloud provider DetachInstance generically across clouds.","solutions":["Use non-surging rolling updates on DigitalOcean (default in-place replace, e.g. `--master-interval`/`--node-interval` without surge options).","Set the instance group's rolling-update policy to not surge (avoid CloudProviderBatching/surging options that trigger DetachInstance).","If surging is required, run the workload on a provider that implements it (AWS, GCE) or implement DetachInstance for DO upstream.","Work around manually: scale the group up, then down, outside of the surging code path."],"exampleFix":"// before (kops CLI)\nkops rolling-update cluster my.cluster --instance-group nodes --surge\n// after\nkops rolling-update cluster my.cluster --instance-group nodes  # sequential, non-surging","handlingStrategy":"fallback","validationCode":"// check provider capability before choosing a surging update strategy\nif cluster.Spec.CloudProvider == kops.CloudProviderID(\"digitalocean\") {\n    // do not enable surging; DetachInstance is unsupported\n}","typeGuard":null,"tryCatchPattern":"if err := cloud.DetachInstance(ci); err != nil {\n    if strings.Contains(err.Error(), \"does not support surging\") {\n        return rollingUpdateInPlace(inst) // fallback strategy\n    }\n    return err\n}","preventionTips":["Use sequential non-surging rolling updates on DigitalOcean.","Do not configure surge/batching policies on DO instance groups.","Check provider capability support before picking an update strategy."],"tags":["digitalocean","unsupported-feature","rolling-update","not-implemented"],"backgroundTag":"cloud-provider-capability-unsupported","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"}