-
Notifications
You must be signed in to change notification settings - Fork 7
Description
The chart sets the JAVA_OPTS env var, which interpolates some user-defined values, for instance $(GEOWEBCACHE_CACHE_DIR).
charts/geoserver/latest/templates/statefulset.yaml
Lines 144 to 152 in 885f681
| - name: JAVA_OPTS | |
| value: "-Xms$(JAVA_XMS) -Xmx$(JAVA_XMX) -Djava.awt.headless=true -server -Dfile.encoding=UTF8 \ | |
| \ -Djavax.servlet.request.encoding=UTF-8 -Djavax.servlet.response.encoding=UTF-8 -XX:SoftRefLRUPolicyMSPerMB=36000 -XX:+UseG1GC | |
| \ -XX:MaxGCPauseMillis=200 -XX:ParallelGCThreads=20 -XX:ConcGCThreads=5 -Duser.timezone=UTC -Dorg.geotools.shapefile.datetime=true | |
| \ -Dorg.geotools.coverage.jaiext.enabled=\"$(JAI_EXT_ENABLED)\" -DGEOSERVER_LOG_LOCATION=\"$(GEOSERVER_LOG_LOCATION)\" -DGEOWEBCACHE_CONFIG_DIR=\"$(GEOWEBCACHE_CONFIG_DIR)\" | |
| \ -DGEOWEBCACHE_CACHE_DIR=$(GEOWEBCACHE_CACHE_DIR) -DNETCDF_DATA_DIR=$(NETCDF_DATA_DIR) -DGRIB_CACHE_DIR=$(GRIB_CACHE_DIR) -DGEOSERVER_CSRF_DISABLED=\"$(GEOSERVER_CSRF_DISABLED)\" | |
| \ -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=$(GEOSERVER_HEAP_DUMP_DIR)/$(POD_HOSTNAME).hprof -DGEOSERVER_DATA_DIR=\"$(GEOSERVER_DATA_DIR)\" | |
| \ -DGEOSERVER_AUDIT_PATH=\"$(GEOSERVER_AUDIT_PATH)\" -Dpod.hostname=\"$(POD_HOSTNAME)\" | |
| \ -DALLOW_ENV_PARAMETRIZATION=true -DPROXY_BASE_URL='$(PROXY_BASE_URL)' -DPROXY_BASE_URL_HEADERS='$(PROXY_BASE_URL_HEADERS)'" |
The problem is: our Dockerfile used to build vanilla images overrides some options, by setting the CATALINA_OPTS env variable.
https://github.com/geosolutions-it/docker-geoserver/blob/63be5d98ea0e251f003022a18dd98470d22da4e9/Dockerfile#L88-L105
The CATALINA_OPTS from the image are appended to the JAVA_OPTS at runtime inside catalina.sh.
So the opts set at build-time override the ones set at run-time by K8s.
This means some user-defined values (in the values file) are ignored.
The EXTRA_GEOSERVER_OPTS env var was introduced months ago as a last resort to override (again) the opts. EXTRA_GEOSERVER_OPTS is appended to CATALINA_OPTS in entrypoint.sh, and it's empty by default.
Possible solutions
- Reset the
CATALINA_OPTSenv var in the chart to"".
Bad. All the opts set in the Dockerfile would be lost. - Move everything we currently set in
JAVA_OPTStoEXTRA_GEOSERVER_OPTS.
Not great. It would be nice to removeEXTRA_GEOSERVER_OPTSin the future. We want to reduce complexity.
Even if not great, at the moment I'd go with solutions 2.