From 86d245d8925299e761a7a9d2d76b3b855e3a2dd6 Mon Sep 17 00:00:00 2001 From: po-et <42566883+po-et@users.noreply.github.com> Date: Tue, 15 Sep 2026 14:41:05 +0800 Subject: [PATCH] feat(helm): expose the upload size limit as global.maxFileSizeMB The chart never rendered MAX_FILE_SIZE_MB, so a Helm install was pinned to the image default of 50 MB with no supported way to raise it for the frontend (nginx client_max_body_size) and docreader (gRPC message limit) together. Add global.maxFileSizeMB, default 50 as in docker-compose, and render it into the app, frontend and docreader containers. --- helm/README.md | 1 + helm/templates/app.yaml | 2 ++ helm/templates/docreader.yaml | 2 ++ helm/templates/frontend.yaml | 2 ++ helm/values.yaml | 5 +++++ 5 files changed, 12 insertions(+) diff --git a/helm/README.md b/helm/README.md index e685e49c..fddd3556 100644 --- a/helm/README.md +++ b/helm/README.md @@ -148,6 +148,7 @@ helm install weknora ./helm \ |-----------|-------------|---------| | `global.storageClass` | Storage class for PVCs | `""` | | `global.imagePullSecrets` | Image pull secrets | `[]` | +| `global.maxFileSizeMB` | Maximum upload size in MB (frontend, app, docreader) | `50` | | `global.podSecurityContext` | Pod security context | See values.yaml | | `global.containerSecurityContext` | Container security context | See values.yaml | diff --git a/helm/templates/app.yaml b/helm/templates/app.yaml index d555766a..9b79ca83 100644 --- a/helm/templates/app.yaml +++ b/helm/templates/app.yaml @@ -51,6 +51,8 @@ spec: value: {{ .Values.app.env.GIN_MODE | quote }} - name: TZ value: {{ .Values.app.env.TZ | quote }} + - name: MAX_FILE_SIZE_MB + value: {{ .Values.global.maxFileSizeMB | quote }} # Database configuration - name: DB_DRIVER value: "postgres" diff --git a/helm/templates/docreader.yaml b/helm/templates/docreader.yaml index 229f8bc2..7d2385ca 100644 --- a/helm/templates/docreader.yaml +++ b/helm/templates/docreader.yaml @@ -48,6 +48,8 @@ spec: env: - name: STORAGE_TYPE value: {{ .Values.docreader.env.STORAGE_TYPE | quote }} + - name: MAX_FILE_SIZE_MB + value: {{ .Values.global.maxFileSizeMB | quote }} resources: {{- toYaml .Values.docreader.resources | nindent 12 }} # gRPC health check using grpc_health_probe diff --git a/helm/templates/frontend.yaml b/helm/templates/frontend.yaml index b905fa40..dd43be08 100644 --- a/helm/templates/frontend.yaml +++ b/helm/templates/frontend.yaml @@ -46,6 +46,8 @@ spec: value: {{ .Values.frontend.appHost | default "app" | quote }} - name: APP_PORT value: {{ .Values.frontend.appPort | default .Values.app.service.port | quote }} + - name: MAX_FILE_SIZE_MB + value: {{ .Values.global.maxFileSizeMB | quote }} ports: - containerPort: 80 name: http diff --git a/helm/values.yaml b/helm/values.yaml index 17a12879..3d2c4399 100644 --- a/helm/values.yaml +++ b/helm/values.yaml @@ -20,6 +20,11 @@ global: imagePullSecrets: [] # - name: regcred + # -- Maximum upload size in MB, applied to the frontend (nginx + # client_max_body_size), the app (upload limit) and docreader (gRPC message + # limit). Same knob as MAX_FILE_SIZE_MB in docker-compose.yml. + maxFileSizeMB: 50 + # -- Default security context for all pods # Note: Official images (nginx, postgres, redis) run as root by default # Enable runAsNonRoot only if using non-root compatible images