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


边栏推荐
- 多态的理解以及作用
- Typescript 之 快速入门
- AcWing 1137. Select the best line solution (the shortest circuit)
- 450-深信服面经1
- Pytorch版本、CUDA版本与显卡驱动版本的对应关系
- AcWing 343. 排序 题解(floyd性质实现传递闭包)
- 开发固定资产管理系统,开发固定资产管理系统用什么语音
- AcWing 181. 回转游戏 题解(搜索—IDA*搜索)
- mysql函数
- Web2.0 giants have deployed VC, and tiger Dao VC may become a shortcut to Web3
猜你喜欢

Web2.0的巨头纷纷布局VC,Tiger DAO VC或成抵达Web3捷径

Thread application instance

450-深信服面经1

mysql函数

In pytorch function__ call__ And forward functions

教程篇(5.0) 09. RESTful API * FortiEDR * Fortinet 网络安全专家 NSE 5

《架构整洁之道》读书笔记(下)

Machine learning notes - time series prediction research: monthly sales of French champagne

Educational Codeforces Round 129 (Rated for Div. 2) 补题题解

zabbix5客户端安装和配置
随机推荐
IEDA refactor的用法
MySQL
AcWing 1127. 香甜的黄油 题解(最短路—spfa)
NPOI导出Excel2007
pxe装机「建议收藏」
When converting from list to map, if a certain attribute may cause key duplication and exceptions, you can set the way to deal with this duplication
2022.7.1-----leetcode. two hundred and forty-one
Npoi export Excel2007
Function high order curry realization
横向越权与纵向越权[通俗易懂]
Codeforces Round #802 (Div. 2) 纯补题
为什么要做企业固定资产管理系统,企业如何加强固定资产管理
Markdown基础语法
Horizontal ultra vires and vertical ultra vires [easy to understand]
GMapping代码解析[通俗易懂]
数据降维——主成分分析
Windows2008R2 安装 PHP7.4.30 必须 LocalSystem 启动应用程序池 不然500错误 FastCGI 进程意外退出
【pytorch学习笔记】Tensor
AcWing 1134. Shortest circuit counting problem solution (shortest circuit)
[error record] problems related to the installation of the shuttle environment (follow-up error handling after executing the shuttle doctor command)