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

mimir-jsonnet: allow disabling ingester anti-affinity #1581

Merged
merged 5 commits into from
Mar 31, 2022

Conversation

colega
Copy link
Contributor

@colega colega commented Mar 31, 2022

What this PR does

While setting up Mimir on my personal toy-cluster of one node, I got stuck scheduling the ingesters as they have the anti-affinity rules by default and it can't be easily removed without redefining the statefulset. There are similar configs for distributor, querier, etc.,
so I just added another one, and documented it a little bit.

Which issue(s) this PR fixes or relates to

None

Checklist

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

While setting up Mimir on my personal toy-cluster of one node, I got
stuck scheduling the ingesters as they have the anti-affinity rules by
default and it can't be easily removed without redefining the
statefulset. There are similar configs for distributor, querier, etc.,
so I just added another one, and documented it a little bit.

Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com>
Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com>
@colega colega requested a review from a team March 31, 2022 09:17
Copy link
Collaborator

@pracucci pracucci left a comment

Choose a reason for hiding this comment

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

LGTM (as far as linter doesn't show any diff in compiled jsonnet).

@@ -95,7 +95,7 @@
statefulSet.mixin.spec.withPodManagementPolicy('Parallel') +
(if with_anti_affinity then $.util.antiAffinity else {}),

ingester_statefulset: self.newIngesterStatefulSet('ingester', $.ingester_container),
ingester_statefulset: self.newIngesterStatefulSet('ingester', $.ingester_container, !$._config.ingester_allow_multiple_replicas_on_same_node),
Copy link
Collaborator

Choose a reason for hiding this comment

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

You may also want to check it in newIngesterZoneStatefulSet().

Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com>
Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com>
@colega
Copy link
Contributor Author

colega commented Mar 31, 2022

Hmm, what's wrong with the cla check? It won't run 🤷

@@ -86,7 +86,7 @@
newIngesterZoneStatefulSet(zone, container)::
local name = 'ingester-zone-%s' % zone;

self.newIngesterStatefulSet(name, container, with_anti_affinity=false) +
self.newIngesterStatefulSet(name, container, with_anti_affinity=!$._config.ingester_allow_multiple_replicas_on_same_node) +
Copy link
Collaborator

Choose a reason for hiding this comment

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

Doh! This should always be false, because this function injects a different anti-affinity rule below (see spec+:). What I meant in the other comment is that we should inject the custom anti-affinity rule only if ingester_allow_multiple_replicas_on_same_node: false.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I should have paid more attention to that, thank you.

This should be the fix: 3d534a7

@pstibrany
Copy link
Member

pstibrany commented Mar 31, 2022

Had the same problem yesterday (with CLA check not running), it fixed itself after pushing an empty commit (git commit -m 'empty' --allow-empty && git push)

Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com>
@colega colega merged commit 3f09c89 into main Mar 31, 2022
@colega colega deleted the mimir-jsonnet-allow-multiple-ingesters-on-same-node branch March 31, 2022 10:55
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.

3 participants