我想添加节点选择器应该存在于pod中的策略。我让下面的代码不能解决这个问题,因为它不能得到想要的输出。
package kubernetes.admission
deny[reason] {
input.request.kind.kind == "Pod"
input.request.operation == "CREATE"
input.request.object.spec.nodeSelector
not count(input.request.object.spec.nodeSelector) > 0
reason := "pod with nodeselector not allowed at the specified location"发布于 2021-10-05 13:44:18
正如在OPA contrib issue中所讨论的,问题不在于您的策略,而在于有缺陷的输入数据。
https://stackoverflow.com/questions/69436271
复制相似问题