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

Allow daemonset plugins running on subset of nodes #990

Merged
merged 1 commit into from
Nov 12, 2019
Merged

Allow daemonset plugins running on subset of nodes #990

merged 1 commit into from
Nov 12, 2019

Conversation

johnSchnake
Copy link
Contributor

@johnSchnake johnSchnake commented Nov 11, 2019

What this PR does / why we need it:
For daemonsets, node affinity can be set to limit/select the nodes
which the daemonset will run on. Since this is a native k8s feature
we should support it.

However, we use 'node-plugin' as a key in a few places which need
to understand that not every node will be considered.

The upstream logic for this node selection is in the core scheduling
packages and not readily consumable as a module. As a result, the
most reasonable path forward is to implement a small bit of the
desired functionality on our end.

For now, we just care about the RequiredDuringSchedulingIgnoredDuringExecution
field and only for node labels. This allows picking out nodes based on
labels that may satisfy most use cases.

Which issue(s) this PR fixes
Fixes #988

Special notes for your reviewer:

Release note:

Daemonset plugins may now specify node affinity in their podSpec without extraneous errors. Until now, this could be specified but Sonobuoy would record errors due to "missing" plugins on the non-targeted nodes. Currently support In/NotIn/Exists/DoesNotExists operators only.

@johnSchnake johnSchnake requested a review from zubron November 11, 2019 17:04
@johnSchnake
Copy link
Contributor Author

I manually tested this slightly with just a DoesNotExist case to run a plugin just on my worker nodes and it worked well. It should be quite easy to test these functions.

@johnSchnake johnSchnake changed the title WIP Ds with affinity WIP Daemonsets running on subset of nodes Nov 11, 2019
For daemonsets, node affinity can be set to limit/select the nodes
which the daemonset will run on. Since this is a native k8s feature
we should support it.

However, we use 'node-plugin' as a key in a few places which need
to understand that not every node will be considered.

The upstream logic for this node selection is in the core scheduling
packages and not readily consumable as a module. As a result, the
most reasonable path forward is to implement a small bit of the
desired functionality on our end.

For now, we just care about the RequiredDuringSchedulingIgnoredDuringExecution
field and only for node labels. This allows picking out nodes based on
labels which may satisfy most use cases.

Fixes #988

Signed-off-by: John Schnake <[email protected]>
@johnSchnake johnSchnake changed the title WIP Daemonsets running on subset of nodes Allow daemonset plugins running on subset of nodes Nov 12, 2019
Copy link
Contributor

@zubron zubron left a comment

Choose a reason for hiding this comment

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

Thanks, @johnSchnake! Especially for adding those test cases :)

@johnSchnake johnSchnake merged commit c5ad70d into vmware-tanzu:master Nov 12, 2019
@johnSchnake johnSchnake deleted the dsWithAffinity branch November 12, 2019 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve daemonset monitoring logic
2 participants