Red Hat OpenShift brings an environment to simplify harnessing the power of Kubernetes for managing a suite of stateless applications, but applications that maintain state (e.g. databases) often require a little bit more work. Often on teams, there are people dedicated to managing the requirements, configurations, deployment for stateful applications in their production environment and are responsible for the real-time monitoring as well controlling authorization and access to these systems.
The robustness of PostgreSQL from a feature standpoint, as well as its ability to meet the compliance and scale requirements for enterprises, makes it no exception to requiring additional support to run it at scale on OpenShift.
In order to enable enterprises to deploy and maintain PostgreSQL containers at scale, Crunchy Data built an open source PostgreSQL Operator. The PostgreSQL Operator leverages the “Operator” design pattern initially created by the team at CoreOS. Kubernetes Operators extend the Kubernetes API to enable teams to perform their administration tasks at scale.
More specifically, CoreOS defines an Operator as “an application-specific controller that extends the Kubernetes API to create, configure, and manage instances of complex stateful applications on behalf of a Kubernetes user. It builds upon the basic Kubernetes resource and controller concepts but includes domain or application-specific knowledge to automate common tasks.” [1]
Following the release of the Crunchy PostgreSQL Container Suite, Crunchy Data was frequently asked by enterprise customers - “How do we manage thousands of PostgreSQL containers?” The PostgreSQL Operator was designed to address that problem. Initially released in March 2017 and now on version 2.6, the PostgreSQL Operator automates many database management tasks associated with large-scale PostgreSQL operations, including:
- Provisioning new PostgreSQL clusters
- Creating PostgreSQL replicas and failover targets
- Defining which servers and disks a PostgreSQL cluster should be deployed to (“node affinity”) as well as CPU & memory requirements
- Defining and managing user authorization and access controls across databases
- Deploying load balancing and performance monitoring to clusters
- Performing backups and restores as well as minor and major upgrades across databases
and more. Your team can use the PostgreSQL Operator through a series of simple commands that can also be furthered automated through scripts or the Kubernetes API itself. For instance, if you want to create a cluster named “openshift1” with load balancing and monitoring to two replicas that run on your medium tier hardware (this assume you have set up your node labels), you would run the following two commands:
pgo create cluster openshift1 --metrics --pgpool
pgo scale openshift1 --replica-count=2 --node-label=speed=medium
Getting started with the PostgreSQL Operator on OpenShift is easy: the Crunchy Data team has a quickstart script for the Crunchy PostgreSQL Operator on OpenShift that will have you up and running in moments. While there are additional considerations in addition to configuration to securely run a PostgreSQL cluster on OpenShift, this script will allow you to become comfortable with using the PostgreSQL Operator and demonstrate to you the new possibilities of managing your databases at scale.
If you want to learn more about running PostgreSQL on Red Hat OpenShift, we invite you to view our Primed Partner page and encourage you to explore what applications you can deploy on OpenShift!
About the author
More like this
Accelerating success with the Red Hat Partner Program
F5 BIG-IP Virtual Edition is now validated for Red Hat OpenShift Virtualization
Communicating the Value of Connecting Systems | Code Comments
Transforming Your Acquisition
Browse by channel
Automation
The latest on IT automation for tech, teams, and environments
Artificial intelligence
Updates on the platforms that free customers to run AI workloads anywhere
Open hybrid cloud
Explore how we build a more flexible future with hybrid cloud
Security
The latest on how we reduce risks across environments and technologies
Edge computing
Updates on the platforms that simplify operations at the edge
Infrastructure
The latest on the world’s leading enterprise Linux platform
Applications
Inside our solutions to the toughest application challenges
Virtualization
The future of enterprise virtualization for your workloads on-premise or across clouds