Skip to content
This repository was archived by the owner on Apr 28, 2025. It is now read-only.

Commit b3274ea

Browse files
committed
Add option to disable anti-affinity in newIngesterStatefulSet()
Signed-off-by: Marco Pracucci <marco@pracucci.com>
1 parent eb11774 commit b3274ea

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

cortex/tsdb.libsonnet

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101
'ingester.tokens-file-path': '/data/tokens',
102102
},
103103

104-
newIngesterStatefulSet(name, container)::
104+
newIngesterStatefulSet(name, container, with_anti_affinity=true)::
105105
statefulSet.new(name, 3, [
106106
container + $.core.v1.container.withVolumeMountsMixin([
107107
volumeMount.new('ingester-data', '/data'),
@@ -119,12 +119,12 @@
119119
statefulSet.mixin.spec.updateStrategy.withType('RollingUpdate') +
120120
$.util.configVolumeMount($._config.overrides_configmap, '/etc/cortex') +
121121
$.util.podPriority('high') +
122-
$.util.antiAffinity +
123122
// Parallelly scale up/down ingester instances instead of starting them
124123
// one by one. This does NOT affect rolling updates: they will continue to be
125124
// rolled out one by one (the next pod will be rolled out once the previous is
126125
// ready).
127-
statefulSet.mixin.spec.withPodManagementPolicy('Parallel'),
126+
statefulSet.mixin.spec.withPodManagementPolicy('Parallel') +
127+
(if with_anti_affinity then $.util.antiAffinity else {}),
128128

129129
ingester_statefulset: self.newIngesterStatefulSet('ingester', $.ingester_container),
130130

0 commit comments

Comments
 (0)