Skip to content

Commit

Permalink
deploy: enable feature gate for generic ephemeral volume support
Browse files Browse the repository at this point in the history
This commit enable feature gate reqquired for generic ephemeral volume
support in minikube deployment. This feature gate is enabled for
kubernets version >=20.

Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
  • Loading branch information
humblec committed Oct 29, 2021
1 parent b6d6278 commit 5310e9b
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions scripts/minikube.sh
Expand Up @@ -43,6 +43,15 @@ minikube_version() {
echo "${MINIKUBE_VERSION}" | sed 's/^v//' | cut -d'.' -f"${1}"
}

# parse the kubernetes version, return the digit passed as argument
# v1.21.0 -> kube_version 1 -> 1
# v1.21.0 -> kube_version 2 -> 21
# v1.21.0 -> kube_version 3 -> 0
kube_version() {
echo "${KUBE_VERSION}" | sed 's/^v//' | cut -d'.' -f"${1}"
}


# detect if there is a minikube executable available already. If there is none,
# fallback to using /usr/local/bin/minikube, as that is where
# install_minikube() will place it too.
Expand Down Expand Up @@ -202,6 +211,14 @@ up)

disable_storage_addons

# get kubernetes version we are operating on and accordingly enable feature gates
KUBE_MAJOR=$(kube_version 1)
KUBE_MINOR=$(kube_version 2)
if [ "${KUBE_MAJOR}" -eq 1 ] && [ "${KUBE_MINOR}" -ge 20 ];
then
# if kubernetes version is greater than 1.20 enable Generic Ephemeral Volume feature gate
K8S_FEATURE_GATES="GenericEphemeralVolume=true"
fi
# shellcheck disable=SC2086
${minikube} start --force --memory="${MEMORY}" --cpus="${CPUS}" -b kubeadm --kubernetes-version="${KUBE_VERSION}" --driver="${VM_DRIVER}" --feature-gates="${K8S_FEATURE_GATES}" --cni="${CNI}" ${EXTRA_CONFIG} ${EXTRA_CONFIG_PSP} --wait-timeout="${MINIKUBE_WAIT_TIMEOUT}" --wait="${MINIKUBE_WAIT}" --delete-on-failure ${DISK_CONFIG}

Expand Down

0 comments on commit 5310e9b

Please sign in to comment.