From 0a4c0c38c7366dfcd50243d49053da566bb4a26a Mon Sep 17 00:00:00 2001 From: wyou Date: Wed, 4 Mar 2026 10:26:10 +0800 Subject: [PATCH] Feat: expose admin service in helm configuration (#13345) ### What problem does this PR solve? _Briefly describe what this PR aims to solve. Include background context that will help reviewers understand the purpose of the PR._ ### Type of change - [x] New Feature (non-breaking change which adds functionality) For helm deployment, there is also requirement to enable the Admin Service for administrative operations. So expose the ability of enable/disable this function by helm configuration. When it's enabled (by default), image Admin access and operations would be feasible like below, image Something like 'user management' is very much important for Ragflow User/Owner to control their clients. --- helm/Chart.yaml | 2 +- helm/templates/ragflow.yaml | 29 +++++++++++++++++++++++++++++ helm/templates/ragflow_config.yaml | 5 +++++ helm/values.yaml | 7 +++++++ 4 files changed, 42 insertions(+), 1 deletion(-) diff --git a/helm/Chart.yaml b/helm/Chart.yaml index 4dd5af1ac4..e8e672005b 100644 --- a/helm/Chart.yaml +++ b/helm/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.1.0 +version: 0.1.1 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/helm/templates/ragflow.yaml b/helm/templates/ragflow.yaml index 73821ddfb5..456c2da8d1 100644 --- a/helm/templates/ragflow.yaml +++ b/helm/templates/ragflow.yaml @@ -40,11 +40,19 @@ spec: {{- with .Values.ragflow.image.pullPolicy }} imagePullPolicy: {{ . }} {{- end }} + {{- if .Values.ragflow.admin.enabled }} + args: + - "--enable-adminserver" + {{- end }} ports: - containerPort: 80 name: http - containerPort: 9380 name: http-api + {{- if .Values.ragflow.admin.enabled }} + - containerPort: 9381 + name: admin + {{- end }} volumeMounts: - mountPath: /etc/nginx/conf.d/ragflow.conf subPath: ragflow.conf @@ -117,3 +125,24 @@ spec: name: http-api type: {{ .Values.ragflow.api.service.type }} {{- end }} + +{{- if .Values.ragflow.admin.enabled }} +--- +apiVersion: v1 +kind: Service +metadata: + name: {{ .Release.Name }}-admin + labels: + {{- include "ragflow.labels" . | nindent 4 }} + app.kubernetes.io/component: ragflow +spec: + selector: + {{- include "ragflow.selectorLabels" . | nindent 4 }} + app.kubernetes.io/component: ragflow + ports: + - protocol: TCP + port: {{ .Values.ragflow.admin.port }} + targetPort: admin + name: admin + type: {{ .Values.ragflow.admin.serviceType }} +{{- end }} diff --git a/helm/templates/ragflow_config.yaml b/helm/templates/ragflow_config.yaml index 533bd3df9a..01f9493761 100644 --- a/helm/templates/ragflow_config.yaml +++ b/helm/templates/ragflow_config.yaml @@ -31,6 +31,11 @@ data: gzip_vary on; gzip_disable "MSIE [1-6]\."; + location ~ ^/api/v1/admin { + proxy_pass http://localhost:9381; + include proxy.conf; + } + location ~ ^/(v1|api) { proxy_pass http://localhost:9380; include proxy.conf; diff --git a/helm/values.yaml b/helm/values.yaml index 803d982696..0860f136f5 100644 --- a/helm/values.yaml +++ b/helm/values.yaml @@ -109,6 +109,13 @@ ragflow: service: # Use LoadBalancer to expose the web interface externally type: ClusterIP + admin: + # Enable Admin Service + enabled: true + # Admin Service port configuration + port: 9381 + # Admin Service type + serviceType: ClusterIP api: service: enabled: true