参考:https://istio.io/latest/zh/
istio是什么
Istio带给你:
通过在整个环境中部署一个特殊的sidecar代理(辅助容器),您可以将Istio支持添加到服务中(这给我留下了深刻的印象,如果您想做到这一点,请参阅后面的内容)。安装了sidecar代理之后,(微)服务之间的所有网络通信都通过这个代理。此外,所有的网络通信都是使用Istio的控制平面功能进行配置和管理的。
Istio是 Service Mesh(服务网格) 。我认为的service mesh定义就是“它是一个专用的基础设施层,使得服务间的通信安全、高效和可靠”。
通过kubectl可以很方便的把istio部署到k8s里,当然使用helm也是可以的,但有时helm版本和istio会有冲突,所以本文主要使用kubectl来进行部署
在Service Mesh中,我们需要了解Data Plane和Control Plane两个概念:
curl -L https://git.io/getLatestIstio | sh -
kubectl create namespace istio-system
for i in install/kubernetes/helm/istio-init/files/crd*yaml; do kubectl apply -f $i; done
kubectl get crds | grep ‘istio.io‘ | wc -l
kubectl apply -f install/kubernetes/istio-demo.yaml
这个过程需要消耗一些时间,它会先下载镜像,然后才能启动容器
[root@i-pcwovafu istio-1.5.1]# kubectl -n istio-system get pods
NAME READY STATUS RESTARTS AGE
grafana-7797c87688-9nwd9 0/1 ContainerCreating 0 11m
istio-citadel-f5974cc7d-tqglf 0/1 ContainerCreating 0 11m
istio-egressgateway-5757854ddd-x6cq9 0/1 Running 0 11m
istio-galley-6799449b85-tnlpm 1/1 Running 0 11m
istio-grafana-post-install-1.5.1-h7ph2 0/1 Completed 0 11m
istio-ingressgateway-7dcf45496f-2cwcm 0/1 Running 0 11m
istio-pilot-7897f5dc-j9jzr 0/2 ContainerCreating 0 11m
istio-policy-5b579b8889-gs4j9 0/2 ContainerCreating 0 11m
istio-security-post-install-1.5.1-xlx2n 0/1 Completed 0 11m
istio-sidecar-injector-5d97f8cb99-rh22f 0/1 ContainerCreating 0 11m
istio-telemetry-d79f68d7d-cnpn2 0/2 ContainerCreating 0 11m
istio-tracing-797d4c8d48-fmrlh 1/1 Running 0 11m
kiali-74fdc898b9-d5w5z 0/1 ImagePullBackOff 0 11m
prometheus-c8fdbd64f-fh7vs 0/1 ContainerCreating 0 11m
需要等待这些pod启动之后,你的istio才算启动起来。
# kubectl label namespace default istio-injection=enable
# kubectl label namespace default istio-injection-
kubectl get namespace -L istio-injection
原文:https://www.cnblogs.com/xinfang520/p/13221158.html