我有一个带有节点池的 kubernetes 集群,作为混沌工程计划的一部分,我需要重新启动虚拟机。是否有使用 azure 资源图的相同代码?
最佳答案
当 AKS 节点是规模集时。然后,您需要找到要重启的节点资源组、规模集名称和实例 ID。然后重启实例。以下是 CLI 命令:
# get the AKS node resource group name
az aks show -g groupName -n aksName --query nodeResourceGroup
# get the scale set info and all the instance id
az vmss list -g nodeGroupName --query [].name
az vmss list-instances -g nodeGroupName -n vmssName -o table
# restart the instance with the instance Id
az vmss restart -g nodeGroupName -n vmssName --instance-ids n
如果您在 Azure 门户中执行此操作,步骤相同,但更容易实现。
关于python - 重启 AKS 节点池中规模集中的 VM,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64688989/