From 0538a9676290cd53973885e6c48fa1280c7bdec8 Mon Sep 17 00:00:00 2001 From: irizzant Date: Tue, 10 May 2022 17:37:18 +0000 Subject: [PATCH 1/3] feat(loki)!: allow custom server configuration Signed-off-by: irizzant --- production/ksonnet/loki/config.libsonnet | 5 +++++ production/ksonnet/loki/gateway.libsonnet | 2 ++ 2 files changed, 7 insertions(+) diff --git a/production/ksonnet/loki/config.libsonnet b/production/ksonnet/loki/config.libsonnet index 9b979fa3b201a..a8f400ef62f47 100644 --- a/production/ksonnet/loki/config.libsonnet +++ b/production/ksonnet/loki/config.libsonnet @@ -42,6 +42,11 @@ jaeger_reporter_max_queue: 1000, + // This is inserted into the gateway Nginx config file + // under the server + + server_snippet: '', + querier: { // This value should be set equal to (or less than) the CPU cores of the system the querier runs. // A higher value will lead to a querier trying to process more requests than there are available diff --git a/production/ksonnet/loki/gateway.libsonnet b/production/ksonnet/loki/gateway.libsonnet index f2174dbc7b846..ae05d97fca8ba 100644 --- a/production/ksonnet/loki/gateway.libsonnet +++ b/production/ksonnet/loki/gateway.libsonnet @@ -74,6 +74,8 @@ local k = import 'ksonnet-util/kausal.libsonnet'; location ~ /loki/api/.* { proxy_pass http://query-frontend.%(namespace)s.svc.cluster.local:%(http_listen_port)s$request_uri; } + + %(server_snippet)s } } ||| % $._config, From 58ca0c63f4db8e3d48446c54f95f981ccb3a80d0 Mon Sep 17 00:00:00 2001 From: irizzant Date: Tue, 10 May 2022 17:47:00 +0000 Subject: [PATCH 2/3] doc(loki): fix documentation --- production/ksonnet/loki/config.libsonnet | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/production/ksonnet/loki/config.libsonnet b/production/ksonnet/loki/config.libsonnet index a8f400ef62f47..2ccd6895b49b5 100644 --- a/production/ksonnet/loki/config.libsonnet +++ b/production/ksonnet/loki/config.libsonnet @@ -43,7 +43,7 @@ jaeger_reporter_max_queue: 1000, // This is inserted into the gateway Nginx config file - // under the server + // under the server directive server_snippet: '', From eb2e91387ef4b20e11625c263a45d28a589a1745 Mon Sep 17 00:00:00 2001 From: irizzant Date: Tue, 17 May 2022 07:46:59 +0000 Subject: [PATCH 3/3] refactor: move server_snippet under gateway.libsonnet Signed-off-by: irizzant --- production/ksonnet/loki/config.libsonnet | 5 ----- production/ksonnet/loki/gateway.libsonnet | 6 +++++- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/production/ksonnet/loki/config.libsonnet b/production/ksonnet/loki/config.libsonnet index dd71fc86e18b4..cb9b56bd3d265 100644 --- a/production/ksonnet/loki/config.libsonnet +++ b/production/ksonnet/loki/config.libsonnet @@ -42,11 +42,6 @@ jaeger_reporter_max_queue: 1000, - // This is inserted into the gateway Nginx config file - // under the server directive - - server_snippet: '', - querier: { // This value should be set equal to (or less than) the CPU cores of the system the querier runs. // A higher value will lead to a querier trying to process more requests than there are available diff --git a/production/ksonnet/loki/gateway.libsonnet b/production/ksonnet/loki/gateway.libsonnet index ae05d97fca8ba..6492e7b0f7e7c 100644 --- a/production/ksonnet/loki/gateway.libsonnet +++ b/production/ksonnet/loki/gateway.libsonnet @@ -3,6 +3,10 @@ local k = import 'ksonnet-util/kausal.libsonnet'; { _config+:: { htpasswd_contents: error 'must specify htpasswd contents', + + // This is inserted into the gateway Nginx config file + // under the server directive + gateway_server_snippet: '', }, _images+:: { @@ -75,7 +79,7 @@ local k = import 'ksonnet-util/kausal.libsonnet'; proxy_pass http://query-frontend.%(namespace)s.svc.cluster.local:%(http_listen_port)s$request_uri; } - %(server_snippet)s + %(gateway_server_snippet)s } } ||| % $._config,