-
Notifications
You must be signed in to change notification settings - Fork 247
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
Allow optionally setting node taints defined on the NodeFeatureRule CR #910
Conversation
✅ Deploy Preview for kubernetes-sigs-nfd ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
Ops, seems I'm behind the master. I'll rebase. Actually I missed to the part where taints are deleted based on the deletion of the NodeFeatureRule CR or the specific taints on the CR (will add it shortly). |
20e44ec
to
069ebee
Compare
/hold |
2c6ed87
to
f100b61
Compare
/cc @marquiz |
/hold cancel |
/test pull-node-feature-discovery-build-image-cross-generic |
f100b61
to
9e42d04
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @fmuyassarov! I took a first quick pass (incomplete, not even going through all the changes, yet) and this looks really good already.
One suggestion/ask: could you submit the package renames
- whatever "k8s.io/api/core/v1"
+ corev1 "k8s.io/api/core/v1"
and other possible "beautifying" as separate PR(s). This will greatly reduce the "noise" in this PR and make review easier
BTW, now that #848 is in, we should also add some e2e coverage. But that can be done in a separate PR (and tracked in a separate issue), imo |
Yep, I'm on it now 😊 |
9e42d04
to
a990e1b
Compare
Extend current E2E tests to check tainting feature of nfd implemented in kubernetes-sigs#910 Signed-off-by: Feruzjon Muyassarov <[email protected]>
Extend NodeFeatureRule Spec with taints field to allow users to specify the list of the taints they want to be set on the node if rule matches. Signed-off-by: Feruzjon Muyassarov <[email protected]>
This commits extends NFD master code to support adding node taints from NodeFeatureRule CR. We also introduce a new annotation for taints which helps to identify if the taint set on node is owned by NFD or not. When user deletes the taint entry from NodeFeatureRule CR, NFD will remove the taint from the node. But to avoid accidental deletion of taints not owned by the NFD, it needs to know the owner. Keeping track of NFD set taints in the annotation can be used during the filtering of the owner. Also enable-taints flag is added to allow users opt in/out for node tainting feature. The flag takes precedence over taints defined in NodeFeatureRule CR. In other words, if enbale-taints is set to false(disabled) and user still defines taints on the CR, NFD will ignore those taints and skip them from setting on the node. Signed-off-by: Feruzjon Muyassarov <[email protected]>
@fmuyassarov please rebase |
Signed-off-by: Feruzjon Muyassarov <[email protected]>
6fcc0f0
to
984a3de
Compare
done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thx @fmuyassarov
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ArangoGutierrez, fmuyassarov, marquiz 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 |
Extend current E2E tests to check tainting feature of nfd implemented in kubernetes-sigs#910 Signed-off-by: Feruzjon Muyassarov <[email protected]>
Extend current E2E tests to check tainting feature of nfd implemented in kubernetes-sigs#910 Signed-off-by: Feruzjon Muyassarov <[email protected]>
Extend current E2E tests to check tainting feature of nfd implemented in kubernetes-sigs#910 Signed-off-by: Feruzjon Muyassarov <[email protected]>
Extend current E2E tests to check tainting feature of nfd implemented in kubernetes-sigs#910 Signed-off-by: Feruzjon Muyassarov <[email protected]>
Extend current E2E tests to check tainting feature of nfd implemented in kubernetes-sigs#910 Signed-off-by: Feruzjon Muyassarov <[email protected]>
Extend current E2E tests to check tainting feature of nfd implemented in kubernetes-sigs#910 Signed-off-by: Feruzjon Muyassarov <[email protected]>
Extend current E2E tests to check tainting feature of nfd implemented in kubernetes-sigs#910 Signed-off-by: Feruzjon Muyassarov <[email protected]>
Extend current E2E tests to check tainting feature of nfd implemented in kubernetes-sigs#910 Signed-off-by: Feruzjon Muyassarov <[email protected]>
Extend current E2E tests to check tainting feature of nfd implemented in kubernetes-sigs#910 Signed-off-by: Feruzjon Muyassarov <[email protected]>
Extend current E2E tests to check tainting feature of nfd implemented in kubernetes-sigs#910 Signed-off-by: Feruzjon Muyassarov <[email protected]>
This commit adds an argument to updateNodeFeatures method for receiving client argument, which currently gets initialized within the method itself. This is a minor improvement for kubernetes-sigs/node-feature-discovery#910. Ref:kubernetes-sigs/node-feature-discovery#910 (comment) Signed-off-by: Feruzjon Muyassarov <[email protected]>
Extend current E2E tests to check tainting feature of nfd implemented in kubernetes-sigs/node-feature-discovery#910 Signed-off-by: Feruzjon Muyassarov <[email protected]>
Extend current E2E tests to check tainting feature of nfd implemented in kubernetes-sigs#910 Signed-off-by: Feruzjon Muyassarov <[email protected]>
This PR enables setting node taints defined on NodeFeatureRule CR. User can
define a list of taints under spec.rule of the CR as in this example:
The only allowed values for the effect are
NoExecute
,NoSchedule
,PrefereNoSchedule
(following k8s). By default this feature is disabled and enabling it requires explicitly setting
--enable-taints
flag true. Even if there are taints defined in the NodeFeatureRule CR and therule matches, taints will not be set on the node until flag is enabled.
NFD master updates the node object based on the addition/removal of taints in the CR.
Deleting the CR results in deletion of the taints too.
nfd.node.kubernetes.io/taints
annotationis added to keep track of taints. The value of the new annotation is a list of taints in the format
of
nfd.node.kubernetes.io/taints: "<key>=<value>:<effect>,<key>=<value>:<effect>"
.Fixes: #540