This chapter describes the recommended process for updating the CYBERTEC PostgreSQL Operator (CPO). To ensure a smooth transition and compatibility with new features, updates should be performed using our official Helm repository.
ImportantCRD Update Requirement: Due to how Helm handles the crds/ directory, helm upgrade will not automatically update or patch existing Custom Resource Definitions (CRDs). You must manually apply the updated CRDs before upgrading the Helm release.
- Update the Helm Repository
First, ensure your local Helm chart cache is up to date with the latest versions from the CYBERTEC repository:
helm repo update cpo
- Update the Custom Resource Definitions (CRDs)
Before upgrading the Helm release, you must manually apply the latest CRDs from the CYBERTEC-operator-tutorials repository. This is a safety measure because Helm does not touch existing CRDs to prevent accidental data loss.
Apply the definitions for the Postgres clusters and the operator configuration directly from the source:
# Update the PostgreSQL Cluster CRD
kubectl apply -f https://raw.githubusercontent.com/cybertec-postgresql/CYBERTEC-operator-tutorials/refs/heads/main/setup/helm/operator/crds/postgresql.crd.yaml
# Update the Operator Configuration CRD
kubectl apply -f https://raw.githubusercontent.com/cybertec-postgresql/CYBERTEC-operator-tutorials/refs/heads/main/setup/helm/operator/crds/operatorconfiguration.crd.yaml
- Execute the Helm Upgrade
Once the CRDs are up to date, you can upgrade the operator deployment. This process replaces the operator pod with the new version and updates the necessary RBAC roles and service accounts.
# Upgrade the CPO release in the 'cpo' namespace
helm upgrade cpo cpo/cybertec-pg-operator \
--namespace cpo \
--reuse-values
- Clone or Update the Tutorial Repo
git clone https://github.com/$GITHUB_USER/CYBERTEC-operator-tutorials.git
cd CYBERTEC-operator-tutorials
- Patch CRDS
# Update the PostgreSQL Cluster CRD
kubectl apply -f setup/helm/operator/crds/postgresql.crd.yaml
# Update the Operator Configuration CRD
kubectl apply -f setup/helm/operator/crds/operatorconfiguration.crd.yaml
- Execute the Helm Upgrade
# Upgrade the CPO release in the 'cpo' namespace
helm upgrade cpo setup/helm/operator/. \
--namespace cpo \
--reuse-values
To ensure the update was successful, perform the following checks:
- Pod Status: Verify that the new operator pod is running.
kubectl get pods -n cpo -l app.kubernetes.io/name=cybertec-pg-operator
- Version Check: Check the logs to see the version string during startup.
kubectl logs -n cpo deployment/cybertec-pg-operator | grep "Starting operator"
- CRD Integrity: Ensure the new CRD fields are recognized by the Kubernetes API.
kubectl describe crd postgresqls.cpo.opensource.cybertec.at
The CRDs are located in the helm/operator/crds/ folder. By design, Helm only installs these during the initial helm install. During an upgrade, Helm ignores this folder to protect the cluster from unintended schema changes. Therefore, manual application via kubectl apply is the standard and safest path for CPO updates.
Always ensure that your postgresql manifests are compatible with the new operator version by checking the Release Notes in the Documentation.