Skip to content
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 #394

Merged
merged 8 commits into from Nov 19, 2021
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 3 additions & 9 deletions .github/workflows/helm.yaml
Expand Up @@ -25,17 +25,12 @@ jobs:
with:
version: v3.5.0
llamerada-jp marked this conversation as resolved.
Show resolved Hide resolved

- 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 +52,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
14 changes: 8 additions & 6 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_DOCS_VERSION=1.5.0
HELM_VERSION=3.7.1
HELM_DOCS_VERSION=1.6.0
llamerada-jp marked this conversation as resolved.
Show resolved Hide resolved
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
5 changes: 4 additions & 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 Expand Up @@ -157,11 +157,14 @@ You need to configure kube-scheduler to use topolvm-scheduler extender by referr
| scheduler.tolerations | list | `[{"key":"CriticalAddonsOnly","operator":"Exists"},{"effect":"NoSchedule","key":"node-role.kubernetes.io/control-plane"},{"effect":"NoSchedule","key":"node-role.kubernetes.io/master"}]` | Specify tolerations on the Deployment or DaemonSet. |
| scheduler.type | string | `"daemonset"` | If you run with a managed control plane (such as GKE, AKS, etc), topolvm-scheduler should be deployed as Deployment and Service. topolvm-scheduler should otherwise be deployed as DaemonSet in unmanaged (i.e. bare metal) deployments. possible values: daemonset/deployment |
| scheduler.updateStrategy | object | `{}` | Specify updateStrategy on the Deployment or DaemonSet. |
| securityContext | object | `{"runAsGroup":10000,"runAsUser":10000}` | ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ |
| securityContext.runAsGroup | int | `10000` | Specify runAsGroup. |
| securityContext.runAsUser | int | `10000` | Specify runAsUser. |
| storageClasses | list | `[{"name":"topolvm-provisioner","storageClass":{"additionalParameters":{},"allowVolumeExpansion":true,"annotations":{},"fsType":"xfs","isDefaultClass":false,"reclaimPolicy":null,"volumeBindingMode":"WaitForFirstConsumer"}}]` | Whether to create storageclass(s) ref: https://kubernetes.io/docs/concepts/storage/storage-classes/ |
| storageClasses[0].storageClass.isDefaultClass | bool | `false` | ref: https://kubernetes.io/docs/concepts/storage/dynamic-provisioning |
| webhook.caBundle | string | `nil` | Specify the certificate to be used for AdmissionWebhook. |
| webhook.existingCertManagerIssuer | object | `{}` | Specify the cert-manager issuer to be used for AdmissionWebhook. |
| webhook.podMutatingWebhook | object | `{"enabled":true}` | kind: Issuer name: webhook-issuer |
| webhook.podMutatingWebhook.enabled | bool | `true` | Enable Pod MutatingWebhook. |
| webhook.pvcMutatingWebhook.enabled | bool | `true` | Enable PVC MutatingWebhook. |

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
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
llamerada-jp marked this conversation as resolved.
Show resolved Hide resolved
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
llamerada-jp marked this conversation as resolved.
Show resolved Hide resolved
creationTimestamp: null
name: logicalvolumes.topolvm.cybozu.com
spec:
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
)