This repo contains two helm charts: edb-postgres-for-kubernetes and edb-postgres-distributed-for-kubernetes. 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 each EDB operator. I.e., even if we have several supported release branches, we will only target the most advanced point release.
- Releasing the
edb-postgres-for-kuberneteschart - Releasing the
edb-postgres-distributed-for-kuberneteschart
To create a new release of the edb-postgres-for-kubernetes chart,
follow these steps:
-
Check the current chart version by inspecting the
versionfield incharts/edb-postgres-for-kubernetes/Chart.yaml.OLD_VERSION=$(yq -r '.version' charts/edb-postgres-for-kubernetes/Chart.yaml) OLD_PG4K_VERSION=$(yq -r '.appVersion' charts/edb-postgres-for-kubernetes/Chart.yaml) echo $OLD_VERSION
-
Determine the next chart version based on the type of update in the EDB Postgres for Kubernetes (PG4K) release, following semantic versioning best practices. For reference, use
X.Y.Zas the new version.NEW_VERSION="X.Y.Z" -
Create a branch named
release/edb-postgres-for-kubernetes-vX.Y.Zand switch to itgit switch --create release/edb-postgres-for-kubernetes-v$NEW_VERSION -
Update the
.versionincharts/edb-postgres-for-kubernetes/Chart.yamlto"X.Y.Z"sed -i -E "s/^version: \"([0-9]+.?)+\"/version: \"$NEW_VERSION\"/" charts/edb-postgres-for-kubernetes/Chart.yaml -
Update everything else as required, if releasing due to a new
edb-postgres-for-kubernetesversion being released, you might want to:-
Find the latest
edb-postgres-for-kubernetesversion by running:NEW_PG4K_VERSION=$( gh api "https://api.github.com/repos/EnterpriseDB/cloud-native-postgres/tags" | \ jq -r '.[0].name | ltrimstr("v")') echo $NEW_PG4K_VERSION
-
Update
.appVersionin Chart.yaml filesed -i -E "s/^appVersion: \"([0-9]+.?)+\"/appVersion: \"$NEW_PG4K_VERSION\"/" \ charts/edb-postgres-for-kubernetes/Chart.yaml -
Update crds.yaml, which can be built using kustomize from the PG4K repo using kustomize remoteBuild running:
echo '{{- if .Values.crds.create }}' > ./charts/edb-postgres-for-kubernetes/templates/crds/crds.yaml kustomize build https://github.com/EnterpriseDB/cloud-native-postgres/config/helm/\?ref\=v$NEW_PG4K_VERSION >> ./charts/edb-postgres-for-kubernetes/templates/crds/crds.yaml echo '{{- end }}' >> ./charts/edb-postgres-for-kubernetes/templates/crds/crds.yaml
-
To update the files in the templates directory, you can diff the previous PG4K release YAML against the new one to find what should be updated. E.g.,
vimdiff \ "https://get.enterprisedb.io/pg4k/pg4k-${OLD_PG4K_VERSION}.yaml" \ "https://get.enterprisedb.io/pg4k/pg4k-${NEW_PG4K_VERSION}.yaml"
Or from the
cloudnative-pgrepo, with the desired release branch checked out:vimdiff pg4k-${OLD_PG4K_VERSION}.yaml pg4k-${NEW_PG4K_VERSION}.yaml
-
Update values.yaml if needed
NOTE: updating
values.yamljust for the PG4K version is not necessary, as the value should default to theappVersioninChart.yaml
-
-
Run
make docs schemato regenerate the docs and the values schema as neededmake docs schema
-
Commit and add the relevant information you wish in the commit message.
git add -p . git commit -S -s -m "Release edb-postgres-for-kubernetes-v$NEW_VERSION" --edit
-
Push the new branch
git push --set-upstream origin release/edb-postgres-for-kubernetes-v$NEW_VERSION -
A PR named
Release edb-postgres-for-kubernetes-vX.Y.Zshould be automatically created -
Wait for all the checks to pass
-
Two approvals are required to merge the PR. If you are a maintainer, you may approve the PR yourself and request an additional approval from another maintainer. Otherwise, request two approvals from maintainers.
-
Merge the PR squashing all commits and taking care to keep the commit message to be
Release edb-postgres-for-kubernetes-vX.Y.Z -
A release
edb-postgres-for-kubernetes-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:
helm repo add edb https://enterprisedb.github.io/edb-postgres-for-kubernetes-charts helm repo update helm search repo edb
and be able to see the new version
X.Y.ZasCHART VERSIONforedb-postgres-for-kubernetes
To create a new release of the edb-postgres-distributed-for-kubernetes chart,
follow these steps:
-
Check the current chart version by inspecting the
versionfield incharts/edb-postgres-distributed-for-kubernetes/Chart.yamlOLD_VERSION=$(yq -r '.version' charts/edb-postgres-distributed-for-kubernetes/Chart.yaml) OLD_PGD4K_VERSION=$(yq -r '.appVersion' charts/edb-postgres-distributed-for-kubernetes/Chart.yaml) echo $OLD_VERSION
-
Determine the next chart version based on the type of update in the EDB Postgres Distributed for Kubernetes (PGD4K) release, following semantic versioning best practices. For reference, use
X.Y.Zas the new version.NEW_VERSION="X.Y.Z" -
Create a branch named
release/edb-postgres-distributed-for-kubernetes-vX.Y.Zand switch to itgit switch --create release/edb-postgres-distributed-for-kubernetes-v$NEW_VERSION -
Update the
.versionincharts/edb-postgres-distributed-for-kubernetes/Chart.yamlto"X.Y.Z"sed -i -E "s/^version: \"([0-9]+.?)+\"/version: \"$NEW_VERSION\"/" charts/edb-postgres-distributed-for-kubernetes/Chart.yaml -
Update everything else as required, if releasing due to a new
edb-postgres-distributed-for-kubernetesversion being released, you might want to:-
Find the latest
edb-postgres-distributed-for-kubernetesversion by running:NEW_PGD4K_VERSION=$( gh api "https://api.github.com/repos/EnterpriseDB/pg4k-pgd/tags" | \ jq -r '.[0].name | ltrimstr("v")') echo $NEW_PGD4K_VERSION
-
Update
.appVersionin Chart.yaml filesed -i -E "s/^appVersion: \"([0-9]+.?)+\"/appVersion: \"$NEW_PGD4K_VERSION\"/" \ charts/edb-postgres-distributed-for-kubernetes/Chart.yaml -
Update crds.yaml, which can be built using kustomize from the PGD4K repo using kustomize remoteBuild running:
echo '{{- if .Values.crds.create }}' > ./charts/edb-postgres-distributed-for-kubernetes/templates/crds/crds.yaml kustomize build https://github.com/EnterpriseDB/pg4k-pgd/config/helm/\?ref\=v$NEW_PGD4K_VERSION >> ./charts/edb-postgres-distributed-for-kubernetes/templates/crds/crds.yaml echo '{{- end }}' >> ./charts/edb-postgres-distributed-for-kubernetes/templates/crds/crds.yaml
-
To update the files in the templates directory, you can diff the previous PGD4K release YAML against the new one to find what should be updated. E.g.,
vimdiff \ "https://get.enterprisedb.io/pg4k-pgd/pg4k-pgd-enterprise-${OLD_PGD4K_VERSION}.yaml" \ "https://get.enterprisedb.io/pg4k-pgd/pg4k-pgd-enterprise-${NEW_PGD4K_VERSION}.yaml"
Or from the
pg4k-pgdrepo, with the desired release branch checked out:vimdiff ./releases/pg4k-pgd-enterprise-${OLD_PGD4K_VERSION}.yaml ./releases/pg4k-pgd-enterprise-${NEW_PGD4K_VERSION}.yaml
-
Update values.yaml if needed
NOTE: updating
values.yamljust for the PGD4K version (imageTagattribute) is not necessary, as the value should default to theappVersioninChart.yaml -
Update
pgdImageNameandproxyImageNamedefaults inside values.yaml according to the default versions present in the release. -
Update dependent
cert-managerversion in Chart.yaml if needed -
Update the
.appVersionand.versionin subchart edb-postgres-for-kubernetes-lts and follow the PG4K Release to update the subchart to latest PG4K lts release if needed -
Update dependent
edb-postgres-for-kubernetes-ltsversion in Chart.yaml
-
-
From here onward, you can follow the steps of PG4K Release, starting from step 6.
IMPORTANT: Take care to replace edb-postgres-for-kubernetes with
edb-postgres-distributed-for-kubernetes accordingly before executing the commands.