Skip to content

Commit

Permalink
Merge pull request #244 from gouthamve/customise-configmap
Browse files Browse the repository at this point in the history
Add option to customise the configmap name
  • Loading branch information
gouthamve authored Jan 12, 2021
2 parents 594e536 + c5b0192 commit 50c36f9
Show file tree
Hide file tree
Showing 11 changed files with 15 additions and 12 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* [ENHANCEMENT] Improved blocks storage observability: #237
- Cortex / Queries: added bucket index load operations and latency (available only when bucket index is enabled)
- Alerts: added "CortexBucketIndexNotUpdated" (bucket index only) and "CortexTenantHasPartialBlocks"
* [ENHANCEMENT] The name of the overrides configmap is now customisable via `$._config.overrides_configmap`. #244
* [BUGFIX] Honor configured `per_instance_label` in all panels. #239
* [BUGFIX] `CortexRequestLatency` alert now ignores long-running requests on query-scheduler. #242

Expand Down
4 changes: 3 additions & 1 deletion cortex/config.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,8 @@
// These are the defaults.
limits: $._config.overrides.extra_small_user,

overrides_configmap: 'overrides',

overrides: {
extra_small_user:: {
max_series_per_user: 0, // Disabled in favour of the max global limit
Expand Down Expand Up @@ -415,7 +417,7 @@
local configMap = $.core.v1.configMap,

overrides_config:
configMap.new('overrides') +
configMap.new($._config.overrides_configmap) +
configMap.withData({
'overrides.yaml': $.util.manifestYaml(
{
Expand Down
2 changes: 1 addition & 1 deletion cortex/distributor.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
distributor_deployment:
deployment.new('distributor', 3, [$.distributor_container], $.distributor_deployment_labels) +
$.util.antiAffinity +
$.util.configVolumeMount('overrides', '/etc/cortex'),
$.util.configVolumeMount($._config.overrides_configmap, '/etc/cortex'),

local service = $.core.v1.service,

Expand Down
2 changes: 1 addition & 1 deletion cortex/flusher-job-blocks.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,6 @@
job.mixin.spec.template.metadata.withLabels({ name: 'flusher' }) +
job.mixin.spec.template.spec.securityContext.withRunAsUser(0) +
job.mixin.spec.template.spec.withTerminationGracePeriodSeconds(300) +
$.util.configVolumeMount('overrides', '/etc/cortex') +
$.util.configVolumeMount($._config.overrides_configmap, '/etc/cortex') +
$.util.podPriority('high'),
}
2 changes: 1 addition & 1 deletion cortex/flusher-job.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@
job.mixin.spec.template.metadata.withLabels({ name: 'flusher' }) +
job.mixin.spec.template.spec.securityContext.withRunAsUser(0) +
job.mixin.spec.template.spec.withTerminationGracePeriodSeconds(300) +
$.util.configVolumeMount('overrides', '/etc/cortex') +
$.util.configVolumeMount($._config.overrides_configmap, '/etc/cortex') +
$.util.podPriority('high'),
}
4 changes: 2 additions & 2 deletions cortex/ingester.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
statefulSet.mixin.spec.template.spec.withTerminationGracePeriodSeconds(4800) +
statefulSet.mixin.spec.updateStrategy.withType('RollingUpdate') +
$.statefulset_storage_config_mixin +
$.util.configVolumeMount('overrides', '/etc/cortex') +
$.util.configVolumeMount($._config.overrides_configmap, '/etc/cortex') +
$.util.podPriority('high') +
$.util.antiAffinityStatefulSet
else null,
Expand All @@ -117,7 +117,7 @@
if $._config.ingester_deployment_without_wal then
deployment.new(name, 3, [$.ingester_container], $.ingester_deployment_labels) +
$.util.antiAffinity +
$.util.configVolumeMount('overrides', '/etc/cortex') +
$.util.configVolumeMount($._config.overrides_configmap, '/etc/cortex') +
deployment.mixin.metadata.withLabels({ name: name }) +
deployment.mixin.spec.withMinReadySeconds(60) +
deployment.mixin.spec.strategy.rollingUpdate.withMaxSurge(0) +
Expand Down
2 changes: 1 addition & 1 deletion cortex/overrides-exporter.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
local deployment = $.apps.v1.deployment,
overrides_exporter_deployment:
deployment.new(name, 1, [$.overrides_exporter_container], { name: name }) +
$.util.configVolumeMount('overrides', '/etc/cortex') +
$.util.configVolumeMount($._config.overrides_configmap, '/etc/cortex') +
$.util.configVolumeMount('overrides-presets', '/etc/cortex_presets') +
deployment.mixin.metadata.withLabels({ name: name }),

Expand Down
2 changes: 1 addition & 1 deletion cortex/querier.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
querier_deployment:
deployment.new('querier', $._config.querier.replicas, [$.querier_container], $.querier_deployment_labels) +
$.util.antiAffinity +
$.util.configVolumeMount('overrides', '/etc/cortex') +
$.util.configVolumeMount($._config.overrides_configmap, '/etc/cortex') +
$.storage_config_mixin,

local service = $.core.v1.service,
Expand Down
2 changes: 1 addition & 1 deletion cortex/query-frontend.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@

query_frontend_deployment:
deployment.new('query-frontend', $._config.queryFrontend.replicas, [$.query_frontend_container]) +
$.util.configVolumeMount('overrides', '/etc/cortex') +
$.util.configVolumeMount($._config.overrides_configmap, '/etc/cortex') +
$.util.antiAffinity +
// inject storage schema in order to know what/how to shard
if $._config.queryFrontend.sharded_queries_enabled then
Expand Down
2 changes: 1 addition & 1 deletion cortex/ruler.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
deployment.mixin.spec.strategy.rollingUpdate.withMaxUnavailable(1) +
deployment.mixin.spec.template.spec.withTerminationGracePeriodSeconds(600) +
$.util.antiAffinity +
$.util.configVolumeMount('overrides', '/etc/cortex') +
$.util.configVolumeMount($._config.overrides_configmap, '/etc/cortex') +
$.storage_config_mixin
else {},

Expand Down
4 changes: 2 additions & 2 deletions cortex/tsdb.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
// For this reason, we grant an high termination period (80 minutes).
statefulSet.mixin.spec.template.spec.withTerminationGracePeriodSeconds(4800) +
statefulSet.mixin.spec.updateStrategy.withType('RollingUpdate') +
$.util.configVolumeMount('overrides', '/etc/cortex') +
$.util.configVolumeMount($._config.overrides_configmap, '/etc/cortex') +
$.util.podPriority('high') +
$.util.antiAffinity +
// Parallelly scale up/down ingester instances instead of starting them
Expand Down Expand Up @@ -218,7 +218,7 @@
// rolled out one by one (the next pod will be rolled out once the previous is
// ready).
statefulSet.mixin.spec.withPodManagementPolicy('Parallel') +
$.util.configVolumeMount('overrides', '/etc/cortex'),
$.util.configVolumeMount($._config.overrides_configmap, '/etc/cortex'),

store_gateway_service:
$.util.serviceFor($.store_gateway_statefulset),
Expand Down

0 comments on commit 50c36f9

Please sign in to comment.