Running PostgreSQL databases in containerized environments is more popular than ever and is moving beyond running only in local, development environments and into large scale production environments. To answer the need to orchestrate complex, database workloads, the Crunchy Data team created the PostgreSQL Operator to automate many typical database administrator tasks at scale:
- Provisioning new PostgreSQL clusters
- Scaling up replicas
- Setup and manage disaster recovery, high-availability, and monitoring
- Allocate resources (memory, CPU, etc.) and suggest nodes for databases to run on
- Mass applying user policies
- Performing major/minor upgrades
and more. In order to keep all of its PostgreSQL databases up and running, the PostgreSQL Operator uses Kubernetes Deployments, which provides an API to manage replicated applications. In order to understand why this is, first we need to understand about running stateful applications with Kubernetes.