Skip to content

Commit

Permalink
[kube-promettheus-stack] ThanosRuler custom resource instance name (#…
Browse files Browse the repository at this point in the history
…4439)

Signed-off-by: Thanasis Petrovas <thanasis.petrovas@camunda.com>
  • Loading branch information
than-pet committed Apr 11, 2024
1 parent 02bbb18 commit 37d05a6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion charts/kube-prometheus-stack/Chart.yaml
Expand Up @@ -23,7 +23,7 @@ name: kube-prometheus-stack
sources:
- https://github.com/prometheus-community/helm-charts
- https://github.com/prometheus-operator/kube-prometheus
version: 58.0.0
version: 58.0.1
appVersion: v0.73.0
kubeVersion: ">=1.19.0-0"
home: https://github.com/prometheus-operator/kube-prometheus
Expand Down
10 changes: 7 additions & 3 deletions charts/kube-prometheus-stack/templates/_helpers.tpl
Expand Up @@ -57,9 +57,13 @@ The longest name that gets created adds and extra 37 characters, so truncation s
{{- end }}
{{- end }}

{{/* Fullname suffixed with thanos-ruler */}}
{{- define "kube-prometheus-stack.thanosRuler.fullname" -}}
{{- printf "%s-thanos-ruler" (include "kube-prometheus-stack.fullname" .) -}}
{{/* ThanosRuler custom resource instance name */}}
{{- define "kube-prometheus-stack.thanosRuler.crname" -}}
{{- if .Values.cleanPrometheusOperatorObjectNames }}
{{- include "kube-prometheus-stack.fullname" . }}
{{- else }}
{{- print (include "kube-prometheus-stack.fullname" .) "-thanos-ruler" -}}
{{- end }}
{{- end }}

{{/* Shortened name suffixed with thanos-ruler */}}
Expand Down
Expand Up @@ -2,7 +2,7 @@
apiVersion: monitoring.coreos.com/v1
kind: ThanosRuler
metadata:
name: {{ template "kube-prometheus-stack.thanosRuler.name" . }}
name: {{ template "kube-prometheus-stack.thanosRuler.crname" . }}
namespace: {{ template "kube-prometheus-stack.namespace" . }}
labels:
app: {{ include "kube-prometheus-stack.thanosRuler.name" . }}
Expand Down

0 comments on commit 37d05a6

Please sign in to comment.