This repo contains two helm charts: cloudnative-pg and cluster. 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)
- Releasing the
cloudnative-pgchart - Releasing the
clusterchart - Releasing the
plugin-barman-cloudchart
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
.versionincharts/cloudnative-pg/Chart.yamlOLD_VERSION=$(yq -r '.version' charts/cloudnative-pg/Chart.yaml) OLD_CNPG_VERSION=$(yq -r '.appVersion' charts/cloudnative-pg/Chart.yaml) echo Old chart version: $OLD_VERSION echo Old CNPG version: $OLD_CNPG_VERSION
- 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.ZNEW_VERSION="X.Y.Z" - Create a branch named
release/cloudnative-pg-vX.Y.Zand switch to it:git switch --create release/cloudnative-pg-v$NEW_VERSION - Update the
.versionin the Chart.yaml file to"X.Y.Z"sed -i -E "s/^version: \"([0-9]+.?)+\"/version: \"$NEW_VERSION\"/" charts/cloudnative-pg/Chart.yaml - Update everything else as required, e.g. if releasing due to a new
cloudnative-pgversion being released, you might want to:-
Find the latest
cloudnative-pgversion by running:NEW_CNPG_VERSION=$(curl -Ssl "https://api.github.com/repos/cloudnative-pg/cloudnative-pg/tags" | jq -r '.[0].name | ltrimstr("v")') echo New CNPG version: $NEW_CNPG_VERSION
-
Update
.appVersionin the Chart.yaml filesed -i -E "s/^appVersion: \"([0-9]+.?)+\"/appVersion: \"$NEW_CNPG_VERSION\"/" charts/cloudnative-pg/Chart.yaml -
Update crds.yaml, which can be built using kustomize from the
cloudnative-pgrepo using kustomize remoteBuild running:Verify the version is correct. Edit it if incorrect, then run:
echo '{{- if .Values.crds.create }}' > ./charts/cloudnative-pg/templates/crds/crds.yaml kustomize build https://github.com/cloudnative-pg/cloudnative-pg/config/helm/\?ref\=v$NEW_CNPG_VERSION >> ./charts/cloudnative-pg/templates/crds/crds.yaml echo '{{- end }}' >> ./charts/cloudnative-pg/templates/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://github.com/cloudnative-pg/cloudnative-pg/releases/download/v${OLD_CNPG_VERSION}/cnpg-${OLD_CNPG_VERSION}.yaml" \ "https://github.com/cloudnative-pg/cloudnative-pg/releases/download/v${NEW_CNPG_VERSION}/cnpg-${NEW_CNPG_VERSION}.yaml"Or from the
cloudnative-pgrepo, 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.yamljust for the CNPG version may not be necessary, as the value should default to theappVersioninChart.yaml
-
- Run
make docs schemato regenerate the docs and the values schema in case it is neededmake docs schema
- Commit and add the relevant information you wish in the commit message.
git add . git commit -S -s -m "Release cloudnative-pg-v$NEW_VERSION" --edit
- Push the new branch
git push --set-upstream origin release/cloudnative-pg-v$NEW_VERSION - A PR named
Release cloudnative-pg-vX.Y.Zshould 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 release
cloudnative-pg-vX.Y.Zshould be automatically created by an action, which will then trigger the release action. Verify they both are successful. - Once done you should be able to run:
and be able to see the new version
helm repo add cnpg https://cloudnative-pg.github.io/charts helm repo update helm search repo cnpg
X.Y.ZasCHART VERSIONforcloudnative-pg
In order to create a new release of the cluster chart, follow these steps:
- Take note of the current value of the release: see
.versionincharts/cluster/Chart.yamlyq -r '.version' charts/cluster/Chart.yaml - Decide which version to create, depending on the kind of changes and backwards compatibility, following semver
semantics. For this document, let's call it
X.Y.ZNEW_VERSION="X.Y.Z" - Create a branch: named
release/cluster-vX.Y.Zand switch to itgit switch --create release/cluster-v$NEW_VERSION - Update the
.versionin the Chart.yaml file to"X.Y.Z"sed -i -E "s/^version: ([0-9]+.?)+/version: $NEW_VERSION/" charts/cluster/Chart.yaml - Run
make docs schemato regenerate the docs and the values schema in case it is neededmake docs schema
- Commit and add the relevant information you wish in the commit message.
git add . git commit -S -s -m "Release cluster-v$NEW_VERSION" --edit
- Push the new branch
git push --set-upstream origin release/cluster-v$NEW_VERSION - A PR should 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 cluster-vX.Y.Z - A release
cluster-vX.Y.Zshould be automatically created by an action, which will ten trigger the release action. Verify they both are successful. - Once done you should be able to run:
and be able to see the new version
helm repo add cnpg https://cloudnative-pg.github.io/charts helm repo update helm search repo cnpg
X.Y.ZasCHART VERSIONforcluster
In order to create a new release of the plugin-barman-cloud chart, follow these steps:
- Take note of the current value of the release: see
.versionincharts/plugin-barman-cloud/Chart.yamlOLD_VERSION=$(yq -r '.version' charts/plugin-barman-cloud/Chart.yaml) OLD_APP_VERSION=$(yq -r '.appVersion' charts/plugin-barman-cloud/Chart.yaml) echo Old chart version: $OLD_VERSION echo Old app version: $OLD_APP_VERSION
- 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.ZNEW_VERSION="X.Y.Z" - Create a branch named
release/plugin-barman-cloud-vX.Y.Zand switch to it:git switch --create release/plugin-barman-cloud-v$NEW_VERSION - Update the
.versionin the Chart.yaml file to"X.Y.Z"sed -i -E "s/^version: \"([0-9]+.?)+\"/version: \"$NEW_VERSION\"/" charts/plugin-barman-cloud/Chart.yaml - Update everything else as required, e.g. if releasing due to a new
plugin-barman-cloudversion being released, you might want to:-
Find the latest
plugin-barman-cloudversion by running:NEW_APP_VERSION=$(curl -Ssl "https://api.github.com/repos/cloudnative-pg/plugin-barman-cloud/tags" | jq -r '.[0].name') echo New app version: $NEW_APP_VERSION
-
Update
.appVersionin the Chart.yaml filesed -i -E "s/^appVersion: \"v([0-9]+.?)+\"/appVersion: \"$NEW_APP_VERSION\"/" charts/plugin-barman-cloud/Chart.yaml -
Update crds.yaml, which can be built using kustomize from the
plugin-barman-cloudrepo using kustomize remoteBuild running:Verify the version is correct. Edit it if incorrect, then run:
echo '{{- if .Values.crds.create }}' > ./charts/plugin-barman-cloud/templates/crds/crds.yaml kustomize build https://github.com/cloudnative-pg/plugin-barman-cloud/config/crd/\?ref\=$NEW_APP_VERSION >> ./charts/plugin-barman-cloud/templates/crds/crds.yaml echo '{{- end }}' >> ./charts/plugin-barman-cloud/templates/crds/crds.yaml
Check that the
helm.sh/resource-policy: keepannotation is still present after regenerating the CRDs. -
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://github.com/cloudnative-pg/plugin-barman-cloud/releases/download/${OLD_APP_VERSION}/manifest.yaml" \ "https://github.com/cloudnative-pg/plugin-barman-cloud/releases/download/${NEW_APP_VERSION}/manifest.yaml" -
Update values.yaml if needed
-
NOTE: updating
values.yamljust for the appVersion may not be necessary, as the value should default to theappVersioninChart.yaml
-
- Run
make docs schemato regenerate the docs and the values schema in case it is neededmake docs schema
- Commit and add the relevant information you wish in the commit message.
git add . git commit -S -s -m "Release plugin-barman-cloud-v$NEW_VERSION" --edit
- Push the new branch
git push --set-upstream origin release/plugin-barman-cloud-v$NEW_VERSION - A PR named
Release plugin-barman-cloud-vX.Y.Zshould 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 plugin-barman-cloud-vX.Y.Z - A release
plugin-barman-cloud-vX.Y.Zshould be automatically created by an action, which will then trigger the release action. Verify they both are successful. - Once done you should be able to run:
and be able to see the new version
helm repo add cnpg https://cloudnative-pg.github.io/charts helm repo update helm search repo cnpg
X.Y.ZasCHART VERSIONforplugin-barman-cloud