1 环境说明

框架版本功能
Kubernetesv1.17.3K8S集群
Istiov1.11.4ServiceMesh

2 下载 Istio

2.1 解压并切换到 Istio 包所在目录下

cd /usr/local/
方法一:curl -L https://istio.io/downloadIstio | sh -
方法二:wget https://github.com/istio/istio/releases/download/1.11.4/istio-1.11.4-linux-amd64.tar.gz

cd istio-1.11.4
  • 安装目录包含如下内容:
    • samples/ 目录下,有示例应用程序
    • bin/ 目录下,包含 istioctl的客户端文件。istioctl 工具用于手动注入 Envoy sidecar 代理。

2.2 将 istioctl 客户端路径增加到 path 环境变量中

vi /etc/profile
export PATH=/usr/local/istio-1.11.4/bin:$PATH
source /etc/profile

2.3 开启自动补全

cp /usr/local/istio-1.11.4/tools/istioctl.bash $HOME/
source ~/istioctl.bash

3 安装 Istio

3.1 安装 default配置

cd /usr/local/istio-1.11.4
istioctl install
This will install the Istio default profile with ["Istio core" "Istiod" "Ingress gateways"] components into the cluster. Proceed? (y/N) y
✔ Istio core installed
✔ Istiod installed
✔ Ingress gateways installed
- Pruning removed resources                                                                                                                                                                         Removed PodDisruptionBudget:istio-system:istio-egressgateway.
  Removed Deployment:istio-system:istio-egressgateway.
  Removed Service:istio-system:istio-egressgateway.
  Removed ServiceAccount:istio-system:istio-egressgateway-service-account.
  Removed RoleBinding:istio-system:istio-egressgateway-sds.
  Removed Role:istio-system:istio-egressgateway-sds.
✔ Installation complete  

3.2 安装demo配置

  • 此处安装时候会花些功夫,如果第一次安装失败,多装几回
cd /usr/local/istio-1.11.4
istioctl install --set profile=demo -y
This will install the Istio demo profile with ["Istio core" "Istiod" "Ingress gateways" "Egress
✔ Istio core installed
- Processing resources for Istiod.                                                              ✔ Istiod installed
✔ Ingress gateways installed
✔ Egress gateways installed
- Pruning removed resources                                                                       Removed HorizontalPodAutoscaler:istio-system:istio-ingressgateway.
  Removed HorizontalPodAutoscaler:istio-system:istiod.
✔ Installation complete

3.3 检查安装状态

kubectl -n istio-system get deploy
NAME                   READY   UP-TO-DATE   AVAILABLE   AGE
istio-egressgateway    1/1     1            1           7m4s
istio-ingressgateway   1/1     1            1           15m
istiod                 1/1     1            1           15m

4 卸载istio

  • 要从集群中完整卸载Istio
istioctl x uninstall --purge
  • 控制平面的命名空间,删除istio-system
kubectl delete namespace istio-system
Logo

K8S/Kubernetes社区为您提供最前沿的新闻资讯和知识内容

更多推荐