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
…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 <[email protected]>

* bump version and small comment update

* Bump chart version

---------

Signed-off-by: Don O'Neill <[email protected]>
Co-authored-by: Tony Scott <[email protected]>
  • Loading branch information
sntxrr and Tony Scott authored Oct 14, 2023
1 parent f700255 commit 7116423
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion charts/opencost/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ keywords:
- kubecost
- opencost
- monitoring
version: 1.20.2
version: 1.20.3
maintainers:
- name: mattray
url: https://mattray.dev
Expand Down
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 thanos 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 7116423

Please sign in to comment.