Compare commits

...
Author SHA1 Message Date
Cédric VerstraetenandClaude Fable 5.1 600391152b hub: chart always mounts the frontend /tmp scratch volume (0.210.0)
The hardened hub-frontend image needs a writable /tmp for its generated
runtime configuration and nginx temp files. Until now that emptyDir was a
default entry in kerberoshub.frontend.volumes / volumeMounts, so any values
file that added its own custom-layout mounts replaced the list and dropped
/tmp; with readOnlyRootFilesystem the pod then failed at startup and custom
CSS never showed up.

The chart now renders the frontend-tmp volume and /tmp mount itself (both
frontends), sized by kerberoshub.frontend.tmp.sizeLimit, and appends the
user-supplied volumes and mounts. Values files that still list frontend-tmp
or mount their own volume at /tmp keep working: the built-in entries are
skipped. Also fixes the favicons mount path in the values comment and
documents the UID 65532 / no-shell constraints for custom layout files.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-11-26 14:06:37 +00:00
6 changed files with 86 additions and 36 deletions
+1 -1
View File
@@ -16,7 +16,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.209.0
version: 0.210.0
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
+17 -12
View File
@@ -83,20 +83,25 @@ kerberoshub:
drop: ["ALL"]
seccompProfile:
type: RuntimeDefault
volumes:
- name: frontend-tmp
emptyDir:
medium: Memory
sizeLimit: 16Mi
volumeMounts:
- name: frontend-tmp
mountPath: /tmp
tmp:
sizeLimit: 16Mi
```
Merge the temporary volume into any existing branding/translation mounts rather
than replacing them. Custom files must be readable by UID `65532`; mount them
read-only. Only `/tmp` needs writes for generated public runtime configuration
and nginx's PID/temp files. The web root stays read-only. Health checks can use
Since chart `0.210.0` the chart itself renders the writable `/tmp` (a
memory-backed emptyDir named `frontend-tmp`, sized by
`kerberoshub.frontend.tmp.sizeLimit`) for both frontends. Custom
branding/translation entries in `kerberoshub.frontend.volumes` and
`volumeMounts` are added next to it, so a values file that lists only the
custom mounts no longer drops `/tmp` and crashes the pod at startup. Values
files that still list the `frontend-tmp` entries themselves, or that mount
their own volume at `/tmp`, keep working: the built-in entries are then
skipped.
Custom files must be readable by UID `65532`; mount them read-only and write
them to the volume from outside the frontend pod (a ConfigMap, or a helper pod
on the same PVC), since the image has no shell or `tar` for `kubectl cp`. Only
`/tmp` needs writes for generated public runtime configuration and nginx's
PID/temp files. The web root stays read-only. Health checks can use
`GET /healthz` on the named `http` container port. These settings apply to both
the primary and demo frontends, which share the frontend image tag. Update the
live Argo CD Application's chart pin as well as its values: an image-only
+42
View File
@@ -199,3 +199,45 @@ Usage, as the last line of the container's env list:
{{ toYaml . | indent 8 }}
{{- end -}}
{{- end -}}
{{/*
hub-frontend scratch volume.
The hardened hub-frontend image runs with a read-only root filesystem and
writes its generated runtime configuration (/tmp/frontend-env.js) and nginx's
PID/temp files to /tmp, so every frontend pod needs a writable /tmp. The chart
always renders a memory-backed emptyDir for it, so custom branding or
translation mounts in kerberoshub.frontend.volumes / volumeMounts only add to
the pod and can never drop it (Helm replaces lists, it does not merge them).
Deployments that still list the old frontend-tmp entries themselves, or mount
their own volume at /tmp, keep those: the built-in entries are skipped.
*/}}
{{- define "hub.frontend.hasTmpMount" -}}
{{- range .Values.kerberoshub.frontend.volumeMounts }}{{ if eq .mountPath "/tmp" }}true{{ end }}{{ end }}
{{- end -}}
{{- define "hub.frontend.hasTmpVolume" -}}
{{- range .Values.kerberoshub.frontend.volumes }}{{ if eq .name "frontend-tmp" }}true{{ end }}{{ end }}
{{- end -}}
{{- define "hub.frontend.volumes" -}}
{{- $tmp := .Values.kerberoshub.frontend.tmp | default dict }}
{{- if not (or (include "hub.frontend.hasTmpMount" .) (include "hub.frontend.hasTmpVolume" .)) }}
- name: frontend-tmp
emptyDir:
medium: Memory
sizeLimit: {{ $tmp.sizeLimit | default "16Mi" }}
{{- end }}
{{- with .Values.kerberoshub.frontend.volumes }}
{{ toYaml . }}
{{- end }}
{{- end -}}
{{- define "hub.frontend.volumeMounts" -}}
{{- if not (include "hub.frontend.hasTmpMount" .) }}
- name: frontend-tmp
mountPath: /tmp
{{- end }}
{{- with .Values.kerberoshub.frontend.volumeMounts }}
{{ toYaml . }}
{{- end }}
{{- end -}}
@@ -89,10 +89,8 @@ spec:
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.kerberoshub.frontend.volumes }}
volumes:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- include "hub.frontend.volumes" . | trim | nindent 8 }}
{{- with .Values.kerberoshub.frontend.topologySpreadConstraints }}
topologySpreadConstraints:
{{- toYaml . | nindent 8 }}
@@ -112,10 +110,8 @@ spec:
ports:
- containerPort: {{ .Values.kerberoshub.frontend.containerPort | default 8080 }}
name: http
{{- with .Values.kerberoshub.frontend.volumeMounts}}
volumeMounts:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- include "hub.frontend.volumeMounts" . | trim | nindent 8 }}
env:
- name: SSO_DOMAINS
# get the domain attribute from the list of sso domains
@@ -170,10 +170,8 @@ spec:
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.kerberoshub.frontend.volumes }}
volumes:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- include "hub.frontend.volumes" . | trim | nindent 8 }}
{{- with .Values.kerberoshub.frontend.topologySpreadConstraints }}
topologySpreadConstraints:
{{- toYaml . | nindent 8 }}
@@ -193,10 +191,8 @@ spec:
ports:
- containerPort: {{ .Values.kerberoshub.frontend.containerPort | default 8080 }}
name: http
{{- with .Values.kerberoshub.frontend.volumeMounts}}
volumeMounts:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- include "hub.frontend.volumeMounts" . | trim | nindent 8 }}
env:
- name: LOG_LEVEL
value: "{{ .Values.kerberoshub.frontend.logLevel }}"
+22 -11
View File
@@ -650,15 +650,16 @@ kerberoshub:
drop: ["ALL"]
seccompProfile:
type: RuntimeDefault
# Keep these entries when adding custom branding/translation mounts.
volumes:
- name: frontend-tmp
emptyDir:
medium: Memory
sizeLimit: 16Mi
volumeMounts:
- name: frontend-tmp
mountPath: /tmp
# The hardened image writes its generated runtime configuration and nginx's
# temp files to /tmp. The chart always mounts a memory-backed emptyDir there
# (volume name frontend-tmp); you never have to list it yourself, and the
# custom branding/translation mounts further down only add to it.
tmp:
sizeLimit: 16Mi
# Extra volumes and mounts for this deployment (custom css, favicons,
# translations). See the "Custom layout" section below for the mount paths.
volumes: []
volumeMounts: []
topologySpreadConstraints: [] # Optional pod topology spread constraints (empty = none).
# Set to false to skip rendering the hub-frontend Service (e.g. when an
# external/shared Service is managed elsewhere).
@@ -709,7 +710,14 @@ kerberoshub:
logo: "custom"
# Custom layout: override css, favicons and translations (i18n)
# By providing a style.css file in the custom folder this file will override
# any css styling. Favicons are mounted into the favicon folder.
# any css styling. Favicons are mounted into the favicons folder.
# The image runs as UID 65532 without a shell, so the files must be readable
# by that UID (chmod a+rX) and must be written to the volume from outside the
# frontend pod (a ConfigMap, or a helper pod mounting the same PVC).
# Mounting a directory replaces everything the image ships there: when you
# mount assets/custom, include icons.js, auth-icons.js and logo-sidebar.png
# (copy them from custom-layout/) next to your style.css, or mount only
# style.css with subPath.
#
# Translations (i18n): for each language the served strings are
# deepMerge(assets/i18n/<lang>.json, assets/i18n-custom/<lang>.json)
@@ -731,10 +739,13 @@ kerberoshub:
#volumeMounts:
# - name: custom-layout
# mountPath: /usr/share/nginx/html/assets/custom
# readOnly: true
# - name: custom-favicon
# mountPath: /usr/share/nginx/html/assets/favicon
# mountPath: /usr/share/nginx/html/assets/favicons
# readOnly: true
# - name: custom-i18n
# mountPath: /usr/share/nginx/html/assets/i18n-custom
# readOnly: true
#volumes:
# - name: custom-layout
# persistentVolumeClaim: