Skip to content

Commit

Permalink
Drop support for Shoots with Kubernetes version < 1.22 (#623)
Browse files Browse the repository at this point in the history
* Vendor `[email protected]`

* Update README.md

* Drop v1.21 handling for PDBs

* Adapt tests

* Drop `CustomResourceValidation ` usages

* Run `make generate`

* Vendor `[email protected]`

* Set effective version when building images

Similar to gardener/gardener-extension-provider-openstack#638
  • Loading branch information
shafeeqes authored Jul 7, 2023
1 parent 2eb93ff commit f53b573
Show file tree
Hide file tree
Showing 74 changed files with 522 additions and 2,092 deletions.
5 changes: 4 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ FROM golang:1.19.3 AS builder

WORKDIR /go/src/github.com/gardener/gardener-extension-provider-alicloud
COPY . .
RUN make install

ARG EFFECTIVE_VERSION

RUN make install EFFECTIVE_VERSION=$EFFECTIVE_VERSION

############# base
FROM gcr.io/distroless/static-debian11:nonroot AS base
Expand Down
11 changes: 8 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ IMAGE_PREFIX := $(REGISTRY)/extensions
REPO_ROOT := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
HACK_DIR := $(REPO_ROOT)/hack
VERSION := $(shell cat "$(REPO_ROOT)/VERSION")
EFFECTIVE_VERSION := $(VERSION)-$(shell git rev-parse HEAD)
LD_FLAGS := "-w $(shell $(REPO_ROOT)/vendor/github.com/gardener/gardener/hack/get-build-ld-flags.sh k8s.io/component-base $(REPO_ROOT)/VERSION $(EXTENSION_PREFIX))"
VERIFY := true
LEADER_ELECTION := false
Expand All @@ -40,6 +41,10 @@ ACCESS_KEY_ID_FILE := .kube-secrets/alicloud/access_key_id.secret
ACCESS_KEY_SECRET_FILE := .kube-secrets/alicloud/access_key_secret.secret
VPC_ID_FILE := .kube-secrets/alicloud/vpc_id.secret

ifneq ($(strip $(shell git status --porcelain 2>/dev/null)),)
EFFECTIVE_VERSION := $(EFFECTIVE_VERSION)-dirty
endif

#########################################
# Tools #
#########################################
Expand Down Expand Up @@ -82,7 +87,7 @@ start-admission:

.PHONY: install
install:
@LD_FLAGS=$(LD_FLAGS) \
@LD_FLAGS=$(LD_FLAGS) EFFECTIVE_VERSION=$(EFFECTIVE_VERSION) \
$(REPO_ROOT)/vendor/github.com/gardener/gardener/hack/install.sh ./...

.PHONY: docker-login
Expand All @@ -91,8 +96,8 @@ docker-login:

.PHONY: docker-images
docker-images:
@docker build -t $(IMAGE_PREFIX)/$(NAME):$(VERSION) -t $(IMAGE_PREFIX)/$(NAME):latest -f Dockerfile -m 6g --target $(EXTENSION_PREFIX)-$(NAME) .
@docker build -t $(IMAGE_PREFIX)/$(ADMISSION_NAME):$(VERSION) -t $(IMAGE_PREFIX)/$(ADMISSION_NAME):latest -f Dockerfile -m 6g --target $(EXTENSION_PREFIX)-$(ADMISSION_NAME) .
@docker build --build-arg EFFECTIVE_VERSION=$(EFFECTIVE_VERSION) -t $(IMAGE_PREFIX)/$(NAME):$(VERSION) -t $(IMAGE_PREFIX)/$(NAME):latest -f Dockerfile -m 6g --target $(EXTENSION_PREFIX)-$(NAME) .
@docker build --build-arg EFFECTIVE_VERSION=$(EFFECTIVE_VERSION) -t $(IMAGE_PREFIX)/$(ADMISSION_NAME):$(VERSION) -t $(IMAGE_PREFIX)/$(ADMISSION_NAME):latest -f Dockerfile -m 6g --target $(EXTENSION_PREFIX)-$(ADMISSION_NAME) .

#####################################################################
# Rules for verification, formatting, linting, testing and cleaning #
Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ This extension controller supports the following Kubernetes versions:
| Kubernetes 1.24 | 1.24.0+ | [![Gardener v1.24 Conformance Tests](https://testgrid.k8s.io/q/summary/conformance-gardener/Gardener,%20v1.24%20Alibaba%20Cloud/tests_status?style=svg)](https://testgrid.k8s.io/conformance-gardener#Gardener,%20v1.24%20Alibaba%20Cloud) |
| Kubernetes 1.23 | 1.23.0+ | [![Gardener v1.23 Conformance Tests](https://testgrid.k8s.io/q/summary/conformance-gardener/Gardener,%20v1.23%20Alibaba%20Cloud/tests_status?style=svg)](https://testgrid.k8s.io/conformance-gardener#Gardener,%20v1.23%20Alibaba%20Cloud) |
| Kubernetes 1.22 | 1.22.0+ | [![Gardener v1.22 Conformance Tests](https://testgrid.k8s.io/q/summary/conformance-gardener/Gardener,%20v1.22%20Alibaba%20Cloud/tests_status?style=svg)](https://testgrid.k8s.io/conformance-gardener#Gardener,%20v1.22%20Alibaba%20Cloud) |
| Kubernetes 1.21 | 1.21.0+ | [![Gardener v1.21 Conformance Tests](https://testgrid.k8s.io/q/summary/conformance-gardener/Gardener,%20v1.21%20Alibaba%20Cloud/tests_status?style=svg)](https://testgrid.k8s.io/conformance-gardener#Gardener,%20v1.21%20Alibaba%20Cloud) |
| Kubernetes 1.20 | 1.20.0+ | [![Gardener v1.20 Conformance Tests](https://testgrid.k8s.io/q/summary/conformance-gardener/Gardener,%20v1.20%20Alibaba%20Cloud/tests_status?style=svg)](https://testgrid.k8s.io/conformance-gardener#Gardener,%20v1.20%20Alibaba%20Cloud) |

Please take a look [here](https://github.com/gardener/gardener/blob/master/docs/usage/supported_k8s_versions.md) to see which versions are supported by Gardener in general.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
{{- if semverCompare ">= 1.21-0" .Capabilities.KubeVersion.GitVersion }}
apiVersion: policy/v1
{{- else }}
apiVersion: policy/v1beta1
{{- end }}
kind: PodDisruptionBudget
metadata:
name: {{ include "name" . }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
{{- if semverCompare ">= 1.21-0" .Capabilities.KubeVersion.GitVersion }}
apiVersion: policy/v1
{{- else }}
apiVersion: policy/v1beta1
{{- end }}
kind: PodDisruptionBudget
metadata:
name: {{ include "name" . }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
{{- if semverCompare ">= 1.21-0" .Capabilities.KubeVersion.GitVersion }}
apiVersion: policy/v1
{{- else }}
apiVersion: policy/v1beta1
{{- end }}
kind: PodDisruptionBudget
metadata:
name: machine-controller-manager
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
{{- if semverCompare ">= 1.21-0" .Capabilities.KubeVersion.GitVersion }}
apiVersion: policy/v1
{{- else }}
apiVersion: policy/v1beta1
{{- end }}
kind: PodDisruptionBudget
metadata:
name: cloud-controller-manager
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ podNetwork: 192.168.0.0/16
podAnnotations: {}
podLabels: {}
featureGates: {}
# CustomResourceValidation: true
# RotateKubeletServerCertificate: false
images:
alicloud-controller-manager: image-repository
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
{{- if semverCompare ">= 1.21-0" .Capabilities.KubeVersion.GitVersion }}
apiVersion: policy/v1
{{- else }}
apiVersion: policy/v1beta1
{{- end }}
kind: PodDisruptionBudget
metadata:
name: csi-plugin-controller
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
{{- if semverCompare ">= 1.21-0" .Capabilities.KubeVersion.GitVersion }}
apiVersion: policy/v1
{{- else }}
apiVersion: policy/v1beta1
{{- end }}
kind: PodDisruptionBudget
metadata:
name: csi-snapshot-controller
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
{{- if semverCompare ">= 1.21-0" .Capabilities.KubeVersion.GitVersion }}
apiVersion: policy/v1
{{- else }}
apiVersion: policy/v1beta1
{{- end }}
kind: PodDisruptionBudget
metadata:
name: csi-snapshot-validation
Expand Down
2 changes: 1 addition & 1 deletion docs/usage-as-end-user.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ csi:
enableADController: true
cloudControllerManager:
featureGates:
CustomResourceValidation: true
RotateKubeletServerCertificate: true
```
The `csi.enableADController` is used as the value of environment [DISK_AD_CONTROLLER](https://github.com/kubernetes-sigs/alibaba-cloud-csi-driver/blob/cd0788a0a440926d504d8f8fb7f6e738fe96f3ae/pkg/disk/nodeserver.go#L80), which is used for AliCloud csi-disk-plugin. This field is optional. When a new shoot is creatd, this field is automatically set true. For an existing shoot created in previous versions, it remains unchanged. If there are persistent volumes created before year 2021, please be cautious to set this field _true_ because they may fail to mount to nodes.

Expand Down
2 changes: 1 addition & 1 deletion example/30-controlplane.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ spec:
kind: ControlPlaneConfig
cloudControllerManager:
featureGates:
CustomResourceValidation: true
RotateKubeletServerCertificate: true
infrastructureProviderStatus:
apiVersion: alicloud.provider.extensions.gardener.cloud/v1alpha1
kind: InfrastructureStatus
Expand Down
Loading

0 comments on commit f53b573

Please sign in to comment.