From fa79c2469c59c90cfb8e0415b0998665d5db2601 Mon Sep 17 00:00:00 2001 From: Jeff Valore Date: Fri, 18 Oct 2019 17:10:40 -0400 Subject: [PATCH] Add release name to prometheus service name. (#1174) --- production/helm/loki-stack/Chart.yaml | 2 +- production/helm/loki-stack/templates/_helpers.tpl | 8 ++++++++ production/helm/loki-stack/templates/datasources.yaml | 2 +- production/helm/loki-stack/values.yaml | 2 -- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/production/helm/loki-stack/Chart.yaml b/production/helm/loki-stack/Chart.yaml index 4f006b3cb1fb5..eb14e6690a754 100644 --- a/production/helm/loki-stack/Chart.yaml +++ b/production/helm/loki-stack/Chart.yaml @@ -1,5 +1,5 @@ name: loki-stack -version: 0.17.2 +version: 0.17.3 appVersion: v0.3.0 kubeVersion: "^1.10.0-0" description: "Loki: like Prometheus, but for logs." diff --git a/production/helm/loki-stack/templates/_helpers.tpl b/production/helm/loki-stack/templates/_helpers.tpl index 9c9e5176861ec..1543db74a2849 100644 --- a/production/helm/loki-stack/templates/_helpers.tpl +++ b/production/helm/loki-stack/templates/_helpers.tpl @@ -30,3 +30,11 @@ Create chart name and version as used by the chart label. {{- define "loki-stack.chart" -}} {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} {{- end -}} + +{{/* +Override the naming defined by the prometheus chart. +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 diff --git a/production/helm/loki-stack/templates/datasources.yaml b/production/helm/loki-stack/templates/datasources.yaml index cec67f19bfed7..c0e73f03eb0e6 100644 --- a/production/helm/loki-stack/templates/datasources.yaml +++ b/production/helm/loki-stack/templates/datasources.yaml @@ -25,7 +25,7 @@ data: - name: Prometheus type: prometheus access: proxy - url: http://{{ .Values.prometheus.server.fullnameOverride }}:{{ .Values.prometheus.server.service.servicePort }} + url: http://{{ include "prometheus.fullname" .}}:{{ .Values.prometheus.server.service.servicePort }} version: 1 {{- end }} {{- end }} diff --git a/production/helm/loki-stack/values.yaml b/production/helm/loki-stack/values.yaml index 1e2c9238446ea..eae38fe6543ea 100644 --- a/production/helm/loki-stack/values.yaml +++ b/production/helm/loki-stack/values.yaml @@ -17,5 +17,3 @@ grafana: prometheus: enabled: false - server: - fullnameOverride: prometheus-server