puppetdb: isolate only the stockpile queue per pod (fix #340 crashloop) #342
Reference in New Issue
Block a user
Delete Branch "benvin/puppetdb-stockpile-only-queue"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
PR #340 made the entire PuppetDB vardir (
/opt/puppetlabs/server/data/puppetdb) per-pod viasubPathExpr: $(POD_NAME). The vardir also holds the SSL keypair undercerts/, so every freshly-rolled pod got an emptycerts/and crash-looped:All puppetdb pods share certname
openvoxdb, so a pod with no local keypair can neither reuse the cert nor re-request one the CA already signed. Result: puppetdb went CrashLoopBackOff after #340 synced. Only the command queue (stockpile/) actually needs per-pod isolation;certs/(andlogs/) were correctly shared before.Change
subPathExpr; the vardir mount is shared again (certs + logs behave as before #340)./opt/puppetlabs/server/data/puppetdb/stockpilewithsubPathExpr: stockpile/$(POD_NAME), so each pod gets its own command queue at<pvc>/stockpile/<pod-name>/while everything else stays shared.create-log-dirinit container (root) now alsomkdirs andchowns the per-pod stockpile dir to uid/gid 999.Approach
Still subPathExpr with pod name, but scoped to the stockpile subdirectory instead of the whole vardir — the minimal correct fix that both restores service and delivers unique per-pod command queues. Persistent per-pod (nested subPath on the durable RWX PVC), not emptyDir. PuppetDB's stockpile default (
<vardir>/stockpile) is unchanged; the k8s mount simply backs that path per-pod, so app config and mount agree with no configmap change.Replica count: HPA min 2 / max 5 (unchanged).
Restores service (certs shared again) and keeps the per-pod queue fix from #340.
https://claude.ai/code/session_01JUoARVdmhxKQHyyyp1pxeT