postgres-operator

command module
v4.5.3+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 1, 2021 License: Apache-2.0 Imports: 26 Imported by: 1

README

PGO: The Postgres Operator from Crunchy Data

Go Report Card

Run Cloud Native PostgreSQL on Kubernetes with PGO: The Postgres Operator from Crunchy Data!

PGO, the Postgres Operator developed by Crunchy Data and included in Crunchy PostgreSQL for Kubernetes, automates and simplifies deploying and managing open source PostgreSQL clusters on Kubernetes.

Whether you need to get a simple Postgres cluster up and running, need to deploy a high availability, fault tolerant cluster in production, or are running your own database-as-a-service, the PostgreSQL Operator provides the essential features you need to keep your cloud native Postgres clusters healthy, including:

Postgres Cluster Provisioning

Create, Scale, & Delete PostgreSQL clusters with ease, while fully customizing your Pods and PostgreSQL configuration!

High Availability

Safe, automated failover backed by a distributed consensus based high-availability solution. Uses Pod Anti-Affinity to help resiliency; you can configure how aggressive this can be! Failed primaries automatically heal, allowing for faster recovery time.

Support for standby PostgreSQL clusters that work both within and across multiple Kubernetes clusters.

Disaster Recovery

Backups and restores leverage the open source pgBackRest utility and includes support for full, incremental, and differential backups as well as efficient delta restores. Set how long you want your backups retained for. Works great with very large databases!

TLS

Secure communication between your applications and data servers by enabling TLS for your PostgreSQL servers, including the ability to enforce all of your connections to use TLS.

Monitoring

Track the health of your PostgreSQL clusters using the open source pgMonitor library.

PostgreSQL User Management

Quickly add and remove users from your PostgreSQL clusters with powerful commands. Manage password expiration policies or use your preferred PostgreSQL authentication scheme.

Upgrade Management

Safely apply PostgreSQL updates with minimal availability impact to your PostgreSQL clusters.

Advanced Replication Support

Choose between asynchronous replication and synchronous replication for workloads that are sensitive to losing transactions.

Clone

Create new clusters from your existing clusters or backups with pgo create cluster --restore-from.

Connection Pooling

Use pgBouncer for connection pooling

Node Affinity

Have your PostgreSQL clusters deployed to Kubernetes Nodes of your preference

Scheduled Backups

Choose the type of backup (full, incremental, differential) and how frequently you want it to occur on each PostgreSQL cluster.

Backup to S3

Store your backups in Amazon S3 or any object storage system that supports the S3 protocol. The PostgreSQL Operator can backup, restore, and create new clusters from these backups.

Multi-Namespace Support

You can control how PGO, the Postgres Operator, leverages Kubernetes Namespaces with several different deployment models:

  • Deploy PGO and all PostgreSQL clusters to the same namespace
  • Deploy PGO to one namespaces, and all PostgreSQL clusters to a different namespace
  • Deploy PGO to one namespace, and have your PostgreSQL clusters managed across multiple namespaces
  • Dynamically add and remove namespaces managed by the PostgreSQL Operator using the pgo client to run pgo create namespace and pgo delete namespace
Full Customizability

The Postgres Operator (PGO) makes it easy to get Postgres up and running on Kubernetes-enabled platforms, but we know that there are further customizations that you can make. As such, PGO allows you to further customize your deployments, including:

  • Selecting different storage classes for your primary, replica, and backup storage
  • Select your own container resources class for each PostgreSQL cluster deployment; differentiate between resources applied for primary and replica clusters!
  • Use your own container image repository, including support imagePullSecrets and private repositories
  • Customize your PostgreSQL configuration
  • Bring your own trusted certificate authority (CA) for use with the Operator API server
  • Override your PostgreSQL configuration for each cluster

Deployment Requirements

PGO, the Postgres Operator, is validated for deployment on Kubernetes, OpenShift, GKE, Anthos, AKS, EKS, and VMware Tanzu clusters. PGO is cloud native and storage agnostic, working with a wide variety of storage classes, hostPath, and NFS.

PGO includes various components that get deployed to your Kubernetes cluster as shown in the following diagram and detailed in the Design section of the documentation for the version you are running.

Reference

