Introduces a template helper for injecting custom pod labels from values. Enables configuring tolerations, affinity, and node selectors in the deployment spec via values to improve scheduling flexibility and control. Enhances pod labeling and scheduling customization without hardcoding, supporting more dynamic deployments.
53 lines
1.1 KiB
Smarty
53 lines
1.1 KiB
Smarty
{{/*
|
|
Application name
|
|
*/}}
|
|
{{- define "lightrag.name" -}}
|
|
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
|
|
{{- end }}
|
|
|
|
{{/*
|
|
Full application name
|
|
*/}}
|
|
{{- define "lightrag.fullname" -}}
|
|
{{- default .Release.Name .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
|
|
{{- end }}
|
|
|
|
{{/*
|
|
Common labels
|
|
*/}}
|
|
{{- define "lightrag.labels" -}}
|
|
app.kubernetes.io/name: {{ include "lightrag.name" . }}
|
|
app.kubernetes.io/instance: {{ .Release.Name }}
|
|
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
|
{{- end }}
|
|
|
|
{{/*
|
|
Selector labels
|
|
*/}}
|
|
{{- define "lightrag.selectorLabels" -}}
|
|
app.kubernetes.io/name: {{ include "lightrag.name" . }}
|
|
app.kubernetes.io/instance: {{ .Release.Name }}
|
|
{{- end }}
|
|
|
|
{{/*
|
|
.env file content
|
|
*/}}
|
|
{{- define "lightrag.envContent" -}}
|
|
{{- $first := true -}}
|
|
{{- range $key, $val := .Values.env -}}
|
|
{{- if not $first -}}{{- "\n" -}}{{- end -}}
|
|
{{- $first = false -}}
|
|
{{ $key }}={{ $val }}
|
|
{{- end -}}
|
|
{{- end -}}
|
|
|
|
{{/*
|
|
Pod-specific labels
|
|
*/}}
|
|
{{- define "lightrag.apoloPodLabels" -}}
|
|
{{- if .Values.podLabels -}}
|
|
{{- range $key, $value := .Values.podLabels }}
|
|
{{ $key }}: {{ $value }}
|
|
{{- end }}
|
|
{{- end -}}
|
|
{{- end -}}
|