Last active
April 6, 2020 19:50
-
-
Save rvennam/7567f31db066f8efaea0990650b1f3a9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo "### Downloading both versions of Istio" | |
curl -L https://istio.io/downloadIstio | ISTIO_VERSION=1.4.6 sh - | |
curl -L https://istio.io/downloadIstio | ISTIO_VERSION=1.5.1 sh - | |
echo "### Uninstall sleep" | |
kubectl delete deployment sleep -n default | |
kubectl delete -f ./test-egress-gateway.yaml | |
echo "### Uninstall Istio 1.5" | |
./istio-1.5.1/bin/istioctl manifest generate --set profile=demo | kubectl delete -f - | |
sleep 120s | |
echo "### Install Istio 1.4" | |
./istio-1.4.6/bin/istioctl manifest apply --set profile=demo | |
sleep 120s | |
echo "### Install Sleep" | |
function get_sleep_pod_ready { | |
kubectl get pod -l app=sleep --no-headers | grep "2/2" | |
} | |
function install { | |
kubectl label namespace default istio-injection=enabled --overwrite | |
kubectl get namespace -L istio-injection | |
kubectl apply -f ./istio-1.4.6/samples/sleep/sleep.yaml | |
until get_sleep_pod_ready; do sleep 5; done | |
kubectl apply -f ./test-egress-gateway.yaml | |
sleep 5 | |
} | |
install | |
| |
function check_egress { | |
time_start=$(gdate --iso-8601=seconds) | |
export SOURCE_POD=$(kubectl get pod -l app=sleep -o jsonpath={.items..metadata.name}) | |
kubectl exec -it $SOURCE_POD -c sleep -- curl -sL -o /dev/null -w "%{http_code}\n" http://edition.cnn.com/politics || true | |
kubectl exec -it $SOURCE_POD -c sleep -- curl -sL -o /dev/null -w "%{http_code}\n" https://edition.cnn.com/politics || true | |
sleep 15 | |
echo "###### SIDECAR PROXY" | |
kubectl logs -l app=sleep -c istio-proxy --since-time=$time_start | |
echo "###### EGRESS GATEWAY" | |
kubectl logs -l app=istio-egressgateway -n istio-system --since-time=$time_start | |
} | |
check_egress | |
echo "### Upgrade to Istio 1.5" | |
./istio-1.5.1/bin/istioctl upgrade -f ./istio-1.5.1/install/kubernetes/operator/profiles/demo.yaml --force | |
y | |
sleep 180s | |
check_egress |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment