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

Enhance nfd-worker placement #31

Merged
merged 3 commits into from
Sep 25, 2020

Conversation

ArangoGutierrez
Copy link
Contributor

Enable NFD operator to deploy nfd-worker pods on nodes labeled other
than "node-role.kubernetes.io/worker"

Also: Fix clean-labels make target

Closes: #29
Closes: #30

@k8s-ci-robot k8s-ci-robot added do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Sep 23, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ArangoGutierrez

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 approved Indicates a PR has been approved by an approver from all required OWNERS files. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Sep 23, 2020
Enable NFD operator to deploy nfd-worker pods on nodes labeled other
than "node-role.kubernetes.io/worker"

Also: Fix clean-labels make target

Signed-off-by: Carlos Eduardo Arango Gutierrez <carangog@redhat.com>
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. label Sep 23, 2020
@ArangoGutierrez
Copy link
Contributor Author

/kind feature

@k8s-ci-robot k8s-ci-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Sep 23, 2020
Copy link
Contributor

@marquiz marquiz left a comment

Choose a reason for hiding this comment

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

Hmm, I guess I never totally understood the old nodeSelector 🤔 Do we really need some affinity? By default (in upstream Kubernetes at least) daemonset should be scheduled on on every schedulable node, right(?)

The Makefile fix makes sense in any case.

@ArangoGutierrez
Copy link
Contributor Author

Hmm, I guess I never totally understood the old nodeSelector thinking Do we really need some affinity? By default (in upstream Kubernetes at least) daemonset should be scheduled on on every schedulable node, right(?)

The Makefile fix makes sense in any case.

this PR affect only nfd-worker to be scheduled on non master nodes. by utilizing https://v1-16.docs.kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity.

I know we have #4 but that is for nfd-master (fix will come after this PR) , but this PR really target use cases where kubernetes "worker" nodes are being labelled something different than worker for different use cases, I have seen some users going for infra other for test and so on, but the current nodeSelector is failing to schedule nfd-worker on those.

By Using nodeAffinity we can better help jube-scheduler to deploy nfd-worker pods

@marquiz
Copy link
Contributor

marquiz commented Sep 24, 2020

Mm, I know how node affinity works. But again, why do we need node affinity for workers? Shouldn't we just let it run on all (schedulable) nodes?
https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/#running-pods-on-select-nodes

In some setups even master node might be configured to run regular workloads in which case this new affinity will prevent nfd-worker from running there.

@zvonkok
Copy link

zvonkok commented Sep 24, 2020

@marquiz There are several customers that apply taints to workers, since we do not know which taints, the NFD worker daemonset tolerates all taints, which means they can be also scheduled on masters.

For now we want to prevent NFD to be scheduled on masters but I have seen requests for labelling masters as well.

For now, tolerate all taints, and set an anti-affinity on the master. Let NFD worker be scheduled only on "any" worker.

@marquiz
Copy link
Contributor

marquiz commented Sep 24, 2020

For now, tolerate all taints, and set an anti-affinity on the master. Let NFD worker be scheduled only on "any" worker.

OK, that explains. This patch would make sense IF there were some tolerations added. But, currently there are none.

For now we want to prevent NFD to be scheduled on masters but I have seen requests for labelling masters as well.

Yet another configurability option for #19?

Co-authored-by: Markus Lehtonen <markus.lehtonen@intel.com>
Signed-off-by: Carlos Eduardo Arango Gutierrez <carangog@redhat.com>
@ArangoGutierrez
Copy link
Contributor Author

/label tide/merge-method-squash

@k8s-ci-robot k8s-ci-robot added the tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges. label Sep 25, 2020
Copy link
Contributor

@marquiz marquiz left a comment

Choose a reason for hiding this comment

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

Thanks @ArangoGutierrez ! Now this makes sense 😉

@marquiz
Copy link
Contributor

marquiz commented Sep 25, 2020

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 25, 2020
@k8s-ci-robot k8s-ci-robot merged commit e371c0b into kubernetes-sigs:master Sep 25, 2020
ArangoGutierrez added a commit to ArangoGutierrez/node-feature-discovery-operator that referenced this pull request Nov 13, 2020
After kubernetes-sigs#31 three node cluster, where all nodes will have the master and
worker(or node for vanilla clusters) labels are just getting the
nfd-master daemonset deployed. Since they have the master label, the NFD
workers will not be scheduled.

Discussion started in a downstream distribution of NFD:
openshift/cluster-nfd-operator#109

This Patch fix that adding support for master:worker type of nodes,
being used in edge deployments

Signed-off-by: Carlos Eduardo Arango Gutierrez <carangog@redhat.com>
ArangoGutierrez added a commit to ArangoGutierrez/node-feature-discovery-operator that referenced this pull request Nov 13, 2020
After kubernetes-sigs#31 three node cluster, where all nodes will have the master and
worker(or node for vanilla clusters) labels are just getting the
nfd-master daemonset deployed. Since they have the master label, the NFD
workers will not be scheduled.

Discussion started in a downstream distribution of NFD:
openshift/cluster-nfd-operator#109

This Patch fix that, by adding support for master:worker type of nodes,
modifying the nodeAffinity rules on the nfd-worker daemonSet to allow any node with the "node" label
(independent if it is a master also) to get scheduled

Signed-off-by: Carlos Eduardo Arango Gutierrez <carangog@redhat.com>
@ArangoGutierrez ArangoGutierrez mentioned this pull request Dec 4, 2020
14 tasks
courtneypacheco pushed a commit to courtneypacheco/node-feature-discovery-operator that referenced this pull request May 20, 2021
@ArangoGutierrez ArangoGutierrez deleted the nodeAffinity branch March 13, 2023 10:32
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/feature Categorizes issue or PR as related to a new feature. 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. tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

make clean-labels fails Enhance nfd-worker placement
4 participants