部署 Kubernetes,将容器与 Azure Stack 中心配合使用Deploy Kubernetes to use containers with Azure Stack Hub

备注

仅使用 Kubernetes Azure Stack Marketplace 项将群集部署为概念证明。Only use the Kubernetes Azure Stack Marketplace item to deploy clusters as a proof-of-concept. 有关 Azure Stack 上支持的 Kubernetes 群集,请使用AKS 引擎For supported Kubernetes clusters on Azure Stack, use the AKS engine.

可以按照本文中的步骤,通过单个协调的操作来部署和设置 Kubernetes 的资源。You can follow the steps in this article to deploy and set up the resources for Kubernetes in a single, coordinated operation. 步骤使用 Azure 资源管理器解决方案模板。The steps use an Azure Resource Manager solution template. 需要收集 Azure Stack 集线器安装所需的信息,生成模板,然后将其部署到云。You'll need to collect the required information about your Azure Stack Hub installation, generate the template, and then deploy to your cloud. Azure Stack 中心模板不使用在全球 Azure 中提供的相同的托管 AKS 服务。The Azure Stack Hub template doesn't use the same managed AKS service offered in global Azure.

Kubernetes 和容器Kubernetes and containers

你可以使用 Azure Stack 中心上的 AKS 引擎生成的 Azure 资源管理器模板来安装 Kubernetes。You can install Kubernetes using Azure Resource Manager templates generated by the AKS engine on Azure Stack Hub. Kubernetes是一个开源系统,用于自动部署、缩放和管理容器中的应用程序。Kubernetes is an open-source system for automating deployment, scaling, and managing of applications in containers. 容器在映像中。A container is in an image. 容器映像类似于虚拟机(VM),但与 VM 不同,容器只包含运行应用程序所需的资源,例如代码、运行时、特定的库和设置。The container image is similar to a virtual machine (VM), however, unlike a VM, the container just includes the resources it needs to run an application, such as the code, runtime to execute the code, specific libraries, and settings.

你可以使用 Kubernetes 来执行以下操作:You can use Kubernetes to:

  • 开发可以大规模伸缩、升级并可快速部署的应用程序。Develop massively scalable, upgradable, applications that can be deployed in seconds.
  • 简化应用程序的设计,并通过不同的 Helm 应用程序提高其可靠性。Simplify the design of your application and improve its reliability by different Helm applications. Helm 是一种开放源打包工具,有助于安装和管理 Kubernetes 应用程序的生命周期。Helm is an open-source packaging tool that helps you install and manage the lifecycle of Kubernetes applications.
  • 轻松监视和诊断应用程序的运行状况。Easily monitor and diagnose the health of your applications.

只需对支持群集的节点所需的计算使用情况收费。You'll only be charged for the compute usage required by the nodes supporting your cluster. 有关详细信息,请参阅Azure Stack 中心中的使用情况和计费For more information, see Usage and billing in Azure Stack Hub.

部署 Kubernetes 以使用容器Deploy Kubernetes to use containers

在 Azure Stack 集线器上部署 Kubernetes 群集的步骤将取决于你的标识管理服务。The steps to deploy a Kubernetes cluster on Azure Stack Hub will depend on your identity management service. 验证 Azure Stack 集线器的安装所使用的标识管理解决方案。Verify the identity management solution used by your installation of Azure Stack Hub. 请与 Azure Stack 中心管理员联系,以验证身份管理服务。Contact your Azure Stack Hub administrator to verify your identity management service.

连接到群集Connect to your cluster

你现在已准备好连接到群集。You're now ready to connect to your cluster. 可在群集资源组中找到 master,并将其命名为 k8s-master-<sequence-of-numbers>The master can be found in your cluster resource group, and is named k8s-master-<sequence-of-numbers>. 使用 SSH 客户端连接到主节点。Use an SSH client to connect to the master. 在主节点上,可以使用kubectl(Kubernetes 命令行客户端)来管理群集。On the master, you can use kubectl, the Kubernetes command-line client to manage your cluster. 有关说明,请参阅Kubernetes.ioFor instructions, see Kubernetes.io.

你还可以找到Helm程序包管理器,用于将应用程序安装和部署到群集。You may also find the Helm package manager useful for installing and deploying apps to your cluster. 有关在群集上安装和使用 Helm 的说明,请参阅helm.shFor instructions on installing and using Helm with your cluster, see helm.sh.

后续步骤Next steps

启用 Kubernetes 仪表板Enable the Kubernetes Dashboard

将 Kubernetes 添加到 Marketplace (适用于 Azure Stack 中心操作员)Add a Kubernetes to the Marketplace (for the Azure Stack Hub operator)

使用 Azure Active Directory (Azure AD)将 Kubernetes 部署到 Azure Stack 集线器Deploy Kubernetes to Azure Stack Hub using Azure Active Directory (Azure AD)

使用 Active Directory 联合服务(AD FS)将 Kubernetes 部署到 Azure Stack 中心Deploy Kubernetes to Azure Stack Hub using Active Directory Federated Services (AD FS)

Azure 上的 KubernetesKubernetes on Azure