PGO is developed and tested on CentOS and RHEL linux platforms but is known to run on other Linux variants.

Supported Platforms

PGO, the Postgres Operator, is Kubernetes-native and maintains backwards compatibility to Kubernetes 1.11 and is tested is tested against the following platforms:

  • Kubernetes 1.13+
  • OpenShift 3.11+
  • Google Kubernetes Engine (GKE), including Anthos
  • Amazon EKS
  • Microsoft AKS
  • VMware Tanzu

This list only includes the platforms that the Postgres Operator is specifically tested on as part of the release process: PGO works on other Kubernetes distributions as well.

Storage

PGO, the Postgres Operator, is tested with a variety of different types of Kubernetes storage and Storage Classes, as well as hostPath and NFS.

We know there are a variety of different types of Storage Classes available for Kubernetes and we do our best to test each one, but due to the breadth of this area we are unable to verify Postgres Operator functionality in each one. With that said, the PostgreSQL Operator is designed to be storage class agnostic and has been demonstrated to work with additional Storage Classes.

Installation

Postgres Operator (PGO) Installation

PGO provides a few different methods for installation methods to get up and running with cloud native Postgres.

Based on your storage settings in your Kubernetes environment, you may be able to start as quickly as:

kubectl create namespace pgo
kubectl apply -f https://raw.githubusercontent.com/CrunchyData/postgres-operator/v4.5.3/installers/kubectl/postgres-operator.yml

Otherwise, we highly recommend following the instructions from our Quickstart.

Installations methods include:

pgo Client Installation

If you have the Postgres Operator installed in your environment, and are interested in installation of the client interface, please start here:

There is also a pgo-client container if you wish to deploy the client directly to your Kubernetes environment.

Included Components

PostgreSQL containers deployed with the PostgreSQL Operator include the following components:

In addition to the above, the geospatially enhanced PostgreSQL + PostGIS container adds the following components:

PostgreSQL Operator Monitoring uses the following components:

Additional containers that are not directly integrated with the PostgreSQL Operator but can work alongside it include:

For more information about which versions of the PostgreSQL Operator include which components, please visit the compatibility section of the documentation.

Using the PostgreSQL Operator (PGO)

If you are new to PGO, you can follow along the tutorial to learn how to install the PostgreSQL Operator and how to use many of its features!

If you have the PostgreSQL and client interface installed in your environment and are interested in guidance on the use of the Crunchy PostgreSQL Operator, please start here:

Contributing to the Project

Want to contribute to the PGO Project? Great! We've put together as set of contributing guidelines that you can review here:

If you want to learn how to get up your development environment, please read our documentation here:

Once you are ready to submit a Pull Request, please ensure you do the following:

  1. Reviewing the contributing guidelines and ensure your that you have followed the commit message format, added testing where appropriate, documented your changes, etc.
  2. Open up a pull request based upon the guidelines. If you are adding a new feature, please open up the pull request on the master branch. If you have a bug fix for a supported version, open up a pull request against the supported version branch (e.g. REL_4_2 for 4.2)
  3. Please be as descriptive in your pull request as possible. If you are referencing an issue, please be sure to include the issue in your pull request

Support

If you believe you have found a bug or have detailed feature request, please open a GitHub issue and follow the guidelines for submitting a bug.

For general questions or community support, we welcome you to join the PostgreSQL Operator community mailing list at postgres-operator@crunchydata.com and ask your question there.

For other information, please visit the Support section of the documentation.

Documentation

For additional information regarding design, configuration and operation of the PostgreSQL Operator (PGO), please see the Official Project Documentation.

If you are looking for the nightly builds of the documentation, you can view them at:

https://crunchydata.github.io/postgres-operator/latest/

Past Versions

Documentation for previous releases can be found at the Crunchy Data Access Portal

Releases

When a PGO general availability (GA) release occurs, the container images are distributed on the following platforms in order:

The image rollout can occur over the course of several days.

To stay up-to-date on when releases are made available in the Crunchy Data Developer Portal, please sign up for the Crunchy Data Developer Program Newsletter

