下載 Istio
下載 Istio,下載內容將包含:安裝文件、示例和 istioctl 命令行工具。
-
訪問 Istio release 頁面下載與您操作系統對應的安裝文件。在 macOS 或 Linux 系統中,也可以通過以下命令下載最新版本的 Istio:
curl -L https://istio.io/downloadIstio | sh -
-
切換到 Istio 包所在目錄下。例如:Istio 包名為
istio-1.6.8
,則:cd istio-1.6.8
安裝目錄包含如下內容:
install/kubernetes
目錄下,有 Kubernetes 相關的 YAML 安裝文件samples/
目錄下,有示例應用程序bin/
目錄下,包含istioctl
的客戶端文件。istioctl
工具用於手動注入 Envoy sidecar 代理。
-
將
istioctl
客戶端路徑增加到 path 環境變量中,macOS 或 Linux 系統的增加方式如下:export PATH=$PWD/bin:$PATH
-
在使用 bash 或 ZSH 控制台時,可以選擇啟動 auto-completion option。
安裝 Istio
請按照以下步驟在您所選的平台上使用 demo
配置文件安裝 Istio。
-
安裝
demo
配置$ istioctl manifest apply --set profile=demo
-
為了驗證是否安裝成功,需要先確保以下 Kubernetes 服務正確部署,然后驗證除
jaeger-agent
服務外的其他服務,是否均有正確的CLUSTER-IP
:$ kubectl get svc -n istio-system NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE grafana ClusterIP 172.21.211.123 <none> 3000/TCP 2m istio-citadel ClusterIP 172.21.177.222 <none> 8060/TCP,15014/TCP 2m istio-egressgateway ClusterIP 172.21.113.24 <none> 80/TCP,443/TCP,15443/TCP 2m istio-galley ClusterIP 172.21.132.247 <none> 443/TCP,15014/TCP,9901/TCP 2m istio-ingressgateway LoadBalancer 172.21.144.254 52.116.22.242 15020:31831/TCP,80:31380/TCP,443:31390/TCP,31400:31400/TCP,15029:30318/TCP,15030:32645/TCP,15031:31933/TCP,15032:31188/TCP,15443:30838/TCP 2m istio-pilot ClusterIP 172.21.105.205 <none> 15010/TCP,15011/TCP,8080/TCP,15014/TCP 2m istio-policy ClusterIP 172.21.14.236 <none> 9091/TCP,15004/TCP,15014/TCP 2m istio-sidecar-injector ClusterIP 172.21.155.47 <none> 443/TCP,15014/TCP 2m istio-telemetry ClusterIP 172.21.196.79 <none> 9091/TCP,15004/TCP,15014/TCP,42422/TCP 2m jaeger-agent ClusterIP None <none> 5775/UDP,6831/UDP,6832/UDP 2m jaeger-collector ClusterIP 172.21.135.51 <none> 14267/TCP,14268/TCP 2m jaeger-query ClusterIP 172.21.26.187 <none> 16686/TCP 2m kiali ClusterIP 172.21.155.201 <none> 20001/TCP 2m prometheus ClusterIP 172.21.63.159 <none> 9090/TCP 2m tracing ClusterIP 172.21.2.245 <none> 80/TCP 2m zipkin ClusterIP 172.21.182.245 <none> 9411/TCP 2m
如果集群運行在一個不支持外部負載均衡器的環境中(例如:minikube),
istio-ingressgateway
的EXTERNAL-IP
將顯示為<pending>
狀態。請使用服務的NodePort
或 端口轉發來訪問網關。請確保關聯的 Kubernetes pod 已經部署,並且
STATUS
為Running
:$ kubectl get pods -n istio-system NAME READY STATUS RESTARTS AGE grafana-f8467cc6-rbjlg 1/1 Running 0 1m istio-citadel-78df5b548f-g5cpw 1/1 Running 0 1m istio-egressgateway-78569df5c4-zwtb5 1/1 Running 0 1m istio-galley-74d5f764fc-q7nrk 1/1 Running 0 1m istio-ingressgateway-7ddcfd665c-dmtqz 1/1 Running 0 1m istio-pilot-f479bbf5c-qwr28 1/1 Running 0 1m istio-policy-6fccc5c868-xhblv 1/1 Running 2 1m istio-sidecar-injector-78499d85b8-x44m6 1/1 Running 0 1m istio-telemetry-78b96c6cb6-ldm9q 1/1 Running 2 1m istio-tracing-69b5f778b7-s2zvw 1/1 Running 0 1m kiali-99f7467dc-6rvwp 1/1 Running 0 1m prometheus-67cdb66cbb-9w2hm 1/1 Running 0 1m