From baff3b454d5219898caf052471910ef87c7898f3 Mon Sep 17 00:00:00 2001 From: Goutham Veeramachaneni Date: Thu, 2 Sep 2021 13:01:00 +0200 Subject: [PATCH] Add overrides to compactor Signed-off-by: Goutham Veeramachaneni --- CHANGELOG.md | 1 + cortex/config.libsonnet | 3 +++ cortex/tsdb.libsonnet | 7 ++++++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c8209cfb..a2f9f46d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,7 @@ * [CHANGE] Decreased `-server.grpc-max-concurrent-streams` from 100k to 10k. #369 * [CHANGE] Decreased blocks storage ingesters graceful termination period from 80m to 20m. #369 * [CHANGE] Changed default `job_names` for query-frontend, query-scheduler and querier to match custom deployments too. #376 +* [ENHANCEMENT] Add overrides config to compactor. This allows setting retention configs per user. #386 * [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 * [ENHANCEMENT] Cortex-mixin: Include `cortex-gw-internal` naming variation in default `gateway` job names. #328 * [ENHANCEMENT] Ruler dashboard: added object storage metrics. #354 diff --git a/cortex/config.libsonnet b/cortex/config.libsonnet index f4ad8310..3c4cf545 100644 --- a/cortex/config.libsonnet +++ b/cortex/config.libsonnet @@ -332,6 +332,9 @@ // 300 rules ruler_max_rules_per_rule_group: 15, ruler_max_rule_groups_per_tenant: 20, + + // No retention for now. + compactor_blocks_retention_period: 0, }, medium_small_user:: { diff --git a/cortex/tsdb.libsonnet b/cortex/tsdb.libsonnet index 1c77abd9..2a91f8b4 100644 --- a/cortex/tsdb.libsonnet +++ b/cortex/tsdb.libsonnet @@ -159,6 +159,10 @@ 'compactor.ring.store': 'consul', 'compactor.ring.consul.hostname': 'consul.%s.svc.cluster.local:8500' % $._config.namespace, 'compactor.ring.prefix': '', + + // Limits config. + 'runtime-config.file': '/etc/cortex/overrides.yaml', + 'compactor.blocks-retention-period': $._config.limits.compactor_blocks_retention_period, }, compactor_ports:: $.util.defaultPorts, @@ -187,7 +191,8 @@ // one by one. This does NOT affect rolling updates: they will continue to be // rolled out one by one (the next pod will be rolled out once the previous is // ready). - statefulSet.mixin.spec.withPodManagementPolicy('Parallel'), + statefulSet.mixin.spec.withPodManagementPolicy('Parallel') + + $.util.configVolumeMount($._config.overrides_configmap, '/etc/cortex'), compactor_statefulset: $.newCompactorStatefulSet('compactor', $.compactor_container),