Kubernetes rocks, but this post exemplifies a complaint of mine: there's a glaring lack of examples of production-capable database deployments.
In this Helm chart, your master is a single Pod (which is ephemeral and which you should usually not be creating directly) that stores data in an emptyDir (which is coupled to the lifecycle of the Pod).
Thanks! That was exactly what I was looking for. From a first glance it seems it's well possible to use it with non-k8s environments (like Rancher's Cattle) as well, using Consul and, possibly, a bit of duct tape.
But can you please tell what's the general difference between the original and the fork? I see that both are active, but nothing in README tells what one has over another.
It's a bit of a failure on our (gravitational) side as we are moving fast and haven't submitted PR yet. We will definitely try to merge upstream soon though. We've added several features and changes to the code compared to Simone's version:
* S3 backup restore feature
* RPC to communicate with controller over API
* Refactored client and updated the CLI
* Updated and slimmed down base images
Petsets are alpha quality (lots of bugs and some missing behaviour in 1.3) and will only reach beta in 1.5, which is probably next year. So it wouldn't really be fair to demo something that cannot be used in production.
The persistent state is really just the data, not the process. With kubernetes you store the data on a persistent volume (which could be EBS, iSCSI, etc) and the process runs in the container. Host dies? Kubernetes can re-attach that volume on another host, start up a new container and you are back in business.
*Note: looks like in this example they are not setting up a persistent volume.
Ideally, yes. It's not actually the case though. Again, ideally.
Well tested databases have evolved to have to survive arbitrary power cuts- even in the middle of a transaction; and so have slowly become reliable enough to trust to start from on-disk state only.
Good f-in' luck bringing your db flavor of the month back online from disk state alone. Hope you didn't have any transactions open to your DB before it got rescheduled to a different node in your cluster.
We just played with Elastic File System mounted into a Pod via `nfs` and it worked like a charm, with the additional "oh, wow" of being able to attach the same EFS to several Pods at the same time. I was also thrilled that they mounted with the root uid intact so there wasn't any kind of dumb permission juggling.
I did say "played with" because we haven't beat on it to know if one could run Jira, Gitlab, Prometheus, that kind of workload. I wouldn't at this point try Postgres but maybe it'd work.
I wonder how suitable EFS is for Postgres. It's supposedly low-latency, high-throughput and supports Unix locking semantics and so on. On the other hand, it's NFS (one of the worst protocols out there), and there have been reports of less than impressive latencies. EFS is also a lot more expensive than EBS.
When I looked at it two months ago, I was having issues getting it to build and deploy on my cluster. After having issues trying to dissect the simple examples, I eventually wrote something similar with python & bash wrapped up in a docker container.
My requirements were deploying 30 different apps using pretty much every kin do k8s objects and deploy custom consul configuration. It could have been done with helm, but the quick and dirty was jinja2 to the rescue.
One more completely custom method of provisioning, rather than using operating system packages and simple shell scripts inside of their preinstall, postinstall, preremove, and postremove sections. How wonderful.
In this Helm chart, your master is a single Pod (which is ephemeral and which you should usually not be creating directly) that stores data in an emptyDir (which is coupled to the lifecycle of the Pod).