Skip to content

Conversation

@GnatorX
Copy link
Contributor

@GnatorX GnatorX commented Dec 23, 2025

Fixes #N/A

Description

  • Add option to enable controller runtime warm up when leader election is used. Warm up allows non-leader pods to warm up k8s cache and watch for events hydrating the informer cache even when it isn't the leader. This allows faster fail over (don't have to hydrate informer after leader changes).

How was this change tested?

  • Ran with the change. Follower memory didn't increase dramatically (note that this is simply the informer cache, any subsequent caches that is built after pod is created isn't ran until it becomes leader)
  • Attempted to force a leader election by killing the leader and making sure follower comes up normally

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

@k8s-ci-robot
Copy link
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Dec 23, 2025
@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Dec 23, 2025
@coveralls
Copy link

coveralls commented Jan 15, 2026

Pull Request Test Coverage Report for Build 21188536214

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 2 of 2 (100.0%) changed or added relevant lines in 2 files are covered.
  • 25 unchanged lines in 5 files lost coverage.
  • Overall coverage increased (+0.2%) to 80.742%

Files with Coverage Reduction New Missed Lines %
pkg/controllers/disruption/consolidation.go 4 88.0%
pkg/controllers/nodeoverlay/controller.go 4 75.42%
pkg/controllers/state/informer/nodeclaim.go 4 72.73%
pkg/controllers/metrics/nodepool/controller.go 6 87.27%
pkg/controllers/controllers.go 7 0.0%
Totals Coverage Status
Change from base Build 21011765273: 0.2%
Covered Lines: 11756
Relevant Lines: 14560

💛 - Coveralls

@GnatorX GnatorX marked this pull request as ready for review January 15, 2026 22:49
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 15, 2026
@ellistarn
Copy link
Contributor

ellistarn commented Jan 19, 2026

Any reason to not have this on by default?

There's a network tradeoff, but it seems very worthy given the risk of coordinated lists across controllers during zonal fail over.

@GnatorX
Copy link
Contributor Author

GnatorX commented Jan 19, 2026

Same question was asked during working group. I think it make sense to turn it on by default but I think its likely safer to go first as not default then maybe flip it on as default after a release or two?

@ellistarn
Copy link
Contributor

Sounds good. If our intended goal state is on by default, wdyt about flipping the flag to "disable" and making it true by default (for now).

The general idea being that the natural state of a Boolean is false. We haven't been perfect with this, but I think it generally helps with readability (short of something more sophisticated like feature gates).

@jmdeal I'm noticing that feature gates has a comment to deprecate the field. What's the history there?

@GnatorX
Copy link
Contributor Author

GnatorX commented Jan 20, 2026

That make sense to me, I can update it to do that. I also needed to test one more code path then will ask for another review

Copy link
Contributor

@ellistarn ellistarn left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 20, 2026
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ellistarn, GnatorX

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

The pull request process is described here

Details 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 approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 20, 2026
@k8s-ci-robot k8s-ci-robot merged commit 3c00d41 into kubernetes-sigs:main Jan 20, 2026
16 checks passed
@GnatorX GnatorX deleted the garvin-enable-warmup branch January 20, 2026 23:20
nathangeology pushed a commit to nathangeology/karpenter-core that referenced this pull request Jan 22, 2026
nathangeology added a commit to nathangeology/karpenter-core that referenced this pull request Jan 22, 2026
nathangeology pushed a commit to nathangeology/karpenter-core that referenced this pull request Feb 2, 2026
nathangeology added a commit to nathangeology/karpenter-core that referenced this pull request Feb 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants