Give stalwart-apply a writable HOME (#549)

The stalwart-apply PostSync Job fails with "Read-only file system": stalwart-cli caches the server schema under $HOME/.cache, which sits on the read-only root. The plan never applies, so Stalwart runs without its certificate, listeners or stdout tracer.

- mount a /tmp emptyDir in both Job containers
- set HOME=/tmp for the cli and kubectl (discovery cache)

Reviewed-on: #549
Co-authored-by: unkin-agent <unkin-agent@unkin.net>
Co-committed-by: unkin-agent <unkin-agent@unkin.net>
This commit was merged in pull request #549.
This commit is contained in:
2026-10-13 21:26:50 +11:00
committed by BenVincent
parent 02ded6c26b
commit 283f9e8ac4
+13
View File
@@ -34,6 +34,9 @@ spec:
- --file - --file
- /plan/plan.ndjson - /plan/plan.ndjson
env: env:
# the cli caches the server schema under $HOME/.cache
- name: HOME
value: /tmp
- name: STALWART_URL - name: STALWART_URL
value: http://stalwart.mail.svc:8080 value: http://stalwart.mail.svc:8080
- name: STALWART_USER - name: STALWART_USER
@@ -63,6 +66,8 @@ spec:
- name: plan - name: plan
mountPath: /plan mountPath: /plan
readOnly: true readOnly: true
- name: tmp
mountPath: /tmp
containers: containers:
- name: restart - name: restart
image: registry.k8s.io/kubectl:v1.33.13 image: registry.k8s.io/kubectl:v1.33.13
@@ -71,6 +76,9 @@ spec:
- restart - restart
- statefulset/stalwart - statefulset/stalwart
- --namespace=mail - --namespace=mail
env:
- name: HOME
value: /tmp
securityContext: securityContext:
runAsUser: 65532 runAsUser: 65532
runAsGroup: 65532 runAsGroup: 65532
@@ -86,6 +94,9 @@ spec:
requests: requests:
cpu: 50m cpu: 50m
memory: 32Mi memory: 32Mi
volumeMounts:
- name: tmp
mountPath: /tmp
volumes: volumes:
- name: plan - name: plan
configMap: configMap:
@@ -93,3 +104,5 @@ spec:
items: items:
- key: plan.ndjson - key: plan.ndjson
path: plan.ndjson path: plan.ndjson
- name: tmp
emptyDir: {}