兼容版本
在每个新的 Istio 版本中,可能存在一些故意的行为更改。这些可能是为了提高安全性、修复不正确的行为或以其他方式改进 Istio 以供用户使用。通常,这些类型的更改仅影响极端情况。
虽然从长远来看是有益的,但每次行为更改都会在升级期间引入风险。从历史上看,在升级时,用户应阅读发行说明以了解任何行为更改并确定它们是否受到影响;这可能很繁琐且容易出错。
兼容版本为用户提供了另一个选项,允许将发行版本与行为更改分离。例如,您可以安装 Istio 1.24,但将其配置为表现得像 1.23。
使用兼容版本
要使用兼容版本,只需设置 compatibilityVersion
字段。
$ istioctl install --set values.compatibilityVersion=1.23
$ helm install ... --set 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.ac.cn/v1.21/docs/reference/config/analysis for more information about causes and resolutions.