patroni-postgres-operator

command module
v0.0.0-...-b2fce53 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2025 License: BSD-2-Clause Imports: 13 Imported by: 0

README

patroni-postgres-operator

Still in BETA, use with care.

A Kubernetes operator for Postgresql clusters managed by Patroni. Can do major Postgresql version upgrades without significant downtime.

Uses postgres-patroni images, which supports Postgresql versions 13 and 15 only.

Deploy the Operator

To quickly deploy the operator, run:

$ kubectl apply -f https://raw.githubusercontent.com/k-web-s/patroni-postgres-operator/refs/heads/main/config/deploy.yaml

Create a patronipostgres instance

The following minimal object creates a PatroniPostgres instance with one node:

apiVersion: kwebs.cloud/v1alpha1
kind: PatroniPostgres
metadata:
  name: patroni-postgres
spec:
  version: 15
  volumeSize: 5Gi
  nodes:
  - storageClassName: default

The number of node definitions specifies the cluster size. At least each node definition must have a storageClassName attribute. See full reference. The operator will create a service with the same name as the object, which can be used to access the patronipostgres cluster. No users/databases are created. Superuser credentials are stored in a secret with the same name as the object. Superuser username is postgres, and the password can be obtained by:

$ kubectl --context=pi-kubernetes -n db get secret patroni-postgres --template '{{index .data "superuser-password"}}' | base64 -d

Check more samples.

Scaling the cluster

Adding new nodes is just as easy as extending nodes array. Removing also works, howewer, only removing nodes from the end of the array is supported. Changing a storageClassName in a node definition is not supported.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
api
v1alpha1
Package v1alpha1 contains API Schema definitions for the v1alpha1 API group +kubebuilder:object:generate=true +groupName=kwebs.cloud
Package v1alpha1 contains API Schema definitions for the v1alpha1 API group +kubebuilder:object:generate=true +groupName=kwebs.cloud
cmd
private

Jump to

Keyboard shortcuts

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