Skip to content
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

fix: Check node readiness before force terminating #1099

Merged
merged 1 commit into from
Mar 14, 2024

Conversation

jonathan-innis
Copy link
Member

@jonathan-innis jonathan-innis commented Mar 13, 2024

Fixes #1100

Description

This change gates deletion of the NodeClaim and the force deletion of the Node based on the readiness of the Node. Today, we blindly delete the NodeClaim and Node if we get NotExists from the CloudProvider; however, we should also gate this based on the Node readiness and kubelet heartbeat to deal with potential inconsistency issues on the List() CloudProvider call.

This also lets the Registration liveness controller cleanup any NodeClaims that don't register in time, but allows the full 15m timeout to occur before terminating a NodeClaim that doesn't exist being returned from the CloudProvider List() call.

How was this change tested?

make presubmit

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 Mar 13, 2024
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Mar 13, 2024
@jonathan-innis jonathan-innis force-pushed the check-node-ready branch 3 times, most recently from a9ef709 to 43146a6 Compare March 13, 2024 18:04
@jonathan-innis jonathan-innis changed the title fix: Check node readiness before terminating fix: Check node readiness before force terminating Mar 13, 2024
@jonathan-innis jonathan-innis force-pushed the check-node-ready branch 3 times, most recently from 6a8c8e8 to 5259e0c Compare March 13, 2024 19:36
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Mar 13, 2024
@coveralls
Copy link

coveralls commented Mar 13, 2024

Pull Request Test Coverage Report for Build 8277948745

Details

  • 31 of 37 (83.78%) changed or added relevant lines in 3 files are covered.
  • 4 unchanged lines in 2 files lost coverage.
  • Overall coverage increased (+0.1%) to 79.045%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pkg/controllers/node/termination/controller.go 10 11 90.91%
pkg/controllers/nodeclaim/garbagecollection/controller.go 8 10 80.0%
pkg/test/expectations/expectations.go 13 16 81.25%
Files with Coverage Reduction New Missed Lines %
pkg/test/expectations/expectations.go 2 95.59%
pkg/scheduling/requirements.go 2 97.98%
Totals Coverage Status
Change from base Build 8277948603: 0.1%
Covered Lines: 8291
Relevant Lines: 10489

💛 - Coveralls

@jonathan-innis jonathan-innis force-pushed the check-node-ready branch 10 times, most recently from 70c0dbe to 20a2a34 Compare March 14, 2024 08:35
@k8s-ci-robot k8s-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Mar 14, 2024
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Mar 14, 2024
@jonathan-innis jonathan-innis marked this pull request as ready for review March 14, 2024 09:17
@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 Mar 14, 2024
Copy link
Contributor

@njtran njtran left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jonathan-innis, njtran

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:
  • OWNERS [jonathan-innis,njtran]

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 merged commit c6b8b81 into kubernetes-sigs:main Mar 14, 2024
12 checks passed
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/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement Node Readiness Check Logic for Instance Existence Calls
4 participants