LibreChat/helm/librechat-exporter/templates/_helpers.tpl
Christian Troelsen 28472572c5 add helm support for metrics exporter
change

fix

a few more changes

try a fix

more fixes

add replica count

more fixes

remove some stuff

more changes

more changes

change

change

more fixes

add helm support for metrics exporter

try a fix
2025-12-11 11:00:15 +00:00

62 lines
No EOL
1.7 KiB
Smarty

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "librechat-exporter.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "librechat-exporter.fullname" -}}
{{- if $.Values.fullnameOverride }}
{{- $.Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains .Release.Name $name }}
{{- $name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}
{{/*
Common labels
*/}}
{{- define "librechat-exporter.labels" -}}
helm.sh/chart: {{ include "librechat-exporter.chart" . }}
{{ include "librechat-exporter.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}
{{/*
Exporter selector labels
*/}}
{{- define "librechat-exporter.selectorLabels" -}}
app.kubernetes.io/name: {{ include "librechat-exporter.fullname" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
{{/*
Create the name of the service account to use
*/}}
{{- define "librechat-exporter.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "librechat-exporter.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}