Code Monkey home page Code Monkey logo

postgres-operator's Introduction

PostgreSQL Operator

Overview

The PostgreSQL Operator provides a Kubernetes operator capability for managing PostgreSQL Clusters deployed within a Kubernetes.

The PostgreSQL Operator leverages Kubernetes Third Party Resources to define custom resource type pgcluster, pgbackups, and pgupgrades.

Once those custom objects are defined, Kubernetes provides the ability to create and manage those objects similar to any other native Kubernetes object.

The PostgreSQL Operator runs within Kubernetes detecting these new custom object types being created or removed.

Once the objects are detected, the PostgreSQL Operator enables users to perform operations across the Kubernetes environment, including:

  • Create Cluster

  • Destroy Cluster

  • Backup Cluster

  • Scale a Cluster

  • Restore Cluster

  • Upgrade Cluster

  • View PVC

  • Test Connections

  • Clone a Cluster

What actually gets created on the Kube cluster for a pgcluster resource is defined as a deployment strategy. Strategies are documented in detail in Deployment Strategies.

Requirements

Build and Setup Instructions

With the operator deployed, the pgo command line interface can execute commands that the postgres-operator understands and reacts to.

You can download a pre-built pgo CLI binary from the Releases page on the github repository or build it yourself using the build instructions, documented on the Build and Setup page.

Configuration

You can configure both the client and the operator. The configuration options are documented on the Configuration page.

Examples

Some examples of using the pgo command line interface are as follows.

Display Cluster Information
pgo show cluster all
pgo show cluster db1 db2 db3
pgo show cluster mycluster
pgo show cluster mycluster --show-secrets=true
Create Cluster
pgo create cluster mycluster
Scale Cluster
pgo scale mycluster --replica-count=2
Delete a Cluster
pgo delete cluster mycluster
Backup Cluster
pgo create backup mycluster
Restore Cluster
pgo create cluster myrestore --secret-from=foo --backup-pvc=mypvc --backup-path=foo-backups/2017-03-21-15-57-21
Upgrade Cluster (minor Postgres version upgrade)
pgo create upgrade mycluster
Upgrade Cluster (major Postgres version upgrade from 9.5 to 9.6)
pgo create upgrade mycluster --upgrade-type=major
View PVC
pgo show pvc mypvc
Test Connections
pgo test mycluster
Clone Cluster
pgo clone mycluster --name=myclone

Details on the above pgo command examples are found in the User Guide.

PostgreSQL Operator Container

In the following diagram, the postgres operator client, pgo, is shown interacting with the postgres operator that runs within a Kubernetes cluster. The operator is responsible for creating or modifying PostgreSQL databases deployed within the Kube cluster.

operator diagram

The operator funtionality runs in a Pod deployed to your Kubernetes cluster. The postgres-operator Docker container is available on Dockerhub.

You can also build the Docker image for postgres-operator using the build instructions located on the Build and Setup page.

postgres-operator's People

Contributors

xenophenes avatar prlaurence avatar crunchyjohn avatar vladimirvivien avatar

Watchers

aland-zhang avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.