想象一下有一个集群,上面运行着许多不同的部署。一些 pod 使用 PersistentVolumes(Azure 磁盘)。Azure 中有一个限制,可以将多少磁盘安装到 VM,这会导致调度错误,例如
Status=409 Code="OperationNotAllowed" Message="The maximum number of data disks allowed to be attached to a VM of this size is 8
豆荚留在
Waiting: Container creating
永久状态,但是在调度时,一些节点的带有附加磁盘的 pod 数量要少得多。最好限制每个节点带有附加磁盘的 pod 数量,这样这个错误就不会发生。我相信
podAntiAffinity
是我需要的,我知道我可以限制具有相同标签的 Pod 在同一节点上进行调度,但我不知道如何允许它,直到节点具有最大数量的带有磁盘的 Pod。
我的安装是AKS。
az acs create \
--orchestrator-type=kubernetes \
--orchestrator-version 1.7.9 \
--resource-group <resource_group_here> \
--name=<name_here> \
...