
In memoriam
26 March 2024
Visionary, Architect, Leader, Mentor, Friend





Deployment or StatefulSet

StatefulSetCluster resourceWhere are you in your Kubernetes story: running, planning, or nope?
Cluster resource, what you actually declareTraditional environment

CloudNativePG

Traditional environment

CloudNativePG

Cluster within a single Kubernetes cluster

StorageClass resourcetaints and labels (next slides)
ClusterCluster basis
taints and labelskubectl taint node ${node} \
node-role.kubernetes.io/postgres=:NoSchedule
kubectl label node ${node} \
node-role.kubernetes.io/postgres="" \
node-role.kubernetes.io/worker-
label identifies the node; taint keeps everything else off it
Cluster resource will match it with its own nodeSelector and tolerationsCluster resource and Kubernetes Services
Cluster resource: HA, backup, observability, GitOps, RBACCluster resourceCluster resource is the interface between DBAs and infrastructure teamNULL password for Postgres)ALTER SYSTEM is disabledapiVersion: postgresql.cnpg.io/v1
kind: Cluster
metadata:
name: acdc
spec:
instances: 3
affinity:
nodeSelector:
node-role.kubernetes.io/postgres: ""
postgresql:
synchronous:
method: any
number: 1
storage:
size: 200Gi
spec.postgresql.synchronous controls quorum-based (any) synchronous replication directly
Cluster resource and everything inside its spec:
kubectl apply might still work
cluster-admin roleget/list/watch on common CNPG and K8s-related resources
Cluster, Backup, Pooler, Lease, ConfigMaps, Servicesget on application Secrets onlypods/portforward to open a tunnelpods/exec/attach (no shell inside the container)Cluster spec
Backup and ScheduledBackup resources common to native and CNPG-I pluginsspec:
postgresql:
parameters:
shared_buffers: "4GB"
max_connections: "200"
work_mem: "32MB"
Before:
postgresql.conf, pg_hba.conf, ... and Linux OS settings directly
Now:
Cluster resource, full stop
pg_upgradeBare metal
Handcrafted installs. Total control, total manual burden.
VMs
Faster provisioning, same manual HA logic.
Cloud IaaS
Elastic compute, Postgres still self-managed.
Cloud DBaaS
Day-1 convenience, Day-2 lock-in.
CloudNativePG
Full lifecycle automation, runs anywhere (Cloud Neutral Postgres)
What if moving clouds for Postgres was just a Cluster pointed somewhere else?

pg_dump-and-hope migration

