Will Gorman @willgorman.net · Mar 18

Learned about a footgun running postgres on k8s. The postgres Dockerfile uses a VOLUME command which means it'll mount a local dir if nothing else is mounted there when run. In this case I got that local dir mounted under my PVC so on every restart the data went poof despite appearing persistent

1 likes 1 replies

?

Replies

Patrick Richter · Mar 18

Yeah, that's a classic one. StatefulSets with proper volumeMounts should've caught it, but Dockerfiles with implicit volumes are sneaky that way.