From 521d40a96a5c1c65c786c73ec374580fe767dd3b Mon Sep 17 00:00:00 2001 From: Dylan Guedes Date: Tue, 23 Apr 2024 09:31:53 -0300 Subject: [PATCH] fix: helm: Set compactor addr for distributed mode. (#12748) --- production/helm/loki/templates/_helpers.tpl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/production/helm/loki/templates/_helpers.tpl b/production/helm/loki/templates/_helpers.tpl index 5a93337f02e56..e8107efdeea0c 100644 --- a/production/helm/loki/templates/_helpers.tpl +++ b/production/helm/loki/templates/_helpers.tpl @@ -931,13 +931,18 @@ enableServiceLinks: false {{/* Determine compactor address based on target configuration */}} {{- define "loki.compactorAddress" -}} {{- $isSimpleScalable := eq (include "loki.deployment.isScalable" .) "true" -}} +{{- $isDistributed := eq (include "loki.deployment.isDistributed" .) "true "-}} +{{- $isSingleBinary := eq (include "loki.deployment.isSingleBinary" .) "true" -}} {{- $compactorAddress := include "loki.backendFullname" . -}} {{- if and $isSimpleScalable .Values.read.legacyReadTarget -}} {{/* 2 target configuration */}} {{- $compactorAddress = include "loki.readFullname" . -}} -{{- else if (not $isSimpleScalable) -}} +{{- else if $isSingleBinary -}} {{/* single binary */}} {{- $compactorAddress = include "loki.singleBinaryFullname" . -}} +{{/* distributed */}} +{{- else if $isDistributed -}} +{{- $compactorAddress = include "loki.compactorFullname" . -}} {{- end -}} {{- printf "http://%s:%s" $compactorAddress (.Values.loki.server.http_listen_port | toString) }} {{- end }}