Skip to content

feat: addition of launch TTL for nodeclaim lifecycle #2349

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rschalo
Copy link
Contributor

@rschalo rschalo commented Jul 3, 2025

Fixes #N/A

Description
If Karpenter encounters issues launching instances then we should retry for a shorter amount of time than the full registration TTL. This unblocks provisioning decisions for pods that may be stuck waiting for compute that will not come up due to launch failures. This also allows Karpenter to make new decisions about what compute should be provisioned.

How was this change tested?
Unit tests.

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

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jul 3, 2025
@k8s-ci-robot k8s-ci-robot requested review from engedaam and tallaxes July 3, 2025 20:08
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: rschalo
Once this PR has been reviewed and has the lgtm label, please assign gjtempleton for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jul 3, 2025
@coveralls
Copy link

Pull Request Test Coverage Report for Build 16059632783

Details

  • 14 of 21 (66.67%) changed or added relevant lines in 1 file are covered.
  • 5 unchanged lines in 2 files lost coverage.
  • Overall coverage decreased (-0.06%) to 81.831%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pkg/controllers/nodeclaim/lifecycle/liveness.go 14 21 66.67%
Files with Coverage Reduction New Missed Lines %
pkg/test/expectations/expectations.go 2 93.14%
pkg/controllers/nodeclaim/lifecycle/liveness.go 3 66.1%
Totals Coverage Status
Change from base Build 16014134817: -0.06%
Covered Lines: 10215
Relevant Lines: 12483

💛 - Coveralls


func (l *Liveness) Reconcile(ctx context.Context, nodeClaim *v1.NodeClaim) (reconcile.Result, error) {
registered := nodeClaim.StatusConditions().Get(v1.ConditionTypeRegistered)
if registered.IsTrue() {
return reconcile.Result{}, nil
}
launched := nodeClaim.StatusConditions().Get(v1.ConditionTypeLaunched)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we're gonna functionally decompose the delete, why not add the status condition check? You could pass in the condition and the TTL to check for in addition to the reason.

I'm not sure they need to be functionally decomposed in the first place but if you want to go that route I think we should decompose it all. We could also define the types of conditions we check for in an array or something more explicit

Copy link
Contributor Author

@rschalo rschalo Jul 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The status conditions and TTL aren't handled the same way and I think it's fine to functionally decompose the delete and metric because of that. I think somewhere in between is something like:

type NodeClaimTTL struct {
	duration time.Duration
	reason   string
}

var (
	RegistrationTTL = NodeClaimTTL{
		duration: registrationTTL,
		reason:   registrationTTLReason,
	}
	LaunchTTL = NodeClaimTTL{
		duration: launchTTL,
		reason:   launchTTLReason,
	}
)

WDYT?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants