首页 > 解决方案 > az aks 节点池删除

问题描述

我使用该命令az aks nodepool delete -g $myresource --cluster-name $mycluster --name $mypool删除 aks 中的节点池,但该命令会终止任何正在运行的作业。我正在尝试优化 azure AKS 婴儿床,有时安排az aks nodepool delete.

有没有办法安排az aks nodepool delete一个节点池在作业完成后被删除?

标签: azureazure-aks

解决方案


我了解到您正在尝试删除正在为 GPU 创建虚拟机的 NodePool。

请注意,虽然删除 AgentPool 可能是一个可行的解决方案,但您应该查看 AKS 的新发布功能,该功能允许将用户模式 ​​NodePool 缩减到 0。

https://docs.microsoft.com/en-us/azure/aks/use-system-pools

使用此版本的 AKS:https ://github.com/Azure/AKS/releases/tag/2020-04-13

Features
AKS has now introduced a new Mode property for nodepools. This will allow you to set nodepools as System or User nodepools. System nodepools will have additional validations and will be preferred by system pods, while User pool will have more lax validations and can perform additional operations like scale to 0 nodes or be removed from the cluster. Each cluster needs at least one system pool. All details here: https://aka.ms/aks/nodepool/mode
System/User nodepools are available from core CLI version 2.3.1 or greater (or latest preview extension 0.4.43)

Nodepool mode requires API 2020-03-01 or greater

AKS now allows User nodepools to scale to 0.

这将允许您为 GPU 保留 VMSS,为节点池启用 AutoScaler,并将最小节点数设置为 0。

您的 GPU 节点将在需要时创建(需要 GPU 节点的 pod,应触发自动缩放器)


推荐阅读