3 ms·
Got it, thanks! What about running a postgres container on GKE?
by stevenleeg 11y ago
Got it, thanks! What about running a postgres container on GKE?
- andrewstuart2 11y agoThere's nothing stopping anybody for sure, but it's definitely not going to be as hands-off for getting to high availability, backups, scaling well, etc would be with managed SQL as a service.
- crb 11y agoNice writeup on that here: https://blog.oestrich.org/2015/08/running-postgres-inside-kubernetes/ https://blog.oestrich.org/2015/08/running-postgres-inside-ku...
- waffle_ss 11y agoLots of reasons not to. You'd be in charge of setting up backups (e.g. setting up WAL-E + an S3 bucket and monitoring that - and you'd have to add WAL-E support to your Docker image, which is a PITA), have to perform database upgrades yourself, have to monitor resource usage (CPU, memory, and disk), have to worry about how to manage the Docker volume so that write performance doesn't suffer (Docker defaults to copy-on-write - very bad for databases), you'd have to manage a Docker image and how to make it configurable (how do you enable Postgres extensions if you end up needing one?), you'd have to worry about how the GKE/Kubernetes scheduler will allocate the pod and what other resources on that node might affect it (and how that will affect the resource assumptions in your Postgres config), any Docker updates will require restarting the container and thus downtime (unless you have some kind of replication setup), all kinds of things. In general I wouldn't want to run a relational database in Docker, especially not as some sort of generic cluster of containers; I'd want to give it its own VM with Postgres configuration settings specific to its resources (e.g. using pgtune).
- stevenleeg 11y agoAhh totally makes sense. Thanks a ton for the insight, it's super helpful!