Skip to content

Commit

Permalink
Merge pull request #394 from topolvm/support-k8s-1.22
Browse files Browse the repository at this point in the history
Support Kubernetes v1.22
  • Loading branch information
toshipp committed Nov 19, 2021
2 parents 73653dd + b57319e commit 1de8538
Show file tree
Hide file tree
Showing 12 changed files with 334 additions and 167 deletions.
17 changes: 3 additions & 14 deletions .github/workflows/helm.yaml
Expand Up @@ -20,22 +20,12 @@ jobs:
with:
go-version: 1.16

- name: Setup Helm
uses: azure/setup-helm@v1
with:
version: v3.5.0

- name: Setup helm-docs
- name: Setup Tools
run: |
HELM_DOCS_VERSION="1.5.0"
OS=$(uname)
curl -L -sS https://github.com/norwoodj/helm-docs/releases/download/v"${HELM_DOCS_VERSION}"/helm-docs_"${HELM_DOCS_VERSION}"_${OS}_x86_64.tar.gz \
| tar zx -C /tmp
sudo mv /tmp/helm-docs /usr/local/bin
make -C e2e setup
- name: Run helm-docs
run: helm-docs && git diff --no-patch --exit-code
run: ./bin/helm-docs && git diff --no-patch --exit-code

- uses: actions/setup-python@v2
with:
Expand All @@ -57,7 +47,6 @@ jobs:

