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) <noreply@anthropic.com>
This commit is contained in:
Sagar Patil 2026-04-09 17:02:47 +05:30
parent 57314032c3
commit 4a8d031c87
3 changed files with 26 additions and 2 deletions

View File

@ -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:

View File

@ -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

View File

@ -190,6 +190,11 @@ hibernate:
connectionPoolSize: 10
showSql: "true"
# Tomcat writable directories (emptyDir mounts for non-root pods)
tomcatWritableDirs:
enabled: false
paths: []
nodeSelector: {}
tolerations: []