Open-source LLM knowledge platform: turn raw documents into a queryable RAG, an autonomous reasoning agent, and a self-maintaining Wiki.
Go agentagenticaichatbotdsh-pluginembeddingsevaluationgenerative-aigolangknowledge-basellmmulti-tenantollamaopenaiquestion-answeringragrerankingsemantic-searchvector-searchwiki
feat(helm): allow Service name overrides with matching consumer references (#4109)
Perfectoc6bfe81894be
diff --git a/helm/README.md b/helm/README.mdindex 16b17f146..035ffcdf6 100644--- a/helm/README.md+++ b/helm/README.md@@ -142,6 +142,43 @@ helm install weknora ./helm \## Configuration+### Service names++Optional Service name overrides preserve the following defaults:++| Parameter | Default when omitted or empty |+|-----------|-------------------------------|+| `app.service.name` | `app` |+| `frontend.service.name` | `frontend` |+| `postgresql.service.name` | `postgres` |+| `redis.service.name` | `redis` |+| `docreader.service.name` | `docreader` |+| `neo4j.service.name` | `neo4j` (when enabled) |++For example, save this as `service-names.yaml`:++```yaml+app: {service: {name: weknora-app}}+frontend: {service: {name: weknora-frontend}}+postgresql: {service: {name: weknora-postgres}}+redis: {service: {name: weknora-redis}}+docreader: {service: {name: weknora-docreader}}+neo4j: {service: {name: weknora-neo4j}}+```++Pass `-f service-names.yaml` alongside your other values. Names must be valid+Kubernetes Service names. Services, backend addresses, Ingress and installation+notes use these names consistently. Frontend's `APP_HOST` follows the App Service+unless `frontend.appHost` is explicitly set.++For multiple releases in one namespace, use distinct names for every enabled+Service (for example, `alpha-app` and `beta-app`). Defaults are not release-prefixed+and still collide. Configure separate Ingress hosts when needed.++Omitted or empty overrides preserve Service names on upgrade. Changing a name on+an existing installation requires a DNS/consumer cutover plan; matching a+pre-existing Service name does not automatically transfer its ownership to Helm.+### Global Parameters| Parameter | Description | Default |diff --git a/helm/templates/NOTES.txt b/helm/templates/NOTES.txtindex dfbab9ad0..e4e16db26 100644--- a/helm/templates/NOTES.txt+++ b/helm/templates/NOTES.txt@@ -28,7 +28,7 @@ WeKnora is accessible via Ingress:To access WeKnora, use port-forwarding:# Frontend (Web UI)- kubectl port-forward svc/frontend -n {{ .Release.Namespace }} 8080:80+ kubectl port-forward svc/{{ include "weknora.serviceName" (dict "component" "frontend" "context" .) }} -n {{ .Release.Namespace }} 8080:80# Then open: http://localhost:8080@@ -113,7 +113,7 @@ which is deprecated and no longer read by the app):--set neo4j.password=<your-secure-password>Access Neo4j Browser:- kubectl port-forward svc/neo4j -n {{ .Release.Namespace }} 7474:7474 7687:7687+ kubectl port-forward svc/{{ include "weknora.serviceName" (dict "component" "neo4j" "context" .) }} -n {{ .Release.Namespace }} 7474:7474 7687:7687# Open: http://localhost:7474{{- end }}diff --git a/helm/templates/_helpers.tpl b/helm/templates/_helpers.tplindex 9ed75eaee..8973b1544 100644--- a/helm/templates/_helpers.tpl+++ b/helm/templates/_helpers.tpl@@ -32,6 +32,19 @@ Create a default fully qualified app name.{{- end }}{{- end }}+{{/*+Resolve a component Service name while preserving names used by existing releases.+Usage: include "weknora.serviceName" (dict "component" "postgresql" "context" .)+*/}}+{{- define "weknora.serviceName" -}}+{{- $service := (index .context.Values .component).service | default dict -}}+{{- $legacyName := .component -}}+{{- if eq .component "postgresql" -}}+{{- $legacyName = "postgres" -}}+{{- end -}}+{{- default $legacyName $service.name -}}+{{- end -}}+{{/*Create chart name and version as used by the chart label.Ref: https://helm.sh/docs/chart_best_practices/labels/diff --git a/helm/templates/app.yaml b/helm/templates/app.yamlindex 9b79ca83d..b7b705bcc 100644--- a/helm/templates/app.yaml+++ b/helm/templates/app.yaml@@ -57,7 +57,7 @@ spec:- name: DB_DRIVERvalue: "postgres"- name: DB_HOST- value: "postgres"+ value: {{ include "weknora.serviceName" (dict "component" "postgresql" "context" .) | quote }}- name: DB_PORTvalue: "5432"- name: DB_USER@@ -77,7 +77,7 @@ spec:key: DB_NAME# Redis configuration- name: REDIS_ADDR- value: "redis:6379"+ value: {{ printf "%s:6379" (include "weknora.serviceName" (dict "component" "redis" "context" .)) | quote }}- name: REDIS_USERNAMEvalueFrom:secretKeyRef:@@ -115,7 +115,7 @@ spec:value: {{ .Values.app.env.LOCAL_STORAGE_BASE_DIR | quote }}# Document reader- name: DOCREADER_ADDR- value: "docreader:50051"+ value: {{ printf "%s:50051" (include "weknora.serviceName" (dict "component" "docreader" "context" .)) | quote }}# Processing- name: AUTO_RECOVER_DIRTYvalue: {{ .Values.app.env.AUTO_RECOVER_DIRTY | quote }}@@ -133,7 +133,7 @@ spec:- name: NEO4J_ENABLEvalue: "true"- name: NEO4J_URI- value: "bolt://neo4j:7687"+ value: {{ printf "bolt://%s:7687" (include "weknora.serviceName" (dict "component" "neo4j" "context" .)) | quote }}- name: NEO4J_USERNAMEvalueFrom:secretKeyRef:@@ -186,8 +186,7 @@ spec:apiVersion: v1kind: Servicemetadata:- # Service name must be "app" - frontend nginx config hardcodes this- name: app+ name: {{ include "weknora.serviceName" (dict "component" "app" "context" .) | quote }}namespace: {{ .Release.Namespace }}labels:{{- include "weknora.componentLabels" (dict "component" "app" "context" .) | nindent 4 }}diff --git a/helm/templates/docreader.yaml b/helm/templates/docreader.yamlindex 7d2385cac..1029fd658 100644--- a/helm/templates/docreader.yaml+++ b/helm/templates/docreader.yaml@@ -87,8 +87,7 @@ spec:apiVersion: v1kind: Servicemetadata:- # Service name must be "docreader" - app references this- name: docreader+ name: {{ include "weknora.serviceName" (dict "component" "docreader" "context" .) | quote }}namespace: {{ .Release.Namespace }}labels:{{- include "weknora.componentLabels" (dict "component" "docreader" "context" .) | nindent 4 }}diff --git a/helm/templates/frontend.yaml b/helm/templates/frontend.yamlindex dd43be080..77f52d2f2 100644--- a/helm/templates/frontend.yaml+++ b/helm/templates/frontend.yaml@@ -43,7 +43,7 @@ spec:{{- end }}env:- name: APP_HOST- value: {{ .Values.frontend.appHost | default "app" | quote }}+ value: {{ .Values.frontend.appHost | default (include "weknora.serviceName" (dict "component" "app" "context" .)) | quote }}- name: APP_PORTvalue: {{ .Values.frontend.appPort | default .Values.app.service.port | quote }}- name: MAX_FILE_SIZE_MB@@ -97,8 +97,7 @@ spec:apiVersion: v1kind: Servicemetadata:- # Service name must be "frontend" - ingress references this- name: frontend+ name: {{ include "weknora.serviceName" (dict "component" "frontend" "context" .) | quote }}namespace: {{ .Release.Namespace }}labels:{{- include "weknora.componentLabels" (dict "component" "frontend" "context" .) | nindent 4 }}diff --git a/helm/templates/ingress.yaml b/helm/templates/ingress.yamlindex 7b491a3e8..a22a32677 100644--- a/helm/templates/ingress.yaml+++ b/helm/templates/ingress.yaml@@ -38,7 +38,7 @@ spec:pathType: Prefixbackend:service:- name: app+ name: {{ include "weknora.serviceName" (dict "component" "app" "context" .) | quote }}port:name: http# Frontend routes - catch-all@@ -46,7 +46,7 @@ spec:pathType: Prefixbackend:service:- name: frontend+ name: {{ include "weknora.serviceName" (dict "component" "frontend" "context" .) | quote }}port:name: http{{- end }}diff --git a/helm/templates/neo4j.yaml b/helm/templates/neo4j.yamlindex 935b6769c..cb5efef51 100644--- a/helm/templates/neo4j.yaml+++ b/helm/templates/neo4j.yaml@@ -115,8 +115,7 @@ spec:apiVersion: v1kind: Servicemetadata:- # Service name must be "neo4j" - app references this- name: neo4j+ name: {{ include "weknora.serviceName" (dict "component" "neo4j" "context" .) | quote }}namespace: {{ .Release.Namespace }}labels:{{- include "weknora.componentLabels" (dict "component" "graph" "context" .) | nindent 4 }}diff --git a/helm/templates/postgres.yaml b/helm/templates/postgres.yamlindex fbc3674fb..f8c04fd71 100644--- a/helm/templates/postgres.yaml+++ b/helm/templates/postgres.yaml@@ -111,8 +111,7 @@ spec:apiVersion: v1kind: Servicemetadata:- # Service name must be "postgres" - app references this- name: postgres+ name: {{ include "weknora.serviceName" (dict "component" "postgresql" "context" .) | quote }}namespace: {{ .Release.Namespace }}labels:{{- include "weknora.componentLabels" (dict "component" "database" "context" .) | nindent 4 }}diff --git a/helm/templates/redis.yaml b/helm/templates/redis.yamlindex e64f243e1..b5a00345a 100644--- a/helm/templates/redis.yaml+++ b/helm/templates/redis.yaml@@ -107,8 +107,7 @@ spec:apiVersion: v1kind: Servicemetadata:- # Service name must be "redis" - app references this- name: redis+ name: {{ include "weknora.serviceName" (dict "component" "redis" "context" .) | quote }}namespace: {{ .Release.Namespace }}labels:{{- include "weknora.componentLabels" (dict "component" "cache" "context" .) | nindent 4 }}diff --git a/helm/values.yaml b/helm/values.yamlindex 71583eccb..7f1cae7cc 100644--- a/helm/values.yaml+++ b/helm/values.yaml@@ -114,6 +114,8 @@ app:# -- Service configurationservice:+ # -- Service name override (empty keeps "app")+ name: ""type: ClusterIPport: 8080@@ -181,6 +183,8 @@ frontend:# -- Service configurationservice:+ # -- Service name override (empty keeps "frontend")+ name: ""type: ClusterIPport: 80@@ -231,6 +235,8 @@ docreader:# -- Service configurationservice:+ # -- Service name override (empty keeps "docreader")+ name: ""type: ClusterIPport: 50051@@ -250,6 +256,10 @@ postgresql:# -- Enable PostgreSQLenabled: true+ service:+ # -- Service name override (empty keeps "postgres")+ name: ""+image:# -- Image repository (ParadeDB for vector search)repository: paradedb/paradedb@@ -296,6 +306,10 @@ redis:# -- Enable Redisenabled: true+ service:+ # -- Service name override (empty keeps "redis")+ name: ""+image:# -- Image repositoryrepository: redis@@ -446,6 +460,10 @@ neo4j:# -- Enable Neo4j for GraphRAGenabled: false+ service:+ # -- Service name override (empty keeps "neo4j")+ name: ""+image:# -- Image repositoryrepository: neo4j