From e3d645e1e11214e8d1fca0cc84152f1b9bea24be Mon Sep 17 00:00:00 2001 From: Joachim Bartosik Date: Mon, 30 Jan 2023 14:55:16 +0100 Subject: [PATCH] Add instructions for VPA release --- vertical-pod-autoscaler/RELEASE.md | 161 +++++++++++++++++++++++++++++ 1 file changed, 161 insertions(+) create mode 100644 vertical-pod-autoscaler/RELEASE.md diff --git a/vertical-pod-autoscaler/RELEASE.md b/vertical-pod-autoscaler/RELEASE.md new file mode 100644 index 000000000000..479fba01203a --- /dev/null +++ b/vertical-pod-autoscaler/RELEASE.md @@ -0,0 +1,161 @@ +# VPA Release Instructions + +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](#permissions) section below). + +There are the following steps of the release process: + +1. [ ] Open issue to track the release. +2. [ ] Update VPA version const. +3. [ ] Build and stage images. +4. [ ] Test the release. +5. [ ] Promote image. +6. [ ] Finalize release. + +## Open issue to track the release + +We use the issue to communicate what is state of the release. + +## Update VPA version const + +1. [ ] Wait for all VPA changes that will be in the release to merge. +2. [ ] Wait for [the end to end tests](https://k8s-testgrid.appspot.com/sig-autoscaling-vpa) to run with all VPA changes + included. +3. [ ] Make sure the end to end VPA tests are green. + +### New minor release + +1. [ ] Change the version in + [common/version-go](https://github.com/kubernetes/autoscaler/blob/master/vertical-pod-autoscaler/common/version.go) + to `0.${next-minor}.0`, +2. [ ] Commit and merge the change, +3. [ ] Go to the merged change, +4. [ ] [Create a new branch](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-and-deleting-branches-within-your-repository) named `vpa-release-0.${next-minor}` from the + merged change. + +### New patch release + +1. [ ] Bump the patch version number in VerticalPodAutoscalerVersion constant in + [common/version.go](https://github.com/kubernetes/autoscaler/blob/master/vertical-pod-autoscaler/common/version.go). + Create a commit and merge by making a PR to the `vpa-release-0.${minor}` branch. + +## Build and stage images + +```sh +for component in recommender updater admission-controller ; do REGISTRY=gcr.io/k8s-staging-autoscaling TAG=[*vpa-version*] make release --directory=pkg/${component}; done +``` + +## Test the release + +1. [ ] Create a Kubernetes cluster. If you're using GKE you can use the following command: + + ```shell + $ gcloud container clusters create e2e-test --machine-type=n1-standard-2 --image-type=COS_CONTAINERD --num-nodes=3 + ``` + +1. [ ] Create clusterrole. If you're using GKE you can use the following command: + + ```shell + $ kubectl create clusterrolebinding my-cluster-admin-binding --clusterrole=cluster-admin --user=`gcloud config get-value account` + ``` + +1. [ ] Deploy VPA: + ```shell + $ REGISTRY=gcr.io/k8s-staging-autoscaling TAG=[*vpa-version*] ./hack/vpa-up.sh + ``` + +1. [ ] [Run](https://github.com/kubernetes/autoscaler/blob/master/vertical-pod-autoscaler/hack/run-e2e-tests.sh) + the `full-vpa` test suite: + + ```shell + $ ./hack/run-e2e-tests.sh full-vpa + ``` + +## Promote image + +To promote image from staging repo send out PR updating +[autoscaling images mapping](https://github.com/kubernetes/k8s.io/blob/master/k8s.gcr.io/images/k8s-staging-autoscaling/images.yaml) +([example](https://github.com/kubernetes/k8s.io/pull/1318)). + +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](https://testgrid.k8s.io/sig-k8s-infra-k8sio#post-k8sio-image-promo). +To verify if the promoter finished its job one can use gcloud. E.g.: + +```sh +$ gcloud container images describe us.gcr.io/k8s-artifacts-prod/autoscaling/vpa-recommender:[*vpa-version*] +``` + +You can also take a look at the images in the +[k8s-artifacts repo](https://us.gcr.io/k8s-artifacts-prod/autoscaling/). + +## Finalize release + +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. + +1. [ ] Update the yaml files to point to the [*vpa-version*]. Merge this change + into branch vpa-release-0.X and optionally into master if 0.X is the latest + minor release. + + ```sh + sed -i -s "s|[0-9]\+\.[0-9]\+\.[0-9]\+|[*vpa-version*]|" ./deploy/*-deployment.yaml ./hack/vpa-process-yaml.sh + ``` + + Example PR: https://github.com/kubernetes/autoscaler/pull/3548 + +1. [ ] Tag the commit with version const change + + ```sh + 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*]" + ``` + +1. [ ] Push tag + + ```sh + git push git@github.com:kubernetes/autoscaler.git vertical-pod-autoscaler-[*vpa-version*] + git push git@github.com:kubernetes/autoscaler.git vertical-pod-autoscaler/v[*vpa-version*] + ``` + +1. [ ] To create and publish a github release from pushed tag go to + https://github.com/kubernetes/autoscaler/releases/tag/vertical-pod-autoscaler-[*vpa-version*], + press `Edit release`, complete release title and release notes, tick the + `This is a pre-release` box and press `Publish release`. + +1. [ ] Update information about newest version and K8s compatibility in + [the installation section of README](https://github.com/kubernetes/autoscaler/blob/master/vertical-pod-autoscaler/README.md#installation). + +## Permissions + +* Permissions to access `gcr.io/k8s-staging-autoscaling` are governed by list + of people in + [groups.yaml](https://github.com/kubernetes/k8s.io/blob/master/groups/sig-autoscaling/groups.yaml) + under k8s-infra-staging-autoscaling. +* Permissions to add images to + `k8s.gcr.io/images/k8s-staging-autoscaling/images.yaml` are governed by + [OWNERS file](https://github.com/kubernetes/k8s.io/blob/master/k8s.gcr.io/images/k8s-staging-autoscaling/OWNERS). +* Permissions to add tags to + [kubernetes/autoscaler](https://github.com/kubernetes/autoscaler) and create + releases in the repo you must be: + + * a collaborator on the + [kubernetes/autoscaler](https://github.com/kubernetes/autoscaler) repo + or + * a member of the + [autoscaler-maintainers](https://github.com/orgs/kubernetes/teams/autoscaler-maintainers/members) + team. + + A member of the + [autoscaler-admins](https://github.com/orgs/kubernetes/teams/autoscaler-admins) + can add you to add you as a collaborator. \ No newline at end of file