-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Kubernetes v1.22 #85
Changes from 2 commits
9d14138
9a6e0a8
a96d087
9438e9c
b549e60
4d3826f
b853f98
289d4db
b16e5d0
ee65112
9ed5975
b088450
5208b84
1981530
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
/bin | ||
/.vscode | ||
/.idea | ||
/testbin | ||
/vendor |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
Maintenance guide | ||
================= | ||
|
||
This is the maintenance guide for pvc-autoresizer. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This line is not necessary because it's clear that this document is for maintenance by the document title. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done. |
||
|
||
How to upgrade supported Kubernetes version | ||
bells17 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
------------------------------------------- | ||
|
||
pvc-autoresizer depends on some Kubernetes repositories like `k8s.io/client-go` and should support 3 consecutive Kubernets versions at a time. | ||
bells17 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Here is the guide for how to upgrade the supported versions. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This line is not necessary because it's clear that this section is for changing the supported Kubernetes versions by the section title. |
||
Issues and PRs related to the last upgrade task also help you understand how to upgrade the supported versions, | ||
so checking them together with this guide is recommended when you do this task. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How about adding the link to this PR? |
||
|
||
### Check release notes | ||
|
||
First of all, we should have a look at the release notes in the order below. | ||
|
||
1. Kubernetes | ||
- Choose the next version and check the [release note](https://kubernetes.io/docs/setup/release/notes/). e.g. 1.17, 1.18, 1.19 -> 1.18, 1.19, 1.20 | ||
- Read the [release note](https://github.com/kubernetes-sigs/controller-runtime/releases), and check which version is compatible with the Kubernetes versions. | ||
bells17 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- Read the [kubebuilder go.mod](https://github.com/kubernetes-sigs/kubebuilder/blob/master/go.mod), and check the controller-tools version corresponding to controller-runtime. | ||
2. TopoLVM | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How about changing the order of step 1 and step 2? It' because we should select the versions supported by topolvm in any case. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done. |
||
- Choose the [TopoLVM](https://github.com/topolvm/topolvm/releases) version that supported target Kubernetes version. | ||
3. Depending tools | ||
- They does not depend on other software, use latest versions. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's OK to use the latest versions of the following tools because these tools don't depend on each other. |
||
- [helm](https://github.com/helm/helm/releases) | ||
- [helm-docs](github.com/norwoodj/helm-docs/releases) | ||
- [kube-prometheus](https://github.com/prometheus-operator/kube-prometheus/releases) | ||
4. Depending modules | ||
- Read [kubernetes go.mod](https://github.com/kubernetes/kubernetes/blob/master/go.mod), and update the `prometheus/*` modules. | ||
- Read [csi-test go.mod](https://github.com/kubernetes-csi/csi-test/blob/master/go.mod), and update the `ginkgo` and `gomega` modules. | ||
|
||
Please write down to the Github issue of this task what kinds of changes we find in the release note and what we are going to do and NOT going to do to address the changes. | ||
bells17 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
The format is up to you, but this is very important to keep track of what changes are made in this task, so please do not forget to do it. | ||
bells17 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
Basically, we should pay attention to breaking changes and security fixes first. | ||
If we find some interesting features added in new versions, please consider if we are going to use them or not and make a GitHub issue to incorporate them after the upgrading task is done. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this line is not necessary because it seems to be clear. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done. |
||
|
||
### Update written versions | ||
|
||
Once we decide the versions we are going to upgrade, we should update the versions written in the following files manually. | ||
bells17 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
- `README.md`: Documentation which indicates what versions are supported by pvc-autoresizer | ||
- `Makefile`: Makefile for running envtest | ||
- `e2e/Makefile`: Makefile for running e2e tests | ||
|
||
`git grep 1.18`, `git grep image:`, and `git grep -i VERSION` might help us avoid overlooking necessary changes. | ||
bells17 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Please update the versions in the code and docs with great care. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This line is not necesssary. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done. |
||
|
||
### Update dependencies | ||
|
||
Next, we should update `go.mod` by the following commands. | ||
Please note that Kubernetes v1 corresponds with v0 for the release tags. For example, v1.17.2 corresponds with the `v0.17.2` tag. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How about "If the new kubernetes version is v1.x.y", the new pvc-autoresizer's version will be v0.x.y"? In addition, it's better to place this line after the following command lines. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done. |
||
|
||
```bash | ||
$ VERSION=<upgrading Kubernetes release version> | ||
$ go get k8s.io/api@v${VERSION} k8s.io/apimachinery@v${VERSION} k8s.io/client-go@v${VERSION} | ||
``` | ||
|
||
If we need to upgrade the `controller-runtime` version, do the following as well. | ||
|
||
```bash | ||
$ VERSION=<upgrading controller-runtime version> | ||
$ go get sigs.k8s.io/controller-runtime@v${VERSION} | ||
``` | ||
|
||
Then, please tidy up the dependencies. | ||
|
||
```bash | ||
$ go mod tidy | ||
``` | ||
|
||
These are minimal changes for the Kubernetes upgrade, but if there are some breaking changes found in the release notes, you have to handle them as well in this step. | ||
|
||
### Release the changes | ||
|
||
We should follow [RELEASE.md](../RELEASE.md) and upgrade the minor version. | ||
bells17 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
### Prepare for the next upgrade | ||
|
||
We should create an issue for the next upgrade. Besides, Please update this document if we find something to be updated. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does it mean the next to the next version? In other words, does the new issue for v1.24 if the new supported version is v1.23? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think so. This text is based on Topolvm maintenance.md. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,19 +2,21 @@ | |
TEST_KUBERNETES_TARGET ?= current | ||
|
||
ifeq ($(TEST_KUBERNETES_TARGET),current) | ||
KUBERNETES_VERSION := 1.21.2 | ||
KUBERNETES_VERSION := 1.22.4 | ||
else ifeq ($(TEST_KUBERNETES_TARGET),prev) | ||
KUBERNETES_VERSION := 1.20.7 | ||
KUBERNETES_VERSION := 1.21.2 | ||
else ifeq ($(TEST_KUBERNETES_TARGET),prev2) | ||
KUBERNETES_VERSION := 1.19.11 | ||
KUBERNETES_VERSION := 1.20.7 | ||
endif | ||
export KUBERNETES_VERSION | ||
|
||
KUBE_PROMETHEUS_VERSION := 0.8.0 | ||
TOPOLVM_VERSION := 3f3854c808df5d68f46ba316e96bfe6bb7edcd48 | ||
KUBE_PROMETHEUS_VERSION := 0.9.0 | ||
TOPOLVM_VERSION := 7c269d04b0b8ac8569c8c76c69569a8f9a0b92a8 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 7c269d04b0b8ac8569c8c76c69569a8f9a0b92a8 -> https://github.com/topolvm/topolvm/tree/v0.10.3 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How about simply specifying |
||
KIND_NODE_IMAGE=kindest/node:v$(KUBERNETES_VERSION) | ||
KIND_CLUSTER_NAME := autoresizer-e2e | ||
|
||
GINKGO_VERSION := $(shell awk '/github.com\/onsi\/ginkgo/ {print substr($$2, 2)}' ../go.mod) | ||
|
||
SUDO := sudo | ||
BINDIR := $(shell pwd)/../bin | ||
TMPDIR := /tmp/autoresizer | ||
|
@@ -29,7 +31,7 @@ setup: | |
mkdir -p $(BINDIR) | ||
curl -o $(BINDIR)/kubectl -sfL https://storage.googleapis.com/kubernetes-release/release/v$(KUBERNETES_VERSION)/bin/linux/amd64/kubectl | ||
chmod a+x $(BINDIR)/kubectl | ||
GOBIN=$(BINDIR) go install github.com/onsi/ginkgo/ginkgo@latest | ||
GOBIN=$(BINDIR) go install github.com/onsi/ginkgo/ginkgo@v$(GINKGO_VERSION) | ||
|
||
.PHONY: init-cluster | ||
init-cluster: launch-kind autoresizer.img kube-prometheus | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,14 +5,14 @@ go 1.16 | |
require ( | ||
github.com/go-logr/logr v0.4.0 | ||
github.com/onsi/ginkgo v1.16.4 | ||
github.com/onsi/gomega v1.13.0 | ||
github.com/onsi/gomega v1.17.0 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How did you choose this version? I checked go.mod of csi-test following maintenance.md, and found csi-test is using ginkgo v1.14.2 and gomega v1.10.4. Or just updating to latest release is enough for this time? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The pvc-autoscaler isn't a CSI driver, so the pvc-autoscaler doesn't need dependent on the csi-test. So I maybe chose the latest release for ginkgo and gomega. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That means this instruction is not true for pvc-autoresizer? Or are there other version indications of ginkgo/gomega elsewhere other than There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Yes, sorry. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No need to apologize :) Thank you fixing. |
||
github.com/prometheus/client_golang v1.11.0 | ||
github.com/prometheus/client_model v0.2.0 | ||
github.com/prometheus/common v0.26.0 | ||
github.com/spf13/cobra v1.1.1 | ||
k8s.io/api v0.21.2 | ||
k8s.io/apimachinery v0.21.2 | ||
k8s.io/client-go v0.21.2 | ||
sigs.k8s.io/controller-runtime v0.9.2 | ||
github.com/spf13/cobra v1.2.1 | ||
k8s.io/api v0.22.4 | ||
k8s.io/apimachinery v0.22.4 | ||
k8s.io/client-go v0.22.4 | ||
sigs.k8s.io/controller-runtime v0.10.3 | ||
sigs.k8s.io/yaml v1.2.0 | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using Kubernetes 1.22.1 with envtest because envtest doesn't provide 1.22.4.