Skip to content

fix(DM01-6271): GKE cluster zone + machine type fallback on GCE_STOCKOUT - #652

Merged
liuwei08 merged 5 commits into
masterfrom
fix/DM01-6271
Nov 4, 2026
Merged

liuwei08 merged 5 commits into
masterfrom
fix/DM01-6271

Conversation

@liuwei08

@liuwei08 liuwei08 commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Background

Persistent GCE_STOCKOUT errors (Google Cloud Support Case #75099279) cause GKE cluster creation to fail permanently in europe-west3-c and europe-west3-a. The previous behavior set the CRD status to error immediately with no retry, requiring manual job restart.

Changes

Zone + Machine Type Fallback (handler.go)

When a GKE cluster reaches ERROR status on GCP (e.g. due to GCE_STOCKOUT):

  1. The failed cluster is deleted automatically
  2. The operator tries the next (zone, machineType) combination from a fallback list
  3. Only permanently fails after all combinations are exhausted

Fallback order: exhausts all zones per machine type, then moves to the next machine type:

(n1-highmem-2, west3-c) → (n1-highmem-2, west3-a) → ... → (n1-highmem-2, west1-d)
→ (n2-highmem-2, west3-c) → ...
→ (e2-highmem-2, west3-c) → ...

Auto-generated Machine Type Equivalents

buildEquivalentMachineTypes() parses the user's machineType and generates same-tier/size alternatives across n1→n2→e2 series (skipping e2 for highcpu which is unsupported).

Default Zone List

Covers all 6 verified zones in europe-west1 and europe-west3 — the only regions supporting n1 machine types (used by all current InfraBox users). europe-west10/west12 are excluded as they do not support n1.

New CRD Fields

  • spec.zones []string — user-configurable ordered fallback zone list
  • spec.machineTypes []string — user-configurable ordered machine type list
  • status.fallbackIndex int — tracks current position in the flat fallback list (replaces zoneIndex)

Actionable Error Message

When all options are exhausted, the error message includes:

  • Zones tried
  • Machine types tried
  • Root cause (GCE_STOCKOUT)
  • Link to GCP status page

Test

Verified against existing GCP operation logs from case #75099279 (ib-c49857fb, europe-west3-c, GCE_STOCKOUT).

Jira

https://jira.tools.sap/browse/DM01-6271

…CKOUT

When a GKE cluster creation fails with ERROR status (e.g. GCE_STOCKOUT),
the operator now automatically deletes the failed cluster and retries in
the next available zone instead of permanently failing.

- Add Zones []string to GKEClusterSpec for user-configurable fallback order
- Add ZoneIndex int to GKEClusterStatus to track current fallback position
- Default fallback covers europe-west1/west3 zones only (all current users
  require n1 machine types unavailable in europe-west10/west12)
- Primary zone is always tried first; duplicates removed from default list
- Update DeepCopyInto to correctly handle the new Zones slice field
- Permanently fail only after all configured zones are exhausted
Extends the GCE_STOCKOUT fallback to also try equivalent machine types
(n1 → n2 → e2 for standard/highmem; n1 → n2 for highcpu) after all
zones are exhausted for the current machine type.

- Add MachineTypes []string to GKEClusterSpec for user-configurable list
- Replace ZoneIndex with FallbackIndex in GKEClusterStatus (flat index
  over zones × machineTypes product)
- Add buildFallbackList(): auto-generates equivalent machine types by
  swapping series (n1/n2/e2) while keeping same tier and vCPU count
- Add parseMachineType() and buildEquivalentMachineTypes() helpers
- Update DeepCopyInto for new MachineTypes slice field
…sted

Include tried zones, machine types, root cause (GCE_STOCKOUT), and
point users to GCP status page or administrator instead of vague retry advice.
Spec.Zone and Spec.MachineType now always reflect the user's original
intent. Fallback runtime state is tracked in Status.FallbackZone and
Status.FallbackMachineType. createCluster prefers Status fallback values
when set, falling back to Spec otherwise.

This also makes buildFallbackList stable: it always builds from Spec
(original values), so FallbackIndex reliably maps to the same list.
@liuwei08
liuwei08 merged commit 3782703 into master Nov 4, 2026
2 checks passed
@liuwei08
liuwei08 deleted the fix/DM01-6271 branch November 4, 2026 02:53
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