pgop - PostgreSQL Operator¶
A simple Kubernetes operator for managing PostgreSQL databases.
Features¶
- Cluster Management - Deploy PostgreSQL instances with automatic credential generation
- Role Management - Provision database roles with configurable permissions (LOGIN, SUPERUSER, etc.)
- Database Management - Create databases with extensions, schemas, and grants
Quick Start¶
# Install CRDs
kubectl apply -k config/crd
# Deploy the operator
kubectl apply -k config/default
# Create a PostgreSQL cluster
kubectl apply -f - <<EOF
apiVersion: pgop.ruck.io/v1alpha1
kind: Cluster
metadata:
name: my-cluster
spec:
image: postgres:18
storage:
size: 5Gi
EOF
Architecture¶
%%{init: {'flowchart': {'nodeSpacing': 1, 'rankSpacing': 5}}}%%
flowchart TB
subgraph k8s["Kubernetes Cluster"]
subgraph crds["Custom Resources"]
cluster["Cluster"]
role["Role"]
database["Database"]
end
operator["pgop"]
subgraph k8sres["Kubernetes Resources"]
secret["Secret"]
service["Service"]
sts["StatefulSet"]
end
subgraph pgres["PostgreSQL Resources"]
pgrole["Roles"]
pgdb["Databases"]
pgext["Extensions"]
pgschema["Schemas"]
end
cluster --> operator
role --> operator
database --> operator
operator --> secret
operator --> service
operator --> sts
operator --> pgrole
operator --> pgdb
operator --> pgext
operator --> pgschema
end
classDef default padding:5px 5px
Documentation¶
- Installation - How to install the operator
- Quick Start - Create your first cluster
- User Guide - Detailed usage instructions
- API Reference - CRD specifications
License¶
Apache License 2.0