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.
This commit is contained in:
Taddeus 2025-07-09 09:58:30 +03:00 committed by GitHub
parent bee93af664
commit 8c83a97b8e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 34 additions and 0 deletions

View file

@ -40,3 +40,14 @@ app.kubernetes.io/instance: {{ .Release.Name }}
{{ $key }}={{ $val }}
{{- end -}}
{{- end -}}
{{/*
Pod-specific labels
*/}}
{{- define "lightrag.apoloPodLabels" -}}
{{- if .Values.podLabels -}}
{{- range $key, $value := .Values.podLabels }}
{{ $key }}: {{ $value }}
{{- end }}
{{- end -}}
{{- end -}}

View file

@ -15,7 +15,20 @@ spec:
checksum/config: {{ include "lightrag.envContent" . | sha256sum }}
labels:
{{- include "lightrag.selectorLabels" . | nindent 8 }}
{{- include "lightrag.apoloPodLabels" . | nindent 8 }}
spec:
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"

View file

@ -72,3 +72,13 @@ env:
# Replace with your Qdrant credentials
QDRANT_URL: http://qdrant-cluster-qdrant-qdrant:6333
# REDIS_URI: redis://default:${REDIS_PASSWORD}@redis-cluster-redis-redis:6379
tolerations:
- key: platform.neuromation.io/job
operator: Exists
effect: NoSchedule
affinity: {}
nodeSelector: {}