refactor(deploy-k8s): remove explicit wait on etcd pod

Using `--network-plugin=cni` for `minikube start` will have minikube
wait for Kubernetes components to spin up and not require the Node to be
in ready status.

Change-Id: I08bf40ac4790955c107e8fee6a004b930c333d16
This commit is contained in:
Dustin Specker 2019-10-17 14:37:39 -05:00 committed by Steve Wilkerson
parent 9492a8cde0
commit ae8a6c5d50

View File

@ -118,28 +118,13 @@ sudo -E minikube config set embed-certs true
export CHANGE_MINIKUBE_NONE_USER=true
export MINIKUBE_IN_STYLE=false
sudo -E minikube start \
--wait=false \
--docker-env HTTP_PROXY="${HTTP_PROXY}" \
--docker-env HTTPS_PROXY="${HTTPS_PROXY}" \
--docker-env NO_PROXY="${NO_PROXY},10.96.0.0/12" \
--extra-config=kubelet.network-plugin=cni \
--network-plugin=cni \
--extra-config=controller-manager.allocate-node-cidrs=true \
--extra-config=controller-manager.cluster-cidr=192.168.0.0/16
# Note(srwilkers): With newer versions of Minikube, explicitly disabling the wait
# in the start command is required, as this wait checks the nodes status which
# will block until the CNI is deployed. Instead, we now wait for the etcd pod to
# be present, as this seems to be the last static manifest pod launched by
# minikube. This allows us to move forward with applying the CNI
END=$(($(date +%s) + 240))
until kubectl --namespace=kube-system \
get pods -l component=etcd --no-headers -o name | grep -q "^pod/etcd-minikube"; do
NOW=$(date +%s)
[ "${NOW}" -gt "${END}" ] && exit 1
echo "Waiting for kubernetes etcd"
sleep 10
done
curl https://docs.projectcalico.org/"${CALICO_VERSION}"/manifests/calico.yaml -o /tmp/calico.yaml
kubectl apply -f /tmp/calico.yaml