From 71164231807fc7d0bf139f2132d00912900094f6 Mon Sep 17 00:00:00 2001 From: Don O'Neill Date: Fri, 13 Oct 2023 18:26:23 -0700 Subject: [PATCH] Proposal: fully qualify prom internal url and minor comment updates (#119) * 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 * bump version and small comment update * Bump chart version --------- Signed-off-by: Don O'Neill Co-authored-by: Tony Scott --- charts/opencost/Chart.yaml | 2 +- charts/opencost/templates/_helpers.tpl | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/charts/opencost/Chart.yaml b/charts/opencost/Chart.yaml index c003da8..1b3adaf 100755 --- a/charts/opencost/Chart.yaml +++ b/charts/opencost/Chart.yaml @@ -9,7 +9,7 @@ keywords: - kubecost - opencost - monitoring -version: 1.20.2 +version: 1.20.3 maintainers: - name: mattray url: https://mattray.dev diff --git a/charts/opencost/templates/_helpers.tpl b/charts/opencost/templates/_helpers.tpl index 905eca8..e9685c7 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 thanos 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 -}}