【问题标题】:How to create namespace with specific node pool如何创建具有特定节点池的命名空间
【发布时间】:2021-08-08 14:13:06
【问题描述】:
我们正在尝试创建具有特定节点池的命名空间。如何在 Azure Kubernetes 上实现?
error: Unable to create namespace with specific node pool.
Ex: namespace for user nodepool1
【问题讨论】:
标签:
kubernetes
kubectl
azure-aks
【解决方案1】:
将此作为社区 wiki 发布,随时编辑和扩展。
正如 cmets 中提到的Luca Ghersi,可以将命名空间分配给特定节点。对于这个问题,有一个准入控制器PodNodeSelector(你可以在kubernetes official documentation上阅读)。
简而言之:
这个准入控制器默认并限制节点选择器可以
通过读取命名空间注解和
全局配置。
基于Azure FAQ,Azure AKS 默认启用此准入控制器。
AKS supports the following admission controllers:
- NamespaceLifecycle
- LimitRanger
- ServiceAccount
- DefaultStorageClass
- DefaultTolerationSeconds
- MutatingAdmissionWebhook
- ValidatingAdmissionWebhook
- ResourceQuota
- PodNodeSelector
- PodTolerationRestriction
- ExtendedResourceToleration
Currently, you can't modify the list of admission controllers in AKS.