首页 > 解决方案 > 变异准入 webhook 静态命名空间选择器

问题描述

有谁知道是否有一种方法可以根据命名空间名称而不是标签选择器来定义静态选择器?原因是某些命名空间是由操作员创建的,而我对标签没有任何控制权。

谢谢埃西

标签: kuberneteswebhooks

解决方案


似乎没有,从未听说过,从未发现过这样的事情。

根据 MutatingWebhookConfiguration docs属性namespaceSelector的类型LabelSelector [meta/v1]支持

.matchExpressions
matchExpressions is a list of label selector requirements. The requirements are ANDed.

.matchLabels
matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed.

最后一切都依赖于标签

你肯定看到了这些例子


推荐阅读