top | item 16973272

(no title)

loiselleatwork | 7 years ago

Author of post here and CRL employee: just for some additional detail, we reached out to Kelsey about the problems he's seen running databases in Kubernetes.

https://twitter.com/kelseyhightower/status/96347131657256140...

He said "You still need to worry about database backups and restores. You need to consider downtime during cluster upgrades."

These things are totally true. K8s doesn't automate backups (edit: by default; though, it can) and if you need to take K8s down for upgrades, then everything is down. For its part, though, CockroachDB supports rolling upgrades with no downtime on Kubernetes.

As for routing, that is tough problem if you want to run K8s across multiple regions, though we have some folks who've done it.

And if one finds setting up StatefulSets challenging, we have a tutorial on how to do it written by a former Kubernetes engineer: https://www.cockroachlabs.com/docs/stable/orchestrate-cockro...

discuss

order

hardwaresofton|7 years ago

Note that none of those things are impossible on kubernetes, k8s just doesn't offer them by default (which is good IMO).

There are projects that help you run databases in kubernetes and also make backups of many things hosted:

- Automatic CephFS for your cluster -> https://rook.io/docs/rook/master/

- Backups for cluster resources and volumes -> https://github.com/heptio/ark

- Spin up dynamic postgres clusters -> https://github.com/zalando-incubator/postgres-operator

Databases are just applications with different resource needs. Please stop pushing forward the notion that they can't be run in containers or container orchestration systems. Databases are just programs. If the substrate for running your containers doensn't reliably support flock or fsync or something your database needs, then maybe pick a better substrate that does -- container runtimes these days and kubernetes don't stand in your way these days.

merb|7 years ago

Well with k8s 1.10+ it's also possible to use statefulsets and local volume, so with affinity it's possible to just use k8s as an orchestration system where you "install" your database and keep it up to date with k8s. of course if a node goes down you need to failover, etc. but patroni/zalando postgres works really well with statefulsets and local volume. (as long as a single node is still running, which should always be the case...) (https://kubernetes.io/blog/2018/04/13/local-persistent-volum...)