Skip to content

Instantly share code, notes, and snippets.

@barrydobson
Last active August 5, 2021 14:06
Show Gist options
  • Save barrydobson/b554a0a7ff712142df9d872de39b27c4 to your computer and use it in GitHub Desktop.
Save barrydobson/b554a0a7ff712142df9d872de39b27c4 to your computer and use it in GitHub Desktop.
Istio Traffic Shifting

Istio Demo

Install minikube following instructions here

minikube config set cpus 2
minikube config set memory 8192
minikube config set disk-size 50g
minikube start --vm=true

Install Istio

curl -L https://istio.io/downloadIstio | sh -

Move to the Istio package directory. For example, if the package is istio-1.10.3:

cd istio-1.10.3

Add the istioctl client to your path (Linux or macOS):

export PATH=$PWD/bin:$PATH

Setup Demo

Clone the repository

git clone https://github.com/IBM/cloud-native-starter.git
cd cloud-native-starter
istioctl manifest apply --set profile=demo
kubectl label namespace default istio-injection=enabled
kubectl apply -f https://raw.githubusercontent.com/istio/istio/release-1.11/samples/addons/prometheus.yaml
kubectl apply -f https://raw.githubusercontent.com/istio/istio/release-1.11/samples/addons/kiali.yaml
kubectl apply -f https://raw.githubusercontent.com/istio/istio/release-1.11/samples/addons/jaeger.yaml
kubectl apply -f https://raw.githubusercontent.com/istio/istio/release-1.11/samples/addons/grafana.yaml
kubectl config set-context --current --namespace=default
scripts/check-prerequisites.sh
scripts/deploy-articles-java-jee.sh
scripts/deploy-authors-nodejs.sh
scripts/deploy-web-app-vuejs.sh
scripts/deploy-web-api-java-jee.sh
scripts/deploy-web-api-java-jee-v2.sh
scripts/deploy-istio-ingress-v1-v2.sh
scripts/show-urls.sh

View kiali

istioctl dashboard kiali

Generate traffic

export MINI_IP=$(minikube ip)
while true; do sleep 1; curl "http://$MINI_IP:32405/web-api/v1/getmultiple"; echo -e '\n\n\n\n'$(date);done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment