当前位置:网站首页>Istio部署:快速上手微服务,
Istio部署:快速上手微服务,
2022-07-02 18:38:00 【51CTO】
下载二进制安装包
[[email protected] ~] # $ wget https://github.com/istio/istio/releases/download/1.11.8/istio-1.11.8-linux-amd64.tar.gz
[[email protected] ~] # tar zxvf istio-1.11.8-linux-amd64.tar.gz
[[email protected] ~] # cd istio-1.11.8/
[[email protected] ~] # ls
b i n L I C E N S E m a n i f e s t s m a n i f e s t . y a m l R E A D M E . m d s a m p l e s t o o l s
- 1.
- 2.
- 3.
- 4.
- 5.
samples: 示例应用程序;
bin: 包含istioctl的客户端文件,istioctl工具用于手动注入Envoy sidecar代理(边车代理)
安装Istioctl
把 istioctl 这个可执行文件拷贝到/usr/bin/目录
[[email protected] ~] # mv bin/istioctl /usr/local/bin/ #安装Istioctl客户端工具
[[email protected] ~] # istioctl install -y --set profile=demo
I s t i o c o r e i n s t a l l e d
I s t i o d i n s t a l l e d
I n g r e s s g a t e w a y s i n s t a l l e d
E g r e s s g a t e w a y s i n s t a l l e d
I n s t a l l a t i o n c o m p l e t e
T h a n k y o u f o r i n s t a l l i n g I s t i o 1 . 1 1 .
P l e a s e t a k e a f e w m i n u t e s t o t e l l u s a b o u t y o u r i n s t a l l / u p g r a d e e x p e r i e n c e !
h t t p s: / / f o r m s . g l e / k W U L B R j U v 7 h H c i 7 T 6
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.
Install:在集群上安装或重新配置Istio。
--set profile=demo:生成演示配置文件,不要等待确认
镜像下载
最好每个节点都下载,安装istio的时候会自动下载,但比较慢而且可能会下载失败。
[[email protected] ~] # docker pull docker.io/istio/proxyv2:1.11.8
[[email protected] ~] # docker pull istio/pilot:1.11.8
[[email protected] ~] # docker pull istio/examples-bookinfo-details-v1:1.15.0
[[email protected] ~] # docker pull istio/examples-bookinfo-productpage-v1:1.16.2
[[email protected] ~] # docker pull istio/examples-bookinfo-reviews-v1:1.15.0
[[email protected] ~] # docker pull istio/examples-bookinfo-reviews-v2:1.15.0
[[email protected] ~] # docker pull istio/examples-bookinfo-reviews-v3:1.15.0
[[email protected] ~] # docker pull istio/examples-bookinfo-ratings-v1:1.15.0
[[email protected] ~] # docker pull kennethreitz/httpbin:latest
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
服务验证
1)验证Pod是否正常
[[email protected] ~] # kubectl -n istio-system get pods
N A M E R E A D Y S T A T U S R E S T A R T S A G E
i s t i o - e g r e s s g a t e w a y - 6 6 8 5 4 b 8 4 d f - s n j 2 z 1 / 1 R u n n i n g 0 4 8 m
i s t i o - i n g r e s s g a t e w a y - 7 d f d 6 8 7 6 d f - 9 m 2 q 5 1 / 1 R u n n i n g 0 4 8 m
i s t i o d - 7 f 7 5 7 7 8 f 8 6 - c k k x 8 1 / 1 R u n n i n g 0 4 9 m
- 1.
- 2.
- 3.
- 4.
- 5.
Pod服务状态正常!
2)验证Service服务是否正常
可以看到istio-ingressgateway入口网关的service服务异常,这是因为该服务使用的是公有云的访问方式,我们是自己的kubernetes集群环境,所以会异常。
3)修改istio-ingressgateway的访问方式
默认安装的istio-ingressgateway服务是以LoadBalancer(公有云环境)方式暴露的,服务处于pending状态而无法正常使用,需要修改为NodePort的访问方式。
[[email protected] ~] # kubectl -n istio-system edit svc istio-ingressgateway
t y p e: N o d e P o r t # 将 L o a d B a l a n c e r 修 改 为 N o d e P o r t
s t a t u s:
[[email protected] ~] # kubectl -n istio-system get svc
i s t i o - i n g r e s s g a t e w a y N o d e P o r t 1 0 . 1 0 2 . 5 0 . 2 0 1 < n o n e >
- 1.
- 2.
- 3.
- 4.
- 5.
可以看到服务正常了。
开启default命名空间的自动注入功能
给指定命名空间打上istio-injection=enabled的标签,istio就有向该命名空间中Pod有注入权限。
[[email protected] ~] # kubectl label namespace default istio-injection=enabled
[[email protected] ~] # kubectl describe namespaces default | grep Labels
L a b e l s: i n j e c t i o n= e n a b l e d
- 1.
- 2.
- 3.
安装 Kiali 和其他插件
部署 Kiali仪表板、以及Prometheus、Grafana、还有 Jaeger。
Grafana: 可视化UI界面,展示Prometheus的监控数据;
Zipkin:全链路监控工具,监控服务间的调用关系;
1)安装相关插件
[[email protected] ~] # ls samples/addons/
e x t r a s g r a f a n a . y a m l j a e g e r . y a m l k i a l i . y a m l p r o m e t h e u s . y a m l R E A D M E . m d
[[email protected] ~] # kubectl apply -f samples/addons/
[[email protected] ~] # kubectl rollout status deployment/kiali -n istio-system
[[email protected] ~] # kubectl -n istio-system get pod
N A M E R E A D Y S T A T U S R E S T A R T S A G E
g r a f a n a - 5 5 6 f 8 9 9 8 c d - g d g v d 1 / 1 R u n n i n g 0 2 m 4 s
j a e g e r - 5 f 6 5 f d b f 9 b - v v 7 b 5 1 / 1 R u n n i n g 0 2 m 4 s
k i a l i - 7 8 7 b c 4 8 7 b 7 - q 6 t v n 1 / 1 R u n n i n g 0 2 m 4 s
p r o m e t h e u s - 9 f 4 9 4 7 6 4 9 - p 7 s 7 k 2 / 2 R u n n i n g 0 2 m 4 s
[[email protected] ~] # kubectl -n istio-system get svc #查看Service
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.
- 11.
2)修改服务访问方式
刚才部署的插件的服务默认是ClusterIP,无法在浏览器访问相关的服务,需要修改为NodePort。
[[email protected] ~] # kubectl -n istio-system edit grafana
t y p e: N o d e P o r t
[[email protected] ~] # kubectl -n istio-system edit svc kiali
t y p e: N o d e P o r t
- 1.
- 2.
- 3.
- 4.
3)浏览器访问 Kiali 仪表板
刚才已经修改了Kiali为nodeport的访问方式,在浏览器输入节点IP:port就可以进行访问了。
[[email protected] ~] # kubectl -n istio-system get svc
k i a l i N o d e P o r t 1 0 . 9 6 . 5 3 . 1 4 5 < n o n e > 2 0 0 0 1: 3 2 1 6 2 / T C P , 9 0 9 0: 3 0 8 0 9 / T C P 2 2 m
- 1.
- 2.
卸载istio集群
卸载集群不会卸载安装的插件,安装的插件得单独卸载。
边栏推荐
- 线程应用实例
- The mybatieshelperpro tool can be generated to the corresponding project folder if necessary
- Registration opportunity of autowiredannotationbeanpostprocessor under annotation development mode
- 数字滚动带动画
- Educational Codeforces Round 129 (Rated for Div. 2) 补题题解
- 搭建哨兵模式reids、redis从节点脱离哨兵集群
- 《代碼整潔之道》讀書筆記
- 《重构:改善既有代码的设计》读书笔记(下)
- zabbix5客户端安装和配置
- C file input operation
猜你喜欢
xml开发方式下AutowiredAnnotationBeanPostProcessor的注册时机
SQLite 3.39.0 发布,支持右外连接和全外连接
Data dimensionality reduction factor analysis
450-深信服面经1
搭建主从模式集群redis
安装单机redis详细教程
AcWing 340. 通信线路 题解(二分+双端队列BFS求最短路)
程序猿入门攻略(十二)——数据的存储
云呐|为什么要用固定资产管理系统,怎么启用固定资产管理系统
Tutorial (5.0) 10 Troubleshooting * fortiedr * Fortinet network security expert NSE 5
随机推荐
451-memcpy、memmove、memset的实现
Introduction of Ethernet PHY layer chip lan8720a
Quanzhi A33 uses mainline u-boot
xml开发方式下AutowiredAnnotationBeanPostProcessor的注册时机
Machine learning notes - time series prediction research: monthly sales of French champagne
教程篇(5.0) 09. RESTful API * FortiEDR * Fortinet 网络安全专家 NSE 5
Bubble sort array
Notes de lecture sur le code propre
Why should we build an enterprise fixed asset management system and how can enterprises strengthen fixed asset management
AcWing 1137. 选择最佳线路 题解(最短路)
AcWing 1125. Cattle travel problem solution (shortest path, diameter)
Emmet基础语法
R语言使用econocharts包创建微观经济或宏观经济图、indifference函数可视化无差异曲线(indifference curve)
MySQL
AcWing 1134. Shortest circuit counting problem solution (shortest circuit)
AcWing 383. Sightseeing problem solution (shortest circuit)
AcWing 342. Road and route problem solving (shortest path, topological sorting)
Getting started with typescript
SQLite 3.39.0 发布,支持右外连接和全外连接
[pytorch learning notes] tensor