[root@k8s-master istio-1.12.0]# istioctl install --set profile=demo -y ✔ Istio core installed ✔ Istiod installed ✔ Egress gateways installed ✔ Ingress gateways installed ✔ Installation complete Making this installation the default for injection and validation. Thank you for installing Istio 1.12. Please take a few minutes to tell us about your install/upgrade experience! https://forms.gle/FegQbc9UvePd4Z9z7
验证istio是否部署成功
1 2 3 4 5
[root@k8s-master istio-1.12.0]# kubectl get pods -n istio-system NAME READY STATUS RESTARTS AGE istio-egressgateway-7f4864f59c-wglp2 1/1 Running 0 16m istio-ingressgateway-55d9fb9f-zrscz 1/1 Running 0 16m istiod-555d47cb65-2jm2t 1/1 Running 0 16m
[root@k8s-master istio-1.12.0]# ls samples/bookinfo/platform/kube/bookinfo.yaml samples/bookinfo/platform/kube/bookinfo.yaml
[root@k8s-master istio-1.12.0]# kubectl apply -f samples/bookinfo/platform/kube/bookinfo.yaml service/details created serviceaccount/bookinfo-details created deployment.apps/details-v1 created service/ratings created serviceaccount/bookinfo-ratings created deployment.apps/ratings-v1 created service/reviews created serviceaccount/bookinfo-reviews created deployment.apps/reviews-v1 created deployment.apps/reviews-v2 created deployment.apps/reviews-v3 created service/productpage created serviceaccount/bookinfo-productpage created deployment.apps/productpage-v1 created
[root@k8s-master istio-1.12.0]# kubectl apply -f samples/bookinfo/networking/bookinfo-gateway.yaml gateway.networking.istio.io/bookinfo-gateway created virtualservice.networking.istio.io/bookinfo created
[root@k8s-master istio-1.12.0]# kubectl get gateway NAME AGE bookinfo-gateway 33s
[root@k8s-master istio-1.12.0]# kubectl get virtualservice NAME GATEWAYS HOSTS AGE bookinfo ["bookinfo-gateway"] ["*"] 51s
确定ingress ip和端口
1 2 3
[root@k8s-master istio-1.12.0]# kubectl get svc istio-ingressgateway -n istio-system NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE istio-ingressgateway LoadBalancer 10.102.214.74 <pending> 15021:31077/TCP,80:30181/TCP,443:31334/TCP,31400:32201/TCP,15443:30785/TCP 16m
[root@k8s-master istio-1.12.0]# kubectl get svc istio-ingressgateway -n istio-system NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE istio-ingressgateway LoadBalancer 10.102.214.74 192.168.101.201 15021:31077/TCP,80:30181/TCP,443:31334/TCP,31400:32201/TCP,15443:30785/TCP 27m
[root@k8s-master istio-1.12.0]# sh samples/bookinfo/platform/kube/cleanup.sh namespace ? [default] using NAMESPACE=default virtualservice.networking.istio.io "bookinfo" deleted gateway.networking.istio.io "bookinfo-gateway" deleted Application cleanup may take up to one minute service "details" deleted serviceaccount "bookinfo-details" deleted deployment.apps "details-v1" deleted service "ratings" deleted serviceaccount "bookinfo-ratings" deleted deployment.apps "ratings-v1" deleted service "reviews" deleted serviceaccount "bookinfo-reviews" deleted deployment.apps "reviews-v1" deleted deployment.apps "reviews-v2" deleted deployment.apps "reviews-v3" deleted service "productpage" deleted serviceaccount "bookinfo-productpage" deleted deployment.apps "productpage-v1" deleted Application cleanup successful
确认应用已经关停
1 2 3 4
kubectl get virtualservices #-- there should be no virtual services kubectl get destinationrules #-- there should be no destination rules kubectl get gateway #-- there should be no gateway kubectl get pods #-- the Bookinfo pods should be deleted