diff --git a/operations/mimir/config.libsonnet b/operations/mimir/config.libsonnet index 3c4cf5453b6..6369513cd63 100644 --- a/operations/mimir/config.libsonnet +++ b/operations/mimir/config.libsonnet @@ -312,6 +312,30 @@ // These are the defaults. limits: $._config.overrides.extra_small_user, + // These are all the flags for the default limits. + distributorLimitsConfig: { + 'distributor.ingestion-rate-limit-strategy': 'global', + 'distributor.ingestion-rate-limit': $._config.limits.ingestion_rate, + 'distributor.ingestion-burst-size': $._config.limits.ingestion_burst_size, + }, + ingesterLimitsConfig: { + 'ingester.max-series-per-user': $._config.limits.max_series_per_user, + 'ingester.max-series-per-metric': $._config.limits.max_series_per_metric, + 'ingester.max-global-series-per-user': $._config.limits.max_global_series_per_user, + 'ingester.max-global-series-per-metric': $._config.limits.max_global_series_per_metric, + 'ingester.max-series-per-query': $._config.limits.max_series_per_query, + 'ingester.max-samples-per-query': $._config.limits.max_samples_per_query, + }, + rulerLimitsConfig: { + 'ruler.max-rules-per-rule-group': $._config.limits.ruler_max_rules_per_rule_group, + 'ruler.max-rule-groups-per-tenant': $._config.limits.ruler_max_rule_groups_per_tenant, + }, + compactorLimitsConfig: { + 'compactor.blocks-retention-period': $._config.limits.compactor_blocks_retention_period, + }, + + limitsConfig: self.distributorLimitsConfig + self.ingesterLimitsConfig + self.rulerLimitsConfig + self.compactorLimitsConfig, + overrides_configmap: 'overrides', overrides: { diff --git a/operations/mimir/distributor.libsonnet b/operations/mimir/distributor.libsonnet index 02c8767b51f..436c7fc8020 100644 --- a/operations/mimir/distributor.libsonnet +++ b/operations/mimir/distributor.libsonnet @@ -6,6 +6,7 @@ $._config.grpcConfig + $._config.ringConfig + $._config.distributorConfig + + $._config.distributorLimitsConfig + { target: 'distributor', @@ -29,10 +30,6 @@ 'server.grpc.keepalive.max-connection-age-grace': '5m', 'server.grpc.keepalive.max-connection-idle': '1m', - 'distributor.ingestion-rate-limit-strategy': 'global', - 'distributor.ingestion-rate-limit': $._config.limits.ingestion_rate, - 'distributor.ingestion-burst-size': $._config.limits.ingestion_burst_size, - // The ingestion rate global limit requires the distributors to form a ring. 'distributor.ring.consul.hostname': 'consul.%s.svc.cluster.local:8500' % $._config.namespace, 'distributor.ring.prefix': '', diff --git a/operations/mimir/ingester.libsonnet b/operations/mimir/ingester.libsonnet index e0753d843ee..3078db366bd 100644 --- a/operations/mimir/ingester.libsonnet +++ b/operations/mimir/ingester.libsonnet @@ -6,6 +6,7 @@ $._config.storageConfig + $._config.blocksStorageConfig + $._config.distributorConfig + // This adds the distributor ring flags to the ingester. + $._config.ingesterLimitsConfig + { target: 'ingester', @@ -24,12 +25,6 @@ // Limits config. 'ingester.max-chunk-idle': $._config.max_chunk_idle, - 'ingester.max-series-per-user': $._config.limits.max_series_per_user, - 'ingester.max-series-per-metric': $._config.limits.max_series_per_metric, - 'ingester.max-global-series-per-user': $._config.limits.max_global_series_per_user, - 'ingester.max-global-series-per-metric': $._config.limits.max_global_series_per_metric, - 'ingester.max-series-per-query': $._config.limits.max_series_per_query, - 'ingester.max-samples-per-query': $._config.limits.max_samples_per_query, 'runtime-config.file': '/etc/cortex/overrides.yaml', 'server.grpc-max-concurrent-streams': 10000, 'server.grpc-max-send-msg-size-bytes': 10 * 1024 * 1024, diff --git a/operations/mimir/ruler.libsonnet b/operations/mimir/ruler.libsonnet index dfb5727e9e7..c503defe08f 100644 --- a/operations/mimir/ruler.libsonnet +++ b/operations/mimir/ruler.libsonnet @@ -22,8 +22,6 @@ 'ruler.ring.consul.hostname': 'consul.%s.svc.cluster.local:8500' % $._config.namespace, // Limits - 'ruler.max-rules-per-rule-group': $._config.limits.ruler_max_rules_per_rule_group, - 'ruler.max-rule-groups-per-tenant': $._config.limits.ruler_max_rule_groups_per_tenant, 'server.grpc-max-send-msg-size-bytes': 10 * 1024 * 1024, 'server.grpc-max-recv-msg-size-bytes': 10 * 1024 * 1024, diff --git a/operations/mimir/tsdb.libsonnet b/operations/mimir/tsdb.libsonnet index 2a91f8b4d3b..1ce3c028563 100644 --- a/operations/mimir/tsdb.libsonnet +++ b/operations/mimir/tsdb.libsonnet @@ -144,6 +144,7 @@ $._config.grpcConfig + $._config.storageConfig + $._config.blocksStorageConfig + + $._config.compactorLimitsConfig + { target: 'compactor', @@ -162,7 +163,6 @@ // Limits config. 'runtime-config.file': '/etc/cortex/overrides.yaml', - 'compactor.blocks-retention-period': $._config.limits.compactor_blocks_retention_period, }, compactor_ports:: $.util.defaultPorts,