Skip to content

fix(kubelet): update lease duration when config changes #131749

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

Merged
merged 1 commit into from
May 21, 2025

Conversation

cartermckinnon
Copy link
Contributor

What type of PR is this?

/kind bug

What this PR does / why we need it:

The lease controller used by kubelet does not update the lease's duration when kubelet's config changes.

That is, if a running kubelet's config is changed to extend the lease duration, and kubelet is restarted -- the duration of the lease is not updated to reflect kubelet's config.

The controller will begin updating the lease at the new interval (0.25 * duration), making lease validity more fragile.

Which issue(s) this PR fixes:

Special notes for your reviewer:

Does this PR introduce a user-facing change?

NONE

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/bug Categorizes issue or PR as related to a bug. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels May 13, 2025
@k8s-ci-robot k8s-ci-robot requested review from cici37 and deads2k May 13, 2025 19:57
@k8s-ci-robot k8s-ci-robot added sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels May 13, 2025
@jpbetz
Copy link
Contributor

jpbetz commented May 13, 2025

/assign @Jefftree

@Jefftree
Copy link
Member

@cartermckinnon Would you be able to add a test case to verify this scenario? Otherwise code lgtm.

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels May 14, 2025
@cartermckinnon
Copy link
Contributor Author

Thanks @Jefftree! Added a test and verified it fails without this change 👍

@Jefftree
Copy link
Member

/triage accepted
/lgtm

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. lgtm "Looks good to me", indicates that a PR is ready to be merged. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels May 14, 2025
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 0f604d6b08b81919d6187e204108646325a64aee

@cartermckinnon
Copy link
Contributor Author

/cc @liggitt

can you take a look at this one?

@k8s-ci-robot k8s-ci-robot requested a review from liggitt May 21, 2025 19:23
@liggitt
Copy link
Member

liggitt commented May 21, 2025

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cartermckinnon, liggitt

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

The pull request process is described 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 approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 21, 2025
@liggitt
Copy link
Member

liggitt commented May 22, 2025

Thanks for the fix, it's not clear to me this reaches the bar for backporting. This isn't a regression, right? Do we have evidence this is a severe critical bug?

@cartermckinnon
Copy link
Contributor Author

cartermckinnon commented May 23, 2025

I don't feel strongly either way, we can carry this downstream. It's not a regression AFAICT. If kubelet is configured with a lease duration >=4 times longer than its previous value, the lease will regularly expire.

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. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. release-note-none Denotes a PR that doesn't merit a release note. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy