puppetdb: give each pod a unique command-queue directory
ci/woodpecker/pr/vector-test Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/kubeconform Pipeline was successful

PuppetDB runs as a Deployment (HPA min 2 / max 5) with its vardir
/opt/puppetlabs/server/data/puppetdb backed by a shared RWX cephfs PVC.
All replicas mount the same path, so they share the stockpile/ command
queue and corrupt each other's unprocessed commands.

Mount the shared PVC with subPathExpr: $(POD_NAME) so each pod gets its
own vardir (and thus its own stockpile queue) on the shared volume.

Claude-Session: https://claude.ai/code/session_01JUoARVdmhxKQHyyyp1pxeT
This commit is contained in:
Ben Vincent
2026-08-08 19:57:39 +10:00
parent ba7a1a9509
commit 5bb5be15f3
+11
View File
@@ -49,6 +49,10 @@ spec:
- configMapRef:
name: puppetdb-config
env:
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: OPENVOXDB_POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
@@ -88,6 +92,7 @@ spec:
volumeMounts:
- mountPath: /opt/puppetlabs/server/data/puppetdb
name: puppetdb-storage
subPathExpr: $(POD_NAME)
- mountPath: /etc/puppetlabs/puppetdb/conf.d/read-database.conf
name: puppetdb-read-database-conf
subPath: read-database.conf
@@ -99,6 +104,11 @@ spec:
- -c
args:
- mkdir -p /opt/puppetlabs/server/data/puppetdb/logs && chown 999:999 /opt/puppetlabs/server/data/puppetdb/logs
env:
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
resources:
limits:
cpu: 20m
@@ -111,6 +121,7 @@ spec:
volumeMounts:
- mountPath: /opt/puppetlabs/server/data/puppetdb
name: puppetdb-storage
subPathExpr: $(POD_NAME)
- name: pgchecker
image: docker.io/busybox:1.37