From 5bb5be15f37be514bbae2f41c072f775f7b779b8 Mon Sep 17 00:00:00 2001 From: Ben Vincent Date: Sat, 8 Aug 2026 19:57:39 +1000 Subject: [PATCH] puppetdb: give each pod a unique command-queue directory 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 --- apps/base/puppet/deployment_puppetdb.yaml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/apps/base/puppet/deployment_puppetdb.yaml b/apps/base/puppet/deployment_puppetdb.yaml index 2c08999..1e93c80 100644 --- a/apps/base/puppet/deployment_puppetdb.yaml +++ b/apps/base/puppet/deployment_puppetdb.yaml @@ -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