export PATH=$PWD /bin:$PATH
Dashboard localhost:8001/api/v1/namespaces/kube-system/services/https%3Akubernetes-dashboard%3A/proxy/#!/namespace?namespace=default
kubectl create -f https://raw.githubusercontent.com/kubernetes/dashboard/master/src/deploy/recommended/kubernetes-dashboard.yaml
kubectl apply -f install/kubernetes/helm/helm-service-account.yaml
helm init --service-account tiller
kubectl apply -f install/kubernetes/helm/istio/templates/crds.yaml
helm upgrade --install istio install/kubernetes/helm/istio --namespace istio-system -f install/kubernetes/helm/istio/values-istio-demo.yaml --set kiali.enabled=true
kubectl label namespace default istio-injection=enabled
export GATEWAY_URL=$( kubectl -n istio-system get service istio-ingressgateway -o jsonpath=' {.status.loadBalancer.ingress[0].ip}' )
# Or for desktop
export GATEWAY_URL=$( kubectl -n istio-system get service istio-ingressgateway -o jsonpath=' {.status.loadBalancer.ingress[0].hostname}' )
kubectl apply -f samples/bookinfo/platform/kube/bookinfo.yaml
kubectl apply -f samples/bookinfo/networking/bookinfo-gateway.yaml
kubectl apply -f samples/bookinfo/networking/destination-rule-all.yaml
kubectl describe virtualservice
kubectl describe virtualservice reviews
kubectl apply -f samples/bookinfo/networking/virtual-service-all-v1.yaml
kubectl apply -f samples/bookinfo/networking/virtual-service-reviews-test-v2.yaml
kubectl apply -f samples/bookinfo/networking/virtual-service-reviews-90-10.yaml
kubectl apply -f samples/bookinfo/networking/virtual-service-reviews-80-20.yaml
kubectl delete virtualservice reviews
kubectl apply -f samples/bookinfo/networking/virtual-service-reviews-v2-v3.yaml
kubectl apply -f samples/bookinfo/networking/virtual-service-reviews-v3.yaml
kubectl apply -f samples/bookinfo/platform/kube/bookinfo-mysql.yaml
kubectl apply -f samples/bookinfo/platform/kube/bookinfo-ratings-v2-mysql.yaml
kubectl apply -f samples/bookinfo/networking/virtual-service-ratings-mysql.yaml
kubectl apply -f samples/bookinfo/platform/kube/bookinfo-db.yaml
kubectl apply -f samples/bookinfo/platform/kube/bookinfo-ratings-v2.yaml
kubectl apply -f samples/bookinfo/networking/virtual-service-ratings-db.yaml
kubectl apply -f samples/bookinfo/networking/virtual-service-ratings-test-abort.yaml
kubectl apply -f samples/bookinfo/networking/virtual-service-ratings-test-delay.yaml
Traffic routing - ratings
cat << EOF | kubectl apply -f -
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: ratings
spec:
hosts:
- ratings
http:
- route:
- destination:
host: ratings
subset: v1
EOF
cat << EOF | kubectl apply -f -
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: ratings
spec:
hosts:
- ratings
http:
- fault:
delay:
percent: 100
fixedDelay: 2s
route:
- destination:
host: ratings
subset: v1
EOF
Traffic timeout - reviews
cat << EOF | kubectl apply -f -
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: reviews
spec:
hosts:
- reviews
http:
- route:
- destination:
host: reviews
subset: v3
timeout: 0.5s
EOF
Traffic routing - reviews
cat << EOF | kubectl apply -f -
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: reviews
spec:
hosts:
- reviews
http:
- route:
- destination:
host: reviews
subset: v3
EOF
brew update && brew install vegeta
echo " GET http://localhost/productpage" | vegeta attack -connections 2 -rate=10 -duration=30s | vegeta report -type=' hist[0,10ms,50ms,100ms,1000ms,10000ms]'
echo " GET http://localhost/productpage" | vegeta attack -connections 2 -rate=10 -duration=10s | vegeta plot > ~ /vegeta.html
GET http://localhost/api/v1/products
GET http://localhost/api/v1/products/0
GET http://localhost/api/v1/products/0/ratings
GET http://localhost/api/v1/products/0/reviews
vegeta attack -connections 5 -rate=15 -duration=100s -targets targets.txt | vegeta plot > vegeta-output.html
kubectl -n istio-system port-forward $( kubectl -n istio-system get pod -l app=servicegraph -o jsonpath=' {.items[0].metadata.name}' ) 7001:8088 &
kubectl -n istio-system port-forward $( kubectl -n istio-system get pod -l app=grafana -o jsonpath=' {.items[0].metadata.name}' ) 7002:3000 &
kubectl -n istio-system port-forward $( kubectl get pod -n istio-system -l app=jaeger -o jsonpath=' {.items[0].metadata.name}' ) 7003:16686 &
kubectl -n istio-system port-forward $( kubectl get pod -n istio-system -l app=kiali -o jsonpath=' {.items[0].metadata.name}' ) 7004:20001 &
kubectl -n istio-system port-forward $( kubectl -n istio-system get pod -l app=prometheus -o jsonpath=' {.items[0].metadata.name}' ) 7005:9090 &