您现在访问的是微软AZURE全球版技术文档网站,若需要访问由世纪互联运营的MICROSOFT AZURE中国区技术文档网站,请访问 https://docs.azure.cn.

AKS 企业级可伸缩性AKS enterprise-scale scalability

AKS 可以根据基础结构需求进行扩展和缩小, (需要更多或更少的容量) ,添加具有 GPU 等特殊功能的节点池,在这种情况下,你有多种因素,如并发连接的数量和速率、请求数和 AKS 应用程序的后端延迟。AKS can be scaled-in and out depending upon infrastructure needs (requiring more or less capacity), adding node pools with special capabilities like GPU, or application needs, in this case you have several factors like number and rate of concurrent connections, number of requests, back-end latencies on AKS applications.

AKS 最常见的可伸缩性选项是群集自动缩放程序 (自动添加/删除基于 CPU 和内存使用率的节点) 或应用程序的 HPA (横向 pod 自动缩放程序) ,以便基于 CPU 和内存使用率以及更高级的指标进行扩展或缩减。The most common scalability options for AKS are the cluster autoscaler (automatically adding/removing nodes based on CPU and memory utilization) or the HPA (horizontal pod autoscaler) for your applications to scale in and out based on CPU and memory utilization as well as more advanced metrics.

设计注意事项Design considerations

下面是要考虑的一些重要因素:Here are some crucial factors to consider:

  • 是否可以快速实现应用程序 (无时间等待) ?Is rapid scalability a requirement for your application (no-time-to-wait)?

    • 若要快速预配 pod,请使用虚拟节点,它们仅支持 Linux 节点/pod。To have a quick provisioning of pods use virtual nodes, they are only supported with Linux nodes/pods.
  • 工作负荷是否不区分时间,能否处理中断?Is the workload non-time sensitive and can handle interruptions? 考虑使用 点 vmConsider the use of Spot VMs

  • 底层基础结构 (网络插件、IP 范围、订阅限制、配额等) 是否能够向外扩展?Is the underlying infrastructure (network plug-in, IP ranges, subscription limits, quotas, and so on) capable to scale out?

  • 考虑自动缩放Consider to automate scalability

    • 可以启用群集自动缩放来缩放节点数。You can enable cluster autoscaling to scale the number of nodes. 考虑 群集自动缩放扩展到零Consider cluster autoscaling and scale-to-zero
    • 横向 pod 自动缩放程序自动缩放 pod 数。Horizontal pod autoscaler automatically scales the number of pods.
  • 考虑受到和节点池的可伸缩性Consider scalability with multizone and node pools

    • 创建节点池时,请考虑将可用性区域设置为 AKSWhen creating node pools consider to set Availability Zones with AKS.
    • 请考虑使用多个节点池来支持具有不同要求的应用程序。Consider to use multiple node pools to support applications with different requirements.
    • 通过群集自动缩放程序缩放节点池。Scale node pools with cluster autoscaler.
    • 可以扩展到零个用户节点池。You can scale to zero the user node pools. 请参阅 限制See the limitations.

设计建议Design recommendations

遵循设计的最佳实践:Follow these best practices for your design:

  • 使用虚拟机规模集,其中包括自动缩放、多节点池和 Windows 节点池支持。Use virtual machine scale sets, which are required for scenarios including autoscaling, multiple node pools, and Windows node pool support.
    • 不要在 Azure 门户或使用 Azure CLI 中手动启用或编辑可伸缩性的设置。Don't manually enable or edit settings for scalability in the Azure portal or using the Azure CLI.
  • 如果需要快速突发流量自动缩放,请选择使用 Azure 容器实例和 虚拟节点 从 AKS 群集突发,以实现快速、无限的可伸缩性和每秒计费。If you need fast burst autoscaling choose to burst from AKS cluster using Azure Container Instances and virtual nodes for rapid and infinite scalability and per-second billing.
  • 使用基于 VM 的工作节点可预测的可伸缩性,使用 群集自动缩放程序扩展到零Use cluster autoscaler and scale-to-zero for predictable scalability using VM-based worker nodes.
  • 启用 群集自动缩放程序 以满足应用程序需求。Enable cluster autoscaler to meet application demands.
  • 启用 横向 pod 自动缩放程序 (HPA) 以降低应用程序的繁忙时间。Enable horizontal pod autoscaler (HPA) to mitigate the busy hours of your application.
    • 所有容器和盒都必须定义资源请求和限制。All your containers and pods must have resource requests and limits defined.
    • HPA 基于观察到的资源限制 CPU/内存或自定义指标自动缩放箱的数目。HPA automatically scales the number of pods based on observed resource limits CPU/memory or custom metrics.
  • 容器 和实时监视启用 Azure Monitor 以监视群集和工作负载利用率。Enable Azure Monitor for containers and live monitoring to monitor the cluster and workload utilization.
  • 当应用程序具有不同的资源要求时,请使用多个节点池。Use multiple node pools when your applications have different resource requirements.
  • 考虑将 基于 VM 的节点池 用于可处理中断和逐出的不区分时间的工作负荷。Consider Spot VM-based node pools for non-time-sensitive workloads that can handle interruptions and evictions.