从 IstioOperator 迁移

代管式控制平面不直接支持使用 IstioOperator 进行自定义。从 Anthos Service Mesh 迁移到代管式控制平面需要从 IstioOperator 手动转换。此工具可自动执行该过程,有助于减少麻烦。

关于迁移工具

迁移工具以非破坏性的方式评估提供的 IstioOperator 文件,从而执行以下操作:

  • 检查是否存在兼容性问题。
  • 将兼容的 IstioOperator 配置转换为代管式控制平面支持的配置,并将新配置输出到文件中。
  • 输出有关与代管式控制平面所需的默认值冲突的配置值的警告。
  • 建议如何使用生成的文件。

此工具不会检查集群数据或配置,也不会更改集群配置。您必须单独应用所有生成的文件。

在使用迁移工具之前,请检查代管式控制平面支持的功能的限制,以验证代管式控制平面是否支持安装 Anthos Service Mesh。

使用迁移工具

迁移工具可作为 asmcli 脚本的一部分提供。您必须下载该脚本才能使用此工具。

  1. 运行迁移工具:

    asmcli experimental mcp-migrate-check -f path/to/istiooperator.yaml
    
  2. 请注意该工具列出的文件输出,尤其是 asm/*meshconfig.yamlasm/gateways*

  3. 检查配置警告。

  4. 查看输出并执行迁移所需的操作。

不受支持的 MeshConfig 字段

MeshConfig 上的以下字段会被代管式控制平面替换。

  • trustDomain
  • trustDomainAliases
  • configSources
  • defaultConfig.proxyMetadata - 这些特定字段会被替换。您可以添加新字段:
    • XDS_ROOT_CA
    • CA_ROOT_CA
    • OUTPUT_CERTS
    • XDS_AUTH_PROVIDER
    • PROXY_CONFIG_XDS_AGENT
  • defaultConfig.meshId
  • defaultConfig.discoveryAddress

输出示例

$ asmcli experimental mcp-migrate-check -f some-iop.yaml
asmcli: Downloading ASM..
Generating equivalent configuration for Anthos Service Mesh managed control plane...

Migrating MeshConfig settings...
✔ Wrote MeshConfig to asm-generated-configs/meshconfig.yaml.

Migrating gateway deployments...

Checking configuration compatibility...
! Found unsupported configurations:
    Components.Base: not configurable in managed control plane
    Components.Pilot: not configurable in managed control plane
    Hub=gcr.io/gke-release/asm: not configurable in managed control plane
    Tag=1.10.4-asm.6: not configurable in managed control plane

Actions required to migrate:
! Found potentially unsupported configurations; review warnings above before proceeding
- Found custom mesh configuration settings. To apply these settings to ASM managed
    control plane, run: `kubectl apply -f 'asm-generated-configs/meshconfig.yaml'`

TIP: steps recommending `kubectl apply` to be run should be integrated into your
  CI/CD pipeline, if applicable.

后续步骤