Skip to content

Commit

Permalink
prow.sh: update to kind 0.9, support Kubernetes 1.19
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
pohly committed Oct 6, 2020
1 parent 0c34086 commit 9d3fcdf
Showing 1 changed file with 25 additions and 47 deletions.
72 changes: 25 additions & 47 deletions release-tools/prow.sh
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ configvar CSI_PROW_GO_VERSION_GINKGO "${CSI_PROW_GO_VERSION_BUILD}" "Go version
# kind version to use. If the pre-installed version is different,
# the desired version is downloaded from https://github.com/kubernetes-sigs/kind/releases/download/
# (if available), otherwise it is built from source.
configvar CSI_PROW_KIND_VERSION "v0.6.0" "kind"
configvar CSI_PROW_KIND_VERSION "v0.9.0" "kind"

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

# This is a hack to workaround the issue that each version
# of kind currently only supports specific patch versions of
# Kubernetes. We need to override CSI_PROW_KUBERNETES_VERSION
# of kind currently only has images for specific patch versions of
# Kubernetes, as documented in the release notes of each
# kind release.
#
# We need to override CSI_PROW_KUBERNETES_VERSION
# passed in by our CI/pull jobs to the versions that
# kind v0.5.0 supports.
# kind v0.9.0 supports (https://github.com/kubernetes-sigs/kind/releases/tag/v0.9.0).
#
# If the version is prefixed with "release-", then nothing
# is overridden.
override_k8s_version "1.15.3"
override_k8s_version "1.13.12"
override_k8s_version "1.14.10"
override_k8s_version "1.15.12"
override_k8s_version "1.16.15"
override_k8s_version "1.17.11"
override_k8s_version "1.18.8"
override_k8s_version "1.19.1"

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

# Which external-snapshotter tag to use for the snapshotter CRD and snapshot-controller deployment
Expand Down Expand Up @@ -551,19 +561,13 @@ start_cluster () {
fi
cat >"${CSI_PROW_WORK}/kind-config.yaml" <<EOF
kind: Cluster
apiVersion: kind.sigs.k8s.io/v1alpha3
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
- role: worker
- role: worker
EOF

# kubeadm has API dependencies between apiVersion and Kubernetes version
# 1.15+ requires kubeadm.k8s.io/v1beta2
# We only run alpha tests against master so we don't need to maintain
# different patches for different Kubernetes releases.
if [[ -n "$gates" ]]; then
cat >>"${CSI_PROW_WORK}/kind-config.yaml" <<EOF
featureGates:
$(list_gates "$gates")
kubeadmConfigPatches:
- |
apiVersion: kubeadm.k8s.io/v1beta2
Expand All @@ -572,37 +576,11 @@ kubeadmConfigPatches:
name: config
apiServer:
extraArgs:
"feature-gates": "$gates"
controllerManager:
extraArgs:
"feature-gates": "$gates"
scheduler:
extraArgs:
"feature-gates": "$gates"
- |
apiVersion: kubeadm.k8s.io/v1beta2
kind: InitConfiguration
metadata:
name: config
nodeRegistration:
kubeletExtraArgs:
"feature-gates": "$gates"
- |
apiVersion: kubelet.config.k8s.io/v1beta1
kind: KubeletConfiguration
metadata:
name: config
featureGates:
$(list_gates "$gates")
- |
apiVersion: kubeproxy.config.k8s.io/v1alpha1
kind: KubeProxyConfiguration
metadata:
name: config
featureGates:
$(list_gates "$gates")
# Some, but not all, feature gates depend on additional API groups.
# Here we turn those feature gates into the corresponding API group
# and remove the rest.
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;,*$;;')
EOF
fi

info "kind-config.yaml:"
cat "${CSI_PROW_WORK}/kind-config.yaml"
Expand Down

0 comments on commit 9d3fcdf

Please sign in to comment.