角色
apiVersion: rbac.authorization.k8s.io/v1
import "k8s.io/api/rbac/v1"
角色
Role 是 PolicyRule 的一個名稱空間、邏輯分組,可以作為一個單元被 RoleBinding 引用。
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata (ObjectMeta)
標準物件的元資料。
rules ([]PolicyRule)
原子性:在合併期間將被替換
Rules 包含此 Role 的所有 PolicyRule。
PolicyRule 包含描述策略規則的資訊,但不包含該規則適用於誰或該規則適用於哪個名稱空間的資訊。
rules.apiGroups ([]string)
原子性:在合併期間將被替換
APIGroups 是包含資源的 APIGroup 的名稱。如果指定了多個 API 組,則允許對任何 API 組中的任何列舉資源發起的任何操作。“”(空字串)表示核心 API 組,而“*”表示所有 API 組。
rules.resources ([]string)
原子性:在合併期間將被替換
Resources 是此規則適用的資源列表。“*”表示所有資源。
rules.verbs ([]string), required
原子性:在合併期間將被替換
Verbs 是應用於此規則中包含的所有 ResourceKinds 的動詞列表。“*”表示所有動詞。
rules.resourceNames ([]string)
原子性:在合併期間將被替換
ResourceNames 是規則適用的可選名稱白名單。空集表示允許所有內容。
rules.nonResourceURLs ([]string)
原子性:在合併期間將被替換
NonResourceURLs 是一組使用者應有權訪問的部分 URL。允許使用 *,但只能作為路徑中的最後一個步驟。由於非資源 URL 不受名稱空間限制,因此此欄位僅適用於從 ClusterRoleBinding 引用的 ClusterRoles。規則可以應用於 API 資源(例如“pods”或“secrets”)或非資源 URL 路徑(例如“/api”),但不能同時應用於兩者。
RoleList
RoleList 是 Roles 的集合。
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleList
metadata (ListMeta)
標準物件的元資料。
items ([]Role), required
Items 是 Roles 的列表。
操作
get
讀取指定的 Role
HTTP 請求
GET /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}
引數
響應
200 (Role): OK
401: 未授權
list
列出或監視 Role 型別的物件
HTTP 請求
GET /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles
引數
namespace (在路徑中): string,必填
allowWatchBookmarks (在查詢中): boolean
continue (在查詢中): string
fieldSelector (在查詢中): string
labelSelector (在查詢中): string
limit (在查詢中): integer
pretty (在查詢中): string
resourceVersion (在查詢中): string
resourceVersionMatch (在查詢中): string
sendInitialEvents (在查詢中): boolean
timeoutSeconds (在查詢中): integer
watch (在查詢中): boolean
響應
200 (RoleList): OK
401: 未授權
list
列出或監視 Role 型別的物件
HTTP 請求
GET /apis/rbac.authorization.k8s.io/v1/roles
引數
allowWatchBookmarks (在查詢中): boolean
continue (在查詢中): string
fieldSelector (在查詢中): string
labelSelector (在查詢中): string
limit (在查詢中): integer
pretty (在查詢中): string
resourceVersion (在查詢中): string
resourceVersionMatch (在查詢中): string
sendInitialEvents (在查詢中): boolean
timeoutSeconds (在查詢中): integer
watch (在查詢中): boolean
響應
200 (RoleList): OK
401: 未授權
create
建立一個 Role
HTTP 請求
POST /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles
引數
namespace (在路徑中): string,必填
body: Role, required
dryRun (在查詢中): string
fieldManager (在查詢中): string
fieldValidation (在查詢中): string
pretty (在查詢中): string
響應
200 (Role): OK
201 (Role): Created
202 (Role): Accepted
401: 未授權
update
替換指定的 Role
HTTP 請求
PUT /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}
引數
name (在路徑中): string,必填
Role 的名稱
namespace (在路徑中): string,必填
body: Role, required
dryRun (在查詢中): string
fieldManager (在查詢中): string
fieldValidation (在查詢中): string
pretty (在查詢中): string
響應
200 (Role): OK
201 (Role): Created
401: 未授權
patch
部分更新指定的 Role
HTTP 請求
PATCH /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}
引數
name (在路徑中): string,必填
Role 的名稱
namespace (在路徑中): string,必填
body: Patch,必需
dryRun (在查詢中): string
fieldManager (在查詢中): string
fieldValidation (在查詢中): string
force (在查詢中): boolean
pretty (在查詢中): string
響應
200 (Role): OK
201 (Role): Created
401: 未授權
delete
刪除一個 Role
HTTP 請求
DELETE /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}
引數
name (在路徑中): string,必填
Role 的名稱
namespace (在路徑中): string,必填
body: DeleteOptions
dryRun (在查詢中): string
gracePeriodSeconds (在查詢中): integer
ignoreStoreReadErrorWithClusterBreakingPotential (在查詢中): boolean
pretty (在查詢中): string
propagationPolicy (在查詢中): string
響應
200 (Status): OK
202 (Status): 已接受
401: 未授權
deletecollection
刪除 Role 的集合
HTTP 請求
DELETE /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles
引數
namespace (在路徑中): string,必填
body: DeleteOptions
continue (在查詢中): string
dryRun (在查詢中): string
fieldSelector (在查詢中): string
gracePeriodSeconds (在查詢中): integer
ignoreStoreReadErrorWithClusterBreakingPotential (在查詢中): boolean
labelSelector (在查詢中): string
limit (在查詢中): integer
pretty (在查詢中): string
propagationPolicy (在查詢中): string
resourceVersion (在查詢中): string
resourceVersionMatch (在查詢中): string
sendInitialEvents (在查詢中): boolean
timeoutSeconds (在查詢中): integer
響應
200 (Status): OK
401: 未授權
本頁面是自動生成的。
如果你打算報告此頁面存在的問題,請在問題描述中提及此頁面是自動生成的。修復可能需要在 Kubernetes 專案的其他地方進行。