https://istio.io/latest/docs/setup/install/

https://istio.io/latest/docs/examples/bookinfo/


# Ne pas oublier d'ouvrir une console et lancer la commande minikube tunnel


# Installation de Istio

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

export PATH="$PATH:/root/istio-1.6.3/bin"

istioctl manifest apply --set profile=demo


# Déploiement de l'application bookinfo

cd istio-1.6.3/samples/bookinfo

kubectl create ns bookinfo

kubectl label namespace bookinfo istio-injection=enabled

kubectl apply -f platform/kube/bookinfo.yaml -n bookinfo

kubectl get po -n bookinfo


# Connexion à la l'application

alias kb='kubectl -n bookinfo'

kb exec -it $(kb get pod -l app=ratings -o jsonpath='{.items[0].metadata.name}') -c ratings -- curl productpage:9080/productpage | grep -o "<title>.*</title>"

kb apply -f networking/bookinfo-gateway.yaml

export INGRESS_PORT=$(kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.spec.ports[?(@.name=="http2")].nodePort}')

export GATEWAY_URL=$(minikube ip):${INGRESS_PORT}

curl http://${GATEWAY_URL}/productpage | grep -o "<title>.*</title>"


# Traffic management

kb apply -f networking/destination-rule-all.yaml

kb apply -f networking/virtual-service-all-v1.yaml

kb get virtualservices productpage -o yaml


# Gestion de l'authentification

kb apply -f networking/virtual-service-reviews-test-v2.yaml