當(dāng)前位置:首頁 > IT技術(shù) > 其他 > 正文

【Istio實際操作篇】Istio入門,10分鐘快速安裝
2022-04-25 23:07:56

@

前言

上一篇講了什么是Istio的理論篇,這次我們就來實際操作。

想看上一篇理論篇的看這里(看完絕對有所收獲):
[Istio是什么?] 還不知道你就out了,一文40分鐘快速理解_小葉的技術(shù)Logs的博客-CSDN博客

本文說明 請大家務(wù)必查看

本文有兩個版本,詳細(xì)版、簡潔版

前者適合新手,后者適合老手(方便大家查找,從而過濾掉某些步驟,節(jié)約時間成本) 所以大家按需查看喲。

詳細(xì)版 簡潔版

簡潔版:包含所有步驟,以及命令的執(zhí)行過程(適合新手)

簡潔版:只包含命令(適合有一定熟練度的人)

環(huán)境準(zhǔn)備


系統(tǒng) Vcpu Memory 集群
centos7 2 8 kubernetes

詳細(xì)版

入門:搭建步驟

Istio軟件包下載

安裝最新軟件包

$ curl -L https://istio.io/downloadIstio | sh -  # 安裝最新軟件包

這一條命令如果下載不下來,可以直接訪問下載地址:Istio下載

挑選對應(yīng)的istio版本、下載對應(yīng)的壓縮文件,如圖所示:
注意:Istio1.13.3版本,要求kubernetes最低集群版是1.19

解壓軟件包:

[root@master istio]# ll
total 22704
-rw-r--r-- 1 root root 23245765 Apr 23 10:39 istio-1.12.3-linux-amd64.tar.gz
[root@master istio]# tar -vzxf istio-1.12.3-linux-amd64.tar.gz
istio-1.12.3/
istio-1.12.3/manifest.yaml
istio-1.12.3/bin/
istio-1.12.3/bin/istioctl
istio-1.12.3/manifests/
istio-1.12.3/manifests/examples/
istio-1.12.3/manifests/examples/customresource/
istio-1.12.3/manifests/examples/customresource/istio_v1alpha1_istiooperator_cr.yaml
istio-1.12.3/manifests/examples/user-gateway/

安裝目錄包含:

  • samples/ 目錄下的示例應(yīng)用程序
  • bin/ 目錄下的 istioctl 客戶端二進制文件 .

配置環(huán)境變量:

[root@master istio]# cat /etc/profile
export ISTIO_HOME=/root/istio/istio-1.12.3  
export PATH=$PATH:$ISTIO_HOME/bin
[root@master istio]# istioctl version
client version: 1.12.3
control plane version: 1.12.3
data plane version: 1.12.3 (10 proxies)

下載Istio

[root@master ~]# istioctl install --set profile=demo -y
Detected that your cluster does not support third party JWT authentication. Falling back to less secure first party JWT. See https://istio.io/v1.12/docs/ops/best-practices/security/#configure-third-party-service-account-tokens for details.
! values.global.jwtPolicy is deprecated; use Values.global.jwtPolicy=third-party-jwt. See http://istio.io/latest/docs/ops/best-practices/security/#configure-third-party-service-account-tokens for more information instead
WARNING: Istio control planes installed: 1.13.3.
WARNING: An older installed version of Istio has been detected. Running this command will overwrite it.
? Istio core installed
? Istiod installed
? Egress gateways installed
? Ingress gateways installed
? Installation complete                                                                                                         Making this installation the default for injection and validation.

Thank you for installing Istio 1.12.  Please take a few minutes to tell us about your install/upgrade experience!  https://forms.gle/FegQbc9UvePd4Z9z7

自動注入 Envoy 邊車代理

[root@master ~]#  kubectl label namespace default istio-injection=enabled
namespace/default labeled

卸載

完整卸載 Istio

[root@master istio]# istioctl x uninstall --purge
All Istio resources will be pruned from the cluster
Proceed? (y/N) y
  Removed IstioOperator:istio-system:installed-state.
  Removed PodDisruptionBudget:istio-system:istio-egressgateway.
  Removed PodDisruptionBudget:istio-system:istio-ingressgateway.
  Removed PodDisruptionBudget:istio-system:istiod.
  Removed Deployment:istio-system:istio-egressgateway.
  Removed Deployment:istio-system:istio-ingressgateway.
  Removed Deployment:istio-system:istiod.
  Removed Service:istio-system:istio-egressgateway.
  Removed Service:istio-system:istio-ingressgateway.
  Removed Service:istio-system:istiod.
  Removed ConfigMap:istio-system:istio.
  Removed ConfigMap:istio-system:istio-sidecar-injector.
  Removed Pod:istio-system:istio-egressgateway-6b69dfb9f8-x7zwb.
  Removed Pod:istio-system:istio-ingressgateway-7484f57fd6-hrjjt.
  Removed Pod:istio-system:istiod-7989b7749b-rmslt.

簡潔版

安裝

[root@master istio]# curl -L https://istio.io/downloadIstio | sh -
[root@master istio]# tar -vzxf istio-1.12.3-linux-amd64.tar.gz
[root@master istio]# cat /etc/profile
export ISTIO_HOME=/root/istio/istio-1.12.3  
export PATH=$PATH:$ISTIO_HOME/bin
[root@master ~]# istioctl install --set profile=demo -y
[root@master istio]# kubectl label namespace default istio-injection=enabled

卸載

[root@master istio]# istioctl x uninstall --purge

學(xué)習(xí)不走彎路,gz號「yeTechLog」

本文摘自 :https://www.cnblogs.com/

開通會員,享受整站包年服務(wù)立即開通 >