FlowSchema
apiVersion: flowcontrol.apiserver.k8s.io/v1
import "k8s.io/api/flowcontrol/v1"
FlowSchema
FlowSchema 定義了一組流量的模式。請注意,一個流量由一組具有相似屬性的入站 API 請求組成,並由一對字串標識:FlowSchema 的名稱和一個“流量區分器”。
apiVersion: flowcontrol.apiserver.k8s.io/v1
kind: FlowSchema
metadata (ObjectMeta)
metadata
是標準的資源元資料。更多資訊: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadataspec (FlowSchemaSpec)
spec
是 FlowSchema 的期望行為的規範。更多資訊: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-statusstatus (FlowSchemaStatus)
status
是 FlowSchema 的當前狀態。更多資訊: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
FlowSchemaSpec
FlowSchemaSpec 描述了 FlowSchema 的規範外觀。
distinguisherMethod (FlowDistinguisherMethod)
distinguisherMethod
定義瞭如何計算匹配此模式的請求的流量區分器。nil
表示停用區分器,因此它將始終是空字串。FlowDistinguisherMethod 指定了流量區分器的方法。
distinguisherMethod.type (string), required
type
是流量區分器方法的型別。支援的型別是“ByUser”和“ByNamespace”。必需。
matchingPrecedence (int32)
matchingPrecedence
用於在匹配給定請求的 FlowSchemas 之間進行選擇。選擇的 FlowSchema 是那些具有數值上最低(我們認為邏輯上最高)的 MatchingPrecedence 的 FlowSchemas 之一。每個 MatchingPrecedence 值必須在 [1,10000] 範圍內。請注意,如果未指定優先順序,則預設為 1000。priorityLevelConfiguration (PriorityLevelConfigurationReference), required
priorityLevelConfiguration
應引用叢集中的 PriorityLevelConfiguration。如果引用無法解析,則 FlowSchema 將被忽略並在其狀態中標記為無效。必需。PriorityLevelConfigurationReference 包含指向正在使用的“請求優先順序”的資訊。
priorityLevelConfiguration.name (string), required
name
是被引用的優先順序級別配置的名稱。必需。
rules ([]PolicyRulesWithSubjects)
原子性:在合併期間將被替換
rules
描述了哪些請求將匹配此流模式。僅當 rules 的至少一個成員匹配請求時,此 FlowSchema 才匹配請求。如果它是空切片,則沒有請求匹配 FlowSchema。PolicyRulesWithSubjects 規定了一個應用於向 apiserver 發出的請求的測試。測試考慮了發起請求的主體、請求的動詞以及要操作的資源。此 PolicyRulesWithSubjects 匹配請求的條件是 (a) subjects 的至少一個成員匹配請求,並且 (b) resourceRules 或 nonResourceRules 的至少一個成員匹配請求。
rules.subjects ([]Subject), required
原子性:在合併期間將被替換
subjects 是此規則關心的普通使用者、服務賬戶或組的列表。此切片中必須至少有一個成員。包含 system:authenticated 和 system:unauthenticated 使用者組的切片將匹配每個請求。必需。
Subject 匹配請求的發起者,該發起者由請求認證系統識別。有三種匹配發起者的方式:按使用者、組或服務賬戶。
rules.subjects.kind (string), required
kind
指示其他欄位中的哪個是非空的。必需。rules.subjects.group (GroupSubject)
group
根據使用者組名稱進行匹配。rules.subjects.group.name (string), required
name 是匹配的使用者組,或 "*" 表示匹配所有使用者組。有關一些知名組名,請參閱 https://github.com/kubernetes/apiserver/blob/master/pkg/authentication/user/user.go。必需。
rules.subjects.serviceAccount (ServiceAccountSubject)
serviceAccount
匹配 ServiceAccounts。ServiceAccountSubject 包含服務賬戶型別主體的詳細資訊。
rules.subjects.serviceAccount.name (string), required
name
是匹配的 ServiceAccount 物件的名稱,或者 "*" 表示不考慮名稱進行匹配。必需。rules.subjects.serviceAccount.namespace (string), required
namespace
是匹配的 ServiceAccount 物件的名稱空間。必需。
rules.subjects.user (UserSubject)
user
根據使用者名稱進行匹配。rules.subjects.user.name (string), required
name
是匹配的使用者名稱,或 "*" 表示匹配所有使用者名稱。必需。
rules.nonResourceRules ([]NonResourcePolicyRule)
原子性:在合併期間將被替換
nonResourceRules
是 NonResourcePolicyRule 的列表,用於根據動詞和目標非資源 URL 標識匹配的請求。NonResourcePolicyRule 是一個謂詞,用於根據動詞和目標非資源 URL 匹配非資源請求。NonResourcePolicyRule 匹配請求的條件是 (a) verbs 的至少一個成員匹配請求,並且 (b) nonResourceURLs 的至少一個成員匹配請求。
rules.nonResourceRules.nonResourceURLs ([]string), required
Set: 合併時將保留唯一值
nonResourceURLs
是使用者應有權訪問的 URL 字首的集合,不能為空。例如- "/healthz" 是合法的
- "/hea*" 是非法的
- "/hea" 是合法的,但匹配不到任何內容
- "/hea/*" 也匹配不到任何內容
- "/healthz/*" 匹配所有元件級別的健康檢查。 "*" 匹配所有非資源 URL。如果存在,它必須是唯一條目。必需。
rules.nonResourceRules.verbs ([]string), required
Set: 合併時將保留唯一值
verbs
是匹配的動詞列表,不能為空。 "*" 匹配所有動詞。如果存在,它必須是唯一條目。必需。
rules.resourceRules ([]ResourcePolicyRule)
原子性:在合併期間將被替換
resourceRules
是 ResourcePolicyRule 的切片,用於根據動詞和目標資源標識匹配的請求。resourceRules
和nonResourceRules
中至少有一個必須非空。ResourcePolicyRule 是一個謂詞,用於匹配某些資源請求,測試請求的動詞和目標資源。ResourcePolicyRule 匹配資源請求的條件是:(a) verbs 的至少一個成員匹配請求,(b) apiGroups 的至少一個成員匹配請求,(c) resources 的至少一個成員匹配請求,並且 (d) (d1) 請求不指定名稱空間(即,
Namespace==""
)且 clusterScope 為 true,或 (d2) 請求指定了名稱空間且 namespaces 的至少一個成員匹配請求的名稱空間。rules.resourceRules.apiGroups ([]string), required
Set: 合併時將保留唯一值
apiGroups
是匹配的 API 組列表,不能為空。 "*" 匹配所有 API 組,並且如果存在,則必須是唯一條目。必需。rules.resourceRules.resources ([]string), required
Set: 合併時將保留唯一值
resources
是匹配的資源列表(即,小寫和複數),如果需要,可以包含子資源。例如,["services", "nodes/status"]。此列表不能為空。 "*" 匹配所有資源,並且如果存在,則必須是唯一條目。必需。rules.resourceRules.verbs ([]string), required
Set: 合併時將保留唯一值
verbs
是匹配的動詞列表,不能為空。 "*" 匹配所有動詞,並且如果存在,則必須是唯一條目。必需。rules.resourceRules.clusterScope (boolean)
clusterScope
指示是否匹配未指定名稱空間的請求(這發生在資源不是名稱空間化的,或者請求針對所有名稱空間時)。如果省略此欄位或其值為 false,則namespaces
欄位必須包含一個非空列表。rules.resourceRules.namespaces ([]string)
Set: 合併時將保留唯一值
namespaces
是限制匹配的目標名稱空間列表。指定了目標名稱空間的請求僅在以下情況下匹配:(a) 此列表包含該目標名稱空間,或 (b) 此列表包含 "*"。請注意,"*" 匹配任何指定的名稱空間,但不匹配未指定名稱空間的請求(有關詳細資訊,請參閱clusterScope
欄位)。此列表可以為空,但僅當clusterScope
為 true 時。
FlowSchemaStatus
FlowSchemaStatus 代表 FlowSchema 的當前狀態。
conditions ([]FlowSchemaCondition)
補丁策略:按鍵
type
合併對映:合併時將保留鍵型別上的唯一值
conditions
是 FlowSchema 當前狀態的列表。FlowSchemaCondition 描述了 FlowSchema 的條件。
conditions.lastTransitionTime (Time)
lastTransitionTime
是條件從一種狀態轉變為另一種狀態的最後時間。Time 是 time.Time 的一個包裝器,支援正確地編組到 YAML 和 JSON。提供了 time 包提供的許多工廠方法的包裝器。
conditions.message (string)
message
是一個人類可讀的訊息,指示有關最後一次轉換的詳細資訊。conditions.reason (string)
reason
是條件最後一次轉換的獨特、駝峰式命名的單詞。conditions.status (string)
status
是條件的當前狀態。可以是 True、False、Unknown。必需。conditions.type (string)
type
是條件的型別。必需。
FlowSchemaList
FlowSchemaList 是 FlowSchema 物件的列表。
apiVersion: flowcontrol.apiserver.k8s.io/v1
kind: FlowSchemaList
metadata (ListMeta)
metadata
是標準的列表元資料。更多資訊: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadataitems ([]FlowSchema), required
items
是 FlowSchemas 的列表。
操作
get
讀取指定的 FlowSchema
HTTP 請求
GET /apis/flowcontrol.apiserver.k8s.io/v1/flowschemas/{name}
引數
name (在路徑中): string,必填
FlowSchema 的名稱
pretty (在查詢中): string
響應
200 (FlowSchema): 成功
401: 未授權
get
讀取指定的 FlowSchema 的狀態
HTTP 請求
GET /apis/flowcontrol.apiserver.k8s.io/v1/flowschemas/{name}/status
引數
name (在路徑中): string,必填
FlowSchema 的名稱
pretty (在查詢中): string
響應
200 (FlowSchema): 成功
401: 未授權
list
列出或觀察 FlowSchema 型別的物件
HTTP 請求
GET /apis/flowcontrol.apiserver.k8s.io/v1/flowschemas
引數
allowWatchBookmarks (在查詢中): boolean
continue (在查詢中): string
fieldSelector (在查詢中): string
labelSelector (在查詢中): string
limit (在查詢中): integer
pretty (在查詢中): string
resourceVersion (在查詢中): string
resourceVersionMatch (在查詢中): string
sendInitialEvents (在查詢中): boolean
timeoutSeconds (在查詢中): integer
watch (在查詢中): boolean
響應
200 (FlowSchemaList): 成功
401: 未授權
create
建立一個 FlowSchema
HTTP 請求
POST /apis/flowcontrol.apiserver.k8s.io/v1/flowschemas
引數
body: FlowSchema, required
dryRun (在查詢中): string
fieldManager (在查詢中): string
fieldValidation (在查詢中): string
pretty (在查詢中): string
響應
200 (FlowSchema): 成功
201 (FlowSchema): 已建立
202 (FlowSchema): 已接受
401: 未授權
update
替換指定的 FlowSchema
HTTP 請求
PUT /apis/flowcontrol.apiserver.k8s.io/v1/flowschemas/{name}
引數
name (在路徑中): string,必填
FlowSchema 的名稱
body: FlowSchema, required
dryRun (在查詢中): string
fieldManager (在查詢中): string
fieldValidation (在查詢中): string
pretty (在查詢中): string
響應
200 (FlowSchema): 成功
201 (FlowSchema): 已建立
401: 未授權
update
替換指定的 FlowSchema 的狀態
HTTP 請求
PUT /apis/flowcontrol.apiserver.k8s.io/v1/flowschemas/{name}/status
引數
name (在路徑中): string,必填
FlowSchema 的名稱
body: FlowSchema, required
dryRun (在查詢中): string
fieldManager (在查詢中): string
fieldValidation (在查詢中): string
pretty (在查詢中): string
響應
200 (FlowSchema): 成功
201 (FlowSchema): 已建立
401: 未授權
patch
部分更新指定的 FlowSchema
HTTP 請求
PATCH /apis/flowcontrol.apiserver.k8s.io/v1/flowschemas/{name}
引數
name (在路徑中): string,必填
FlowSchema 的名稱
body: Patch,必需
dryRun (在查詢中): string
fieldManager (在查詢中): string
fieldValidation (在查詢中): string
force (在查詢中): boolean
pretty (在查詢中): string
響應
200 (FlowSchema): 成功
201 (FlowSchema): 已建立
401: 未授權
patch
部分更新指定的 FlowSchema 的狀態
HTTP 請求
PATCH /apis/flowcontrol.apiserver.k8s.io/v1/flowschemas/{name}/status
引數
name (在路徑中): string,必填
FlowSchema 的名稱
body: Patch,必需
dryRun (在查詢中): string
fieldManager (在查詢中): string
fieldValidation (在查詢中): string
force (在查詢中): boolean
pretty (在查詢中): string
響應
200 (FlowSchema): 成功
201 (FlowSchema): 已建立
401: 未授權
delete
刪除一個 FlowSchema
HTTP 請求
DELETE /apis/flowcontrol.apiserver.k8s.io/v1/flowschemas/{name}
引數
name (在路徑中): string,必填
FlowSchema 的名稱
body: DeleteOptions
dryRun (在查詢中): string
gracePeriodSeconds (在查詢中): integer
ignoreStoreReadErrorWithClusterBreakingPotential (在查詢中): boolean
pretty (在查詢中): string
propagationPolicy (在查詢中): string
響應
200 (Status): OK
202 (Status): 已接受
401: 未授權
deletecollection
刪除 FlowSchema 的集合
HTTP 請求
DELETE /apis/flowcontrol.apiserver.k8s.io/v1/flowschemas
引數
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 專案的其他地方進行。