Skip to content

Commit a70c931

Browse files
committed
Upstream some config improvements
Signed-off-by: Marco Pracucci <[email protected]>
1 parent b2bd8a4 commit a70c931

File tree

7 files changed

+21
-7
lines changed

7 files changed

+21
-7
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@
4040
* [CHANGE] Split `cortex_api` recording rule group into three groups. This is a workaround for large clusters where this group can become slow to evaluate. #401
4141
* [CHANGE] Increased `CortexIngesterReachingSeriesLimit` warning threshold from 70% to 80% and critical threshold from 85% to 90%. #404
4242
* [CHANGE] Rename ruler_s3_bucket_name and ruler_gcs_bucket_name to ruler_storage_bucket_name: #415
43+
* [CHANGE] Fine-tuned rolling update policy for distributor, querier, query-frontend, query-scheduler. #420
44+
* [CHANGE] Increased memcached-metadata max connections from 4k to 16k. #420
45+
* [CHANGE] Disabled step alignment in query-frontend to be compliant with PromQL. #420
46+
* [CHANGE] Do not limit compactor CPU and request a number of cores equal to the configured concurrency. #420
4347
* [ENHANCEMENT] Add overrides config to compactor. This allows setting retention configs per user. #386
4448
* [ENHANCEMENT] cortex-mixin: Make `cluster_namespace_deployment:kube_pod_container_resource_requests_{cpu_cores,memory_bytes}:sum` backwards compatible with `kube-state-metrics` v2.0.0. #317
4549
* [ENHANCEMENT] Cortex-mixin: Include `cortex-gw-internal` naming variation in default `gateway` job names. #328

cortex/distributor.libsonnet

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@
5757
distributor_deployment:
5858
deployment.new('distributor', 3, [$.distributor_container], $.distributor_deployment_labels) +
5959
(if $._config.cortex_distributor_allow_multiple_replicas_on_same_node then {} else $.util.antiAffinity) +
60-
$.util.configVolumeMount($._config.overrides_configmap, '/etc/cortex'),
60+
$.util.configVolumeMount($._config.overrides_configmap, '/etc/cortex') +
61+
deployment.mixin.spec.strategy.rollingUpdate.withMaxSurge(5) +
62+
deployment.mixin.spec.strategy.rollingUpdate.withMaxUnavailable(1),
6163

6264
local service = $.core.v1.service,
6365

cortex/memcached.libsonnet

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ memcached {
6565
$.memcached {
6666
name: 'memcached-metadata',
6767
max_item_size: '%dm' % [$._config.memcached_metadata_max_item_size_mb],
68-
connection_limit: 4096,
68+
connection_limit: 16384,
6969

7070
// Metadata cache doesn't need much memory.
7171
memory_limit_mb: 512,

cortex/querier.libsonnet

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@
5858
deployment.new(name, $._config.querier.replicas, [container], $.querier_deployment_labels) +
5959
(if $._config.cortex_querier_allow_multiple_replicas_on_same_node then {} else $.util.antiAffinity) +
6060
$.util.configVolumeMount($._config.overrides_configmap, '/etc/cortex') +
61+
deployment.mixin.spec.strategy.rollingUpdate.withMaxSurge(5) +
62+
deployment.mixin.spec.strategy.rollingUpdate.withMaxUnavailable(1) +
6163
$.storage_config_mixin,
6264

6365
querier_deployment:

cortex/query-frontend.libsonnet

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
'querier.split-queries-by-interval': '24h',
1818

1919
// Cache query results.
20-
'querier.align-querier-with-step': true,
20+
'querier.align-querier-with-step': false,
2121
'querier.cache-results': true,
2222
'frontend.memcached.hostname': 'memcached-frontend.%s.svc.cluster.local' % $._config.namespace,
2323
'frontend.memcached.service': 'memcached-client',
@@ -52,7 +52,9 @@
5252
newQueryFrontendDeployment(name, container)::
5353
deployment.new(name, $._config.queryFrontend.replicas, [container]) +
5454
$.util.configVolumeMount($._config.overrides_configmap, '/etc/cortex') +
55-
(if $._config.cortex_query_frontend_allow_multiple_replicas_on_same_node then {} else $.util.antiAffinity),
55+
(if $._config.cortex_query_frontend_allow_multiple_replicas_on_same_node then {} else $.util.antiAffinity) +
56+
deployment.mixin.spec.strategy.rollingUpdate.withMaxSurge(1) +
57+
deployment.mixin.spec.strategy.rollingUpdate.withMaxUnavailable(1),
5658

5759
query_frontend_deployment: self.newQueryFrontendDeployment('query-frontend', $.query_frontend_container),
5860

cortex/query-scheduler.libsonnet

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@
2525
newQuerySchedulerDeployment(name, container)::
2626
deployment.new(name, 2, [container]) +
2727
$.util.configVolumeMount('overrides', '/etc/cortex') +
28-
$.util.antiAffinity,
28+
$.util.antiAffinity +
29+
// Do not run more query-schedulers than expected.
30+
deployment.mixin.spec.strategy.rollingUpdate.withMaxSurge(0) +
31+
deployment.mixin.spec.strategy.rollingUpdate.withMaxUnavailable(1),
2932

3033
query_scheduler_deployment: if !$._config.query_scheduler_enabled then {} else
3134
self.newQuerySchedulerDeployment('query-scheduler', $.query_scheduler_container),

cortex/tsdb.libsonnet

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,9 @@
172172
container.withPorts($.compactor_ports) +
173173
container.withArgsMixin($.util.mapToFlags($.compactor_args)) +
174174
container.withVolumeMountsMixin([volumeMount.new('compactor-data', '/data')]) +
175-
$.util.resourcesRequests('1', '6Gi') +
176-
$.util.resourcesLimits($._config.cortex_compactor_max_concurrency, '6Gi') +
175+
// Do not limit compactor CPU and request enough cores to honor configured max concurrency.
176+
$.util.resourcesRequests($._config.cortex_compactor_max_concurrency, '6Gi') +
177+
$.util.resourcesLimits(null, '6Gi') +
177178
$.util.readinessProbe +
178179
$.jaeger_mixin,
179180

0 commit comments

Comments
 (0)