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
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user