Skip to content

Commit b2bd8a4

Browse files
authored
Merge pull request grafana#418 from grafana/add-options-to-disable-anti-affinity
Add options to disable anti-affinity
2 parents 248eb8c + 7af10f1 commit b2bd8a4

File tree

6 files changed

+15
-4
lines changed

6 files changed

+15
-4
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,11 @@
7979
* [ENHANCEMENT] Use alertmanager jobname for alertmanager dashboard panels #411
8080
* [ENHANCEMENT] Added `CortexDistributorReachingInflightPushRequestLimit` alert. #408
8181
* [ENHANCEMENT] Define Azure object storage ruler args. #416
82+
* [ENHANCEMENT] Added the following config options to allow to schedule multiple replicas of the same service on the same node: #418
83+
* `cortex_distributor_allow_multiple_replicas_on_same_node`
84+
* `cortex_ruler_allow_multiple_replicas_on_same_node`
85+
* `cortex_querier_allow_multiple_replicas_on_same_node`
86+
* `cortex_query_frontend_allow_multiple_replicas_on_same_node`
8287
* [BUGFIX] Fixed `CortexIngesterHasNotShippedBlocks` alert false positive in case an ingester instance had ingested samples in the past, then no traffic was received for a long period and then it started receiving samples again. #308
8388
* [BUGFIX] Alertmanager: fixed `--alertmanager.cluster.peers` CLI flag passed to alertmanager when HA is enabled. #329
8489
* [BUGFIX] Fixed `CortexInconsistentRuntimeConfig` metric. #335

cortex/config.libsonnet

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@
2020
// 2. Ensure ingester ID is preserved during rollouts
2121
unregister_ingesters_on_shutdown: true,
2222

23+
// Controls whether multiple pods for the same service can be scheduled on the same node.
24+
cortex_distributor_allow_multiple_replicas_on_same_node: false,
25+
cortex_ruler_allow_multiple_replicas_on_same_node: false,
26+
cortex_querier_allow_multiple_replicas_on_same_node: false,
27+
cortex_query_frontend_allow_multiple_replicas_on_same_node: false,
28+
2329
// schema is used to generate the storage schema yaml file used by
2430
// the Cortex chunks storage:
2531
// - More information: https://github.com/cortexproject/cortex/pull/1072

cortex/distributor.libsonnet

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656

5757
distributor_deployment:
5858
deployment.new('distributor', 3, [$.distributor_container], $.distributor_deployment_labels) +
59-
$.util.antiAffinity +
59+
(if $._config.cortex_distributor_allow_multiple_replicas_on_same_node then {} else $.util.antiAffinity) +
6060
$.util.configVolumeMount($._config.overrides_configmap, '/etc/cortex'),
6161

6262
local service = $.core.v1.service,

cortex/querier.libsonnet

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656

5757
newQuerierDeployment(name, container)::
5858
deployment.new(name, $._config.querier.replicas, [container], $.querier_deployment_labels) +
59-
$.util.antiAffinity +
59+
(if $._config.cortex_querier_allow_multiple_replicas_on_same_node then {} else $.util.antiAffinity) +
6060
$.util.configVolumeMount($._config.overrides_configmap, '/etc/cortex') +
6161
$.storage_config_mixin,
6262

cortex/query-frontend.libsonnet

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
newQueryFrontendDeployment(name, container)::
5353
deployment.new(name, $._config.queryFrontend.replicas, [container]) +
5454
$.util.configVolumeMount($._config.overrides_configmap, '/etc/cortex') +
55-
$.util.antiAffinity,
55+
(if $._config.cortex_query_frontend_allow_multiple_replicas_on_same_node then {} else $.util.antiAffinity),
5656

5757
query_frontend_deployment: self.newQueryFrontendDeployment('query-frontend', $.query_frontend_container),
5858

cortex/ruler.libsonnet

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
deployment.mixin.spec.strategy.rollingUpdate.withMaxSurge(0) +
5555
deployment.mixin.spec.strategy.rollingUpdate.withMaxUnavailable(1) +
5656
deployment.mixin.spec.template.spec.withTerminationGracePeriodSeconds(600) +
57-
$.util.antiAffinity +
57+
(if $._config.cortex_ruler_allow_multiple_replicas_on_same_node then {} else $.util.antiAffinity) +
5858
$.util.configVolumeMount($._config.overrides_configmap, '/etc/cortex') +
5959
$.storage_config_mixin
6060
else {},

0 commit comments

Comments
 (0)