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
Browse by channel
Automation
The latest on IT automation that spans tech, teams, and environments
Artificial intelligence
Explore the platforms and partners building a faster path for AI
Open hybrid cloud
Explore how we build a more flexible future with hybrid cloud
Security
Explore how we reduce risks across environments and technologies
Edge computing
Updates on the solutions that simplify infrastructure at the edge
Infrastructure
Stay up to date on the world’s leading enterprise Linux platform
Applications
The latest on our solutions to the toughest application challenges
Original shows
Entertaining stories from the makers and leaders in enterprise tech
Products
- Red Hat Enterprise Linux
- Red Hat OpenShift
- Red Hat Ansible Automation Platform
- Cloud services
- See all products
Tools
- Training and certification
- My account
- Developer resources
- Customer support
- Red Hat value calculator
- Red Hat Ecosystem Catalog
- Find a partner
Try, buy, & sell
Communicate
About Red Hat
We’re the world’s leading provider of enterprise open source solutions—including Linux, cloud, container, and Kubernetes. We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.
Select a language
Red Hat legal and privacy links
- About Red Hat
- Jobs
- Events
- Locations
- Contact Red Hat
- Red Hat Blog
- Diversity, equity, and inclusion
- Cool Stuff Store
- Red Hat Summit