vertical-pod-autoscaler/RELEASE.md
These are instructions for releasing VPA. We aim to release a new VPA minor version after each minor Kubernetes release. We release patch versions as needed.
Before doing the release for the first time check if you have all the necessary permissions (see Permissions section below).
There are the following steps of the release process:
Open a new issue to track the release, use the vpa_release template. We use the issue to communicate what is state of the release.
===== last commit =====
entries in the full build-log.txt of a given test run.vpa-release-1.${next-minor} from the
merged change.1.${next-minor}.0.vpa-release-1.${minor} branch.Select either the Automatic and Manual process below.
NOTE: Currently this process can only be used for new minor releases. Patch releases need to follow the manual process below.
Images are continuously built as part of the PR release process and are listed in the following repository: gcr.io/k8s-staging-autoscaling. Also see the dashboard for build status.
To stage an image:
Pick an image to promote from the latest automatically built images in the
repository. Make note of the automatically generated tag (the tag will contain
the date, the name of the latest tag in the repository and a commit hash). For
example v20250430-cluster-autoscaler-chart-9.46.6-81-g6a6a912b4.
Set the BUILD_TAG variable to this tag in your shell:
export BUILD_TAG=<tag>
cd vertical-pod-autoscaler/
export TAG=`grep 'const versionCore = ' common/version.go | cut -d '"' -f 2`
./hack/tag-release.sh
Create a fresh clone of the repo and switch to the vpa-release-1.${minor}
branch. This makes sure you have no local changes while building the images.
For example:
git clone [email protected]:kubernetes/autoscaler.git
git switch vpa-release-1.${minor}
Once in the freshly cloned repo, build and stage the images.
[!NOTE] Ensure you have run the following before building the images:
gcloud auth loginandgcloud auth configure-docker -q.
cd vertical-pod-autoscaler/
for component in recommender updater admission-controller ; do TAG=`grep 'const versionCore = ' common/version.go | cut -d '"' -f 2` REGISTRY=gcr.io/k8s-staging-autoscaling make release --directory=pkg/${component}; done
Create a Kubernetes cluster. If you're using GKE you can use the following command:
gcloud container clusters create e2e-test --machine-type=n1-standard-2 --image-type=COS_CONTAINERD --num-nodes=3 --release-channel=rapid
Create clusterrole. If you're using GKE you can use the following command:
kubectl create clusterrolebinding my-cluster-admin-binding --clusterrole=cluster-admin --user=`gcloud config get-value account`
Deploy VPA:
REGISTRY=gcr.io/k8s-staging-autoscaling TAG=`grep 'const versionCore = ' common/version.go | cut -d '"' -f 2` ./hack/vpa-up.sh
Run
the full-vpa test suite:
./hack/run-e2e-tests.sh full-vpa
To promote image from staging repo send out PR updating autoscaling images mapping (example).
NOTE: Please use the add-version.sh script to prepare the changes automatically.
When PR merges the promoter will run automatically and upload the image from staging repo to final repo. The post submit job status can be tracked on testgrid. To verify if the promoter finished its job one can use gcloud. E.g.:
gcloud container images describe registry.k8s.io/autoscaling/vpa-recommender:[*vpa-version*]
NOTE: We currently use two tags for releases:
vertical-pod-autoscaler-[*vpa-version*] and
vertical-pod-autoscaler/v[*vpa-version*]. We need
vertical-pod-autoscaler/v[*vpa-version*] for go get k8s.io/autoscaler/vertical-pod-autoscaler@v[*vpa-version*] to work. We can
consider stopping using vertical-pod-autoscaler-[*vpa-version*] tags but
we've been using them since vertical-pod-autoscaler-0.1 and tags with the
other pattern start only with vertical-pod-autoscaler/v0.9.0 so we should make
sure nothing we care about will break if we do.
Make the following changes in the release branch:
git switch vpa-release-1.${minor}
Update information about newest version and K8s compatibility in the installation section of README.
Update the yaml and sh files:
sed -i -s "s|[0-9]\+\.[0-9]\+\.[0-9]\+|[*vpa-version*]|g" ./deploy/*-deployment*.yaml
sed -i -s "s|DEFAULT_TAG=\"[0-9]\+\.[0-9]\+\.[0-9]\+\"|DEFAULT_TAG=\"[*vpa-version*]\"|g" ./hack/*.sh
Generate the flags files:
./hack/generate-flags.sh
Merge these changes into branch vpa-release-1.{$minor}. Make note of the commit hash and use it in the next step.
See https://github.com/kubernetes/autoscaler/pull/8154 as an example.
Tag the commit corresponding to the changes from above in the release branch.
git checkout <commit hash>
git tag -a vertical-pod-autoscaler-[*vpa-version*] -m "Vertical Pod Autoscaler release [*vpa-version*]"
git tag -a vertical-pod-autoscaler/v[*vpa-version*] -m "Vertical Pod Autoscaler release [*vpa-version*]"
Push tag
git push [email protected]:kubernetes/autoscaler.git vertical-pod-autoscaler-[*vpa-version*]
git push [email protected]:kubernetes/autoscaler.git vertical-pod-autoscaler/v[*vpa-version*]
Create and publish a github release from pushed tag go to
https://github.com/kubernetes/autoscaler/releases/tag/vertical-pod-autoscaler-[*vpa-version*],
press Create release from tag, complete release title and release notes and press Publish release.
Repeat steps 2-5 above in the main branch.
After submitting, users who use vpa-up.sh will now start using the latest version.
IMPORTANT: Make sure the tags created above exist before merging into the main branch!
Permissions to access gcr.io/k8s-staging-autoscaling are governed by list
of people in
groups.yaml
under k8s-infra-staging-autoscaling.
Permissions to add images to
k8s.io/registry.k8s.io/images/k8s-staging-autoscaling/images.yaml are governed by
OWNERS file.
Permissions to add tags to kubernetes/autoscaler and create releases in the repo you must be:
A member of the autoscaler-admins can add you to add you as a collaborator.