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


Yugabyte Improves Postgres Compatibility
24/09/2024

YugabyteDB has been upgraded with what the developers describe as enhanced Postgres capability in the form of new capabilities and architectural enhancements that allow a broader range of Postgres app [ ... ]



CouchDB 3.4 Strengthens Password Hashes
03/10/2024

CouchDB 3.41 has been released with stronger password hashes, a Lucene-based full text search implementation, and QuickJS as a JavaScript option.


More News

kotlin book

 

Comments




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

 

Last Updated ( Thursday, 17 October 2024 )