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


边栏推荐
- Digital scroll strip animation
- 【pytorch学习笔记】Tensor
- 数据降维——因子分析
- Implementation of 452 strcpy, strcat, StrCmp, strstr, strchr
- Usage of ieda refactor
- 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
- In pytorch function__ call__ And forward functions
- Registration opportunity of autowiredannotationbeanpostprocessor under annotation development mode
- AcWing 1125. Cattle travel problem solution (shortest path, diameter)
- LeetCode 0871.最低加油次数 - 类似于POJ2431丛林探险
猜你喜欢

Watchful pioneer world outlook Architecture - (how does a good game come from)

Windows2008R2 安装 PHP7.4.30 必须 LocalSystem 启动应用程序池 不然500错误 FastCGI 进程意外退出

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

Py之interpret:interpret的简介、安装、案例应用之详细攻略

嵌入式(PLD) 系列,EPF10K50RC240-3N 可编程逻辑器件

Chic Lang: completely solve the problem of markdown pictures - no need to upload pictures - no need to network - there is no lack of pictures forwarded to others

Reading notes of "the way to clean structure" (Part 2)

End-to-End Object Detection with Transformers(DETR)论文阅读与理解

教程篇(5.0) 10. 故障排除 * FortiEDR * Fortinet 网络安全专家 NSE 5

《MongoDB入门教程》第03篇 MongoDB基本概念
随机推荐
AcWing 1134. Shortest circuit counting problem solution (shortest circuit)
机器学习笔记 - 时间序列预测研究:法国香槟的月销量
使用 Cheat Engine 修改 Kingdom Rush 中的金钱、生命、星
全志A33使用主线U-Boot
《代码整洁之道》读书笔记
Qpropertyanimation use and toast case list in QT
PHP asymmetric encryption method private key and public key encryption and decryption method
PHP-Parser羽毛球预约小程序开发require线上系统
Date tool class (updated from time to time)
潇洒郎:彻底解决Markdown图片问题——无需上传图片——无需网络——转发给他人图片无缺失
Reduce -- traverse element calculation. The specific calculation formula needs to be passed in and combined with BigDecimal
AcWing 343. 排序 题解(floyd性质实现传递闭包)
Virtual machine initialization script, virtual machine mutual secret key free
Preprocessing and preprocessing macros
冒泡排序数组
Bubble sort array
Reading notes of code neatness
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
Markdown基础语法
守望先锋世界观架构 ——(一款好的游戏是怎么来的)