fix: degrade gracefully when zonal shift validation fails at startup - #9468
Open
semx wants to merge 1 commit into
Open
fix: degrade gracefully when zonal shift validation fails at startup#9468semx wants to merge 1 commit into
semx wants to merge 1 commit into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
When
settings.enableZonalShiftistruebut the cluster is not registered with ARC zonal shift — or the controller role lacksarc-zonal-shiftpermissions —NewOperatorpanics and the controller crash-loops: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-eksKarpenter example setsenableZonalShift: truein 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 theDescribeClusterpath — 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?
enableZonalShift: true, cluster not registered for zonal shift): controller panics and restarts indefinitely.zonal_shift_config { enabled = true }: controller runs 2/2 with zero restarts.go build ./pkg/operator/... ./kwok/operator/...andgofmtclean;pkg/operatorsuite 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.