Quick Start: Your First PostgreSQL Cluster in 15 Minutes
This tutorial walks you from a fresh install of the Alauda CloudNativePG operator to a running 3-instance PostgreSQL cluster with backup configured. Each section is sized to a few minutes; total wall-clock is about 15 minutes if your cluster is responsive.
TOC
Prerequisites (5 min)Step 1 — Install the operator (3 min)Step 2 — Your first PostgreSQL cluster (4 min)Step 3 — Configure backup to object storage (3 min)What's nextTroubleshootingPrerequisites (5 min)
You need:
- An ACP managed cluster running Kubernetes 1.30+ with:
- A default block-mode StorageClass (typically a
topolvmclass; verify withkubectl get sc). - cert-manager installed (required for the Barman Cloud backup
plugin's TLS prerequisites). Verify with
kubectl api-resources --api-group=cert-manager.io. If absent, install it via the marketplace before continuing.
- A default block-mode StorageClass (typically a
- Cluster admin or platform admin access for the install steps. Day-2 operations (creating clusters, backups) only require namespace admin on the target namespace.
kubectlconfigured for the target cluster (the ACP web console's Download kubeconfig action is the simplest path).- An S3-compatible object store for backups (MinIO, Ceph RGW, or any S3 endpoint reachable from the cluster), with access keys and a bucket you can write to.
If you don't yet have the operator installed, read
Installation first and come back here once the
CSV is Succeeded.
Step 1 — Install the operator (3 min)
Skip this step if you already followed Installation.
Apply and wait for the CSV to reach Succeeded:
The operator pod (cnpg-controller-manager-* in cnpg-system) should
show Running 1/1 within ~60 seconds of Succeeded.
Step 2 — Your first PostgreSQL cluster (4 min)
Create a workload namespace and apply a 3-instance Cluster. With no image specified, the operator uses the PostgreSQL version shipped with this product release — the simplest, supported default:
To pick a specific PostgreSQL major version, set spec.imageName to a
PostgreSQL operand image from your platform registry, or create a
ClusterImageCatalog and reference it with spec.imageCatalogRef —
see Configuration (Images section). A
ClusterImageCatalog is not installed by default.
Always address CNPG clusters as cluster.postgresql.cnpg.io in
kubectl commands. On ACP clusters the bare cluster shortname
resolves to a different resource (clusters.cluster.x-k8s.io from
Cluster API), and commands like kubectl wait cluster/my-postgres fail
with NotFound.
A 3-instance cluster typically reaches Cluster in healthy state in
two to five minutes (image pull time dominates on first use). The first
instance is the primary; the other two stream replication from it.
Verify with a smoke SQL query through the writable -rw service, using
the same operand image the cluster runs:
Expected output includes the row you inserted and a PostgreSQL 18.x ...
version line.
Step 3 — Configure backup to object storage (3 min)
Backups go through the Barman Cloud plugin, which is included in the Alauda CNPG bundle and bootstrapped automatically by the operator on startup (assuming cert-manager is present).
First, create a Kubernetes Secret with the S3 credentials. Avoid
passing secrets on the command line — use --from-file against
short-lived temp files:
Then create an ObjectStore resource describing where backups land,
and attach the Barman Cloud plugin to the Cluster:
Attaching the plugin triggers a rolling restart of the instances
(the plugin sidecar is injected into each pod). Wait for the cluster to
return to Cluster in healthy state before triggering a backup —
a Backup created mid-rollout fails with
requested plugin is not available: barman-cloud.cloudnative-pg.io.
Trigger an immediate backup:
A small cluster's first backup typically completes in 10–30 seconds.
Verify the artifacts in S3 using mc (or any S3 client):
You now have a self-managed PostgreSQL cluster with HA replication and S3-backed point-in-time recovery.
What's next
- Configuration — parameters, users and databases, synchronous replication, storage, images.
- How-To: Ops Runbook — day-2 operations including failover, scaling, upgrades, and restore.
- How-To: Grafana dashboards — wire the built-in metrics into the platform Prometheus and import the curated dashboards.
- Migrating from Zalando — moving existing Zalando postgres-operator clusters to CloudNativePG.
- Architecture — how primary election, replication, and plugins work.
Troubleshooting
For configuration-level issues, see the troubleshooting quick reference.