Skip to content

Commit

Permalink
Proposal: fully qualify prom internal url and minor comment updates
Browse files Browse the repository at this point in the history
- my team needs to use the fully qualified url including `svc.cluster.local`
- small comment fixes

Signed-off-by: Don O'Neill <[email protected]>
  • Loading branch information
sntxrr authored Sep 27, 2023
1 parent 25048cc commit b9680ed
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions charts/opencost/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -87,24 +87,26 @@ 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 }}
{{- else -}}
{{- $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 -}}
Expand Down

0 comments on commit b9680ed

Please sign in to comment.