2017-10-17 22:50:27 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# Copyright 2017 The Kubernetes Authors.
|
|
|
|
#
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
|
# You may obtain a copy of the License at
|
|
|
|
#
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
# limitations under the License.
|
|
|
|
|
2017-10-24 20:16:24 +00:00
|
|
|
export JSONPATH='{range .items[*]}{@.metadata.name}:{range @.status.conditions[*]}{@.type}={@.status};{end}{end}'
|
2017-10-17 22:50:27 +00:00
|
|
|
|
|
|
|
echo "downloading kubectl..."
|
|
|
|
curl -Lo kubectl https://storage.googleapis.com/kubernetes-release/release/$KUBERNETES_VERSION/bin/linux/amd64/kubectl && \
|
|
|
|
chmod +x kubectl && sudo mv kubectl /usr/local/bin/
|
|
|
|
|
|
|
|
echo "downloading minikube..."
|
2018-05-17 21:50:21 +00:00
|
|
|
curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 && \
|
2017-10-17 22:50:27 +00:00
|
|
|
chmod +x minikube && \
|
|
|
|
sudo mv minikube /usr/local/bin/
|
|
|
|
|
|
|
|
echo "starting minikube..."
|
2018-04-18 19:15:08 +00:00
|
|
|
# Using a lower value for sync-frequency to speed up the tests (during the cleanup of resources inside a namespace)
|
2018-05-17 21:50:21 +00:00
|
|
|
|
|
|
|
export MINIKUBE_WANTUPDATENOTIFICATION=false
|
|
|
|
export MINIKUBE_WANTREPORTERRORPROMPT=false
|
|
|
|
export MINIKUBE_HOME=$HOME
|
|
|
|
mkdir $HOME/.kube || true
|
|
|
|
touch $HOME/.kube/config
|
|
|
|
|
|
|
|
export KUBECONFIG=$HOME/.kube/config
|
|
|
|
|
2018-07-06 03:23:27 +00:00
|
|
|
# workaround to avoid breaking the execution
|
|
|
|
set +o errexit
|
|
|
|
set +o pipefail
|
|
|
|
|
2018-05-17 21:50:21 +00:00
|
|
|
# --vm-driver=none, use host docker (avoid docker-in-docker)
|
|
|
|
# --bootstrapper=localkube, works around https://github.com/kubernetes/minikube/issues/2704
|
|
|
|
sudo -E minikube start \
|
|
|
|
--vm-driver=none \
|
2018-07-06 03:23:27 +00:00
|
|
|
--bootstrapper=localkube \
|
2018-05-17 21:50:21 +00:00
|
|
|
--kubernetes-version=$KUBERNETES_VERSION \
|
|
|
|
--extra-config=kubelet.sync-frequency=1s \
|
|
|
|
--extra-config=apiserver.authorization-mode=RBAC
|
2017-10-17 22:50:27 +00:00
|
|
|
|
|
|
|
minikube update-context
|
|
|
|
|
|
|
|
echo "waiting for kubernetes cluster"
|
|
|
|
until kubectl get nodes -o jsonpath="$JSONPATH" 2>&1 | grep -q "Ready=True";
|
|
|
|
do
|
|
|
|
sleep 1;
|
|
|
|
done
|