From 4d6a4243e1b25390f1bb82a38a9094990d043dcd Mon Sep 17 00:00:00 2001 From: "masa.gr52" Date: Tue, 28 Jan 2020 01:54:54 +0900 Subject: [PATCH 1/2] add helper for the service name to connect to loki --- .../helm/loki-stack/templates/_helpers.tpl | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/production/helm/loki-stack/templates/_helpers.tpl b/production/helm/loki-stack/templates/_helpers.tpl index 1543db74a284..1cb7269e80a8 100644 --- a/production/helm/loki-stack/templates/_helpers.tpl +++ b/production/helm/loki-stack/templates/_helpers.tpl @@ -37,4 +37,22 @@ Added as a fix for https://github.com/grafana/loki/issues/1169 */}} {{- define "prometheus.fullname" -}} {{- printf "%s-%s" .Release.Name "prometheus-server" | trunc 63 | trimSuffix "-" -}} -{{- end -}} \ No newline at end of file +{{- end -}} + +{{/* +The service name to connect to Loki. Defaults to the same logic as "loki.fullname" +*/}} +{{- define "loki.serviceName" -}} +{{- if .Values.loki.serviceName -}} +{{- .Values.loki.serviceName -}} +{{- else if .Values.loki.fullnameOverride -}} +{{- .Values.loki.fullnameOverride | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- $name := default "loki" .Values.loki.nameOverride -}} +{{- if contains $name .Release.Name -}} +{{- .Release.Name | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} +{{- end -}} +{{- end -}} From 46774500fcc3bbf83c9ea35bb0d1a4a0a844303e Mon Sep 17 00:00:00 2001 From: Cyril Tovena Date: Mon, 27 Jan 2020 12:51:33 -0500 Subject: [PATCH 2/2] Bump loki-chart version. Signed-off-by: Cyril Tovena --- production/helm/loki-stack/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/production/helm/loki-stack/Chart.yaml b/production/helm/loki-stack/Chart.yaml index 37623721ba30..5a0f35f97f55 100644 --- a/production/helm/loki-stack/Chart.yaml +++ b/production/helm/loki-stack/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: "v1" name: loki-stack -version: 0.27.0 +version: 0.27.1 appVersion: v1.3.0 kubeVersion: "^1.10.0-0" description: "Loki: like Prometheus, but for logs."