News for hackers. Stuff that matters.
Re:Deploying PostgreSQL Clusters Using StatefulSets by x0x0 on Sunday February 26, 2017 @04:56PM (#13740179)
May I ask why you want to run pg inside kubernetes? I'm trying to wrap my head around why that's a thing that people want to do.
Re:Deploying PostgreSQL Clusters Using StatefulSets by atombender on Sunday February 26, 2017 @05:08PM (#13740263)
If you have to maintain Kubernetes _and_ classical VMs, you have two overlapping systems. I'd rather just use one, and get the flexibility it brings over classical VMs.

For example, I'd be able to upgrade by just starting another container and replicating into it, then routing traffic over. I'd retain the option of rolling back by routing traffic back if anything goes wrong. I'd be able to spin up/down redundant read-only replicas simply by changing the number of replicas. And other apps would be able to piggyback on Kubernetes' discovery system (typically you let service names resolve into IPs/SRV records through DNS). And so on.

You can do anything you want with classical VMs, of course, it's just more static and slower: Provisioning another VM, configuring it (Puppet, Salt, Chef, etc.), connecting persistent storage, reconfiguring everything to point to the right places, configuring DNS, etc.

In short: If you use Kubernetes as your orchestrator, why would you not want to use it for everything?

Re:Deploying PostgreSQL Clusters Using StatefulSets by x0x0 on Sunday February 26, 2017 @07:21PM (#13740903)
I totally get the attraction of learning one set of tooling, rather than k8s and ami/homebrew. Blue/green deploys are nice, particularly because we deploy for most PRs.

But it just seems like you're trying to shove a very stateful management problem (the schema, the associated storage) into a system designed for mostly stateless stuff. And that way lies a giant hassle.

Plus we're certainly not at huge scale, but db rollbacks are nontrivial, and we have to be somewhat careful about schema modifications.

Thanks for your comment!

Re:Deploying PostgreSQL Clusters Using StatefulSets by lobster_johnson on Sunday February 26, 2017 @07:43PM (#13740998)
But Kubernetes _is_ designed to support stateful containers; that's what StatefulSets are about.

There's nothing about containers that says they need to be stateless, it's just more convenient that way because you can treat every container as expendable, redundant, fungible commodities. But the real world needs state, and Kubernetes is capable of managing it. In particular, the pattern pretty much required for stateful apps on Kubernetes is that of using an exclusive-access network block device. Since only one container (or pod) can mount it at any given time, you can ensure that the state follows the container around.

Re:Deploying PostgreSQL Clusters Using StatefulSets by x0x0 on Monday February 27, 2017 @02:10AM (#13742451)
I understand it can be done; it just seems like a hassle (viz this thread!) and I don't understand the upside. Discovery is an upside, but I bet there's a way to get discovery with manual updates.

It may just be our use case -- we have enough data (low TB) that cloning is not a fast thing to do.

Thanks again!

Re:Deploying PostgreSQL Clusters Using StatefulSets by lobster_johnson on Monday February 27, 2017 @02:34AM (#13742547)
Sure, with Kubernetes you can create a "headless" service that points statically at some external service instead of a container.