你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

从已启用 Arc 的 Kubernetes 上的 Azure 应用服务迁移到已启用 Arc 的 Kubernetes 上的 Azure 容器应用

本文提供了一个清单,其中介绍了从已启用 Arc 的 Kubernetes 上的 Azure 应用服务迁移时需要注意的事项和注意事项。

评估和规划

首先,应确定在已启用 Arc 的 Kubernetes 上的应用服务上运行的任何工作负荷。 运行以下 Azure Resource Graph 查询,列出安装了应用程序服务扩展的 Web 应用程序、应用服务 Kubernetes 环境和已启用 Arc 的 Kubernetes 群集:

确定在已启用 Arc 的 Kubernetes 上的应用服务上运行的所有 Web 应用程序

resources
| where type=~"microsoft.web/sites" and kind contains "app,linux,kubernetes"
az graph query -q "resources | where type =~ 'microsoft.web/sites" and kind contains 'app,linux,kubernetes'"

确定连接到已启用 Arc 的 Kubernetes 上的应用服务的所有应用服务 Kubernetes 环境

resources
| where type=~"microsoft.web/kubeenvironments"
az graph query -q "resources | where type=~'microsoft.web/kubeenvironments'"

确定安装了应用程序服务扩展的所有已启用 Azure Arc 的 Kubernetes 群集

KubernetesConfigurationResources 
| where type =~ 'microsoft.kubernetesconfiguration/extensions' 
| where properties.ExtensionType == 'microsoft.web.appservice' 
| project clusterresourceid = trim_end('/providers/Microsoft.KubernetesConfiguration/Extensions/.*', ['id']), name, location
az graph query -q "KubernetesConfigurationResources | where type =~ 'microsoft.kubernetesconfiguration/extensions' | where properties.ExtensionType == 'microsoft.web.appservice' | project clusterresourceid = trim_end('/providers/Microsoft.KubernetesConfiguration/Extensions/.*', ['id']), name, location"

从已启用 Arc 的 Kubernetes 群集中删除应用程序服务扩展

已启用 Arc 的 Kubernetes 扩展上的 Azure 容器应用不能安装在已安装应用程序服务扩展的群集上。 必须先从连接的群集中删除应用程序服务扩展,或者在新群集上在已启用 Arc 的 Kubernetes 扩展上安装 Azure 容器应用。

卸载扩展以使用同一群集

若要卸载应用程序服务扩展,必须:

  1. 从连接的群集中删除任何应用服务 Kubernetes 环境、关联的 Web 应用程序和应用服务计划。
  2. 从连接的群集中卸载应用程序服务扩展。

在已启用 Arc 的 Kubernetes 上设置 Azure 容器应用

可以在已启用 Arc 的 Kubernetes 群集上安装已启用 Arc 的 Kubernetes 上的 Azure 容器应用,该群集满足以下要求:

  1. 群集 必须 支持 LoadBalancer 服务类型。
  2. 群集 必须 连接到受支持的 Azure 区域之一。
  3. 所有容器应用都必须部署在 Linux 容器中。 没有可用的 Windows 支持。

如果群集满足这些要求,请按照文档作,在 已启用 Azure Arc 的 Kubernetes 上启用 Azure 容器应用

创建容器应用

对于要从已启用 Arc 的 Kubernetes 上的 Azure 应用服务迁移到已启用 Arc 的 Kubernetes 上的 Azure 容器应用的任何应用程序,必须在部署之前对其进行容器化。

可以从现有容器映像从代码部署从 GitHub 中的代码部署应用程序