From abd01a5e8f7b343323792fc2b2a096241a7de0ca Mon Sep 17 00:00:00 2001 From: Denis Krivenko Date: Mon, 28 Aug 2023 09:12:58 +0200 Subject: [PATCH] Template Prometheus values (#100) Signed-off-by: Matt Ray Co-authored-by: Matt Ray --- charts/opencost/Chart.yaml | 2 +- charts/opencost/README.md | 3 ++- charts/opencost/templates/_helpers.tpl | 6 +++--- charts/opencost/values.yaml | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/charts/opencost/Chart.yaml b/charts/opencost/Chart.yaml index dc5c630..869db50 100755 --- a/charts/opencost/Chart.yaml +++ b/charts/opencost/Chart.yaml @@ -9,7 +9,7 @@ keywords: - kubecost - opencost - monitoring -version: 1.19.0 +version: 1.19.1 maintainers: - name: mattray url: https://mattray.dev diff --git a/charts/opencost/README.md b/charts/opencost/README.md index e5c737c..dc31861 100644 --- a/charts/opencost/README.md +++ b/charts/opencost/README.md @@ -2,7 +2,7 @@ OpenCost and OpenCost UI -![Version: 1.18.1](https://img.shields.io/badge/Version-1.18.1-informational?style=flat-square) +![Version: 1.19.1](https://img.shields.io/badge/Version-1.19.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.105.2](https://img.shields.io/badge/AppVersion-1.105.2-informational?style=flat-square) @@ -116,6 +116,7 @@ $ helm install opencost opencost/opencost | serviceAccount.annotations | object | `{}` | Annotations to add to the service account | | serviceAccount.automountServiceAccountToken | bool | `true` | Whether pods running as this service account should have an API token automatically mounted | | serviceAccount.create | bool | `true` | Specifies whether a service account should be created | +| serviceAccount.name | string | `""` | | ---------------------------------------------- Autogenerated from chart metadata using [helm-docs v1.11.0](https://github.com/norwoodj/helm-docs/releases/v1.11.0) diff --git a/charts/opencost/templates/_helpers.tpl b/charts/opencost/templates/_helpers.tpl index 0be4623..905eca8 100644 --- a/charts/opencost/templates/_helpers.tpl +++ b/charts/opencost/templates/_helpers.tpl @@ -82,10 +82,10 @@ Create the name of the controller service account to use */}} {{- define "opencost.prometheusServerEndpoint" -}} {{- if .Values.opencost.prometheus.external.enabled -}} - {{ .Values.opencost.prometheus.external.url }} + {{ tpl .Values.opencost.prometheus.external.url . }} {{- else -}} - {{- $host := .Values.opencost.prometheus.internal.serviceName }} - {{- $ns := .Values.opencost.prometheus.internal.namespaceName }} + {{- $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 -}} {{- end -}} diff --git a/charts/opencost/values.yaml b/charts/opencost/values.yaml index 496d19e..b6e1ecb 100644 --- a/charts/opencost/values.yaml +++ b/charts/opencost/values.yaml @@ -160,7 +160,7 @@ opencost: # -- Use external Prometheus (eg. Grafana Cloud) enabled: false # -- External Prometheus url - url: 'https://prometheus.example.com/prometheus' + url: "https://prometheus.example.com/prometheus" internal: # -- Use in-cluster Prometheus enabled: true