Helm/loki-stack: add template for the service name to connect to loki (#1587)

* add helper for the service name to connect to loki

* Bump loki-chart version.

Signed-off-by: Cyril Tovena <cyril.tovena@gmail.com>

Co-authored-by: Cyril Tovena <cyril.tovena@gmail.com>
pull/1590/head
polar3130 5 years ago committed by Cyril Tovena
parent cfaf89bdad
commit e642c28d93
  1. 2
      production/helm/loki-stack/Chart.yaml
  2. 20
      production/helm/loki-stack/templates/_helpers.tpl

@ -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."

@ -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 -}}
{{- 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 -}}

Loading…
Cancel
Save