Istio的版本对k8s的版本是有要求的,不兼容的版本会引发一些隐蔽的错误,安装前先参考下图

版本 目前支持 发行日期 停止维护 支持的 Kubernetes 版本 未测试,可能支持的 Kubernetes 版本
master 否,仅限开发 - - - -
1.15 2022 年 8 月 31 日 ~ 2023 年 3 月(预期) 1.22, 1.23, 1.24, 1.25 1.16, 1.17, 1.18, 1.19, 1.20, 1.21
1.14 2022 年 5 月 24 日 ~ 2023 年 1 月(预期) 1.21, 1.22, 1.23, 1.24 1.16, 1.17, 1.18, 1.19, 1.20
1.13 2022 年 2 月 11 日 ~ 2022 年 10 月(预期) 1.20, 1.21, 1.22, 1.23 1.16, 1.17, 1.18, 1.19
1.12 2021 年 11 月 18 日 2022 年 7 月 12 日 1.19, 1.20, 1.21, 1.22 1.16, 1.17, 1.18
1.11 2021 年 8 月 12 日 2022 年 3 月 25 日 1.18, 1.19, 1.20, 1.21, 1.22 1.16, 1.17
1.10 2021 年 5 月 18 日 2022 年 1 月 7 日 1.18, 1.19, 1.20, 1.21 1.16, 1.17, 1.22
1.9 2021 年 2 月 9 日 2021 年 10 月 8 日 1.17, 1.18, 1.19, 1.20 1.15, 1.16
1.8 2020 年 11 月 10 日 2021 年 5 月 12 日 1.16, 1.17, 1.18, 1.19 1.15
1.7 2020 年 8 月 21 日 2021 年 2 月 25 日 1.16, 1.17, 1.18 1.15
1.6 及更早 - - - -

安装方法比较简单,官方退出了自动部署脚本

curl -L https://istio.io/downloadIstio | ISTIO_VERSION=1.14.0 TARGET_ARCH=x86_64 sh -

# 添加环境变量
cd /usr/local/istio
# 临时添加环境便里昂
export PATH=$PWD/bin:$PATH
# 永久添加环境便变量,编辑/etc/profile,最后添加export,保存后 source
vim /etc/profile
export PATH=/usr/local/istio/bin:$PATH
source /etc/profile

这里指定了版本为 1.14.0,此命令会在当前目录下载 istio 的压缩安装包,解压后得到

 

 

istio 提供了很多的安装配置

[root@master ~]# istioctl profile list
Istio configuration profiles:
    default
    demo
    empty
    external
    minimal
    openshift
    preview
    remote

具体的安装差别可以看 yaml 文件,会发现里面的组件是不太一样的

[root@master istio-1.11.0]# ls ./manifests/profiles/
default.yaml  demo.yaml  empty.yaml  external.yaml  minimal.yaml  openshift.yaml  preview.yaml  remote.yaml

 

 

 可以看到 demo 里除了核心的组件外还添加了链路追踪和日志收集和可视化相关的功能,那我们以demo为例来安装

[root@master ~]# istioctl manifest apply --set profile=demo

安装后发现,只是安装了核心组件而已,其他的套件貌似也要手动添加

[root@master ~]# kubectl get po -n istio-system
NAME                                    READY   STATUS    RESTARTS   AGE
istio-egressgateway-f55b8c8fd-9qbgl     1/1     Running   0          56s
istio-ingressgateway-75cd9dc88b-xm4nt   1/1     Running   0          56s
istiod-d746f686f-krhvg                  1/1     Running   0          84s

添加 kiali

[root@master istio-1.11.0]# kubectl apply -f samples/addons
serviceaccount/grafana created
configmap/grafana created
service/grafana created
deployment.apps/grafana created
configmap/istio-grafana-dashboards created
configmap/istio-services-grafana-dashboards created
deployment.apps/jaeger created
service/tracing created
service/zipkin created
service/jaeger-collector created
serviceaccount/kiali created
configmap/kiali created
clusterrole.rbac.authorization.k8s.io/kiali-viewer created
clusterrole.rbac.authorization.k8s.io/kiali created
clusterrolebinding.rbac.authorization.k8s.io/kiali created
role.rbac.authorization.k8s.io/kiali-controlplane created
rolebinding.rbac.authorization.k8s.io/kiali-controlplane created
service/kiali created
deployment.apps/kiali created
serviceaccount/prometheus created
configmap/prometheus created
clusterrole.rbac.authorization.k8s.io/prometheus created
clusterrolebinding.rbac.authorization.k8s.io/prometheus created
service/prometheus created
deployment.apps/prometheus created

再次查看 pod 可以发现拉起了很多容器,kiali 和 prometheus 的启动非常久4.。。。一直在ContainerCreating,有可能是机器资源的问题

[root@master ~]# kubectl get po -n  istio-system
NAME                                    READY   STATUS    RESTARTS   AGE
grafana-6544947b77-twt78                1/1     Running   0          84m
istio-egressgateway-f55b8c8fd-9qbgl     1/1     Running   0          104m
istio-ingressgateway-75cd9dc88b-xm4nt   1/1     Running   0          104m
istiod-d746f686f-krhvg                  1/1     Running   0          105m
jaeger-7f8cd55b4c-gr8sh                 1/1     Running   0          84m
kiali-74ff4c79f9-dhzpf                  1/1     Running   0          84m
prometheus-6cfc5f58cd-7cfss             2/2     Running   0          84m

开启界面 kiali

istioctl dashboard --address 0.0.0.0 -p 20001 kiali

打开 http://{your host}:20001 可看到 html 界面