The PGO Postgres Operator project source code is available subject to the Apache 2.0 license with the PGO logo and branding assets covered by our trademark guidelines.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal
apiserver/routing
Package routing temporarily breaks circular dependencies within the structure of the apiserver package The apiserver package contains a mix of package content (used by external code) and refactored functionality from the *service folders.
Package routing temporarily breaks circular dependencies within the structure of the apiserver package The apiserver package contains a mix of package content (used by external code) and refactored functionality from the *service folders.
logging
Package logging Functions to set unique configuration for use with the logrus logger
Package logging Functions to set unique configuration for use with the logrus logger
ns
operator/cluster
Package cluster holds the cluster CRD logic and definitions A cluster is comprised of a primary service, replica service, primary deployment, and replica deployment Package cluster holds the cluster CRD logic and definitions A cluster is comprised of a primary service, replica service, primary deployment, and replica deployment Package cluster holds the cluster CRD logic and definitions A cluster is comprised of a primary service, replica service, primary deployment, and replica deployment Package cluster holds the cluster CRD logic and definitions A cluster is comprised of a primary service, replica service, primary deployment, and replica deployment Package cluster holds the cluster CRD logic and definitions A cluster is comprised of a primary service, replica service, primary deployment, and replica deployment Package cluster holds the cluster CRD logic and definitions A cluster is comprised of a primary service, replica service, primary deployment, and replica deployment
Package cluster holds the cluster CRD logic and definitions A cluster is comprised of a primary service, replica service, primary deployment, and replica deployment Package cluster holds the cluster CRD logic and definitions A cluster is comprised of a primary service, replica service, primary deployment, and replica deployment Package cluster holds the cluster CRD logic and definitions A cluster is comprised of a primary service, replica service, primary deployment, and replica deployment Package cluster holds the cluster CRD logic and definitions A cluster is comprised of a primary service, replica service, primary deployment, and replica deployment Package cluster holds the cluster CRD logic and definitions A cluster is comprised of a primary service, replica service, primary deployment, and replica deployment Package cluster holds the cluster CRD logic and definitions A cluster is comprised of a primary service, replica service, primary deployment, and replica deployment
pgo
api
cmd
Package cmd provides the command line functions of the crunchy CLI Package cmd provides the command line functions of the crunchy CLI Package cmd provides the command line functions of the crunchy CLI Package cmd provides the command line functions of the crunchy CLI Package cmd provides the command line functions of the crunchy CLI Package cmd provides the command line functions of the crunchy CLI Package cmd provides the command line functions of the crunchy CLI Package cmd provides the command line functions of the crunchy CLI Package cmd provides the command line functions of the crunchy CLI Package cmd provides the command line functions of the crunchy CLI Package cmd provides the command line functions of the crunchy CLI
Package cmd provides the command line functions of the crunchy CLI Package cmd provides the command line functions of the crunchy CLI Package cmd provides the command line functions of the crunchy CLI Package cmd provides the command line functions of the crunchy CLI Package cmd provides the command line functions of the crunchy CLI Package cmd provides the command line functions of the crunchy CLI Package cmd provides the command line functions of the crunchy CLI Package cmd provides the command line functions of the crunchy CLI Package cmd provides the command line functions of the crunchy CLI Package cmd provides the command line functions of the crunchy CLI Package cmd provides the command line functions of the crunchy CLI
pkg
apis/crunchydata.com/v1
Crunchy PostgreSQL Operator API The Crunchy PostgreSQL Operator API defines HTTP(S) interactions with the Crunchy PostgreSQL Operator.
Crunchy PostgreSQL Operator API The Crunchy PostgreSQL Operator API defines HTTP(S) interactions with the Crunchy PostgreSQL Operator.
generated/clientset/versioned
This package has the automatically generated clientset.
This package has the automatically generated clientset.
generated/clientset/versioned/fake
This package has the automatically generated fake clientset.
This package has the automatically generated fake clientset.
generated/clientset/versioned/scheme
This package contains the scheme of the automatically generated clientset.
This package contains the scheme of the automatically generated clientset.
generated/clientset/versioned/typed/crunchydata.com/v1
This package has the automatically generated typed clients.
This package has the automatically generated typed clients.
generated/clientset/versioned/typed/crunchydata.com/v1/fake
Package fake has the automatically generated clients.
Package fake has the automatically generated clients.
testing module

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL