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

Removing kmod labels without appropriate tolerations #944

Conversation

TomerNewman
Copy link
Contributor

This change addresses #940.
Kmod labels are now deleted only if the kernel module does not have the appropriate tolerations for the taints on the node.


/cc @yevgeny-shnaidman @ybettan

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Dec 3, 2024
@k8s-ci-robot
Copy link
Contributor

Hi @TomerNewman. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Dec 3, 2024
Copy link

netlify bot commented Dec 3, 2024

Deploy Preview for kubernetes-sigs-kmm ready!

Name Link
🔨 Latest commit 916bd69
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-kmm/deploys/6756bc460f558b00082ebd39
😎 Deploy Preview https://deploy-preview-944--kubernetes-sigs-kmm.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@yevgeny-shnaidman
Copy link
Contributor

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Dec 3, 2024
@codecov-commenter
Copy link

codecov-commenter commented Dec 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 72.68%. Comparing base (fa23a9b) to head (916bd69).
Report is 156 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #944      +/-   ##
==========================================
- Coverage   79.09%   72.68%   -6.42%     
==========================================
  Files          51       65      +14     
  Lines        5109     5762     +653     
==========================================
+ Hits         4041     4188     +147     
- Misses        882     1395     +513     
+ Partials      186      179       -7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@TomerNewman TomerNewman force-pushed the feature/removing-kmodlabels-without-tolerations branch from 47fe591 to 1310c3d Compare December 4, 2024 10:43
internal/node/node.go Outdated Show resolved Hide resolved
@TomerNewman TomerNewman force-pushed the feature/removing-kmodlabels-without-tolerations branch from 1310c3d to 90f06b2 Compare December 4, 2024 12:26
internal/node/node.go Outdated Show resolved Hide resolved
internal/node/node.go Outdated Show resolved Hide resolved
@TomerNewman TomerNewman force-pushed the feature/removing-kmodlabels-without-tolerations branch from 90f06b2 to 5bf1f5e Compare December 8, 2024 13:00
@@ -167,7 +167,7 @@ func (r *NMCReconciler) Reconcile(ctx context.Context, req reconcile.Request) (r

// removing label of loaded kmods
if !r.nodeAPI.IsNodeSchedulable(&node, nil) {
Copy link
Contributor

Choose a reason for hiding this comment

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

using IsNodeSchedulable with nil will always return true, so we can simply delete this "if" clause. But i suggest that we actually collect the modules that are not schedulable on the node at line 139, and then we just delete their labels at this line (169). This way it also means that we don't need the whole node-taints-tolerations loop again in the RemoveNodeReadyLabels function

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good idea

@TomerNewman TomerNewman force-pushed the feature/removing-kmodlabels-without-tolerations branch 2 times, most recently from c9603ee to 0b37a9a Compare December 9, 2024 07:34
@ybettan
Copy link
Contributor

ybettan commented Dec 9, 2024

/approve
/assign @yevgeny-shnaidman

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: TomerNewman, ybettan

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 Dec 9, 2024
@@ -128,14 +128,15 @@ func (r *NMCReconciler) Reconcile(ctx context.Context, req reconcile.Request) (r
}

errs := make([]error, 0, len(nmcObj.Spec.Modules)+len(nmcObj.Status.Modules))

var labelsToRemove []string
Copy link
Contributor

Choose a reason for hiding this comment

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

WDYT about changing the variable's name to readyLabelsToRemove

This change addresses kubernetes-sigs#940.
Kmod labels are now deleted only if the kernel
module does not have the appropriate tolerations for the taints on the node.
@TomerNewman TomerNewman force-pushed the feature/removing-kmodlabels-without-tolerations branch from 0b37a9a to 916bd69 Compare December 9, 2024 09:45
@yevgeny-shnaidman
Copy link
Contributor

LGTM by me
@ybettan please take a look , and if no further comments we can push

@ybettan ybettan added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 9, 2024
@k8s-ci-robot k8s-ci-robot merged commit e63298a into kubernetes-sigs:main Dec 9, 2024
22 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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. 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.

5 participants