服务网格:用来描述组成这些应用程序的微服务网络以及他们之间的相互调用
通过负载均衡、服务间的身份验证、监控等方法,Istio 可以轻松地创建一个已经部署了服务的网络,而服务的代码只需很少更改甚至无需更改。通过在整个环境中部署一个特殊的 sidecar 代理为服务添加 Istio 的支持,而代理会拦截微服务之间的所有网络通信,然后使用其控制平面的功能来配置和管理 Istio
https://github.com/istio/istio/releases/tag/1.15.0
curl -L https://istio.io/downloadIstio | ISTIO_VERSION=1.15.0 TARGET_ARCH=x86_64 sh -
#istio 版本为 1.15.0
#处理器架构为x86_64, 在服务器上执行 uname -i 获取处理器架构,本次示例安装使用的是 aarch64,因此实际执行命令如下
例:curl -L https://istio.io/downloadIstio | ISTIO_VERSION=1.15.0 TARGET_ARCH=aarch64 sh -
tar -zxvf istio-1.15.0-linux-arm64.tar.gz
cd istio-1.15.0
#目录说明
#samples:示例应用程序
#bin 目录下的 istioctl 客户端二进制文件
export PATH=/root/istio-1.15.0/bin:$PATH
#示例中 直接解压到 /root 目录
[root@master2 istio-1.15.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.15. Please take a few minutes to tell us about your install/upgrade experience! https://forms.gle/SWHFBmwJspusK1hv6
kubectl apply -f samples/bookinfo/platform/kube/bookinfo.yaml
#由于处理器架构为 aarch64,因此实际 替换了bookinfo.yaml 文件中镜像,替换后的镜像为:
docker pull arkodg/examples-bookinfo-details-v1:latest
docker pull arkodg/examples-bookinfo-ratings-v1:latest
docker pull arkodg/examples-bookinfo-reviews-v1:latest
docker pull arkodg/examples-bookinfo-reviews-v2:latest
docker pull massivezh/examples-bookinfo-reviews-v3:latest
docker pull arkodg/examples-bookinfo-productpage-v1:latest
[root@master2 ~]# kubectl get pod,svc
NAME READY STATUS RESTARTS AGE
pod/details-v1-8464b7b547-lq4jq 2/2 Running 0 21h
pod/productpage-v1-55b8849485-8pzd2 2/2 Running 0 21h
pod/ratings-v1-8d5bd46bc-rbpdc 2/2 Running 0 21h
pod/reviews-v1-7bd8fb5987-clw8n 2/2 Running 0 21h
pod/reviews-v2-7c48f4dcf5-pbfl9 2/2 Running 0 21h
pod/reviews-v3-5bf5cb5b89-jsrd7 2/2 Running 0 21h
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/details ClusterIP 11.233.48.147 9080/TCP 21h
service/kubernetes ClusterIP 11.233.0.1 443/TCP 22h
service/productpage ClusterIP 11.233.20.241 9080/TCP 21h
service/ratings ClusterIP 11.233.52.157 9080/TCP 21h
service/reviews ClusterIP 11.233.37.87 9080/TCP 21h
kubectl apply -f samples/bookinfo/networking/bookinfo-gateway.yaml
istioctl analyze
export INGRESS_PORT=$(kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.spec.ports[?(@.name=="http2")].nodePort}')
export SECURE_INGRESS_PORT=$(kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.spec.ports[?(@.name=="https")].nodePort}')
export INGRESS_HOST=$(kubectl get po -l istio=ingressgateway -n istio-system -o jsonpath='{.items[0].status.hostIP}')
export GATEWAY_URL=$INGRESS_HOST:$INGRESS_PORT
echo "$GATEWAY_URL"
192.168.0.164:31840
kubectl apply -f samples/addons
istioctl dashboard kiali
注:示例中自行暴露了 kiali service 的nodeport 访问,通过节点的IP和端口访问
页面更新:2024-03-08
本站资料均由网友自行发布提供,仅用于学习交流。如有版权问题,请与我联系,QQ:4156828
© CopyRight 2020-2024 All Rights Reserved. Powered By 71396.com 闽ICP备11008920号-4
闽公网安备35020302034903号