From 4a8d031c87758a8a044f8b446110f185b1fc6921 Mon Sep 17 00:00:00 2001 From: Sagar Patil Date: Thu, 9 Apr 2026 17:02:47 +0530 Subject: [PATCH] fix: add configurable tomcatWritableDirs for non-root pod support hadesV3 runs as non-root user (1000) and can't write to Tomcat dirs. Added tomcatWritableDirs config to mount emptyDir volumes at paths like /usr/local/tomcat/conf/Catalina and /usr/local/tomcat/work. Co-Authored-By: Claude Opus 4.6 (1M context) --- hades/templates/deployment.yaml | 16 ++++++++++++++-- hades/values-local.yaml | 7 +++++++ hades/values.yaml | 5 +++++ 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/hades/templates/deployment.yaml b/hades/templates/deployment.yaml index 5d34064..75c667a 100644 --- a/hades/templates/deployment.yaml +++ b/hades/templates/deployment.yaml @@ -142,7 +142,7 @@ spec: value: "false" - name: HIBERNATE_HBM2DDL_AUTO value: "validate" - {{- if or .Values.config.enabled .Values.allhosts.enabled }} + {{- if or .Values.config.enabled .Values.allhosts.enabled .Values.tomcatWritableDirs.enabled }} volumeMounts: {{- if .Values.config.enabled }} {{- range .Values.config.mountPaths }} @@ -157,8 +157,14 @@ spec: subPath: allhosts.tsv readOnly: true {{- end }} + {{- if .Values.tomcatWritableDirs.enabled }} + {{- range $i, $path := .Values.tomcatWritableDirs.paths }} + - name: tomcat-writable-{{ $i }} + mountPath: {{ $path }} {{- end }} - {{- if or .Values.config.enabled .Values.allhosts.enabled }} + {{- end }} + {{- end }} + {{- if or .Values.config.enabled .Values.allhosts.enabled .Values.tomcatWritableDirs.enabled }} volumes: {{- if .Values.config.enabled }} - name: config @@ -170,6 +176,12 @@ spec: configMap: name: {{ include "hades.fullname" . }}-allhosts {{- end }} + {{- if .Values.tomcatWritableDirs.enabled }} + {{- range $i, $path := .Values.tomcatWritableDirs.paths }} + - name: tomcat-writable-{{ $i }} + emptyDir: {} + {{- end }} + {{- end }} {{- end }} {{- with .Values.nodeSelector }} nodeSelector: diff --git a/hades/values-local.yaml b/hades/values-local.yaml index 802e6e7..8463a8d 100644 --- a/hades/values-local.yaml +++ b/hades/values-local.yaml @@ -293,6 +293,13 @@ config: } } +# Tomcat writable directories (emptyDir mounts for non-root pods) +tomcatWritableDirs: + enabled: true + paths: + - /usr/local/tomcat/conf/Catalina + - /usr/local/tomcat/work + # Hibernate configuration options (hibernate.cfg.xml is now generated dynamically) hibernate: connectionPoolSize: 10 diff --git a/hades/values.yaml b/hades/values.yaml index a42bf04..d9b0b69 100644 --- a/hades/values.yaml +++ b/hades/values.yaml @@ -190,6 +190,11 @@ hibernate: connectionPoolSize: 10 showSql: "true" +# Tomcat writable directories (emptyDir mounts for non-root pods) +tomcatWritableDirs: + enabled: false + paths: [] + nodeSelector: {} tolerations: []