Skip to content

Add compatibility with GKE in-place node upgrades - #182

Open
benhoskings wants to merge 1 commit into
doitintl:masterfrom
benhoskings:preserve-access-config-name
Open

benhoskings wants to merge 1 commit into
doitintl:masterfrom
benhoskings:preserve-access-config-name

Conversation

@benhoskings

@benhoskings benhoskings commented Oct 27, 2026 •

Copy link
Copy Markdown

I had Claude Opus 5.5 author this PR as part of a diagnosis into a failed terraform apply.

Context:

GKE in-place node upgrades were released earlier this month:
https://docs.cloud.google.com/kubernetes-engine/docs/release-notes#October_16_2026

Problem

When kubeip swaps a node's ephemeral IP for a reserved one, it deletes the
node's access config and adds a new one, always named External IP. GKE
creates node access configs named external-nat.

Access config names are immutable, so once kubeip has renamed it, the managed
instance group can no longer update the instance in place to match its
template. Any in-place update fails, for example a GKE surge upgrade with
maxUnavailable > 0, or an instance repair with forceUpdateOnRepair:

Instance 'gke-...' update failed: Invalid value for field
'resource.networkInterfaces[0].accessConfigs[0].name': 'external-nat'.
Access config name is immutable.

The instance is then stuck RECREATING, the MIG never stabilises, and the GKE
node pool upgrade (and any other node pool update, such as label or taint
changes) fails with Not all instances running in IGM.

Change

Capture the name of the instance's existing access config before deleting it,
and reuse it for the replacement in Assign, Unassign and RestoreAddress.
When the instance has no access config, the existing defaults (External IP /
External IPv6) are still used.

AddInstanceAddress (on the internal internalAssigner interface) gains an
accessConfigName parameter. The pinned mockery v2.35.2 panics under Go 1.26,
so the InternalAssigner mock was updated by hand to match mockery's output.

Testing

  • go test ./...
  • golangci-lint run -c .golangci.yaml ./... (v2.13.2): 0 issues
  • The Assign test now expects the existing access config name to be
    preserved, and getAccessConfigName has its own table test.

kubeip replaced the node's access config with one named "External IP",
whereas GKE nodes use "external-nat". Access config names are immutable,
so the managed instance group could no longer update the instance in
place, breaking GKE in-place node upgrades and instance repairs.

Reuse the existing access config's name for its replacement, falling
back to the defaults when the instance has none.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant