diff --git a/charts/opencost/templates/_helpers.tpl b/charts/opencost/templates/_helpers.tpl index ec38d3d..febbab8 100644 --- a/charts/opencost/templates/_helpers.tpl +++ b/charts/opencost/templates/_helpers.tpl @@ -101,8 +101,9 @@ Create the name of the controller service account to use {{- else -}} {{- $host := tpl .Values.opencost.prometheus.internal.serviceName . }} {{- $ns := tpl .Values.opencost.prometheus.internal.namespaceName . }} + {{- $clusterName := default "cluster.local" .Values.clusterName }} {{- $port := .Values.opencost.prometheus.internal.port | int }} - {{- printf "http://%s.%s.svc.cluster.local:%d" $host $ns $port -}} + {{- printf "http://%s.%s.svc.%s:%d" $host $ns $clusterName $port -}} {{- end -}} {{- end -}} @@ -115,8 +116,9 @@ Check that either thanos external or internal is defined {{- else -}} {{- $host := .Values.opencost.prometheus.thanos.internal.serviceName }} {{- $ns := .Values.opencost.prometheus.thanos.internal.namespaceName }} + {{- $clusterName := default "cluster.local" .Values.clusterName }} {{- $port := .Values.opencost.prometheus.thanos.internal.port | int }} - {{- printf "http://%s.%s.svc.cluster.local:%d" $host $ns $port -}} + {{- printf "http://%s.%s.svc.%s:%d" $host $ns $clusterName $port -}} {{- end -}} {{- end -}} @@ -179,4 +181,4 @@ apiVersion: networking.k8s.io/v1beta1 {{- else}} {{- .Values.opencost.ui.image.registry -}}/{{- .Values.opencost.ui.image.repository -}}:{{- include "opencostUi.imageTag" . -}} {{- end -}} -{{- end -}} \ No newline at end of file +{{- end -}} diff --git a/charts/opencost/values.yaml b/charts/opencost/values.yaml index 3d57aff..7d2f31f 100644 --- a/charts/opencost/values.yaml +++ b/charts/opencost/values.yaml @@ -4,6 +4,8 @@ nameOverride: "" fullnameOverride: "" # -- Override the deployment namespace namespaceOverride: "" +# -- Override the default name of cluster - Can be found in /etc/kubernetes/admin.conf: clusters -> cluster -> name +clusterName: "" loglevel: info