在 Azure Stack Hub 上设置 AKS 引擎的先决条件Set up the prerequisites for the AKS engine on Azure Stack Hub

可以将 AKS 引擎安装在环境中的虚拟机 (VM) 上,也可以安装在可访问 Azure Stack Hub 资源管理器终结点的任何客户端计算机上。You can install the AKS engine on a virtual machines (VMs) in your environment, or any client machine with access to your Azure Stack Hub Resource Manager endpoint. 运行引擎之前,需具备以下各项:AKS 库 Ubuntu 服务器和订阅中可用的 Linux 自定义脚本扩展、已分配给参与者角色的服务主体标识,以及 SSH 用于访问 Ubuntu 服务器的私钥/公钥对。You will need the following things in place before you run the engine: an AKS Base Ubuntu server and Linux custom script extension available in your subscription, a service principal identity that has been assigned to a contributor role, and a private/public key pair for SSH access to your Ubuntu server. 此外,如果使用的是 Azure Stack 开发工具包,则需要使计算机信任相应的证书。In addition, if you are using the Azure Stack Development Kit, you will need to have your machine trust the appropriate certificates.

如果已满足先决条件,则可以开始定义群集If you have your prerequisites, you can begin to define your cluster.

如果你是 Azure Stack Hub 的云操作员,并且想要提供 AKS 引擎,请按照将 AKS 引擎添加到 Azure Stack Hub 市场中的说明进行操作。If you are the cloud operator for Azure Stack Hub and would like to offer the AKS engine, follow the instructions at Add the AKS engine to the Azure Stack Hub Marketplace.

AKS 引擎的先决条件Prerequisites for the AKS engine

若要使用 AKS 引擎,需具备以下资源。To use the AKS engine, you need to have the following resources available. 请记住,Azure Stack Hub 的租户将使用 AKS 引擎在其租户订阅中部署 Kubernetes 群集。Keep in mind that the AKS engine is meant to be used by tenants of Azure Stack Hub to deploy Kubernetes clusters into their tenant subscription. 下载市场项目和创建服务主体标识是唯一可能需要 Azure Stack Hub 操作员参与的部分。The only part where involvement of the Azure Stack Hub operator may be required is for downloading Marketplace items and the creation of a service principal identity. 可以在下表中找到详细信息。You can find details in the following table.

云操作员需准备好以下各项。Your cloud operator will need to have the following items in place.

先决条件Prerequisite 说明Description 必须Required 说明Instructions
Azure Stack Hub 1910 或更高版本Azure Stack Hub 1910 or greater AKS 引擎需要 Azure Stack Hub 1910 或更高版本。The AKS engine requires Azure Stack Hub 1910 or greater. 必须Required 如果不确定你的 Azure Stack Hub 版本是否为最新版本,请联系云操作员。If you are unsure of your version of Azure Stack Hub, contact your cloud operator.
Linux 自定义脚本扩展Linux custom script extension Linux 自定义脚本扩展 2.0Linux Custom Script extension 2.0
产品/服务:适用于 Linux 的自定义脚本 2.0Offer: Custom Script for Linux 2.0
版本:2.0.6(或最新版本)Version: 2.0.6 (or latest version)
发布者:Microsoft CorpPublisher: Microsoft Corp
必须Required 如果订阅中没有此项,请联系云操作员。If you do not have this item in your subscription, contact your cloud operator.
AKS Ubuntu 基础映像AKS Base Ubuntu Image AKS Ubuntu 16.04-LTS 基础映像AKS Base Ubuntu 16.04-LTS Image
有关版本依赖项的详细信息,请参阅将引擎与基础映像版本相匹配See more information on the version dependency see Matching engine to base image version
必须Required 如果订阅中没有此项,请联系云操作员。If you don't have this item in your subscription, contact your cloud operator.
如果你是 Azure Stack Hub 的云操作员,并且想要提供 AKS 引擎,请按照将 AKS 引擎添加到 Azure Stack Hub 市场中的说明进行操作。If you are the cloud operator for Azure Stack Hub and would like to offer the AKS engine, follow the instructions at Add the AKS engine to the Azure Stack Hub Marketplace.
服务主体标识 (SPN)Service principal identity (SPN) 需要通过 Azure 资源管理器部署或配置资源的应用程序必须以服务主体来表示。An application that needs to deploy or configure resources through Azure Resource Manager, must be represented by a service principal. 必须Required 对于此项,可能需要联系 Azure Stack Hub 操作员。You may need to contact your Azure Stack Hub operator for this item.
如果使用 Azure Active Directory (Azure AD) 服务主体标识,则需要从 Kubernetes 群集中的 VM 访问 Internet,以便使用 Azure AD 对服务主体进行身份验证。If an Azure Active Directory (Azure AD) Service Principal identity is used, Internet access is required from the VMs in the Kubernetes cluster so that the Service Principal can be authenticated with Azure AD. 如果无法访问 Internet,则 Kubernetes 群集将无法正常运行。If there is no internet access, the Kubernetes cluster will not be functional.
有关说明,请参阅使用应用标识访问资源For instructions see Use an app identity to access resources
分配了 (SPN) 的参与者角色(SPN) assigned Contributor role 若要允许应用程序使用其服务主体访问订阅中的资源,必须将该服务主体分配到特定资源的某个角色。To allow an application to access resources in your subscription using its service principal, you must assign the service principal to a role for a specific resource. 必须Required 有关说明,请参阅分配角色For instructions, see Assign a role

