当前位置:网站首页>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集群
卸载集群不会卸载安装的插件,安装的插件得单独卸载。


边栏推荐
猜你喜欢

为什么要做企业固定资产管理系统,企业如何加强固定资产管理

PHP-Parser羽毛球预约小程序开发require线上系统

End to end object detection with transformers (Detr) paper reading and understanding
冒泡排序数组

Web2.0 giants have deployed VC, and tiger Dao VC may become a shortcut to Web3

Windows2008r2 installing php7.4.30 requires localsystem to start the application pool, otherwise 500 error fastcgi process exits unexpectedly

zabbix5客户端安装和配置

Advanced performance test series "24. Execute SQL script through JDBC"

潇洒郎:彻底解决Markdown图片问题——无需上传图片——无需网络——转发给他人图片无缺失

Registration opportunity of autowiredannotationbeanpostprocessor under annotation development mode
随机推荐
Date tool class (updated from time to time)
Microservice technology - distributed global ID in high concurrency
MySQL高级(进阶)SQL语句
[pytorch learning notes] tensor
AcWing 343. 排序 题解(floyd性质实现传递闭包)
《架构整洁之道》读书笔记(下)
思考变量引起的巨大变化
LeetCode 0871. Minimum refueling times - similar to poj2431 jungle adventure
Juypter notebook modify the default open folder and default browser
End-to-End Object Detection with Transformers(DETR)论文阅读与理解
Introduction of Ethernet PHY layer chip lan8720a
数据降维——因子分析
Typescript 之 快速入门
数据湖(十二):Spark3.1.2与Iceberg0.12.1整合
潇洒郎:彻底解决Markdown图片问题——无需上传图片——无需网络——转发给他人图片无缺失
AcWing 1125. 牛的旅行 题解(最短路、直径)
Emmet基础语法
MySQL表历史数据清理总结
Tutorial (5.0) 10 Troubleshooting * fortiedr * Fortinet network security expert NSE 5
Registration opportunity of autowiredannotationbeanpostprocessor under annotation development mode