相容性版本

在每個新的 Istio 版本中,可能會有某些有意的行為變更。這些變更可能是為了提高安全性、修正不正確的行為,或以其他方式改善 Istio 使用者的體驗。一般來說,這些類型的變更只會影響邊緣案例。

雖然從長遠來看是有益的,但每次行為變更都會在升級期間引入風險。過去,在升級時,使用者應閱讀版本說明,了解任何行為變更,並判斷是否受到影響;這可能既繁瑣又容易出錯。

相容性版本為使用者提供額外的選項,允許發行版本與行為變更分開。例如,您可以安裝 Istio 1.24,但將其設定為像 1.23 一樣運作。

使用相容性版本

若要使用相容性版本,只需設定 compatibilityVersion 欄位即可。

$ istioctl install --set values.compatibilityVersion=1.23

我應該在何時使用相容性版本?

建議僅在發現不相容性時才使用相容性版本,而不是預設使用。每個相容性版本只會持續幾個版本,因此您最終需要遷移到新的行為。目前,每個相容性版本都打算至少保留兩個版本,但這可能會有所變更。

為了幫助偵測是否應使用相容性版本,可以使用 istioctl x precheck 以及 --from-version 標記。例如,如果您是從版本 1.23 升級

$ istioctl x precheck --from-version 1.23
Warning [IST0168] (DestinationRule default/tls) The configuration "ENABLE_AUTO_SNI" changed in release 1.20: previously, no SNI would be set; now it will be automatically set. Or, install with `--set compatibilityVersion=1.20` to retain the old default.
Error: Issues found when checking the cluster. Istio may not be safe to install or upgrade.
See https://istio.dev.org.tw/v1.21/docs/reference/config/analysis for more information about causes and resolutions.
這項資訊對您有幫助嗎?
您有任何改進建議嗎?

感謝您的回饋!