Skip to content

fix: degrade gracefully when zonal shift validation fails at startup - #9468

Open
semx wants to merge 1 commit into
aws:mainfrom
semx:fix/zonal-shift-graceful-degradation
Open

fix: degrade gracefully when zonal shift validation fails at startup#9468
semx wants to merge 1 commit into
aws:mainfrom
semx:fix/zonal-shift-graceful-degradation

Conversation

@semx

@semx semx commented Aug 2, 2026

Copy link
Copy Markdown

Description

When settings.enableZonalShift is true but the cluster is not registered with ARC zonal shift — or the controller role lacks arc-zonal-shift permissions — NewOperator panics and the controller crash-loops:

panic: Unable to find Cluster arn:aws:eks:us-east-1:...:cluster/... in Zonal Shift.
Please check that the cluster is enabled for Zonal Shift and roles have appropriate
permissions ... AccessDeniedException: Resource ... is not a managed resource ...

A crash-looping controller stops all node provisioning, so a misconfiguration of an optional resiliency feature takes down the very capability it is meant to protect. In a cluster where CoreDNS or other critical pods are waiting for capacity, this turns a config mismatch into a full provisioning outage that cannot self-heal.

This change logs the validation error with an actionable hint and falls back to the no-op zonal shift provider, keeping the controller running with the feature disabled. The same block is mirrored in kwok/operator/operator.go.

This failure mode is easy to hit in the wild: the terraform-aws-modules/terraform-aws-eks Karpenter example sets enableZonalShift: true in the chart values without registering the cluster (zonal_shift_config), which works with the chart version pinned there but crash-loops on current chart versions. Related: #9118 (IAM policy docs for ARC zonal shift), #9153 (clearer panic for the DescribeCluster path — complementary, different call site).

If maintainers prefer to keep fail-fast semantics here, happy to rework this into a clearer, actionable panic message instead — opening with the graceful-degradation variant since an availability feature reducing availability seems like the wrong default.

How was this change tested?

  • Reproduced the original crash-loop on a live EKS 1.36 cluster (Karpenter 1.14.0, enableZonalShift: true, cluster not registered for zonal shift): controller panics and restarts indefinitely.
  • Verified the intended pairing works on the same cluster with zonal_shift_config { enabled = true }: controller runs 2/2 with zero restarts.
  • go build ./pkg/operator/... ./kwok/operator/... and gofmt clean; pkg/operator suite failure is pre-existing on the base commit in my environment (BeforeSuite requires test infra) and unrelated to this diff.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

When settings.enableZonalShift is true but the cluster is not registered
with ARC zonal shift, or the controller role lacks arc-zonal-shift
permissions, the operator currently panics and the controller crash-loops.
A crash-looping controller stops all node provisioning, so a misconfigured
optional resiliency feature takes down the very capability it is meant to
protect.

Log the validation error with an actionable hint and fall back to the
no-op zonal shift provider instead, keeping the controller running with
the feature disabled.

Signed-off-by: Sergey Sannikov <sergey@sannikov.dev>
@semx
semx requested a review from a team as a code owner August 2, 2026 15:57
@semx
semx requested a review from sergiy-slobodyan August 2, 2026 15:57
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