Postgres And Kubernetes Together In Harmony
Written by Nikos Vaggalis   
Thursday, 17 October 2024

Yes, they can coexist thanks to CloudNativePG, the PostgreSQL Operator for Kubernetes. Furthermore, if you want to try before you buy you can, thanks to the new learning environment, CNPG Playground.

The big obstacle in running data driven stateful applications on Kubernetes was that Kubernetes couldn't play along with state. Not anymore. As things progressed the question shifted from
"can Kubernetes work with databases" to "yes they can, but how?".

As far as PostgreSQL is concerned, CloudNativePG by EDB has got the case covered. CloudNativePG is designed to seamlessly manage PostgreSQL databases within Kubernetes environments, covering the entire operational lifecycle from initial deployment to ongoing maintenance, so that you can bring on your database workload.

There are many advantages to it, but CloudNativePG's main plus point is that it automates the steps that a human operator would do to deploy and to manage a Postgres database inside Kubernetes, including automated failover, simplifying cluster management in cloud-native environments. What's more, despite being developed by EDB, it's released as open source under Apache License 2. 0, which eliminates vendor lock-in.

Of course, setting up such a beast would require carefully planning as well as training. Adopter fear not since things get now simplified with the introduction of CNPG Playground the local learning environment for Postgres in Kubernetes. Its mission is to :

By using Docker and Kind, it simulates real-world scenarios, enabling developers and DBAs to experiment with PostgreSQL replication across two clusters. Designed for hands-on learning, CNPG Playground provides an accessible entry point for testing configurations and features, with plans for future enhancements and community collaboration.

In other words, it helps developers and DBAs to start experimenting with running PostgreSQL in Kubernetes and in an emulated CloudNativePG environment so that they can test configurations and explore features such as high availability without the need of any cloud infrastructure; that is before actually deploying the real thing.

The environment that CNPG Playground emulates comprises of a two-region infrastructure (EU and US), with each region containing:

  • An object storage service powered by MinIO containers
  • A Kubernetes cluster, deployed using Kind, consisting of:
    • One control plane node
    • One node for infrastructure components
    • One node for applications
    • Three nodes dedicated to PostgreSQL

For setting it up, there's a few pre-requirements to get started. You need to be in possession of:

  • Docker
  • Git
  • Kubectl
  • Kind

Then simply run the following script:

. /scripts/setup. sh

Now you can connect to the Kubernetes clusters, inspect the nodes and do your experiments without the hassle and fear of bringing down an environment in production.

 cloudnativepg

More Information

CloudNativePG

CloudNativePG playground

Related Articles

It's 2024. Why Does PostgreSQL Still Dominate?

Learn Kubernetes by Example

 

To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook or Linkedin.

Banner


Greenplum's Cloudberry Fork Enters Apache Incubator
17/12/2024

Cloudberry is the open source equivalent of Greenplum.
Now it is fostered by the Apache Foundation as it acquires incubating status.



Google Adds Premium Tier To Developer Program
29/11/2024

Google has added a premium tier to the Google Developer Program. The new tier is described as providing "a tailored suite of services to help developers throughout the learning, building and deploymen [ ... ]


More News

espbook

 

Comments




or email your comment to: comments@i-programmer.info

 

Last Updated ( Thursday, 17 October 2024 )