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

备注

仅使用 Kubernetes Azure Stack 市场项将部署群集作为概念证明。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 Hub 安装的必需信息,生成模板,然后再部署到云。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 Hub 模板不使用 Azure 中提供的同一托管 AKS 服务。The Azure Stack Hub template doesn't use the same managed AKS service offered in Azure.

Kubernetes 和容器Kubernetes and containers

可以使用由 Azure Stack Hub 上的 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 Hub 中的使用情况和计费For more information, see Usage and billing in Azure Stack Hub.

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

在 Azure Stack Hub 上部署 Kubernetes 群集的步骤将取决于标识管理服务。The steps to deploy a Kubernetes cluster on Azure Stack Hub will depend on your identity management service. 验证安装 Azure Stack Hub 时所使用的标识管理解决方案。Verify the identity management solution used by your installation of Azure Stack Hub. 请与 Azure Stack Hub 管理员联系,以验证标识管理服务。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 客户端连接到 master。Use an SSH client to connect to the master. 在 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(适用于 Azure Stack Hub 操作员)Add a Kubernetes to the Marketplace (for the Azure Stack Hub operator)

使用 Azure Active Directory (Azure AD) 将 Kubernetes 部署到 Azure Stack HubDeploy Kubernetes to Azure Stack Hub using Azure Active Directory (Azure AD)

使用 Active Directory 联合身份验证服务 (AD FS) 将 Kubernetes 部署到 Azure Stack HubDeploy Kubernetes to Azure Stack Hub using Active Directory Federated Services (AD FS)