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

Jsonnet: add distributor_node_affinity_matchers setting support #6782

Merged
merged 1 commit into from
Nov 30, 2023

Conversation

pracucci
Copy link
Collaborator

@pracucci pracucci commented Nov 30, 2023

What this PR does

As part of my on-going work to deploy distributors in multi-AZ, I need an easy way to configure node affinity rules. In this PR I'm proposing to add distributor_node_affinity_matchers so that different jsonnet files can append to it, and then the matchers are materialised by newDistributorDeployment().

In this PR I'm doing it only for distributors, but if experiment will be successful we can do it for all components.

The test I've added can be compared against test-defaults-generated.yaml:

$ diff operations/mimir-tests/test-defaults-generated.yaml operations/mimir-tests/test-node-selector-and-affinity-generated.yaml

434a435,448
>       affinity:
>         nodeAffinity:
>           requiredDuringSchedulingIgnoredDuringExecution:
>             nodeSelectorTerms:
>             - matchExpressions:
>               - key: topology.kubernetes.io/region
>                 operator: In
>                 values:
>                 - us-east-1
>               - key: topology.kubernetes.io/zone
>                 operator: In
>                 values:
>                 - us-east-1a
>                 - us-east-1b
490a505,506
>       nodeSelector:
>         workload: mimir
585a602,603
>       nodeSelector:
>         workload: mimir

... many more repetitions of the nodeSelector ...

Which issue(s) this PR fixes or relates to

N/A

Checklist

  • Tests updated.
  • Documentation added.
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX].
  • about-versioning.md updated with experimental features.

Signed-off-by: Marco Pracucci <marco@pracucci.com>
@pracucci pracucci marked this pull request as ready for review November 30, 2023 12:07
@pracucci pracucci requested a review from a team as a code owner November 30, 2023 12:07
Copy link
Contributor

@dimitarvdimitrov dimitarvdimitrov left a comment

Choose a reason for hiding this comment

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

LGTM, thank you

@pracucci pracucci enabled auto-merge (squash) November 30, 2023 12:09
@pracucci pracucci merged commit 2f7512d into main Nov 30, 2023
28 checks passed
@pracucci pracucci deleted the jsonnet-distributor-node-affinity-matchers branch November 30, 2023 12:15
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.

None yet

2 participants