如何使用特定节点池创建命名空间

时间:2021-05-19 10:28:17

标签: kubernetes kubectl azure-aks

我们正在尝试使用特定节点池创建命名空间。如何在 Azure Kubernetes 上实现这一目标?

error: Unable to create namespace with specific node pool.
Ex: namespace for user nodepool1

1 个答案:

答案 0 :(得分:1)

将此作为社区维基发布,请随意编辑和扩展。

正如注释中提到的 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.