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 项目的其他地方进行。