Skip to content

Instantly share code, notes, and snippets.

@rvennam
Last active March 13, 2020 21:19
Show Gist options
  • Save rvennam/619fca979d3d745394ae4a96b5297a60 to your computer and use it in GitHub Desktop.
Save rvennam/619fca979d3d745394ae4a96b5297a60 to your computer and use it in GitHub Desktop.
export CLUSTER=istio6
echo "Install Istio 1.4"
curl -L https://istio.io/downloadIstio | ISTIO_VERSION=1.4.5 sh -
cd istio-1.4.5
ibmcloud ks cluster addon enable istio -c $CLUSTER
kubectl label namespace default istio-injection=enabled
sleep 120s
kubectl get pods -n istio-system
read -p "Press enter to continue"
echo "Install BookInfo"
kubectl apply -f samples/bookinfo/platform/kube/bookinfo.yaml
kubectl apply -f samples/bookinfo/networking/bookinfo-gateway.yaml
sleep 15s
export INGRESS_HOST=$(kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
export INGRESS_PORT=$(kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.spec.ports[?(@.name=="http2")].port}')
export SECURE_INGRESS_PORT=$(kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.spec.ports[?(@.name=="https")].port}')
echo http://$INGRESS_HOST/productpage
while true; do sleep 1; curl -s -o /dev/null -w "%{http_code}\n" http://$INGRESS_HOST/productpage;done &
read -p "Press enter to continue"
cd ..
echo "Upgrade to Istio 1.5"
curl -L https://istio.io/downloadIstio | sh -
cd istio-1.5.0
ibmcloud ks cluster addon update istio --version 1.5 -c $CLUSTER
sleep 120s
kubectl get pods -n istio-system
echo http://$INGRESS_HOST/productpage
# curl http://$INGRESS_HOST/productpage | grep Simple
# CLEANUP
read -p "Clean up?"
ibmcloud ks cluster addon disable istio -c $CLUSTER -f
./samples/bookinfo/platform/kube/cleanup.sh
cd ..
rm -rf istio-1.4.5/
rm -rf istio-1.5.0/
@jpapejr
Copy link

jpapejr commented Mar 13, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment