-
Notifications
You must be signed in to change notification settings - Fork 1.1k
fix: Add ClusterCIDRReady condition #7965
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
fix: Add ClusterCIDRReady condition #7965
Conversation
✅ Deploy Preview for karpenter-docs-prod ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
@@ -43,9 +41,10 @@ func (n Readiness) Reconcile(ctx context.Context, nodeClass *v1.EC2NodeClass) (r | |||
// will not be done at startup but instead in a reconcile loop. | |||
if nodeClass.AMIFamily() == v1.AMIFamilyAL2023 { | |||
if err := n.launchTemplateProvider.ResolveClusterCIDR(ctx); err != nil { | |||
nodeClass.StatusConditions().SetFalse(status.ConditionReady, "NodeClassNotReady", "Failed to detect the cluster CIDR") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm suggesting we create a specific condition for Cluster CIDR readiness rather than directly marking the whole NodeClass as NotReady. This way, when the EKS API becomes available again, the validation controller can see that this specific dependency is healthy and allow the NodeClass to recover properly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm more inclined to just scope this into the validation controller and drop this sub-reconciler entirely @AlexeyPetroff What do you think about just doing an additional validation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I understand, the decision to do the Cluster CIDR resolution in the reconcile loop was made to support non-EKS clusters, where the CIDR may not be available at the time of creation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, that's correct -- but validation can still be special cased based on the AMIFamily -- I think we should perform the same check, but I'm just suggesting that we remove this reconciler entirely and capture this in validation -- I'd prefer not to create a separate status condition for this
Fixes #7875
Summary
This PR addresses an issue where EC2NodeClass resources using AL2023 AMI family would become stuck in a
NotReady
state after temporary EKS API unavailability. The problem occurs when attempting to resolve Cluster CIDR during reconciliation - if the API call fails, the resource remains in a NotReady state indefinitely, even after the API becomes available again.Changes
Tested by:
NotReady
stateDoes this change impact docs?
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.