LightRAG/k8s-deploy/lightrag/templates/_helpers.tpl
Taddeus 8c83a97b8e
Adds support for pod labels, tolerations, affinity, and node selectors (#7)
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.
2025-07-09 09:58:30 +03:00

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 -}}