Try It Out
In this example we will deploy CloudNativePG on a Kubernetes cluster using the Minimus CloudNativePG Helm chart. Once the operator is running you can declare PostgreSQL clusters as Kubernetes resources and the operator manages provisioning, failover, and backups for you.
Step 1: Start Cluster
If you have a cluster to work with, skip this step. Otherwise, start a Minikube cluster. Deployment instructions
Step 2: Create Namespace
Create a namespace:
kubectl create ns cloudnative-pg
Step 3: Deploy the Helm Chart
Deploy the Minimus Helm chart:
helm install my-cloudnative-pg oci://helm.mini.dev/cloudnative-pg \
--version 0.26.1 \
-n cloudnative-pg \
--wait
If you want to override the chart's defaults, go to the Values tab, save a copy locally with your changes. Deploy the chart with your overrides using -f values.yaml:
helm install my-cloudnative-pg oci://helm.mini.dev/cloudnative-pg \
--version 0.26.1 \
-f values.yaml \
-n cloudnative-pg \
--wait
Step 4: Verify CloudNativePG is Running
Check that the operator pod is running:
kubectl get pods -n cloudnative-pg
You should see the operator pod in the Running state:
NAME READY STATUS RESTARTS AGE
my-cloudnative-pg-xxxxxxxxx-xxxxx 1/1 Running 0 60s
Step 5: Test the Operator
Confirm the operator registered its Custom Resource Definitions:
kubectl get crd | grep cnpg.io
Create a minimal PostgreSQL Cluster and let the operator provision it:
kubectl apply -n cloudnative-pg -f - <<EOF
apiVersion: postgresql.cnpg.io/v1
kind: Cluster
metadata:
name: cluster-example
spec:
instances: 1
imageName: reg.mini.dev/cloudnative-pg-postgresql:17
imagePullSecrets:
- name: minimus-registry
storage:
size: 1Gi
EOF
Wait for the cluster to become ready:
kubectl wait cluster/cluster-example -n cloudnative-pg \
--for=condition=Ready --timeout=300s
kubectl get cluster -n cloudnative-pg
The cluster reports a healthy status once the operator has provisioned it:
NAME AGE INSTANCES READY STATUS PRIMARY
cluster-example 2m 1 1 Cluster in healthy state cluster-example-1
Remove the sample cluster when you are done:
kubectl delete cluster/cluster-example -n cloudnative-pg
Step 6: Clean Up
Uninstall the chart and delete the namespace to remove all resources:
helm uninstall my-cloudnative-pg -n cloudnative-pg
kubectl delete namespace cloudnative-pg
Terms & Info
Trademark
This catalog is published by Minimus. All product names, logos, and marks, other than those belonging to Minimus, shown are owned by their respective rights holders and appear here only to identify the open source software each image contains. Minimus claims no ownership of those marks and implies no affiliation with, endorsement by, certification by, or sponsorship by any rights holder.
Disclaimer
Images are provided "as-is" without warranty of any kind. "Hardened" refers to the security configuration applied at the time of build and does not constitute a guarantee of ongoing security or absence of vulnerabilities. The free tier is provided without support, SLA, or guaranteed patching timelines. Security updates may be applied to paid subscriptions before or instead of free tier images. By pulling or using any image you agree to our Terms of Use.