Files
ragflow/helm/templates/ragflow.yaml
wyou 0a4c0c38c7 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),
<img width="486" height="190" alt="image"
src="https://github.com/user-attachments/assets/4db0dc3d-bd94-4ad9-bb5d-a240aac5e1c5"
/>
        Admin access and operations would be feasible like below,
<img width="2530" height="876" alt="image"
src="https://github.com/user-attachments/assets/3e948e1b-7522-4f8d-8dc0-c80a22242022"
/>
Something like 'user management' is very much important for Ragflow
User/Owner to control their clients.
2026-03-04 10:26:10 +08:00

149 lines
4.4 KiB
YAML

---
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "ragflow.fullname" . }}
labels:
{{- include "ragflow.labels" . | nindent 4 }}
app.kubernetes.io/component: ragflow
spec:
replicas: 1
selector:
matchLabels:
{{- include "ragflow.selectorLabels" . | nindent 6 }}
app.kubernetes.io/component: ragflow
{{- with .Values.ragflow.deployment.strategy }}
strategy:
{{- . | toYaml | nindent 4 }}
{{- end }}
template:
metadata:
labels:
{{- include "ragflow.labels" . | nindent 8 }}
app.kubernetes.io/component: ragflow
annotations:
checksum/config-env: {{ include (print $.Template.BasePath "/env.yaml") . | sha256sum }}
checksum/config-ragflow: {{ include (print $.Template.BasePath "/ragflow_config.yaml") . | sha256sum }}
spec:
{{- if or .Values.global.imagePullSecrets .Values.ragflow.image.pullSecrets }}
imagePullSecrets:
{{- with .Values.global.imagePullSecrets }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.ragflow.image.pullSecrets }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
containers:
- name: ragflow
image: {{ include "ragflow.imageRepo" (dict "root" . "repo" .Values.ragflow.image.repository) }}:{{ .Values.ragflow.image.tag }}
{{- 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
name: nginx-config-volume
- mountPath: /etc/nginx/proxy.conf
subPath: proxy.conf
name: nginx-config-volume
- mountPath: /etc/nginx/nginx.conf
subPath: nginx.conf
name: nginx-config-volume
{{- with .Values.ragflow.service_conf }}
- mountPath: /ragflow/conf/local.service_conf.yaml
subPath: local.service_conf.yaml
name: service-conf-volume
{{- end }}
{{- with .Values.ragflow.llm_factories }}
- mountPath: /ragflow/conf/llm_factories.json
subPath: llm_factories.json
name: service-conf-volume
{{- end }}
envFrom:
- secretRef:
name: {{ include "ragflow.fullname" . }}-env-config
{{- with .Values.ragflow.deployment.resources }}
resources:
{{- . | toYaml | nindent 10 }}
{{- end }}
volumes:
- name: nginx-config-volume
configMap:
name: nginx-config
- name: service-conf-volume
configMap:
name: ragflow-service-config
---
apiVersion: v1
kind: Service
metadata:
name: {{ include "ragflow.fullname" . }}
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: 80
targetPort: http
name: http
type: {{ .Values.ragflow.service.type }}
---
{{- if .Values.ragflow.api.service.enabled }}
apiVersion: v1
kind: Service
metadata:
name: {{ .Release.Name }}-api
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: 80
targetPort: http-api
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 }}