From 2378bf5a66ed05ce259f32f9d967e99550e8a4d9 Mon Sep 17 00:00:00 2001 From: Ryan Date: Fri, 4 Sep 2020 13:11:14 +0100 Subject: [PATCH 1/4] Ensure namespace is set on Statefulsets & Deployments for the following resources: - Distributor - Memcached - Querier - Query-frontend --- cortex/distributor.libsonnet | 1 + cortex/memcached.libsonnet | 1 + cortex/querier.libsonnet | 1 + cortex/query-frontend.libsonnet | 1 + 4 files changed, 4 insertions(+) diff --git a/cortex/distributor.libsonnet b/cortex/distributor.libsonnet index 24169840..7147fde6 100644 --- a/cortex/distributor.libsonnet +++ b/cortex/distributor.libsonnet @@ -54,6 +54,7 @@ distributor_deployment: deployment.new('distributor', 3, [$.distributor_container], $.distributor_deployment_labels) + + deployment.mixin.metadata.withNamespace($._config.namespace) + $.util.antiAffinity + $.util.configVolumeMount('overrides', '/etc/cortex'), diff --git a/cortex/memcached.libsonnet b/cortex/memcached.libsonnet index a7600c33..f7a7da29 100644 --- a/cortex/memcached.libsonnet +++ b/cortex/memcached.libsonnet @@ -13,6 +13,7 @@ memcached { self.memcached_container, self.memcached_exporter, ], []) + + statefulSet.mixin.metadata.withNamespace($._config.namespace) + statefulSet.mixin.spec.withServiceName(self.name) + $.util.antiAffinity, diff --git a/cortex/querier.libsonnet b/cortex/querier.libsonnet index 83d63845..c48272eb 100644 --- a/cortex/querier.libsonnet +++ b/cortex/querier.libsonnet @@ -54,6 +54,7 @@ querier_deployment: deployment.new('querier', $._config.querier.replicas, [$.querier_container], $.querier_deployment_labels) + + deployment.mixin.metadata.withNamespace($._config.namespace) + $.util.antiAffinity + $.util.configVolumeMount('overrides', '/etc/cortex') + $.storage_config_mixin, diff --git a/cortex/query-frontend.libsonnet b/cortex/query-frontend.libsonnet index d7358182..4b153a88 100644 --- a/cortex/query-frontend.libsonnet +++ b/cortex/query-frontend.libsonnet @@ -65,6 +65,7 @@ query_frontend_deployment: deployment.new('query-frontend', $._config.queryFrontend.replicas, [$.query_frontend_container]) + + deployment.mixin.metadata.withNamespace($._config.namespace) + $.util.configVolumeMount('overrides', '/etc/cortex') + $.util.antiAffinity + // inject storage schema in order to know what/how to shard From c5dd547798a0ed6229af14f82a11ba8be3815048 Mon Sep 17 00:00:00 2001 From: Ryan Date: Fri, 4 Sep 2020 13:13:45 +0100 Subject: [PATCH 2/4] Updated changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8ecdc3fc..7ae58794 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ * [CHANGE] Ingesters now default to running as `StatefulSet` with WAL enabled. It is controlled by the config `$._config.ingester_deployment_without_wal` which is `false` by default. Setting the config to `true` will yeild the old behaviour (stateless `Deployment` without WAL enabled). #72 * [CHANGE] We now allow queries that are 32 days long. For example, rate(metric[32d]). Before it was 31d. #173 * [BUGFIX] Add support the `local` ruler client type +* [BUGFIX] Ensure namespaces are set on all kubernetes resources ## 1.3.0 / 2020-08-21 From 8dfa94a96b7cbc9f7907a47f6f3062effd336607 Mon Sep 17 00:00:00 2001 From: Ryan Date: Fri, 4 Sep 2020 13:20:25 +0100 Subject: [PATCH 3/4] Fixed build not passing (removed whitespace at end of line) --- cortex/query-frontend.libsonnet | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cortex/query-frontend.libsonnet b/cortex/query-frontend.libsonnet index 4b153a88..57349466 100644 --- a/cortex/query-frontend.libsonnet +++ b/cortex/query-frontend.libsonnet @@ -65,7 +65,7 @@ query_frontend_deployment: deployment.new('query-frontend', $._config.queryFrontend.replicas, [$.query_frontend_container]) + - deployment.mixin.metadata.withNamespace($._config.namespace) + + deployment.mixin.metadata.withNamespace($._config.namespace) + $.util.configVolumeMount('overrides', '/etc/cortex') + $.util.antiAffinity + // inject storage schema in order to know what/how to shard From 075c074fd0b9389f921ee9ac977ab2e636072284 Mon Sep 17 00:00:00 2001 From: RyanW8 <62933917+RyanW8@users.noreply.github.com> Date: Mon, 7 Sep 2020 09:30:38 +0100 Subject: [PATCH 4/4] Update CHANGELOG.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Peter Štibraný --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 156e7b73..70391040 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,7 @@ * [CHANGE] Ingesters now default to running as `StatefulSet` with WAL enabled. It is controlled by the config `$._config.ingester_deployment_without_wal` which is `false` by default. Setting the config to `true` will yeild the old behaviour (stateless `Deployment` without WAL enabled). #72 * [CHANGE] We now allow queries that are 32 days long. For example, rate(metric[32d]). Before it was 31d. #173 * [BUGFIX] Add support the `local` ruler client type -* [BUGFIX] Ensure namespaces are set on all kubernetes resources +* [BUGFIX] Ensure namespaces are set on all kubernetes resources. #178 * [ENHANCEMENT] Enable support for HA in the Cortex Alertmanager #147 ## 1.3.0 / 2020-08-21