From 8606684b0c3f0485f152c3d80f916ce7afa3301e Mon Sep 17 00:00:00 2001 From: Teddy Andrieux Date: Mon, 28 Feb 2022 16:11:57 +0100 Subject: [PATCH 1/2] tests: Fix test for specific service for Loki instance --- tests/post/steps/test_logging.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/post/steps/test_logging.py b/tests/post/steps/test_logging.py index b987860cfe..b408ea4a48 100644 --- a/tests/post/steps/test_logging.py +++ b/tests/post/steps/test_logging.py @@ -52,6 +52,11 @@ def test_logging_pipeline_is_working(host): pass +@scenario("../features/logging.feature", "We can access a specific Loki instance") +def test_instance_service(host): + pass + + # }}} # Given {{{ @@ -220,7 +225,7 @@ def _check_alert_exists(): ) -@then("the Loki API is available through Service '{service}'") +@then(parsers.parse("the Loki API is available through Service '{service}'")) def then_check_loki_api(k8s_client, service): check_loki_api(k8s_client, service) From 6c8fa4a57e4dba89b9b16a7d76604b0f7698d858 Mon Sep 17 00:00:00 2001 From: Teddy Andrieux Date: Mon, 28 Feb 2022 16:15:29 +0100 Subject: [PATCH 2/2] salt: Do not longer remove Loki service instance post-upgrade Fix a bug that deletes the Loki service instance post-upgrade when it shouldn't. This Loki service instance and grafana datasources are deployed to mitigate a Loki limitation when working with multi instances See: abc293a7d78c3a1a83db9dfcfe5d1624cab8b2ab See: #3681 --- CHANGELOG.md | 4 ++++ buildchain/buildchain/salt_tree.py | 1 - .../addons/logging/loki/post-upgrade.sls | 17 ----------------- salt/metalk8s/orchestrate/upgrade/post.sls | 1 - 4 files changed, 4 insertions(+), 19 deletions(-) delete mode 100644 salt/metalk8s/addons/logging/loki/post-upgrade.sls diff --git a/CHANGELOG.md b/CHANGELOG.md index 30ccf8039e..4a04a7ef71 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ ignore the Ingress object that does not have the class explicitly set (PR[#3704](https://github.com/scality/metalk8s/pull/3704)) +- Fix a bug during the upgrade that remove the Loki instance services used by + Grafana datasources + (PR[#3717](https://github.com/scality/metalk8s/pull/3717)) + ## Release 2.11.2 ### Bug fixes diff --git a/buildchain/buildchain/salt_tree.py b/buildchain/buildchain/salt_tree.py index f105aff10f..0a8230b49b 100644 --- a/buildchain/buildchain/salt_tree.py +++ b/buildchain/buildchain/salt_tree.py @@ -336,7 +336,6 @@ def task(self) -> types.TaskDict: Path("salt/metalk8s/addons/logging/loki/deployed/loki-configuration-secret.sls"), Path("salt/metalk8s/addons/logging/loki/deployed/service.sls"), Path("salt/metalk8s/addons/logging/loki/deployed/service-configuration.sls"), - Path("salt/metalk8s/addons/logging/loki/post-upgrade.sls"), Path("salt/metalk8s/addons/prometheus-adapter/deployed/chart.sls"), Path("salt/metalk8s/addons/prometheus-adapter/deployed/init.sls"), Path("salt/metalk8s/addons/prometheus-operator/macros.j2"), diff --git a/salt/metalk8s/addons/logging/loki/post-upgrade.sls b/salt/metalk8s/addons/logging/loki/post-upgrade.sls deleted file mode 100644 index 10b29ddc38..0000000000 --- a/salt/metalk8s/addons/logging/loki/post-upgrade.sls +++ /dev/null @@ -1,17 +0,0 @@ -{%- set loki_defaults = salt.slsutil.renderer( - 'salt://metalk8s/addons/logging/loki/config/loki.yaml', saltenv=saltenv - ) -%} -{%- set loki = salt.metalk8s_service_configuration.get_service_conf( - 'metalk8s-logging', 'metalk8s-loki-config', loki_defaults - ) -%} - -{%- for index in range(loki.spec.deployment.replicas) %} -Delete old loki-{{ index }} service object: - metalk8s_kubernetes.object_absent: - - apiVersion: v1 - - kind: Service - - name: loki-{{ index }} - - namespace: metalk8s-logging -{%- endfor %} diff --git a/salt/metalk8s/orchestrate/upgrade/post.sls b/salt/metalk8s/orchestrate/upgrade/post.sls index 7288603666..58f3b7a59a 100644 --- a/salt/metalk8s/orchestrate/upgrade/post.sls +++ b/salt/metalk8s/orchestrate/upgrade/post.sls @@ -2,5 +2,4 @@ include: - metalk8s.addons.prometheus-operator.post-upgrade - - metalk8s.addons.logging.loki.post-upgrade - metalk8s.addons.ui.post-upgrade