2021-11-22 19:17:19 +00:00
|
|
|
{{/* Name suffixed with operator */}}
|
|
|
|
{{- define "kube-prometheus.fullname" -}}
|
2022-06-07 17:41:19 +00:00
|
|
|
{{- printf "%s" (include "tc.common.names.fullname" . ) -}}
|
2021-11-22 19:17:19 +00:00
|
|
|
{{- end }}
|
|
|
|
|
|
|
|
{{/* Name suffixed with operator */}}
|
|
|
|
{{- define "kube-prometheus.name" -}}
|
2022-06-07 17:41:19 +00:00
|
|
|
{{- printf "%s" (include "tc.common.names.fullname" . ) -}}
|
2021-11-22 19:17:19 +00:00
|
|
|
{{- end }}
|
|
|
|
|
|
|
|
{{/* Name suffixed with operator */}}
|
|
|
|
{{- define "kube-prometheus.operator.name" -}}
|
2022-06-07 17:41:19 +00:00
|
|
|
{{- printf "%s-operator" (include "tc.common.names.fullname" . ) -}}
|
2021-11-22 19:17:19 +00:00
|
|
|
{{- end }}
|
|
|
|
|
|
|
|
{{/* Name suffixed with prometheus */}}
|
|
|
|
{{- define "kube-prometheus.prometheus.name" -}}
|
2022-06-07 17:41:19 +00:00
|
|
|
{{- printf "%s-prometheus" (include "tc.common.names.fullname" . ) -}}
|
2021-11-22 19:17:19 +00:00
|
|
|
{{- end }}
|
|
|
|
|
|
|
|
{{/* Name suffixed with alertmanager */}}
|
|
|
|
{{- define "kube-prometheus.alertmanager.name" -}}
|
2022-06-07 17:41:19 +00:00
|
|
|
{{- printf "%s-alertmanager" (include "tc.common.names.fullname" . ) -}}
|
2021-11-22 19:17:19 +00:00
|
|
|
{{- end }}
|
|
|
|
|
|
|
|
{{/* Name suffixed with thanos */}}
|
|
|
|
{{- define "kube-prometheus.thanos.name" -}}
|
2022-06-07 17:41:19 +00:00
|
|
|
{{- printf "%s-thanos" (include "tc.common.names.fullname" . ) -}}
|
2021-11-22 19:17:19 +00:00
|
|
|
{{- end }}
|
|
|
|
|
|
|
|
{{/* Fullname suffixed with operator */}}
|
|
|
|
{{- define "kube-prometheus.operator.fullname" -}}
|
2022-06-07 17:41:19 +00:00
|
|
|
{{- printf "%s-operator" (include "tc.common.names.fullname" . ) -}}
|
2021-11-22 19:17:19 +00:00
|
|
|
{{- end }}
|
|
|
|
|
|
|
|
{{/* Fullname suffixed with prometheus */}}
|
|
|
|
{{- define "kube-prometheus.prometheus.fullname" -}}
|
2022-06-07 17:41:19 +00:00
|
|
|
{{- printf "%s-prometheus" (include "tc.common.names.fullname" . ) -}}
|
2021-11-22 19:17:19 +00:00
|
|
|
{{- end }}
|
|
|
|
|
|
|
|
{{/* Fullname suffixed with alertmanager */}}
|
|
|
|
{{- define "kube-prometheus.alertmanager.fullname" -}}
|
2022-06-07 17:41:19 +00:00
|
|
|
{{- printf "%s-alertmanager" (include "tc.common.names.fullname" . ) -}}
|
2021-11-22 19:17:19 +00:00
|
|
|
{{- end }}
|
|
|
|
|
|
|
|
{{/* Fullname suffixed with thanos */}}
|
|
|
|
{{- define "kube-prometheus.thanos.fullname" -}}
|
|
|
|
{{- printf "%s-thanos" (include "kube-prometheus.prometheus.fullname" .) -}}
|
|
|
|
{{- end }}
|
|
|
|
|
|
|
|
{{- define "kube-prometheus.chart" -}}
|
|
|
|
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
|
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{/*
|
|
|
|
Common Labels
|
|
|
|
*/}}
|
|
|
|
{{- define "kube-prometheus.labels" -}}
|
2022-06-07 17:41:19 +00:00
|
|
|
{{ include "tc.common.labels" . }}
|
2021-11-22 19:17:19 +00:00
|
|
|
{{- if .Values.global.labels }}
|
|
|
|
{{ toYaml .Values.global.labels }}
|
|
|
|
{{- end }}
|
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{/*
|
|
|
|
Labels for operator
|
|
|
|
*/}}
|
|
|
|
{{- define "kube-prometheus.operator.labels" -}}
|
2022-06-07 17:41:19 +00:00
|
|
|
{{ include "tc.common.labels" . }}
|
2021-11-22 19:17:19 +00:00
|
|
|
app.kubernetes.io/component: operator
|
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{/*
|
|
|
|
Labels for prometheus
|
|
|
|
*/}}
|
|
|
|
{{- define "kube-prometheus.prometheus.labels" -}}
|
2022-06-07 17:41:19 +00:00
|
|
|
{{ include "tc.common.labels" . }}
|
2021-11-22 19:17:19 +00:00
|
|
|
app.kubernetes.io/component: prometheus
|
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{/*
|
|
|
|
Labels for alertmanager
|
|
|
|
*/}}
|
|
|
|
{{- define "kube-prometheus.alertmanager.labels" -}}
|
2022-06-07 17:41:19 +00:00
|
|
|
{{ include "tc.common.labels" . }}
|
2021-11-22 19:17:19 +00:00
|
|
|
app.kubernetes.io/component: alertmanager
|
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{/*
|
|
|
|
matchLabels for operator
|
|
|
|
*/}}
|
|
|
|
{{- define "kube-prometheus.operator.matchLabels" -}}
|
2022-06-07 17:41:19 +00:00
|
|
|
{{ include "tc.common.labels.selectorLabels" . }}
|
2021-11-22 19:17:19 +00:00
|
|
|
app.kubernetes.io/component: operator
|
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{/*
|
|
|
|
matchLabels for prometheus
|
|
|
|
*/}}
|
|
|
|
{{- define "kube-prometheus.prometheus.matchLabels" -}}
|
2022-06-07 17:41:19 +00:00
|
|
|
{{ include "tc.common.labels.selectorLabels" . }}
|
2021-11-22 19:17:19 +00:00
|
|
|
app.kubernetes.io/component: prometheus
|
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{/*
|
|
|
|
matchLabels for alertmanager
|
|
|
|
*/}}
|
|
|
|
{{- define "kube-prometheus.alertmanager.matchLabels" -}}
|
2022-06-07 17:41:19 +00:00
|
|
|
{{ include "tc.common.labels.selectorLabels" . }}
|
2021-11-22 19:17:19 +00:00
|
|
|
app.kubernetes.io/component: alertmanager
|
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{/*
|
|
|
|
Return the proper Prometheus Operator image name
|
|
|
|
*/}}
|
|
|
|
{{- define "kube-prometheus.image" -}}
|
|
|
|
{{ printf "%s:%s" .Values.image.repository (default .Chart.AppVersion .Values.image.tag) | quote }}
|
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{/*
|
|
|
|
Return the proper Prometheus Operator Reloader image name
|
|
|
|
*/}}
|
|
|
|
{{- define "kube-prometheus.prometheusConfigReloader.image" -}}
|
|
|
|
{{- include "kube-prometheus.image" . -}}
|
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{/*
|
|
|
|
Return the proper Prometheus Image name
|
|
|
|
*/}}
|
|
|
|
{{- define "kube-prometheus.prometheus.image" -}}
|
2022-11-11 17:32:36 +00:00
|
|
|
{{ printf "%s:%s" .Values.image.repository (default .Chart.AppVersion .Values.image.tag) | quote }}
|
2021-11-22 19:17:19 +00:00
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{/*
|
|
|
|
Return the proper Thanos Image name
|
|
|
|
*/}}
|
|
|
|
{{- define "kube-prometheus.prometheus.thanosImage" -}}
|
|
|
|
{{ printf "%s:%s" .Values.thanosImage.repository (default .Chart.AppVersion .Values.thanosImage.tag) | quote }}
|
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{/*
|
|
|
|
Return the proper Alertmanager Image name
|
|
|
|
*/}}
|
|
|
|
{{- define "kube-prometheus.alertmanager.image" -}}
|
|
|
|
{{ printf "%s:%s" .Values.alertmanagerImage.repository (default .Chart.AppVersion .Values.alertmanagerImage.tag) | quote }}
|
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{/*
|
|
|
|
Return the proper Docker Image Registry Secret Names
|
|
|
|
*/}}
|
|
|
|
{{- define "kube-prometheus.imagePullSecrets" -}}
|
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{/*
|
|
|
|
Create the name of the operator service account to use
|
|
|
|
*/}}
|
|
|
|
{{- define "kube-prometheus.operator.serviceAccountName" -}}
|
|
|
|
{{- if .Values.operator.serviceAccount.create -}}
|
|
|
|
{{ default (include "kube-prometheus.operator.fullname" .) .Values.operator.serviceAccount.name }}
|
|
|
|
{{- else -}}
|
|
|
|
{{ default "default" .Values.operator.serviceAccount.name }}
|
|
|
|
{{- end -}}
|
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{/*
|
|
|
|
Create the name of the prometheus service account to use
|
|
|
|
*/}}
|
|
|
|
{{- define "kube-prometheus.prometheus.serviceAccountName" -}}
|
|
|
|
{{- if .Values.prometheus.serviceAccount.create -}}
|
|
|
|
{{ default (include "kube-prometheus.prometheus.fullname" .) .Values.prometheus.serviceAccount.name }}
|
|
|
|
{{- else -}}
|
|
|
|
{{ default "default" .Values.prometheus.serviceAccount.name }}
|
|
|
|
{{- end -}}
|
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{/*
|
|
|
|
Create the name of the alertmanager service account to use
|
|
|
|
*/}}
|
|
|
|
{{- define "kube-prometheus.alertmanager.serviceAccountName" -}}
|
|
|
|
{{- if .Values.alertmanager.serviceAccount.create -}}
|
|
|
|
{{ default (include "kube-prometheus.alertmanager.fullname" .) .Values.alertmanager.serviceAccount.name }}
|
|
|
|
{{- else -}}
|
|
|
|
{{ default "default" .Values.alertmanager.serviceAccount.name }}
|
|
|
|
{{- end -}}
|
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{/*
|
|
|
|
Compile all warnings into a single message, and call fail.
|
|
|
|
*/}}
|
|
|
|
{{- define "kube-prometheus.validateValues" -}}
|
|
|
|
{{- $messages := list -}}
|
|
|
|
{{- $messages := without $messages "" -}}
|
|
|
|
{{- $message := join "\n" $messages -}}
|
|
|
|
|
|
|
|
{{- if $message -}}
|
|
|
|
{{- printf "\nVALUES VALIDATION:\n%s" $message | fail -}}
|
|
|
|
{{- end -}}
|
|
|
|
{{- end -}}
|