diff options
Diffstat (limited to 'src/vagrant/kubeadm_istio/istio/deploy.sh')
-rwxr-xr-x | src/vagrant/kubeadm_istio/istio/deploy.sh | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/src/vagrant/kubeadm_istio/istio/deploy.sh b/src/vagrant/kubeadm_istio/istio/deploy.sh index ed873f5..84af41b 100755 --- a/src/vagrant/kubeadm_istio/istio/deploy.sh +++ b/src/vagrant/kubeadm_istio/istio/deploy.sh @@ -17,23 +17,36 @@ set -ex -# Deploy istio 0.4.0 +# Get latest istio version, refer: https://git.io/getLatestIstio +if [ "x${ISTIO_VERSION}" = "x" ] ; then + ISTIO_VERSION=$(curl -L -s https://api.github.com/repos/istio/istio/releases/latest | \ + grep tag_name | sed "s/ *\"tag_name\": *\"\(.*\)\",*/\1/") +fi + +ISTIO_DIR_NAME="istio-$ISTIO_VERSION" + cd /vagrant curl -L https://git.io/getLatestIstio | sh - -mv istio-0.4.0 istio-source +mv $ISTIO_DIR_NAME istio-source cd /vagrant/istio-source/ -export PATH=$PWD/bin:$PATH -kubectl apply -f install/kubernetes/istio.yaml + +# Persistently append istioctl bin path to PATH env +echo 'export PATH="$PATH:/vagrant/istio-source/bin"' >> ~/.bashrc +echo "source <(kubectl completion bash)" >> ~/.bashrc +source ~/.bashrc + +kubectl apply -f install/kubernetes/istio-demo.yaml # Validate the installation kubectl get svc -n istio-system kubectl get pods -n istio-system +kubectl get namespace -L istio-injection -r="0" -while [ $r -ne "4" ] +r="1" +while [ $r -ne "0" ] do + sleep 30 kubectl get pods -n istio-system - r=$(kubectl get pods -n istio-system | grep Running | wc -l) - sleep 60 + r=$(kubectl get pods -n istio-system | egrep -v 'NAME|Running' | wc -l) done |