From 96f9dd1377a140b4a9a128fc6ad3f4e33f8d29a9 Mon Sep 17 00:00:00 2001 From: Ashwanth Goli Date: Wed, 25 Oct 2023 12:42:01 +0530 Subject: [PATCH 1/5] ksonnet: do not deploy table manager when shipper is enabled --- production/ksonnet/loki/loki.libsonnet | 3 ++- production/ksonnet/loki/table-manager.libsonnet | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/production/ksonnet/loki/loki.libsonnet b/production/ksonnet/loki/loki.libsonnet index 199fb9e757f6d..ad0489a69cd3f 100644 --- a/production/ksonnet/loki/loki.libsonnet +++ b/production/ksonnet/loki/loki.libsonnet @@ -9,7 +9,6 @@ (import 'distributor.libsonnet') + (import 'ingester.libsonnet') + (import 'querier.libsonnet') + -(import 'table-manager.libsonnet') + (import 'query-frontend.libsonnet') + (import 'ruler.libsonnet') + @@ -27,6 +26,8 @@ // BoltDB and TSDB Shipper support. Anything that modifies the compactor must be imported after this. (import 'shipper.libsonnet') + +(import 'table-manager.libsonnet') + + // Multi-zone ingester related config (import 'multi-zone.libsonnet') + diff --git a/production/ksonnet/loki/table-manager.libsonnet b/production/ksonnet/loki/table-manager.libsonnet index 16ffb97e3802f..cea24b67b977c 100644 --- a/production/ksonnet/loki/table-manager.libsonnet +++ b/production/ksonnet/loki/table-manager.libsonnet @@ -17,7 +17,7 @@ local k = import 'ksonnet-util/kausal.libsonnet'; 'bigtable.table-cache.enabled': true, }, - table_manager_container:: + table_manager_container:: if $._config.using_shipper_store then {} else container.new('table-manager', $._images.tableManager) + container.withPorts($.util.defaultPorts) + container.withArgsMixin(k.util.mapToFlags($.table_manager_args)) + @@ -31,11 +31,11 @@ local k = import 'ksonnet-util/kausal.libsonnet'; local deployment = k.apps.v1.deployment, - table_manager_deployment: + table_manager_deployment: if $._config.using_shipper_store then {} else deployment.new('table-manager', 1, [$.table_manager_container]) + $.config_hash_mixin + k.util.configVolumeMount('loki', '/etc/loki/config'), - table_manager_service: + table_manager_service: if $._config.using_shipper_store then {} else k.util.serviceFor($.table_manager_deployment, $._config.service_ignored_labels), } From 0f535abc37ab1b896f110827445066e97d6d0b43 Mon Sep 17 00:00:00 2001 From: Ashwanth Goli Date: Wed, 25 Oct 2023 12:47:43 +0530 Subject: [PATCH 2/5] fixup! ksonnet: do not deploy table manager when shipper is enabled --- production/ksonnet/loki/table-manager.libsonnet | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/production/ksonnet/loki/table-manager.libsonnet b/production/ksonnet/loki/table-manager.libsonnet index cea24b67b977c..66b6bd5246c46 100644 --- a/production/ksonnet/loki/table-manager.libsonnet +++ b/production/ksonnet/loki/table-manager.libsonnet @@ -17,7 +17,7 @@ local k = import 'ksonnet-util/kausal.libsonnet'; 'bigtable.table-cache.enabled': true, }, - table_manager_container:: if $._config.using_shipper_store then {} else + table_manager_container:: if !$._config.using_shipper_store then container.new('table-manager', $._images.tableManager) + container.withPorts($.util.defaultPorts) + container.withArgsMixin(k.util.mapToFlags($.table_manager_args)) + @@ -27,15 +27,19 @@ local k = import 'ksonnet-util/kausal.libsonnet'; container.mixin.readinessProbe.withTimeoutSeconds(1) + container.withEnvMixin($._config.commonEnvs) + k.util.resourcesRequests('100m', '100Mi') + - k.util.resourcesLimits('200m', '200Mi'), + k.util.resourcesLimits('200m', '200Mi') + else {}, local deployment = k.apps.v1.deployment, - table_manager_deployment: if $._config.using_shipper_store then {} else + table_manager_deployment: if !$._config.using_shipper_store then deployment.new('table-manager', 1, [$.table_manager_container]) + $.config_hash_mixin + - k.util.configVolumeMount('loki', '/etc/loki/config'), + k.util.configVolumeMount('loki', '/etc/loki/config') + else {}, - table_manager_service: if $._config.using_shipper_store then {} else - k.util.serviceFor($.table_manager_deployment, $._config.service_ignored_labels), + + table_manager_service: if !$._config.using_shipper_store then + k.util.serviceFor($.table_manager_deployment, $._config.service_ignored_labels) + else {}, } From 833b26d60fe9723bf14f61f3ff000075d3ebef6d Mon Sep 17 00:00:00 2001 From: Ashwanth Goli Date: Wed, 25 Oct 2023 13:10:05 +0530 Subject: [PATCH 3/5] also remove table manager config --- production/ksonnet/loki/table-manager.libsonnet | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/production/ksonnet/loki/table-manager.libsonnet b/production/ksonnet/loki/table-manager.libsonnet index 66b6bd5246c46..df1f7338af075 100644 --- a/production/ksonnet/loki/table-manager.libsonnet +++ b/production/ksonnet/loki/table-manager.libsonnet @@ -42,4 +42,8 @@ local k = import 'ksonnet-util/kausal.libsonnet'; table_manager_service: if !$._config.using_shipper_store then k.util.serviceFor($.table_manager_deployment, $._config.service_ignored_labels) else {}, + + _config+: { + table_manager: if !$._config.using_shipper_store then super.table_manager else null, + }, } From 3a42fc97a4b1f0cea85231db9110fe2456753ae3 Mon Sep 17 00:00:00 2001 From: Ashwanth Goli Date: Wed, 25 Oct 2023 13:46:41 +0530 Subject: [PATCH 4/5] add changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c62cf0894d703..19bc57c1896b0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -69,6 +69,8 @@ #### Jsonnet +* [11020](https://github.com/grafana/loki/pull/11020) **ashwanthgoli**: Do not generate table-manager manifests if shipper store is in-use. + * [10784](https://github.com/grafana/loki/pull/10894) **slim-bean** Update index gateway client to use a headless service. * [10542](https://github.com/grafana/loki/pull/10542) **chaudum**: Remove legacy deployment mode for ingester (Deployment, without WAL) and instead always run them as StatefulSet. From e4c04b542ba6a2971c4c36fec0e9724ba65f442c Mon Sep 17 00:00:00 2001 From: Ashwanth Goli Date: Fri, 27 Oct 2023 10:54:03 +0530 Subject: [PATCH 5/5] fixup! add changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 19bc57c1896b0..6d15cc7b11d53 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -69,7 +69,7 @@ #### Jsonnet -* [11020](https://github.com/grafana/loki/pull/11020) **ashwanthgoli**: Do not generate table-manager manifests if shipper store is in-use. +* [11020](https://github.com/grafana/loki/pull/11020) **ashwanthgoli**: Loki ksonnet: Do not generate table-manager manifests if shipper store is in-use. * [10784](https://github.com/grafana/loki/pull/10894) **slim-bean** Update index gateway client to use a headless service.