apiVersion: authorization.k8s.io/v1
import "k8s.io/api/authorization/v1"
ResourceRule {#ResourceRule}
ResourceRule 是主体被允许对资源执行的操作列表。 该列表的顺序无关紧要,可能包含重复项,也可能不完整。
<hr>
<table> <thead><tr><th>字段</th><th>描述</th></tr></thead> <tbody> <tr> <td><code>apiGroups</code><br/><em>string array</em></td> <td>
<code>apiGroups</code> 是包含相关资源的 API 组名称。
如果指定了多个 API 组,则针对其中任一 API 组内所列资源发起的任何操作请求都将被允许。
其中,"*" 表示所有。
</td>
</tr>
<tr>
<td><code>resourceNames</code><br/><em>string array</em></td>
<td>
<code>resourceNames</code> 是一个可选的名称白名单,用于指定该规则适用的对象。
若该集合为空,则表示允许所有对象;"*" 表示所有对象。
</td>
</tr>
<tr>
<td><code>resources</code><br/><em>string array</em></td>
<td>
<code>resources</code> 是此规则适用的资源列表。
"*" 表示指定 <code>apiGroups</code> 中的所有资源。"*/foo" 表示指定
<code>apiGroups</code> 中所有资源的子资源 "foo"。
</td>
</tr>
<tr>
<td><code>verbs</code> <strong>*</strong><br/><em>string array</em></td>
<td>
<code>verbs</code> 是 Kubernetes 资源 API 动词的列表,例如:
<code>get</code>、<code>list</code>、<code>watch</code>、
<code>create</code>、<code>update</code>、<code>delete</code>、
<code>proxy</code>。其中 "*" 表示所有动词。
</td>
</tr>
</tbody> </table>
来源:Kubernetes 文档贡献者 · 作者与贡献记录 · CC BY 4.0。离线整理了版式、链接和媒体显示。
