{"record":{"id":"39dfff507e0000b1","repo":"kubernetes/kops","slug":"gce-cloud-provider-does-not-support-surging","errorCode":null,"errorMessage":"gce cloud provider does not support surging","messagePattern":"gce cloud provider does not support surging","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/gce/instancegroups.go","lineNumber":93,"sourceCode":"\t}\n\n\treturn DeleteInstanceTemplate(c, mig.InstanceTemplate)\n}\n\n// DeleteInstance deletes a GCE instance\nfunc (c *gceCloudImplementation) DeleteInstance(i *cloudinstances.CloudInstance) error {\n\treturn recreateCloudInstance(c, i)\n}\n\nfunc (c *gceCloudImplementation) DeregisterInstance(i *cloudinstances.CloudInstance) error {\n\tklog.V(8).Info(\"GCE DeregisterInstance not implemented\")\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 *gceCloudImplementation) DetachInstance(i *cloudinstances.CloudInstance) error {\n\tklog.V(8).Info(\"gce cloud provider DetachInstance not implemented yet\")\n\treturn fmt.Errorf(\"gce cloud provider does not support surging\")\n}\n\n// recreateCloudInstance recreates the specified instances, managed by an InstanceGroupManager\nfunc recreateCloudInstance(c GCECloud, i *cloudinstances.CloudInstance) error {\n\tmig := i.CloudInstanceGroup.Raw.(*compute.InstanceGroupManager)\n\n\tklog.V(2).Infof(\"Recreating GCE Instance %s in MIG %s\", i.ID, mig.Name)\n\n\tmigURL, err := ParseGoogleCloudURL(mig.SelfLink)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\top, err := c.Compute().InstanceGroupManagers().RecreateInstances(migURL.Project, migURL.Zone, migURL.Name, i.ID)\n\tif err != nil {\n\t\tif IsNotFound(err) {\n\t\t\tklog.Infof(\"Instance not found, assuming deleted: %q\", i.ID)\n\t\t\treturn nil","sourceCodeStart":75,"sourceCodeEnd":111,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/gce/instancegroups.go#L75-L111","documentation":"gceCloudImplementation.DetachInstance is explicitly not implemented for GCE. Detaching an instance (used by rolling-update surging, where a new node is added before the old is removed) is unsupported, so the method unconditionally returns this error after logging at V(8).","triggerScenarios":"Any call to DetachInstance on a GCE cloud, which happens when running a rolling-update with surge enabled (kops rolling-update cluster --surge) against a cluster backed by GCE instance groups.","commonSituations":"Operators using the `--surge` flag on `kops rolling-update cluster` in a GCE cluster; surging works on AWS but not GCE, so the update fails once detach is attempted.","solutions":["Run rolling updates on GCE without surging: omit --surge (use the default non-surging rolling update).","Use --cloud-aws only if surging is required, or wait for GCE detach support to be implemented.","Alternatively, manually scale the MIG and drain nodes with kubectl drain if you need overlap."],"exampleFix":"// before\nkops rolling-update cluster mycluster --yes --surge\n// after\nkops rolling-update cluster mycluster --yes  # no --surge on GCE","handlingStrategy":"validation","validationCode":"// feature-gate surging off for GCE before invoking rolling update\nif cloudProvider == \"gce\" && strings.Contains(strings.Join(args, \" \"), \"--surge\") {\n\treturn fmt.Errorf(\"--surge is not supported on GCE (DetachInstance unimplemented)\")\n}","typeGuard":null,"tryCatchPattern":"err := cloud.DetachInstance(ci)\nif err != nil && strings.Contains(err.Error(), \"does not support surging\") {\n\t// fall back to non-surging rolling update\n\treturn rollingUpdateWithoutSurge(group)\n}","preventionTips":["Never pass --surge on `kops rolling-update cluster` for GCE clusters.","Check the cloud provider's implemented-feature list before using rolling-update options.","Script rolling updates per cloud provider so AWS-only flags stay out of GCE workflows."],"tags":["gce","rolling-update","surge","unimplemented"],"backgroundTag":"feature-not-supported","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"}