News for hackers. Stuff that matters.
Re:PostgreSQL 14 on Kubernetes by leetrout on Tuesday October 05, 2021 @11:59PM (#28769041)
Why would i want to run my database in k8s?
Re:PostgreSQL 14 on Kubernetes by rafaelturk on Wednesday October 06, 2021 @07:36AM (#28771840)
We run all our databases in K8S, approx 80 DBs. We're a fintech that requires HA so all databases run with at least 3 notes. Maging DB clusters with K8S only requires 1 file.

If we need to increase storage this can be achieved in minutes, if we need to take one node down we basically can do it anytime during the day..

Every now and then we discuss moving DBs to AWS RDS (or equivalent) however for our transaction volume RDS costs are prohibitive.

Re:PostgreSQL 14 on Kubernetes by dijit on Wednesday October 06, 2021 @11:08AM (#28774052)
I just checked your comment history and it appears that you like to troll.

How can I know that this isn't one of those cases? I know some folks in fintech and while obviously they're not _you_, they're definitely not the sort to be wishy washy with data, if anything they're quite conservative when it comes to how the databases are managed.

Any incidental complexity is incredibly discouraged.

Re:PostgreSQL 14 on Kubernetes by cbushko on Wednesday October 06, 2021 @11:07AM (#28774041)
What DB are you running?
Re:PostgreSQL 14 on Kubernetes by evil-olive on Wednesday October 06, 2021 @02:05AM (#28769725)
if you run your stateless services on an orchestration system like k8s, you have two options:

a) run your stateful services (such as Postgres) on the same orchestration system

b) choose a second orchestration system (often a more "traditional" infrastructure provisioning system like Chef/Puppet/Ansible/SaltStack) that will only manage your stateful services, and deal with the care & feeding & mental overhead of having two things that do fairly similar jobs and need to interact with each other (because of course your k8s-hosted stateless services need to be able to look up Postgres in DNS)

(option C would be to use a managed service like RDS...but options A and B assume you've already made a decision, for whatever reason, to run the stateful services yourself)

Re:PostgreSQL 14 on Kubernetes by morelisp on Wednesday October 06, 2021 @02:55AM (#28770027)
If you choose a) you don't really get to avoid b), since something still has to bootstrap your Kubernetes nodes themselves. So it's more a question whether you'd rather write a Kubernetes manifest or a Salt/Ansible config; and with the complexity and limitations of a lot of storage operators, and no real "orchestration" benefit once you have pinned deployments to particular nodes anyway, sometimes it's the latter.

The main force that's pushing us to move our storage into K8s isn't simplifying our node configuration, but to keep parity between our prod and more dynamic staging environments. For the latter k8s storage operators are great because we don't generally care about data durability or performance.

Re:PostgreSQL 14 on Kubernetes by cdogl on Wednesday October 06, 2021 @05:53AM (#28771089)
> If you choose a) you don't really get to avoid b), since something still has to bootstrap your Kubernetes nodes themselves

Not quite true if you use a managed K8S offering - and it seems a self-managed cluster is something to be avoided until absolutely necessary. Even with a managed cluster like GKE there's plenty of operational overhead to keep everything up-to-date and working properly.

Re:PostgreSQL 14 on Kubernetes by morelisp on Wednesday October 06, 2021 @04:35PM (#28778093)
If you're running on a managed K8s offering yet not using the managed storage, you're getting ripped off. (I'm well aware this describes a lot of companies / projects.)
Re:PostgreSQL 14 on Kubernetes by goodpoint on Wednesday October 06, 2021 @06:00AM (#28771138)
Aka: k8s is the new hammer and every workload looks like a nail.

I'll be downvoted to hell for this.

Re:PostgreSQL 14 on Kubernetes by manigandham on Wednesday October 06, 2021 @01:06AM (#28769410)
Because kubernetes is a fantastic platform that provides a lot of node and app management functionality out of the box. Stateful services like databases are not really a challenge anymore given recent developments in both K8S and database containerization.
Re:PostgreSQL 14 on Kubernetes by tiew9Vii on Wednesday October 06, 2021 @01:41AM (#28769589)
With a database I generally want to have it on its own dedicated host with fast NVME drives, memory, cpu etc, maybe some OS specific system level configuration options for performance etc. I don't want to binpack it on a cluster of nodes each contending for system resources. Also RDBMS databases are not really designed to be ephemeral/elastic, they are stateful/persistent by nature.

What does Kubernetes offer in this scenario?

I'm still hesitant to run things like DB's on K8's but have absolutely no problems running cloud native apps on K8's which can run ephemerally, be bin packed and only needing compute as all state is external to where the app is being executed.

Re:PostgreSQL 14 on Kubernetes by paulfurtado on Wednesday October 06, 2021 @03:19AM (#28770155)
Say you have 100 database clusters and you want to schedule them on dedicated servers.

A kubernetes node can advertise those local block devices as persistent volumes. Your StatefulSet can request that class of local storage and the kubernetes scheduler will then find a volume for the pods on a node that the pod can fit on.

You then get all the features of kubernetes operators plus the performance of dedicated nodes and local storage. When a local storage node disappears, your pod gets a new volume on a new node and can replicate from its peers, or start from a backup.

Kubernetes then offers metrics, certificate management, secret storage and management, load balancing, healthchecks, debugging tools, rich firewalling, RBAC, and a huge ecosystem of plugins. It gives you a unified API for all your workloads. Requesting a database then is as simple as a single API call to kubernetes with a spec for your database (ex: creating a MysqlCluster object).

The company I work for runs MySQL, ZooKeeper, memcached, hbase, hadoop, kafka, elasticsearch, and more in kubernetes with great success. Scale here in one prod region is ~10,000 pods on a clusters of ~600 nodes. There are about 900 separate MySQL clusters consisting of 3 replicas each, 150 separate zk clusters of 5 replicas each, etc.

Re:PostgreSQL 14 on Kubernetes by arianvanp on Wednesday October 06, 2021 @05:50AM (#28771070)
> when a node disappears you get a new volume

Actually no. Currently you need to manually delete the persistent volume claim. Followed by deleting the pod. For the statefulsets ti to create a new PVC.

There even was a race condition until like 1.21 that made this operation fail 20% of the time so you'd have to delete the pod twice or the system would deadlock.

It'd be nice if the PVC would claim a new PVC if the orchestration layer knows 100% the PV is gone but it currently doesn't do this yet.

It's not an enormous problem once you're aware of it. But it does mean things don't auto heal at all. A node going down with local storage on it needs manual intervention to get the system running and healthy again.

There might be some operators that automate this away but i haven't seen it yet in the wild.

Re:PostgreSQL 14 on Kubernetes by paulfurtado on Wednesday October 06, 2021 @11:45AM (#28774531)
We do actually automate this away by deleting PVCs when they are tied to PVs on nodes with our drain taint on them and their pod is in the pending state. We also delete pods owned my StatefulSets that have missing PVCs. These two control loops really grease the wheels. It's definitely frustrating that statefulset pvc management isn't fully declarative, but hopefully this improves.
Re:PostgreSQL 14 on Kubernetes by chousuke on Wednesday October 06, 2021 @12:54PM (#28775356)
How do you prevent someone (or something) from accidentally draining a node hosting a database that does not have a synchronised replica?

Kubernetes is neat, but destroying stuff is so easy (and the context mechanism is just begging for human error) that I am a bit leery about hosting large amounts of stateful stuff in it.

Re:PostgreSQL 14 on Kubernetes by paulfurtado on Wednesday October 06, 2021 @01:43PM (#28775954)
No database should lack an unsynchronized replica in general. A kubernetes admin could accidentally drain the host, but we run in AWS and AWS can kill nodes a lot faster than we can haha. We have enough servers in AWS that at least 5 fail per day. If some database is not replicated, someone is getting paged for it. We run MySQL with semi-sync replication for example: if a primary has two replicas, one replica must ack a write before the primary commits it, so you can lose the primary at any time and not lose data. That said, kubernetes has prevention mechanisms for this.

PodDisruptionBudgets allow you to specify the minimum number of replicas. The drain command calls evict instead of delete and evict honors these restrictions. This is helpful for node draining, but not necessarily helpful if someone accidentally deletes a StatefulSet. However, nothing in kubernetes deletes PVC objects automatically, so if you delete the pod, the volume remains bound to the PVC until you delete it.

preStop hooks are used in all the database pods to ensure that if the current pod is the primary, leadership is correctly changed to a replica before proceeding with the delete. We combine this with extremely long termination grace periods and alerting if termination is taking too long so that an ops team can look into the issue.

preStop hooks are great, but they also are somewhat of a time bomb if not careful, so some of our database operators make use of finalizers instead. With finalizers, nothing happens when a pod enters the terminating state until an operator marks the pod's finalizer as completed. This flow is really nice because you end up with behavior where the kubernetes cluster admins or built in controllers effectively are really gently requesting that a pod terminate, and it's up to the operator of that pod to decide exactly how and when that occurs.

For non-local volumes, like EBS PVCs, once the PVC is deleted an operator will snapshot the volume during a finalizer before allowing the volume to be fully deleted so that we can recover data if this ever accidentally occurs. This was the first protection we ever implemented when initially adopting kubernetes back when we had no idea what we were doing so that we could always recover data in the event of admin mistakes. We can't do this for local volumes, however, any team making use of local volumes truly needs to stay on top of replication when running in the cloud, whether on kubernetes or not or else you absolutely will lose data. AWS local nvme volumes have limited write cycles just like the ones in on-prem servers. So ideally all databses are configured to not accept writes that cannot be replicated. And even with EBS, at scale we end up with something like 20 unrecoverable volume failures per year

Re:PostgreSQL 14 on Kubernetes by chousuke on Wednesday October 06, 2021 @02:35PM (#28776575)
Thanks for the detailed response. I was aware Kubernetes has hooks for pretty much everything, so getting details on how they are used in practice is interesting.

Mostly I'm concerned about preventing administrator mistakes; if you have enough privileges, it's distressingly easy to just accidentally delete all kinds of resources in the default configuration, especially since kubectl is context-sensitive. I like my automation software to have checks in it to prevent me from doing stupid things without explicitly disabling a number of safeties first.

I feel like Kubernetes is a powertool that requires a competent and trained admin team or managed access so that you simply can't make awful mistakes as a "regular user", but a lot of the hype around it seems to be focused on how "easy" it is.

To my eyes, it's indeed easy to just throw manifests from the internet at Kubernetes, but that is often akin to disabling SELinux because some blog says so; it may get things working, but it's not the competent choice most of the time.

I'm also a big proponent of storing everything in git repositories, so I do like how Kubernetes enables declarative configuration, though it seems much of the tooling in the ecosystem works against that by just creating resources in a cluster with no version control...

Re:PostgreSQL 14 on Kubernetes by paulfurtado on Wednesday October 06, 2021 @03:40PM (#28777399)
Cool thing about finalizers is that there's no straightforward way to delete them from the CLI, you need to explicitly patch the object to delete the finalizer so that goes a long way towards preventing instant mass deletion, they really do help a lot here.

The additional protection we have is via admission controllers which hook all API calls to prevent mistakes, of course, you have to foresee those mistakes and come up with a validation that prevents it. But even something as simple as "only 5 pods are allowed to be terminating at once" can help.

I absolutely agree about people claiming kubernetes is easy. It is easy to throw some helm chart at the kube API and suddenly have an app running with all it's databses configured. It is hard to keep them all running.

The pattern of operators seeks to solve this. Instead of a helm chart creating a MySQL statefulset, it creates a MySQLCluster that gets managed by a well-written operator following the best practices and correctly implementing all the hooks. The ecosystem is starting to converge on this finally and the beauty is that the sum of the industry's operational knowledge can be coded into these operators and we'll finally arrive at nearly fully self managing databases with backups and all.

The industry isn't there quite yet though, and so at least for stateful workloads you need significant operational experience. For background: I am the Tech Lead of our team that runs the kubernetes clusters and we provide all of the primitives our users need and control access. Each database type then has dedicated teams operating them and codifying operations into operators. There is a lot of work being done. But prior to kubernetes, all of these teams separately were coding against the EC2 API with no standardization, no unified view, ad-hoc failure detection, ad-hoc auditing, etc. Kubernetes is a very substantial improvement over that, but 90% of companies never reach a scale where this is necessary. But once extremely solid open source operators exist we may truly hit the dream of just applying some self managing operator manifest to an EKS or GKE cluster and getting an actually production grade database setup.

Version control is an interesting topic because it's hard to express transitive dependencies in that code. For example, the MySQL operator creating a StatefulSet and the Statefulset creating pods. It doesn't make sense to commit those lower level resources to git, they're not fully independent. However, for top level things, our build system produces artifacts from git and the deploy system creates them in the cluster. With this setup, only admins could directly apply them, which really helps with keeping things in sync with git.

Re:PostgreSQL 14 on Kubernetes by chousuke on Friday October 08, 2021 @05:22PM (#28804365)
I'm a bit late replying, but I just want to clarify my stance on the last paragraph; I don't think you need to store everything in the cluster in version control if they're created automatically as a result of applying the top-level configuration, If there's something important that's too dynamic to be in source control, I treat it as data to be backed up.

My ideal is that what is in the repository allows me to rebuild the system from scratch (assuming suitable hardware exists) to the point where it can be successfully used as a restore target for your backups following documented restore procedures.

Re:PostgreSQL 14 on Kubernetes by arianvanp on Wednesday October 06, 2021 @02:23PM (#28776424)
Is this part of the postgres controller or is this an own controller that you wrote?
Re:PostgreSQL 14 on Kubernetes by paulfurtado on Thursday October 07, 2021 @03:11AM (#28783169)
This is a controller we wrote in order to make local storage actually usable. Internally we have a "kube cluster operator" that handles the cluster-level ops like this, gracefully draining nodes, etc.
Re:PostgreSQL 14 on Kubernetes by FridgeSeal on Wednesday October 06, 2021 @02:20AM (#28769822)
As the other comment or pointed out, there’s a number of features now that tick these boxes:

- StatefulSets mean that K8s scheduling is aware that the workload is stateful and the auto-attach of drives works fantastically in my experience.

- NodeTaints/Tolerances and workload anti-affinities between workloads mean that you can very easily say “this workload runs on nodes with these features/labels” and “don’t run workload replicas on the same node” and “don’t run other workloads on the same node as this workload. Node groups on things like AWS EKS also make it really easy to get autoscaling groups of nodes with specific hardware.

Re:PostgreSQL 14 on Kubernetes by manigandham on Wednesday October 06, 2021 @05:13AM (#28770844)
Kubernetes is an orchestrator: You have servers. One of them is the master, the rest are workers. Master talks to the workers via ssh. You talk to the master via API. You tell the master node what you want running and it runs it for you. Then it continuously checks to make sure that what's actually running is what you wanted, and makes fixes if it isn't.

What you want to run, and how, where, under what conditions, etc. is all specified in declarative files. Like I said, stateful services are not a problem anymore. K8S can deploy a database service as instances exclusive to specific nodes with the appropriate storage and networking config.

It's like an invisible assistant to automate what you would be doing yourself, or using several other tools to do anyway. A well-tested way to handle most of the common infrastructure issues for any deployed software in a single platform.

EDIT: I'll add that running K8S itself can be challenging, but that's because complexity can't be erased but only abstracted. I recommend using managed K8S to offload this.

Re:PostgreSQL 14 on Kubernetes by arianvanp on Wednesday October 06, 2021 @04:23AM (#28770535)
Have a look at local storage provisioners. There are plenty of them

They give you raw access to storage without redundancy. Which is great if your workload on top (like https://k8ssandra.io) already is redundant. Whilst making sure workloads stick to where their data is stored

E.g. https://github.com/openebs/lvm-localpv

Re:PostgreSQL 14 on Kubernetes by alphabettsy on Wednesday October 06, 2021 @01:52AM (#28769658)
StatefulSets, Node Groups, and Node Affinity/Taints solve some of those issues.
Re:PostgreSQL 14 on Kubernetes by karolist on Wednesday October 06, 2021 @04:01AM (#28770401)
A database is not a service well suited for ephemeral, quick scale down and scale up container workloads that K8s really excells at, and if you have nodes specifically configured to run databases and nothing else then you should simply run them there directly and not mangle K8s to replicate what will essentially be equivalent to running them there directly.
Re:PostgreSQL 14 on Kubernetes by dividedbyzero on Wednesday October 06, 2021 @05:53AM (#28771095)
I've ran several small postgres databases and a kafka cluster on Kubernetes; in our case, the VM route would have added lots and lots of overhead with very questionable benefits, given that we didn't run a single prod VM ourselves (all managed by GKE) and hence we had good tooling, observability, monitoring for k8s workloads in place, but VMs were essentially treated as more like a set of disposable blackboxes (not entirely, but we'd only monitor certain aspects and leave all else to GKE)

Being able to get essentially the same result, but with our familiar processes, tooling, infra, that was really helpful getting things off the ground quickly and keeping them stable. We picked k8s/GKE way before that as a platform where a small set of abstractions allow us to do a lot of different things, and that makes it easy to debug unfamiliar workloads, keeping operations overhead low, and it worked out really well, and much easier for people with little ops experience to learn and get to a point where they could take care of their workloads themselves.

And it never felt we had to mangle k8s for our stateful workloads at all. Statefulsets, storage, node affinity etc. feel very much like organic building blocks and work really really well, with very few surprises. I guess k8s has come a long way as far as stateful workloads are concerned.

Re:PostgreSQL 14 on Kubernetes by manigandham on Wednesday October 06, 2021 @06:01AM (#28771144)
K8S runs workloads across servers in a declarative fashion. Ephemeral or stateful doesn't make a difference anymore.

Whatever you use to manage the nodes directly is basically what K8S provides (and more) already, so you're really just replicating effort and complexity instead.

Re:PostgreSQL 14 on Kubernetes by Arnavion on Wednesday October 06, 2021 @06:24AM (#28771312)
Indeed.

k8s orchestration is also useful for running multiple replicas of a database and using leader election to promote a secondary to a primary if the primary goes down. Doing this without k8s would require some kind of clustering anyway, to coordinate the leader election. So if you're already using k8s for everything else, you might as well also use it for this instead of introducing something else like pacemaker.

The one disadvantage is that leader election under k8s does need to be implemented from scratch, because it isn't a first-party concept in k8s. All it gives you is the first-party implementation of compare-and-swap for resources. So you have to make a StatefulSet for your replicas, make a ConfigMap to store the leader election data (which is where the CAS ensures atomicity), and write a sidecar container to handle the healthchecks and leader election and dynamic scale-up/down of replicas. You'll probably end up making an operator to do all that for you so that you can deploy a custom resource for your replicas and they're converted to StatefulSets with Pods containing the sidecars, etc automatically.

Of course, for the big popular DBs, someone has probably already written such operators for you.

Re:PostgreSQL 14 on Kubernetes by briffle on Wednesday October 06, 2021 @09:33AM (#28772950)
what happens when you declare that your PG 13 cluster should now be PG 14?

I haven't yet seen good documentation on how these K8s databases handle upgrades. Additionally, they all seem very quick to stream from master to create a new node. That is great, for very, very small db's. But a 1TB db would be royal pain to do that with.

Re:PostgreSQL 14 on Kubernetes by bitwalker on Wednesday October 06, 2021 @01:02PM (#28775470)
I think this is where the operator pattern really shines. By defining a custom resource that contains the cluster configuration, the operator can detect certain types of changes, such as upgrading Postgres to a new major version, and automate that change the same way that you'd do it manually. Of course, if such an operator doesn't already exist, its on you to build it, but with popular databases like Postgres, they are generally already out there in some form. That said, I'm not sure if existing Postgres operators handle your specific example.
Re:PostgreSQL 14 on Kubernetes by funcDropShadow on Wednesday October 06, 2021 @04:11AM (#28770459)
So, the argument to deploy a database (e.g. Postgres) via Kubernetes is, that that some of the problems doing so are now solved?
Re:PostgreSQL 14 on Kubernetes by prpl on Wednesday October 06, 2021 @10:51AM (#28773856)
minio’s DirectCSI might be a solution you are interested in
Re:PostgreSQL 14 on Kubernetes by mr-karan on Wednesday October 06, 2021 @02:11AM (#28769768)
> Stateful services like databases are not really a challenge anymore

I've faced so many issues with the CSI driver which doesn't attach/deattach properly when you modify anything on the Statetfulset.

Additionally, you need to pin your DBs ("statefulset workloads") to certain Nodes based on the AZs since a block storage like an EBS cannot really be attached from Zone 1 to Zone 2 automatically.

Based on these limitations, I dont really see any utility/usefulness in running a DB on K8s. I get all of the other niceties that K8s offers, but here it makes the Ops work more complex than desired.

Re:PostgreSQL 14 on Kubernetes by manigandham on Wednesday October 06, 2021 @06:03AM (#28771160)
This is where complexity comes in. Let Kubernetes abstract the resources for your workloads.

For example, use a storage service (like Rook/openEBS/portworx/etc) that uses node-attached disks to create a data layer. Then you can assign volumes to your individual workloads created and managed by the storage service.

This provides reliable and portable storage for your other services without having to tying them to lower-level details.

Re:PostgreSQL 14 on Kubernetes by nullify88 on Wednesday October 06, 2021 @02:43AM (#28769952)
> Additionally, you need to pin your DBs ("statefulset workloads") to certain Nodes based on the AZs since a block storage like an EBS cannot really be attached from Zone 1 to Zone 2 automatically.

Having Postgres replicate the data across AZs or run Ceph on top of EBS to do it at the storage level are options. The complexity of setup is made simpler by running their respective operators.

Re:PostgreSQL 14 on Kubernetes by arianvanp on Wednesday October 06, 2021 @05:53AM (#28771088)
This is not true. Once your PVC is assigned to a pod the scheduler takes into account the zone information stored in the PVC/PV to make subsequent scheduling decisions if the pod gets restarted. The scheduler will make sure to only start a pod in a place where the PV can get reattached.

There used to be bugs with this years ago but all storage providers now get this right.

Re:PostgreSQL 14 on Kubernetes by FridgeSeal on Wednesday October 06, 2021 @02:27AM (#28769856)
Are you on a cloud provider?

I’ve not had issues with EBS/AWS, and affinity configs meant it was really easy to spread nodes throughout AZ’s.

On Azure though, volume mounts/unmounts were an absolute dumpster fire.

Re:PostgreSQL 14 on Kubernetes by Hamuko on Wednesday October 06, 2021 @03:40AM (#28770272)
>Stateful services like databases are not really a challenge anymore given recent developments in both K8S and database containerization.

People say this but my first reaction to "let's put our DB in the Kubernetes cluster" is still to take two steps backwards and prepare to run in the other direction. It really goes against all of my better instincts (and unfortunately hands-on experiences).

Re:PostgreSQL 14 on Kubernetes by hijinks on Wednesday October 06, 2021 @07:16AM (#28771700)
20 years ago people said the same thing about running DBs on virtual machines.

Now almost all databases are run on VMs

Re:PostgreSQL 14 on Kubernetes by mbreese on Wednesday October 06, 2021 @08:57AM (#28772566)
But that’s really not a great comparison, is it? Running on a VM is much more like running on a plain physical node. Running on K8s implies a whole new level of management overhead, that just isn’t there on a single node system.

In this case, you should be asking “will we all be running databases in clustered mode in the future?”

I think that answer still up for debate.

Re:PostgreSQL 14 on Kubernetes by gizdan on Wednesday October 06, 2021 @10:33AM (#28773640)
> Running on a VM is much more like running on a plain physical node.

Sure, and containers are just plain processes on a VM. The exact code that controls processes in a VM, also controls processes inside a container.

As long as the underlying data volume is reliable, it really doesn't matter whether you're running it outside of a container or not. Volumes for K8s have a come a long way since its early days.

Re:PostgreSQL 14 on Kubernetes by mbreese on Wednesday October 06, 2021 @11:33AM (#28774377)
But that’s not the difference. Any single process can run in a container without much issue. I think volume storage isn’t a solved issue yet, but it is better.

But running a database in K8s is implying (and it’s how the article sets it up) as a cluster. This is a big difference from running a solo instance on bare metal, in a VM, or in a container. That’s the point I was making to the parent comment.

To go up a level (comment), running Postgres in K8s doesn’t really get you much that you can’t also get from a VM (I’m thinking mainly about migration and setup). After that, the benefits come from running a cluster, which K8s can make easier to orchestrate over bare metal. But that’s a different architecture entirely.

Re:PostgreSQL 14 on Kubernetes by jatone on Wednesday October 06, 2021 @09:22AM (#28772828)
containers are actually a really good fit for dbs. they do one thing and one thing only and for a really really long time without many changes.

and the answer is we will definitely be running DBs in clustered mode in the future. its not really a debate its an eventuality.

without clusters you lose on reliability and maintenance QOL improvements. without clusters its very hard to upgrade systems effectively leaving systems to stagnate and decay both in performance (Hard/Software improvements aka kernel updates or inbternal DB improvements) and reliability.

Re:PostgreSQL 14 on Kubernetes by morelisp on Wednesday October 06, 2021 @04:47PM (#28778219)
The question isn't whether DBs will be running in clusters - they all pretty much do, or can - but will those clusters be orchestrated by something first designed for dynamic scaling of stateless services, treating all nodes as varying-sized pools of otherwise mostly-homogeneous hyperconverged compute/storage? Or, how much are you willing to pay in $/performance/dev time to force them into such infrastructure?

Or will they be on something more purpose-built, either designed from the start to handle storage more flexibly at a higher level? Or conversely something more specific and lower-level to extract maximum performance for their particular storage patterns?

Re:PostgreSQL 14 on Kubernetes by morelisp on Wednesday October 06, 2021 @04:42PM (#28778159)
> Now almost all databases are run on VMs

And now almost all databases (meaning running instances, not software artifacts) are way slower than necessary and lie about durability.

Re:PostgreSQL 14 on Kubernetes by Keyframe on Wednesday October 06, 2021 @11:38AM (#28774433)
Now almost all databases are run on VMs

now, that's a bit of a stretch, no?

Re:PostgreSQL 14 on Kubernetes by dagw on Wednesday October 06, 2021 @02:38AM (#28769916)
At least in my case, because your ops team has decided that everything that gets deployed, gets deployed in k8s (unless you have a Very! good reason not to)
Re:PostgreSQL 14 on Kubernetes by dijit on Wednesday October 06, 2021 @04:02AM (#28770410)
Kubernetes is great but not everything fits in kubernetes, this is a bad ops team if this is the case.
Re:PostgreSQL 14 on Kubernetes by jpgvm on Wednesday October 06, 2021 @05:39AM (#28771008)
Note the "except if you have a very good reason" caveat.

I think this is a good ops team mantra. PostgreSQL unless you have a very good reason otherwise, and k8s unless you have a very good reason otherwise.

Decisions like this allow for economies of scale with tooling, monitoring/observability, etc.

Saying no to snowflakes is an important part of having a good ops team.

Re:PostgreSQL 14 on Kubernetes by dijit on Wednesday October 06, 2021 @06:11AM (#28771221)
Guess it depends on who is defining “very”.

A persistent connection is antithetical to the design of kubernetes.

Persistent storage is hard to get right in kubernetes and puts a lot of pressure on the cluster being perfect, which is something a good ops team will tell you is hard.

If your application is stateless http services then kubernetes is great, but there are common things that don’t fit well, and forcing people into a solution which may require a complete rethinking is not very pragmatic.

Re:PostgreSQL 14 on Kubernetes by dagw on Wednesday October 06, 2021 @05:54AM (#28771098)
Eh, for what it's worth they've deployed a couple of PostgreSQL instances for me using Kubernetes and it's worked exactly like I've wanted it to. But then again I've never had push those instances to breaking point either when it comes to IO or concurrency so who knows.
Re:PostgreSQL 14 on Kubernetes by tveita on Wednesday October 06, 2021 @07:49AM (#28771941)
A middle ground would be provisioning managed services through Kubernetes resources using a controller like Config Connector (GCP) or ACK (AWS)

https://cloud.google.com/config-connector/docs/reference/res...

https://aws-controllers-k8s.github.io/community/reference/rd...

[dead]
Re:PostgreSQL 14 on Kubernetes by ryanisnan on Wednesday October 06, 2021 @12:42AM (#28769280)
I think while true, this is an incredibly reductive take on what Kubernetes really is.
Re:PostgreSQL 14 on Kubernetes by longcommonname on Wednesday October 06, 2021 @12:41AM (#28769276)
What level of competency do you need to run dbs?
Re:PostgreSQL 14 on Kubernetes by darthrupert on Wednesday October 06, 2021 @12:49AM (#28769314)
Poorly? Almost none.

Well? Significant.

Re:PostgreSQL 14 on Kubernetes by edoceo on Wednesday October 06, 2021 @01:10AM (#28769435)
Unhelpful and arrogant. We are amateurs in the eyes of the gods.
Re:PostgreSQL 14 on Kubernetes by dijit on Wednesday October 06, 2021 @02:24AM (#28769844)
It’s very easy to set something up for the first time.

It’s a bit complex to keep something running for a long time.

It’s very difficult to make something fault tolerant with no data loss or corruption.

Arrogance is thinking that these things are easy because you can read a quickstart.

Re:PostgreSQL 14 on Kubernetes by tinus_hn on Wednesday October 06, 2021 @03:31AM (#28770222)
It is true though, but it is also true that a ‘poorly’ run database server is good enough for many use cases. There is a reason people are DBAs and they are very well paid.
Re:PostgreSQL 14 on Kubernetes by janto on Wednesday October 06, 2021 @05:30AM (#28770954)
Arrogant and foolish to declare no-one can be high skilled.
Re:PostgreSQL 14 on Kubernetes by darthrupert on Wednesday October 06, 2021 @08:12AM (#28772157)
You're right. But so am I.