Skip to content

Commit 9d3fcdf

Browse files
committed
prow.sh: update to kind 0.9, support Kubernetes 1.19
That release adds support for recent Kubernetes releases like 1.19 and simplifies configuration of feature gates. With Kubernetes 1.19, new feature gates were introduced which might become relevant for the alpha Prow jobs.
1 parent 0c34086 commit 9d3fcdf

File tree

1 file changed

+25
-47
lines changed

1 file changed

+25
-47
lines changed

release-tools/prow.sh

Lines changed: 25 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ configvar CSI_PROW_GO_VERSION_GINKGO "${CSI_PROW_GO_VERSION_BUILD}" "Go version
109109
# kind version to use. If the pre-installed version is different,
110110
# the desired version is downloaded from https://github.com/kubernetes-sigs/kind/releases/download/
111111
# (if available), otherwise it is built from source.
112-
configvar CSI_PROW_KIND_VERSION "v0.6.0" "kind"
112+
configvar CSI_PROW_KIND_VERSION "v0.9.0" "kind"
113113

114114
# ginkgo test runner version to use. If the pre-installed version is
115115
# different, the desired version is built from source.
@@ -137,14 +137,23 @@ configvar CSI_PROW_BUILD_JOB true "building code in repo enabled"
137137
configvar CSI_PROW_KUBERNETES_VERSION 1.17.0 "Kubernetes"
138138

139139
# This is a hack to workaround the issue that each version
140-
# of kind currently only supports specific patch versions of
141-
# Kubernetes. We need to override CSI_PROW_KUBERNETES_VERSION
140+
# of kind currently only has images for specific patch versions of
141+
# Kubernetes, as documented in the release notes of each
142+
# kind release.
143+
#
144+
# We need to override CSI_PROW_KUBERNETES_VERSION
142145
# passed in by our CI/pull jobs to the versions that
143-
# kind v0.5.0 supports.
146+
# kind v0.9.0 supports (https://github.com/kubernetes-sigs/kind/releases/tag/v0.9.0).
144147
#
145148
# If the version is prefixed with "release-", then nothing
146149
# is overridden.
147-
override_k8s_version "1.15.3"
150+
override_k8s_version "1.13.12"
151+
override_k8s_version "1.14.10"
152+
override_k8s_version "1.15.12"
153+
override_k8s_version "1.16.15"
154+
override_k8s_version "1.17.11"
155+
override_k8s_version "1.18.8"
156+
override_k8s_version "1.19.1"
148157

149158
# CSI_PROW_KUBERNETES_VERSION reduced to first two version numbers and
150159
# with underscore (1_13 instead of 1.13.3) and in uppercase (LATEST
@@ -337,9 +346,10 @@ configvar CSI_PROW_E2E_ALPHA "$(get_versioned_variable CSI_PROW_E2E_ALPHA "${csi
337346
# it anymore for older releases.
338347
configvar CSI_PROW_E2E_ALPHA_GATES_1_15 'VolumeSnapshotDataSource=true,ExpandCSIVolumes=true' "alpha feature gates for Kubernetes 1.15"
339348
configvar CSI_PROW_E2E_ALPHA_GATES_1_16 'VolumeSnapshotDataSource=true' "alpha feature gates for Kubernetes 1.16"
340-
# TODO: add new CSI_PROW_ALPHA_GATES_xxx entry for future Kubernetes releases and
341-
# add new gates to CSI_PROW_E2E_ALPHA_GATES_LATEST.
342-
configvar CSI_PROW_E2E_ALPHA_GATES_LATEST '' "alpha feature gates for latest Kubernetes"
349+
configvar CSI_PROW_E2E_ALPHA_GATES_1_17 '' "alpha feature gates for Kubernetes 1.17"
350+
configvar CSI_PROW_E2E_ALPHA_GATES_1_18 '' "alpha feature gates for Kubernetes 1.18"
351+
configvar CSI_PROW_E2E_ALPHA_GATES_1_19 'GenericEphemeralVolume=true,CSIStorageCapacity=true' "alpha feature gates for Kubernetes 1.19"
352+
configvar CSI_PROW_E2E_ALPHA_GATES_LATEST 'GenericEphemeralVolume=true,CSIStorageCapacity=true' "alpha feature gates for latest Kubernetes"
343353
configvar CSI_PROW_E2E_ALPHA_GATES "$(get_versioned_variable CSI_PROW_E2E_ALPHA_GATES "${csi_prow_kubernetes_version_suffix}")" "alpha E2E feature gates"
344354

345355
# Which external-snapshotter tag to use for the snapshotter CRD and snapshot-controller deployment
@@ -551,19 +561,13 @@ start_cluster () {
551561
fi
552562
cat >"${CSI_PROW_WORK}/kind-config.yaml" <<EOF
553563
kind: Cluster
554-
apiVersion: kind.sigs.k8s.io/v1alpha3
564+
apiVersion: kind.x-k8s.io/v1alpha4
555565
nodes:
556566
- role: control-plane
557567
- role: worker
558568
- role: worker
559-
EOF
560-
561-
# kubeadm has API dependencies between apiVersion and Kubernetes version
562-
# 1.15+ requires kubeadm.k8s.io/v1beta2
563-
# We only run alpha tests against master so we don't need to maintain
564-
# different patches for different Kubernetes releases.
565-
if [[ -n "$gates" ]]; then
566-
cat >>"${CSI_PROW_WORK}/kind-config.yaml" <<EOF
569+
featureGates:
570+
$(list_gates "$gates")
567571
kubeadmConfigPatches:
568572
- |
569573
apiVersion: kubeadm.k8s.io/v1beta2
@@ -572,37 +576,11 @@ kubeadmConfigPatches:
572576
name: config
573577
apiServer:
574578
extraArgs:
575-
"feature-gates": "$gates"
576-
controllerManager:
577-
extraArgs:
578-
"feature-gates": "$gates"
579-
scheduler:
580-
extraArgs:
581-
"feature-gates": "$gates"
582-
- |
583-
apiVersion: kubeadm.k8s.io/v1beta2
584-
kind: InitConfiguration
585-
metadata:
586-
name: config
587-
nodeRegistration:
588-
kubeletExtraArgs:
589-
"feature-gates": "$gates"
590-
- |
591-
apiVersion: kubelet.config.k8s.io/v1beta1
592-
kind: KubeletConfiguration
593-
metadata:
594-
name: config
595-
featureGates:
596-
$(list_gates "$gates")
597-
- |
598-
apiVersion: kubeproxy.config.k8s.io/v1alpha1
599-
kind: KubeProxyConfiguration
600-
metadata:
601-
name: config
602-
featureGates:
603-
$(list_gates "$gates")
579+
# Some, but not all, feature gates depend on additional API groups.
580+
# Here we turn those feature gates into the corresponding API group
581+
# and remove the rest.
582+
runtime-config: $(IFS=',' ; for gate in $(echo "$gates"); do if [ "$gate" = 'CSIStorageCapacity=true' ]; then echo storage.k8s.io/v1alpha1=true,; fi; done | sed -e 's;,*$;;')
604583
EOF
605-
fi
606584

607585
info "kind-config.yaml:"
608586
cat "${CSI_PROW_WORK}/kind-config.yaml"

0 commit comments

Comments
 (0)