- name: Setup kind
run: |
make -C e2e setup
make -C e2e daemonset-lvmd/create-vg
make -C e2e daemonset-lvmd/setup-minikube
make -C e2e daemonset-lvmd/update-minikube-setting
Expand Down
12 changes: 7 additions & 5 deletions Makefile
Expand Up @@ -5,8 +5,9 @@ CONTROLLER_TOOLS_VERSION=$(shell awk '/sigs\.k8s\.io\/controller-tools/ {print s
CSI_VERSION=1.5.0
PROTOC_VERSION=3.15.0
KIND_VERSION=v0.11.1
HELM_VERSION=3.5.0
HELM_VERSION=3.7.1
HELM_DOCS_VERSION=1.5.0
YQ_VERSION=4.14.1

SUDO=sudo
CURL=curl -Lsf
Expand All @@ -31,8 +32,7 @@ IMAGE_TAG ?= latest
## for build kind node
KIND_NODE_VERSION=v1.21.1

## TODO: update to 1.21 after envtest in controller-rutime support k8s 1.21
ENVTEST_KUBERNETES_VERSION=1.20
ENVTEST_KUBERNETES_VERSION=1.22

# Set the shell used to bash for better error handling.
SHELL = /bin/bash
Expand Down Expand Up @@ -89,7 +89,7 @@ manifests: ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefin
webhook \
paths="./api/...;./controllers;./hook;./driver/k8s;./pkg/..." \
output:crd:artifacts:config=config/crd/bases
yq eval 'del(.status)' config/crd/bases/topolvm.cybozu.com_logicalvolumes.yaml > charts/topolvm/crds/topolvm.cybozu.com_logicalvolumes.yaml
$(BINDIR)/yq eval 'del(.status)' config/crd/bases/topolvm.cybozu.com_logicalvolumes.yaml > charts/topolvm/crds/topolvm.cybozu.com_logicalvolumes.yaml

.PHONY: generate
generate: $(PROTOBUF_GEN) ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
Expand Down Expand Up @@ -182,7 +182,9 @@ tools: install-kind ## Install development tools.

GOBIN=$(BINDIR) go install github.com/norwoodj/helm-docs/cmd/helm-docs@v$(HELM_DOCS_VERSION)
curl -L -sS https://get.helm.sh/helm-v$(HELM_VERSION)-linux-amd64.tar.gz \
| tar xvz -C $(BINDIR) --strip-components 1 linux-amd64/helm
| tar xvz -C $(BINDIR) --strip-components 1 linux-amd64/helm
wget https://github.com/mikefarah/yq/releases/download/v${YQ_VERSION}/yq_linux_amd64 -O $(BINDIR)/yq \
&& chmod +x $(BINDIR)/yq

.PHONY: setup
setup: tools ## Setup local environment.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -20,7 +20,7 @@ Join our community on Slack: [Invitation form](https://docs.google.com/forms/d/e
Supported environments
----------------------

- Kubernetes: 1.21, 1.20, 1.19
- Kubernetes: 1.22, 1.21, 1.20
- Node OS: Linux with LVM2 (*1)
- Filesystems: ext4, xfs

Expand Down
2 changes: 1 addition & 1 deletion charts/topolvm/README.md
Expand Up @@ -3,7 +3,7 @@

## Prerequisites

* Kubernetes 1.18+
* Kubernetes 1.20+
* Configure `kube-scheduler` on the underlying nodes, ref: https://github.com/topolvm/topolvm/tree/master/deploy#configure-kube-scheduler
* `cert-manager` version `v1.0.0+` installed. ref: https://cert-manager.io/
* Requires at least `v3.5.0+` version of helm to support
Expand Down
2 changes: 1 addition & 1 deletion charts/topolvm/README.md.gotmpl
Expand Up @@ -3,7 +3,7 @@

## Prerequisites

* Kubernetes 1.18+
* Kubernetes 1.20+
* Configure `kube-scheduler` on the underlying nodes, ref: https://github.com/topolvm/topolvm/tree/master/deploy#configure-kube-scheduler
* `cert-manager` version `v1.0.0+` installed. ref: https://cert-manager.io/
* Requires at least `v3.5.0+` version of helm to support
Expand Down
2 changes: 1 addition & 1 deletion charts/topolvm/crds/topolvm.cybozu.com_logicalvolumes.yaml
Expand Up @@ -2,7 +2,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.6.0
controller-gen.kubebuilder.io/version: v0.7.0
creationTimestamp: null
name: logicalvolumes.topolvm.cybozu.com
spec:
Expand Down
2 changes: 1 addition & 1 deletion config/crd/bases/topolvm.cybozu.com_logicalvolumes.yaml
Expand Up @@ -4,7 +4,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.6.0
controller-gen.kubebuilder.io/version: v0.7.0
creationTimestamp: null
name: logicalvolumes.topolvm.cybozu.com
spec:
Expand Down
6 changes: 5 additions & 1 deletion docs/maintenance.md
Expand Up @@ -17,8 +17,8 @@ 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
2. controller-runtime
- Read the [release note](https://github.com/kubernetes-sigs/controller-runtime/releases), and check which version is compatible with the Kubernetes versions.
- 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.
3. CSI spec
- Read the [release note](https://github.com/container-storage-interface/spec/releases) and check all the changes from the current version to the latest.
- Basically, CSI spec should NOT be upgraded aggressively in this task.
Expand All @@ -34,10 +34,14 @@ First of all, we should have a look at the release notes in the order below.
5. Depending tools
- They does not depend on other software, use latest versions.
- [helm](https://github.com/helm/helm/releases)
- [helm-docs](github.com/norwoodj/helm-docs/releases)
- [protoc](https://github.com/protocolbuffers/protobuf/releases)
- They depend on kubernetes, use appropriate version associating to minimal supported kubernetes version by TopoLVM.
- [kind](https://github.com/kubernetes-sigs/kind/releases)
- [minikube](https://github.com/kubernetes/minikube/releases)
6. Depending modules
- Read [kubernetes go.mod](https://github.com/kubernetes/kubernetes/blob/master/go.mod), and update the `prometheus/*` and `grpc` 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.
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.
Expand Down
6 changes: 3 additions & 3 deletions e2e/Makefile
Expand Up @@ -4,7 +4,7 @@ TEST_SCHEDULER_MANIFEST ?= daemonset
STORAGE_CAPACITY ?= false

## Dependency versions
MINIKUBE_VERSION := v1.22.0
MINIKUBE_VERSION := v1.23.2
CERT_MANAGER_VERSION := v1.3.1

BINDIR := $(shell pwd)/bin
Expand All @@ -20,7 +20,7 @@ export MINIKUBE_HOME

READ_WRITE_ONCE_POD=false
ifeq ($(TEST_KUBERNETES_TARGET),current)
KUBERNETES_VERSION := 1.22.0
KUBERNETES_VERSION := 1.22.2
READ_WRITE_ONCE_POD=true
else ifeq ($(TEST_KUBERNETES_TARGET),prev)
KUBERNETES_VERSION := 1.21.2
Expand All @@ -39,7 +39,7 @@ endif
KIND_CONFIG="topolvm-cluster.yaml"
MINIKUBE_FEATURE_GATES=""
MINIKUBE_SCHEDULER_MANIFEST=kube-scheduler.yaml
ifeq ($(KUBERNETES_VERSION),1.22.0)
ifeq ($(KUBERNETES_VERSION),1.22.2)
KIND_CONFIG="topolvm-cluster-single-writer.yaml"
MINIKUBE_FEATURE_GATES="ReadWriteOncePod=true"
MINIKUBE_SCHEDULER_MANIFEST=kube-scheduler-single-writer.yaml
Expand Down
24 changes: 12 additions & 12 deletions go.mod
Expand Up @@ -9,24 +9,24 @@ require (
github.com/google/go-cmp v0.5.6
github.com/kubernetes-csi/csi-test/v4 v4.3.0
github.com/onsi/ginkgo v1.16.4
github.com/onsi/gomega v1.13.0
github.com/onsi/gomega v1.15.0
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/pseudomuto/protoc-gen-doc v1.4.1
github.com/spf13/cobra v1.1.3
github.com/spf13/viper v1.7.1
golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40
google.golang.org/grpc v1.38.0
github.com/spf13/cobra v1.2.1
github.com/spf13/viper v1.8.1
golang.org/x/sys v0.0.0-20210817190340-bfb29a6856f2
google.golang.org/grpc v1.42.0
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0
google.golang.org/protobuf v1.26.0
k8s.io/api v0.21.1
k8s.io/apimachinery v0.21.1
k8s.io/client-go v0.21.1
k8s.io/api v0.22.2
k8s.io/apimachinery v0.22.2
k8s.io/client-go v0.22.2
k8s.io/klog v1.0.0
k8s.io/mount-utils v0.21.1
k8s.io/utils v0.0.0-20210527160623-6fdb442a123b
sigs.k8s.io/controller-runtime v0.9.0
sigs.k8s.io/controller-tools v0.6.0
k8s.io/mount-utils v0.22.2
k8s.io/utils v0.0.0-20210819203725-bdf08cb9a70a
sigs.k8s.io/controller-runtime v0.10.2
sigs.k8s.io/controller-tools v0.7.0
sigs.k8s.io/yaml v1.2.0
)

0 comments on commit 1de8538

Please sign in to comment.