From b9680edc873ccbfea0e6c06d1e74c887e97fc496 Mon Sep 17 00:00:00 2001 From: Don O'Neill Date: Wed, 27 Sep 2023 14:23:28 -0700 Subject: [PATCH] Proposal: fully qualify prom internal url and minor comment updates - my team needs to use the fully qualified url including `svc.cluster.local` - small comment fixes Signed-off-by: Don O'Neill --- charts/opencost/templates/_helpers.tpl | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/charts/opencost/templates/_helpers.tpl b/charts/opencost/templates/_helpers.tpl index 905eca8..811af72 100644 --- a/charts/opencost/templates/_helpers.tpl +++ b/charts/opencost/templates/_helpers.tpl @@ -87,11 +87,13 @@ Create the name of the controller service account to use {{- $host := tpl .Values.opencost.prometheus.internal.serviceName . }} {{- $ns := tpl .Values.opencost.prometheus.internal.namespaceName . }} {{- $port := .Values.opencost.prometheus.internal.port | int }} - {{- printf "http://%s.%s.svc:%d" $host $ns $port -}} + {{- printf "http://%s.%s.svc.cluster.local:%d" $host $ns $port -}} {{- end -}} {{- end -}} - +{{/* +Check that either prometheus external or internal is defined +*/}} {{- define "opencost.thanosServerEndpoint" -}} {{- if .Values.opencost.prometheus.thanos.external.enabled -}} {{ .Values.opencost.prometheus.thanos.external.url }} @@ -99,12 +101,12 @@ Create the name of the controller service account to use {{- $host := .Values.opencost.prometheus.thanos.internal.serviceName }} {{- $ns := .Values.opencost.prometheus.thanos.internal.namespaceName }} {{- $port := .Values.opencost.prometheus.thanos.internal.port | int }} - {{- printf "http://%s.%s.svc:%d" $host $ns $port -}} + {{- printf "http://%s.%s.svc.cluster.local:%d" $host $ns $port -}} {{- end -}} {{- end -}} {{/* -Check that either prometheus external or internal is defined +Check that the config is valid */}} {{- define "isPrometheusConfigValid" -}} {{- if and .Values.opencost.prometheus.external.enabled .Values.opencost.prometheus.internal.enabled -}}