This repo contains two helm charts: cloudnative-pg and cnpg-sandbox. Both the charts are available through a single repository, but should be released separately as their versioning might be unlinked, and the latter depends on the former.
IMPORTANT we should run the below procedures against the latest point release of the CloudNativePG operator. I.e. even if we have several release branches in CNPG, we will only target the most advanced point release (e.g. 1.17.1)
In order to create a new release of the cloudnative-pg
chart,
follow these steps:
- take note of the current value of the release: see
.version
incharts/cloudnative-pg/Chart.yaml
- decide which version to create, depending on the kind of jump of the
CloudNativePG release, following semver semantics.
For this document, let's call it
X.Y.Z
- create a branch named
release/cloudnative-pg-vX.Y.Z
and switch to it - update the
.version
in the Chart.yaml file to"X.Y.Z"
- update everything else as required, e.g. if releasing due to a new
cloudnative-pg version being released, you might want to update the
following:
.appVersion
in the Chart.yaml file- crds.yaml, whose
content can be built using kustomize from the
cloudnative-pg repo using kustomize
remoteBuild
running:
kustomize build https://github.com/cloudnative-pg/cloudnative-pg/tree/release-1.16/config/helm/\?ref=v1.16.0
, take care to set the correct release branch and version as ref (v1.15.1 in the example command).
It might be easier to runkustomize build config/helm
from thecloudnative-pg
repo, with the desired release branch checked out, and copy the result to./charts/cloudnative-pg/templates/crds/crds.yaml
. - NOTE: please keep the guards for
.Values.crds.create
, i.e.{{- if .Values.crds.create }}
and{{- end }}
after you copy the CRD intotemplates/crds/crds.yaml
. - to update the files in the
templates directory, you can diff
the previous CNPG release yaml against the new one, to find what
should be updated (e.g.
vimdiff https://raw.githubusercontent.com/cloudnative-pg/cloudnative-pg/main/releases/cnpg-1.15.0.yaml https://raw.githubusercontent.com/cloudnative-pg/cloudnative-pg/main/releases/cnpg-1.15.1.yaml
)
Or, from thecloudnative-pg
repo, with the desired release branch checked out,vimdiff releases/cnpg-1.15.0.yaml releases/cnpg-1.15.1.yaml
- update values.yaml if needed
- NOTE: updating
values.yaml
just for the CNPG verision may not be necessary, as the value should default to theappVersion
inChart.yaml
- run
make docs schema
to regenerate the docs and the values schema in case it is needed git commit -S -s -m "Release cloudnative-pg-vX.Y.Z" --edit
and add all the informations you wish below the commit message.git push --set-upstream origin release/cloudnative-pg-vX.Y.Z
- a PR named
Release cloudnative-pg-vX.Y.Z
will be automatically created - wait for all the checks to pass
- two approvals are required in order to merge the PR, if you are a maintainer approve the PR yourself and ask for another approval, otherwise ask for two approvals directly.
- merge the pr squashing all commits and taking care to keep the commit
message to be
Release cloudnative-pg-vX.Y.Z
- a tag
cloudnative-pg-vX.Y.Z
will be automatically created by an action, which will ten trigger the release action, check they both are successful. - once done you should be able to run helm repo
helm repo add cnpg https://cloudnative-pg.github.io/charts; helm repo update; helm search repo cnpg
and be able to see the new versionvX.Y.Z
asCHART VERSION
forcloudnative-pg