istio 之 profile
在介紹 istio profile 之前,我們先介紹一下電信的套餐:
我們去電信開通手機業務時,一般都會選擇手機套餐,不同的手機套餐會提供不同的增值服務。如上圖所示,每個套餐就是一個 profile。istioctl 在安裝 istio 時提供的 profile 概念與此類似,不同 profile 定義了不同的 istio 控制面行為。
istioctl profile
使用如下命令查看 istioctl profile:
istioctl profile list
執行結果如下圖所示:1、demo
demo profile 僅供學習使用,並不合適作為生產環境。該 profile 會安裝 ingressgateway、egressgateway、istio-pilot 等 istio 組件,同時會安裝 grafana、istio-tracing、kiali、prometheus 等外部插件。使用如下命令查看 demo profile 的 istio 安裝配置清單:
istioctl profile dump demo
從 dump 出的 profile 來看,最重要的是兩塊配置:插件和組件。插件是指外部第三方依賴,比如 grafana、kiali、prometheus、tracing;組件是指 istio 自身的組件,比如 citadel、egressgateway、ingressgateway、pilot、policy、sidecarInjector、telemetry 等。如下截圖所示:
部分組件信息如下截圖所示:
總結 demo profile 的組件、插件的開關情況信息如下截圖所示,其中 X 代表開啟組件或插件:
2、minimal
minimal profile 僅僅開啟了 pilot 組件,其他的組件或者插件都是關閉的狀態,可以通過如下命令查看明細:
istioctl profile dump minimal > minimal.yaml
如下圖所示,minimal 插件都是關閉的:
僅有 pilot 組件是開啟狀態:
符合官方描述,如下圖所示:
3、 default
default 是官方推薦的 istio 安裝 profile。它在組件和插件的選擇上做到了最合適,比如組件中它只開啟了 ingressgateway、pilot,插件中只開啟了 prometheus。如下圖所示:
4、 empty
empty profile 不會開啟任何組件或者插件。該 profile 的作用是提供一個干凈的模板供有經驗的 istio 使用者自定義配置。
5、 remote
remote profile 在實際使用中情況並不多見。該 profile 提供共享控制面去操作多集群服務網格。remote profile 官方提供的組件、插件描述如下圖所示,但是根據本人實際觀察,發現並不准確,特別標注在下圖中:
dump 出的 ingress-gateway 組件應該處於開啟狀態:
dump 出來的 pilot 組件應該處於開啟狀態:
6、separate
官方宣稱 separate profile 在未來的版本中將要被廢棄掉了,所以就直接略過不提了吧。大家都生活得夠艱難了,就不要給自己找麻煩了。
總結
本小節介紹了 istioctl 安裝 istio 時提供的各個 profile,已經可以覆蓋 90% 上的工作場景了。但是有些技術小騷仍然不會滿足,那么后續哥將會繼續提供自定義配置安裝的方法,請繼續跟隨九析的腳步,我們一同輕松完爆 istio。