From 4cc6238cc43019f85c624acf89fae38b8161ee5c Mon Sep 17 00:00:00 2001 From: Madhu Rajanna Date: Tue, 25 May 2021 14:55:47 +0530 Subject: [PATCH] ci: add wait-timeout flag to minikube start minikube waits for 6 minutes for the minikube or host to be ready, due to resource issue sometimes the host/minikube might take longer time to start the cluster. Increase the timeout to 10m by default updates #1969 Signed-off-by: Madhu Rajanna --- scripts/minikube.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/minikube.sh b/scripts/minikube.sh index 8e0abd297..3224752ed 100755 --- a/scripts/minikube.sh +++ b/scripts/minikube.sh @@ -149,6 +149,7 @@ MINIKUBE_VERSION=${MINIKUBE_VERSION:-"latest"} KUBE_VERSION=${KUBE_VERSION:-"latest"} CONTAINER_CMD=${CONTAINER_CMD:-"docker"} MEMORY=${MEMORY:-"4096"} +MINIKUBE_WAIT_TIMEOUT=${MINIKUBE_WAIT_TIMEOUT:-"10m"} CPUS=${CPUS:-"$(nproc)"} VM_DRIVER=${VM_DRIVER:-"virtualbox"} CNI=${CNI:-"bridge"} @@ -208,16 +209,16 @@ up) if minikube_supports_psp; then enable_psp # 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} + ${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}" else # This is a workaround to fix psp issues in minikube >1.6.2 and <1.11.0 # 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} + ${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} --wait-timeout="${MINIKUBE_WAIT_TIMEOUT}" DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)" ${minikube} kubectl -- apply -f "$DIR"/psp.yaml ${minikube} stop # 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} + ${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}" fi # create a link so the default dataDirHostPath will work for this