将 Azure Kubernetes 服务 (AKS) 引擎必备组件添加到 Azure Stack Hub 市场Add the Azure Kubernetes Services (AKS) engine prerequisites to the Azure Stack Hub Marketplace

可以为用户设置 Azure Kubernetes 服务 (AKS) 引擎。You can set up the Azure Kubernetes Services (AKS) Engine for your users. 将本文中所述的项添加到 Azure Stack Hub。Add the items described in this article to your Azure Stack Hub. 之后,用户通过一次协调的操作即可部署 Kubernetes 群集。Your users can then deploy a Kubernetes cluster in a single, coordinated operation. 本文指导你完成让用户在联网和离线环境中都能使用 AKS 引擎所需的步骤。This article walks you through the steps you need to make the AKS engine available to your users in both connected and disconnected environments. AKS 引擎依赖于服务主体标识,以及市场中的自定义脚本扩展和 AKS 基础映像。The AKS engine depends on a service principle identity, and in the marketplace, a Custom Script extension and the AKS Base Image. AKS 引擎要求运行 Azure Stack Hub 1910 或更高版本。The AKS engine requires that you're running Azure Stack Hub 1910 or greater.

备注

可以在 AKS 引擎发行说明中找到 Azure Stack Hub 到 AKS 引擎版本号的映射。You can find the mapping of Azure Stack Hub to AKS engine version number in the AKS engine release notes.

检查用户的服务产品Check your user's service offering

你的用户将需要具备带有足够空间的 Azure Stack Hub 计划、套餐和订阅。Your users will need a plan, offer, and subscription to Azure Stack Hub with enough space. 通常,用户需要部署最多由六个虚拟机(包含三个主机和三个工作器节点)组成的群集。Users will often want to deploy clusters of up to six virtual machines, made of three masters and three worker nodes. 你需要确保其配额空间足够大。You will want to make sure they have a large enough quota.

如果需要有关计划和设置服务产品的详细信息,请参阅有关在 Azure Stack Hub 中提供服务的概述If you need more information about planning and setting up a service offering, see Overview of offering services in Azure Stack Hub

创建服务主体和凭据Create a service principal and credentials

Kubernetes 群集将需要 Azure Stack Hub 中的服务主体 (SPN) 和基于角色的权限。The Kubernetes cluster will need service principal (SPN) and role-based permissions in Azure Stack Hub.

在 Azure AD 中创建 SPNCreate an SPN in Azure AD

如果将 Azure Active Directory (Azure AD) 用于标识管理服务,则需要为部署 Kubernetes 群集的用户创建服务主体。If you use Azure Active Directory (Azure AD) for your identity management service, you will need to create a service principal for users deploying a Kubernetes cluster. 使用客户端密码创建服务主体。Create a service principal using a client secret. 有关说明,请参阅创建使用客户端密码凭据的服务主体For instructions, see Create a service principal that uses a client secret credential.

在 AD FS 中创建 SPNCreate an SPN in AD FS

如果将 Active Directory 联合身份验证服务 (AD FS) 用于标识管理服务,则需要为部署 Kubernetes 群集的用户创建服务主体。If you use Active Directory Federated Services (AD FS) for your identity management service, you will need to create a service principal for users deploying a Kubernetes cluster. 使用客户端密码创建服务主体。Create a service principal using a client secret. 有关说明,请参阅使用客户端密码创建服务主体For instructions, see Create a service principal using a client secret.

添加 AKS 基础映像Add the AKS Base Image

可通过从 Azure 获取 AKS 基础映像将该项添加到市场。You can add the AKS Base Image to the marketplace by getting the item from Azure. 但是,如果 Azure Stack Hub 处于离线状态,请按照从 Azure 下载市场项中的说明来添加该项。However, if your Azure Stack Hub is disconnected, use these instructions Download marketplace items from Azure to add the item. 添加第 5 步中指定的项。Add the item specified in step 5.

将以下项添加到市场:Add the following item to the marketplace:

  1. 登录到管理门户 https://adminportal.local.azurestack.externalSign in to the Administration portal https://adminportal.local.azurestack.external.

  2. 选择“所有服务”,然后在“管理”类别下,选择“市场管理”。Select All services, and then under the ADMINISTRATION category, select Marketplace management.

  3. 选择“+ 从 Azure 添加”。Select + Add from Azure.

  4. 输入 AKS BaseEnter AKS Base.

  5. 选择与 AKS 引擎版本匹配的映像版本。Select the image version that matches the version of the AKS engine. 可在受支持的 Kubernetes 版本中找到与 AKS 引擎版本对应的 AKS 基础映像的列表。You can find listing of AKS Base Image to AKS engine version at Supported Kubernetes Versions.

    在该列表中,选择:In the list, select:

    • 发布者:Azure Kubernetes 服务Publisher: Azure Kubernetes Service
    • 套餐:aksOffer: aks
    • 名称:AKS Ubuntu 16.04-LTS 基础映像发行版,2020 年 8 月(2020.09.14 或映射到 AKS 引擎的版本)Name: AKS Base Ubuntu 16.04-LTS Image Distro, August 2020 (2020.09.14 or version that maps to AKS engine)
    • 版本:2020.09.14Version: 2020.09.14
  6. 选择“下载”。Select Download.

添加自定义脚本扩展Add a Custom Script extension

可通过从 Azure 获取自定义脚本将该项添加到市场。You can add the custom script to the marketplace by getting the item from Azure. 但是,如果 Azure Stack Hub 处于离线状态,请按照从 Azure 下载市场项中的说明来添加该项。However, if your Azure Stack Hub is disconnected, use the instructions Download marketplace items from Azure to add the item. 添加第 5 步中指定的项。Add the item specified in step 5.

  1. 打开管理门户 https://adminportal.local.azurestack.externalOpen the Administration portal https://adminportal.local.azurestack.external.

  2. 选择“所有服务”,然后在“管理”类别下,选择“市场管理”。Select ALL services and then under the ADMINISTRATION category, select Marketplace Management.

  3. 选择“+ 从 Azure 添加”。Select + Add from Azure.

  4. 输入 Custom Script for LinuxEnter Custom Script for Linux.

  5. 选择具有以下配置文件的服务器:Select the script with the following profile:

    • 产品/服务:适用于 Linux 的自定义脚本 2.0Offer: Custom Script for Linux 2.0

    • 版本:2.0.6(或最新版本)Version: 2.0.6 (or latest version)

    • 发布者:Microsoft CorpPublisher: Microsoft Corp

      备注

      可能会列出适用于 Linux 的自定义脚本的多个版本。More than one version of the Custom Script for Linux may be listed. 你需要添加该项的最新版本。You will need to add the last version of the item.

  6. 选择“下载”。Select Download.

后续步骤Next steps

Azure Stack Hub 上的 AKS 引擎是什么?What is the AKS engine on Azure Stack Hub?

在 Azure Stack Hub 中提供服务概述Overview of offering services in Azure Stack Hub