可设置以下项。You can set the following items.

先决条件Prerequisite 说明Description 必须Required 说明Instructions
Azure Stack Hub 订阅Azure Stack Hub subscription 可以通过订阅访问 Azure Stack Hub 中的套餐。You access offers in your Azure Stack Hub through subscriptions. 套餐包含可供你使用的服务。The offer contains the services that are available to you. 必须Required 需要先获得 Azure Stack Hub 订阅,才能在 Azure Stack Hub 中部署任何租户工作负载。To be able to deploy any tenant workloads in Azure Stack Hub, you need to first get an Azure Stack Hub Subscription.
资源组Resource group 资源组是用于保存 Azure 解决方案相关资源的容器。A resource group is a container that holds related resources for an Azure solution. 如果未指定现有资源组,该工具将创建一个。If you don't specify an existing resource group the tool will create one for you. 可选Optional 使用 Azure 门户管理 Azure 资源管理器资源组Manage Azure Resource Manager resource groups by using the Azure portal
私钥公钥对Private Public key 若要使用从开发计算机到 Azure Stack Hub 实例中服务器 VM(用于托管 Web 应用)的开放 SSH 连接,需要创建安全外壳 (SSH) 公钥和私钥对。To use an open SSH connection from your development machine to the server VM in your Azure Stack Hub instance that hosts your web app, you need to create a Secure Shell (SSH) public and private key pair. 必须Required 有关如何生成密钥的说明,请参阅 SSH 密钥生成For instructions on generating a key, see SSH Key Generation.

备注

还可以使用 Azure Stack Hub 的 Azure CLIAzure Stack Hub PowerShell 创建 AKS 引擎的先决条件。You can also create the prerequisites for the AKS engine with Azure CLI for Azure Stack Hub or Azure Stack Hub PowerShell.

将引擎与基础映像版本相匹配Matching engine to base image version

AKS 引擎将自定义 Ubuntu Server OS 部署到每个群集节点映像,即“AKS Ubuntu 16.04-LTS 基础映像发行版”。The AKS engine deploys a customized Ubuntu Server OS to each cluster node image, the AKS Base Ubuntu 16.04-LTS Image Distro. 任何 AKS 引擎版本都依赖于 Azure Stack Hub 操作员在 Azure Stack Hub 中提供的特定映像版本。Any AKS engine version is dependent on a specific image version made available in your Azure Stack Hub by your Azure Stack Hub operator. 可以在支持的 Kubernetes 版本中找到列出了 AKS 引擎版本和相应的受支持 Kubernetes 版本的表。You can find a table listing the AKS engine versions and corresponding supported Kubernetes versions at Supported Kubernetes Versions. 例如,AKS 引擎版本 v0.55.0 依赖于 AKS Ubuntu 16.04-LTS 基础映像分发版版本 2020.08.24For example, AKS engine version v0.55.0 depends on version 2020.08.24 of the AKS Base Ubuntu 16.04-LTS Image Distro. 请求 Azure Stack Hub 操作员将特定的映像版本从 Azure 市场下载到 Azure Stack Hub 市场。Ask your Azure Stack Hub operator to download the specific image version from the Azure Marketplace to the Azure Stack Hub Marketplace.

如果映像在 Azure Stack Hub 市场中不可用,则会触发错误。You will trigger and error if the image is not available in your Azure Stack Hub Marketplace. 例如,如果当前使用的是 AKS 引擎 v0.55.0 版,并且 AKS Ubuntu 16.04-LTS 基础映像发行版 2020.08.24 不可用,则运行 AKS 引擎时会显示以下错误:For example, if you're currently using AKS engine version v0.55.0 and AKS Base Ubuntu 16.04-LTS Image Distro version 2020.08.24 isn't available, you will see the following error when running the AKS engine:

The platform image 'microsoft-aks:aks:aks-ubuntu-1604-202003:2020.08.24' is not available. 
Verify that all fields in the storage profile are correct.

可以运行以下命令查看 AKS 引擎的当前版本:You can check the current version of your AKS engine by running the following command:

$ aks-engine version
Version: v0.55.0
GitCommit: 44a35c00c
GitTreeState: clean

后续步骤Next steps