Skip to content

Commit

Permalink
[kube-prometheus-stack] Allow fullname override of prometheus-operator (
Browse files Browse the repository at this point in the history
  • Loading branch information
than-pet authored Feb 4, 2024
1 parent 1c5bc2c commit 5bd2f82
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion charts/kube-prometheus-stack/Chart.yaml
Original file line number Diff line number Diff line change
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: 56.6.1
version: 56.6.2
appVersion: v0.71.2
kubeVersion: ">=1.19.0-0"
home: https://github.com/prometheus-operator/kube-prometheus
Expand Down
7 changes: 6 additions & 1 deletion charts/kube-prometheus-stack/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,15 @@ The longest name that gets created adds and extra 37 characters, so truncation s
{{- end -}}
{{- end -}}

{{/* Fullname suffixed with operator */}}
{{/* Fullname suffixed with -operator */}}
{{/* Adding 9 to 26 truncation of kube-prometheus-stack.fullname */}}
{{- define "kube-prometheus-stack.operator.fullname" -}}
{{- if .Values.prometheusOperator.fullnameOverride -}}
{{- .Values.prometheusOperator.fullnameOverride | trunc 35 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s-operator" (include "kube-prometheus-stack.fullname" .) -}}
{{- end }}
{{- end }}

{{/* Prometheus custom resource instance name */}}
{{- define "kube-prometheus-stack.prometheus.crname" -}}
Expand Down
3 changes: 3 additions & 0 deletions charts/kube-prometheus-stack/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2073,6 +2073,9 @@ prometheus-node-exporter:
prometheusOperator:
enabled: true

## Use '{{ template "kube-prometheus-stack.fullname" . }}-operator' by default
fullnameOverride: ""

## Number of old replicasets to retain ##
## The default value is 10, 0 will garbage-collect old replicasets ##
revisionHistoryLimit: 10
Expand Down

0 comments on commit 5bd2f82

Please sign in to comment.