1 - Namespace

Namespace 为名字提供作用域。

apiVersion: v1

import "k8s.io/api/core/v1"

Namespace

Namespace 为名字提供作用域。使用多个命名空间是可选的。


NamespaceSpec

NamespaceSpec 用于描述 Namespace 的属性。


NamespaceStatus

NamespaceStatus 表示 Namespace 的当前状态信息。


  • conditions ([]NamespaceCondition)

    补丁策略:基于 type 健合并

    表示命名空间当前状态的最新可用状况。

    NamespaceCondition 包含命名空间状态的详细信息。

    • conditions.status (string),必需

      状况(condition)的状态,取值为 True、False 或 Unknown 之一。

    • conditions.type (string), 必需

    命名空间控制器状况的类型。

    • conditions.lastTransitionTime (Time)

      **Time 是对 time.Time 的封装。Time 支持对 YAML 和 JSON 进行正确封包。为 time 包的许多函数方法提供了封装器。**
      
    • conditions.message (string)

    • conditions.reason (string)

  • phase (string)

    phase 是命名空间的当前生命周期阶段。更多信息: https://kubernetes.io/docs/tasks/administer-cluster/namespaces/

NamespaceList

NamespaceList 是一个命名空间列表。


操作


get 读取指定的 Namespace

HTTP 请求

GET /api/v1/namespaces/{name}

参数

  • name (路径参数):string,必需

    Namespace 的名称

  • pretty (查询参数):string

    pretty

响应

200 (Namespace):OK

401:Unauthorized

get 读取指定 Namespace 的状态

HTTP 请求

GET /api/v1/namespaces/{name}/status

参数

  • name (路径参数):string,必需

    Namespace 的名称

  • pretty (查询参数):string

    pretty

响应

200 (Namespace):OK

401:Unauthorized

list 列出或者检查类别为 Namespace 的对象

HTTP 请求

GET /api/v1/namespaces

参数

  • continue (查询参数):string

    continue

  • limit (查询参数):integer

    limit

  • pretty (查询参数):string

    pretty

  • watch (查询参数):boolean

    watch

响应

200 (NamespaceList):OK

401:Unauthorized

create 创建一个 Namespace

HTTP 请求

POST /api/v1/namespaces

参数

  • dryRun (查询参数):string

    dryRun

  • pretty (查询参数):string

    pretty

响应

200 (Namespace):OK

201 (Namespace):Created

202 (Namespace):Accepted

401:Unauthorized

update 替换指定的 Namespace

HTTP 请求

PUT /api/v1/namespaces/{name}

参数

  • name (路径参数):string,必需

    Namespace 的名称

  • body: Namespace, 必需

  • dryRun (查询参数):string

    dryRun

  • pretty (查询参数):string

    pretty

响应

200 (Namespace):OK

201 (Namespace):Created

401:Unauthorized

update 替换指定 Namespace 的终结器

HTTP 请求

PUT /api/v1/namespaces/{name}/finalize

参数

  • name (路径参数):string,必需

    Namespace 的名称

  • body: Namespace,必需

  • dryRun (查询参数):string

    dryRun

  • pretty (查询参数):string

    pretty

响应

200 (Namespace):OK

201 (Namespace):Created

401:Unauthorized

update 替换指定 Namespace 的状态

HTTP 请求

PUT /api/v1/namespaces/{name}/status

参数

  • name (路径阐述):string,必需

    Namespace 的名称

  • body: Namespace,必需

  • dryRun (查询参数):string

    dryRun

  • pretty (查询参数):string

    pretty

响应

200 (Namespace):OK

201 (Namespace):Created

401: Unauthorized

patch 部分更新指定的 Namespace

HTTP 请求

PATCH /api/v1/namespaces/{name}

参数

  • name (路径参数):string,必需

    Namespace 的名称

  • dryRun (查询参数):string

    dryRun

  • force (查询参数):boolean

    force

  • pretty (查询参数): string

    pretty

响应

200 (Namespace):OK

201 (Namespace):Created

401: Unauthorized

patch 部分更新指定 Namespace 的状态

HTTP 请求

PATCH /api/v1/namespaces/{name}/status

参数

  • name (路径参数):string,必需

    Namespace 的名称

  • dryRun (查询参数):string

    dryRun

  • force (查询参数): boolean

    force

  • pretty (查询参数):string

    pretty

响应

200 (Namespace):OK

201 (Namespace):Created

401:Unauthorized

delete 删除一个 Namespace

HTTP 请求

DELETE /api/v1/namespaces/{name}

参数

  • name (路径参数):string,必需

    Namespace 的名称

  • body: DeleteOptions

  • dryRun (查询参数):string

    dryRun

  • pretty (查询参数):string

    pretty

响应

200 (Status):OK

202 (Status):Accepted

401:Unauthorized

2 - APIService

APIService 是用来表示一个特定的 GroupVersion 的服务器

apiVersion: apiregistration.k8s.io/v1

import "k8s.io/kube-aggregator/pkg/apis/apiregistration/v1"

APIService

APIService 是用来表示一个特定的 GroupVersion 的服务器。名称必须为 "version.group"。


APIServiceSpec

APIServiceSpec 包含用于定位和与服务器通信的信息。仅支持 HTTPS 协议,但是你可以禁用证书验证。


  • groupPriorityMinimum (int32), 必需

    groupPriorityMininum 是这个组至少应该具有的优先级。优先级高表示客户端优先选择该组。 请注意,该组的其他版本可能会指定更高的 groupPriorityMininum 值,使得整个组获得更高的优先级。 主排序基于 groupPriorityMinimum 值,从高到低排序(20 在 10 之前)。 次要排序基于对象名称的字母顺序(v1.bar 在 v1.foo 之前)。 我们建议这样配置:*.k8s.io(扩展除外)值设置为 18000,PaaS(OpenShift、Deis)建议值为 2000 左右。

  • versionPriority (int32), 必需

    versionPriority 控制该 API 版本在其组中的排序,必须大于零。主排序基于 versionPriority, 从高到低排序(20 在 10 之前)。因为在同一个组里,这个数字可以很小,可能是几十。 在版本优先级相等的情况下,版本字符串将被用来计算组内的顺序。如果版本字符串是与 Kubernetes 的版本号形式类似, 则它将排序在 Kubernetes 形式版本字符串之前。Kubernetes 的版本号字符串按字典顺序排列。 Kubernetes 版本号以 “v” 字符开头,后面是一个数字(主版本),然后是可选字符串 “alpha” 或 “beta” 和另一个数字(次要版本)。 它们首先按 GA > beta > alpha 排序(其中 GA 是没有 beta 或 alpha 等后缀的版本),然后比较主要版本, 最后是比较次要版本。版本排序列表示例:v10、v2、v1、v11beta2、v10beta3、v3beta1、v12alpha1、v11alpha2、foo1、foo10。

  • caBundle ([]byte)

    原子性:将在合并期间被替换

    caBundle 是一个 PEM 编码的 CA 包,用于验证 API 服务器的服务证书。如果未指定, 则使用 API 服务器上的系统根证书。

  • group (string)

    group 是此服务器主机的 API 组名称。

  • insecureSkipTLSVerify (boolean)

    insecureSkipTLSVerify 代表在与此服务器通信时禁用 TLS 证书验证。强烈建议不要这样做。你应该使用 caBundle。

  • service (ServiceReference)

    service 是对该 API 服务器的服务的引用。它只能在端口 443 上通信。如果 service 是 nil, 则意味着 API groupversion 的处理是在当前服务器上本地处理的。服务调用被直接委托给正常的处理程序链来完成。

    ServiceReference 保存对 Service.legacy.k8s.io 的一个引用。

    • service.name (string)

      name 是服务的名称
      
    • service.namespace (string)

      namespace 是服务的命名空间
      
    • service.port (int32)

      如果指定,则为托管 Webhook 的服务上的端口。为实现向后兼容,默认端口号为 443。
      

      port 应该是一个有效的端口号(1-65535,包含)。

  • version (string)

    version 是此服务器的 API 版本。例如:“v1”。

APIServiceStatus

APIServiceStatus 包含有关 API 服务器的派生信息


  • conditions ([]APIServiceCondition)

    补丁策略:基于键 type 合并

    Map:合并时将保留 type 键的唯一值

    APIService 的当前服务状态。

    APIServiceCondition 描述 APIService 在特定点的状态

    • conditions.status (string), 必需

      status 表示状况(Condition)的状态,取值为 True、False 或 Unknown 之一。
      
    • conditions.type (string), 必需

      type 是状况的类型。
      
    • conditions.lastTransitionTime (Time)

      上一次发生状况状态转换的时间。
      

      Time 是对 time.Time 的封装。Time 支持对 YAML 和 JSON 进行正确封包。为 time 包的许多函数方法提供了封装器。
      
    • conditions.message (string)

      指示上次转换的详细可读信息。  
      
    • conditions.reason (string)

      表述状况上次转换原因的、驼峰格式命名的、唯一的一个词。
      

APIServiceList

APIServiceList 是 APIService 对象的列表。


Operations


get 读取指定的 APIService

HTTP 请求

GET /apis/apiregistration.k8s.io/v1/apiservices/{name}

参数

  • name路径参数):string,必需

    APIService 名称

  • pretty查询参数):string

    pretty

响应

200 (APIService): OK

401: Unauthorized

get 读取指定 APIService 的状态

HTTP 请求

GET /apis/apiregistration.k8s.io/v1/apiservices/{name}/status

参数

  • name路径参数):string,必需

    APIService 名称

  • pretty查询参数):string

    pretty

响应

200 (APIService): OK

401: Unauthorized

list 列出或观察 APIService 类的对象

HTTP 请求

GET /apis/apiregistration.k8s.io/v1/apiservices

参数

响应

200 (APIServiceList): OK

401: Unauthorized

create 创建一个 APIService

HTTP 请求

POST /apis/apiregistration.k8s.io/v1/apiservices

参数

响应

200 (APIService): OK

201 (APIService): Created

202 (APIService): Accepted

401: Unauthorized

update 替换指定的 APIService

HTTP 请求

PUT /apis/apiregistration.k8s.io/v1/apiservices/{name}

参数

  • name 路径参数):string, 必需

    APIService 名称

  • bodyAPIService必需

  • dryRun 查询参数):string

    dryRun

  • fieldManager 查询参数):string

    fieldManager

  • fieldValidation 查询参数):string

    fieldValidation

  • pretty 查询参数):string

    pretty

响应

200 (APIService): OK

201 (APIService): Created

401: Unauthorized

update 替换指定 APIService 的 status

HTTP 请求

PUT /apis/apiregistration.k8s.io/v1/apiservices/{name}/status

参数

  • name路径参数):string, 必需

    APIService 名称

  • bodyAPIService必需

  • dryRun 查询参数):string

    dryRun

  • fieldManager 查询参数):string

    fieldManager

  • fieldValidation 查询参数):string

    fieldValidation

  • pretty 查询参数):string

    pretty

响应

200 (APIService): OK

201 (APIService): Created

401: Unauthorized

patch 部分更新指定的 APIService

HTTP 请求

PATCH /apis/apiregistration.k8s.io/v1/apiservices/{name}

参数

  • name路径参数):string, 必需

    APIService 名称

  • bodyPatch必需

  • dryRun 查询参数):string

    dryRun

  • fieldManager 查询参数):string

    fieldManager

  • fieldValidation 查询参数):string

    fieldValidation

  • force 查询参数):boolean

    force

  • pretty 查询参数):string

    pretty

响应

200 (APIService): OK

201 (APIService): Created

401: Unauthorized

patch 部分更新指定 APIService 的 status

HTTP 请求

PATCH /apis/apiregistration.k8s.io/v1/apiservices/{name}/status

参数

  • name路径参数):string, 必需

    APIService 名称

  • bodyPatch必需

  • dryRun 查询参数):string

    dryRun

  • fieldManager 查询参数):string

    fieldManager

  • fieldValidation 查询参数):string

    fieldValidation

  • force 查询参数):boolean

    force

  • pretty 查询参数):string

    pretty

响应

200 (APIService): OK

201 (APIService): Created

401: Unauthorized

delete 删除一个 APIService

HTTP 请求

DELETE /apis/apiregistration.k8s.io/v1/apiservices/{name}

参数

响应

200 (Status): OK

202 (Status): Accepted

401: Unauthorized

deletecollection 删除 APIService 集合

HTTP 请求

DELETE /apis/apiregistration.k8s.io/v1/apiservices

参数

响应

200 (Status): OK

401: Unauthorized

3 - Lease

Lease defines a lease concept.

apiVersion: coordination.k8s.io/v1

import "k8s.io/api/coordination/v1"

Lease

Lease 定义了租约的概念。


  • apiVersion: coordination.k8s.io/v1

  • kind: Lease

  • metadata (ObjectMeta)

更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata

Lease 规范。更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status

LeaseSpec

LeaseSpec 是一个 Lease 的规范。


  • acquireTime (MicroTime)

    acquireTime 是当前租约被获取的时间。

    MicroTime 是微秒级精确时间的版本。

  • holderIdentity (string)

    holderIdentity 包含当前租约持有人的身份。

  • leaseDurationSeconds (int32)

    leaseDurationSeconds 是租约候选人需要等待强制获取租约的持续时间。这是相对于上次观察到的更新时间的度量。

  • leaseTransitions (int32)

    LeasetTransitions 是租约持有人之间的转换次数。

  • renewTime (MicroTime)

    renewTime 是当前租约持有人上次更新租约的时间。

    MicroTime 是具有微秒级精度的时间版本。

LeaseList

LeaseList 是 Lease 对象的列表。


  • apiVersion: coordination.k8s.io/v1

  • kind: LeaseList

  • metadata (ListMeta)

标准列表元数据。更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata

  • items ([]Lease), required

Items 是架构对象的列表。

操作


get 读取指定的租赁

HTTP 请求

GET /apis/coordination.k8s.io/v1/namespaces/{namespace}/leases/{name}

参数

  • name (路径参数): string, 必需

    Lease 名称

  • namespace (路径参数): string, 必需

    namespace

  • pretty (查询参数): string

    pretty

响应

200 (Lease): OK

401: Unauthorized

list 列出或监视 Lease 类对象

HTTP 请求

GET /apis/coordination.k8s.io/v1/namespaces/{namespace}/leases

参数

响应

200 (LeaseList): OK

401: Unauthorized

list 列出或监视 Lease 类对象

HTTP 请求

GET /apis/coordination.k8s.io/v1/leases

参数

响应

200 (LeaseList): OK

401: Unauthorized

create 创建 Lease

HTTP 请求

POST /apis/coordination.k8s.io/v1/namespaces/{namespace}/leases

参数

响应

200 (Lease): OK

201 (Lease): Created

202 (Lease): Accepted

401: Unauthorized

update 替换指定的 Lease

HTTP 请求

PUT /apis/coordination.k8s.io/v1/namespaces/{namespace}/leases/{name}

参数

  • name (路径参数): string, 必需

    租贷名称

  • namespace (路径参数): string, 必需

    namespace

  • body: Lease, 必需

  • dryRun (查询参数): string

    dryRun

  • fieldManager (查询参数): string

    fieldManager

  • fieldValidation (查询参数): string

    fieldValidation

  • pretty (查询参数): string

    pretty

响应

200 (Lease): OK

201 (Lease): Created

401: Unauthorized

patch 部分更新指定的 Lease

HTTP 请求

PATCH /apis/coordination.k8s.io/v1/namespaces/{namespace}/leases/{name}

参数

  • name (路径参数): string, 必需

    租贷名称

  • namespace (路径参数): string, 必需

    namespace

  • body: Patch, 必需

  • dryRun (查询参数): string

    dryRun

  • fieldManager (查询参数): string

    fieldManager

  • fieldValidation (查询参数): string

    fieldValidation

  • force (查询参数): boolean

    force

  • pretty (查询参数): string

    pretty

响应

200 (Lease): OK

201 (Lease): Created

401: Unauthorized

delete 删除一个 Lease

HTTP 请求

DELETE /apis/coordination.k8s.io/v1/namespaces/{namespace}/leases/{name}

参数

响应

200 (Status): OK

202 (Status): Accepted

401: Unauthorized

deletecollection 删除 Lease 收款

HTTP 请求

DELETE /apis/coordination.k8s.io/v1/namespaces/{namespace}/leases

参数

响应

200 (Status): OK

401: Unauthorized

4 - RuntimeClass

RuntimeClass 定义集群中支持的容器运行时类。

apiVersion: node.k8s.io/v1

import "k8s.io/api/node/v1"

RuntimeClass

RuntimeClass 定义集群中支持的容器运行时类。 RuntimeClass 用于确定哪个容器运行时用于运行某 Pod 中的所有容器。 RuntimeClass 由用户或集群制备程序手动定义,并在 PodSpec 中引用。 Kubelet 负责在运行 Pod 之前解析 RuntimeClassName 引用。 有关更多详细信息,请参阅 https://kubernetes.io/zh-cn/docs/concepts/containers/runtime-class/


  • apiVersion: node.k8s.io/v1

  • kind: RuntimeClass

  • metadata (ObjectMeta)

    更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata

  • handler (string),必需

    handler 指定底层运行时和配置,在 CRI 实现过程中将使用这些运行时和配置来处理这个类的 Pod。 可能的值特定于节点和 CRI 配置。 假定所有 handler 可用于每个节点上,且同一名称的 handler 在所有节点上是等效的。 例如,一个名为 “runc” 的 handler 可能指定 runc OCI 运行时将(使用原生 Linux 容器) 用于运行 Pod 中的容器。该 handler 必须采用小写,遵从 DNS Label (RFC 1123) 要求,且是不可变更的。

  • scheduling (Scheduling)

    scheduling 包含调度约束,这些约束用来确保以这个 RuntimeClass 运行的 Pod 被调度到支持此运行时类的节点。 如果 scheduling 设为空,则假定所有节点支持此 RuntimeClass。

    Scheduling 指定支持 RuntimeClass 的节点的调度约束。

    • scheduling.nodeSelector (map[string]string)

      nodeSelector 列出支持此 RuntimeClass 的节点上必须存在的标签。 使用此 RuntimeClass 的 Pod 只能调度到与这个选择算符匹配的节点上。 RuntimeClass nodeSelector 与 Pod 现有的 nodeSelector 合并。 任何冲突均会使得该 Pod 在准入时被拒绝。

    • scheduling.tolerations ([]Toleration)

      原子性:将在合并期间被替换

      tolerations 在准入期间追加到以此 RuntimeClass 运行的 Pod(不包括重复项)上, 本质上是求取 Pod 和 RuntimeClass 所容忍的节点并集。

      附加此容忍度的 Pod 将容忍用匹配运算符 operator 运算后与三元组 <key,value,effect> 匹配的任何污点。

      • scheduling.tolerations.key (string)

        key 是容忍度所应用到的污点键。空意味着匹配所有污点键。 如果键为空,则运算符必须为 Exists;这个组合意味着匹配所有值和所有键。

      • scheduling.tolerations.operator (string)

        operator 表示一个键与值的关系。有效的运算符为 Exists 和 Equal。默认为 Equal。 Exists 等价于将值设置为通配符的情况,因此一个 Pod 可以容忍特定类别的所有污点。

      • scheduling.tolerations.value (string)

        value 是容忍度匹配到的污点值。如果运算符为 Exists,则值应为空,否则就是一个普通字符串。

      • scheduling.tolerations.effect (string)

        effect 表示匹配度污点效果。空意味着匹配所有污点效果。 当指定值时,允许的值为 NoSchedule、PreferNoSchedule 或 NoExecute。

      • scheduling.tolerations.tolerationSeconds (int64)

        tolerationSeconds 表示容忍度容忍污点的时间段(必须是 NoExecute 的效果,否则忽略此字段)。 默认情况下,不设置此字段,这意味着永远容忍污点(不驱逐)。零和负值将被系统视为 0(立即驱逐)。

RuntimeClassList

RuntimeClassList 是 RuntimeClass 对象的列表。


  • apiVersion: node.k8s.io/v1

  • kind: RuntimeClassList

操作


get 读取指定的 RuntimeClass

HTTP 请求

GET /apis/node.k8s.io/v1/runtimeclasses/{name}

参数
  • name (路径参数): string,必需

    RuntimeClass 的名称

  • pretty (查询参数): string

    pretty

响应

200 (RuntimeClass): OK

401: Unauthorized

list 列出或监视 RuntimeClass 类别的对象

HTTP 请求

GET /apis/node.k8s.io/v1/runtimeclasses

参数

响应

200 (RuntimeClassList): OK

401: Unauthorized

create 创建 RuntimeClass

HTTP 请求

POST /apis/node.k8s.io/v1/runtimeclasses

参数

响应

200 (RuntimeClass): OK

201 (RuntimeClass): Created

202 (RuntimeClass): Accepted

401: Unauthorized

update 替换指定的 RuntimeClass

HTTP 请求

PUT /apis/node.k8s.io/v1/runtimeclasses/{name}

参数
  • name (路径参数): string,必需

    RuntimeClass 的名称

  • body: RuntimeClass,必需

  • dryRun (查询参数): string

    dryRun

  • fieldManager (查询参数): string

    fieldManager

  • fieldValidation (查询参数): string

    fieldValidation

  • pretty (查询参数): string

    pretty

响应

200 (RuntimeClass): OK

201 (RuntimeClass): Created

401: Unauthorized

patch 部分更新指定的 RuntimeClass

HTTP 请求

PATCH /apis/node.k8s.io/v1/runtimeclasses/{name}

参数
  • name (路径参数): string,必需

    RuntimeClass 的名称

  • body: Patch,必需

  • dryRun (查询参数): string

    dryRun

  • fieldManager (查询参数): string

    fieldManager

  • fieldValidation (查询参数): string

    fieldValidation

  • force (查询参数): boolean

    force

  • pretty (查询参数): string

    pretty

响应

200 (RuntimeClass): OK

201 (RuntimeClass): Created

401: Unauthorized

delete 删除 RuntimeClass

HTTP 请求

DELETE /apis/node.k8s.io/v1/runtimeclasses/{name}

参数

响应

200 (Status): OK

202 (Status): Accepted

401: Unauthorized

deletecollection 删除 RuntimeClass 的集合

HTTP 请求

DELETE /apis/node.k8s.io/v1/runtimeclasses

参数

响应

200 (Status): OK

401: Unauthorized

5 - FlowSchema v1beta2

FlowSchema 定义一组流的模式。

apiVersion: flowcontrol.apiserver.k8s.io/v1beta2

import "k8s.io/api/flowcontrol/v1beta2"

FlowSchema

FlowSchema 定义一组流的模式。请注意,一个流由属性类似的一组入站 API 请求组成, 用一对字符串进行标识:FlowSchema 的名称和一个 “流区分项”。


  • apiVersion: flowcontrol.apiserver.k8s.io/v1beta2

  • kind: FlowSchema

FlowSchemaSpec

FlowSchemaSpec 描述 FlowSchema 的规约看起来是怎样的。


  • priorityLevelConfiguration (PriorityLevelConfigurationReference),必需

    priorityLevelConfiguration 应引用集群中的 PriorityLevelConfiguration。 如果此应用无法被解析,则忽略此 FlowSchema,并在其状态中将其标记为无效。必需。

    PriorityLevelConfigurationReference 包含指向正被使用的 “request-priority” 的信息。

    • priorityLevelConfiguration.name (string),必需

      name 是正被引用的优先级配置的名称。必需。

  • distinguisherMethod (FlowDistinguisherMethod)

    distinguisherMethod 定义如何为匹配此模式的请求来计算流区分项。 nil 表示该区分项被禁用,且因此将始终为空字符串。

    FlowDistinguisherMethod 指定流区分项的方法。

    • distinguisherMethod.type (string),必需

      type 是流区分项的类型。支持的类型为 “ByUser” 和 “ByNamespace”。必需。

  • matchingPrecedence (int32)

    matchingPrecedence 用于选择与给定请求匹配的一个 FlowSchema。 选中的 FlowSchema 是某个 MatchingPrecedence 数值最小(我们视其为逻辑上最大)的 FlowSchema。 每个 MatchingPrecedence 值必须在 [1,10000] 的范围内。 请注意,如果未指定优先顺序,则其默认设为 1000。

  • rules ([]PolicyRulesWithSubjects)

    原子性:将在合并期间被替换

    rules 描述哪些请求将与这个流模式匹配。只有当至少一条规则与请求匹配时, 才视为此 FlowSchema 与该请求匹配。如果字段值为空表,则 FlowSchema 不会与任何请求匹配。

    PolicyRulesWithSubjects 给出针对 API 服务器请求的一个测试。 该测试将检查发出请求的主体、所请求的动作和要操作的资源。 只有同时满足以下两个条件时,才表示此 PolicyRulesWithSubjects 与请求匹配: (a) 至少一个主体成员与请求匹配且 (b) 至少 resourceRules 或 nonResourceRules 的一个成员与请求匹配。

    • rules.subjects ([]Subject),必需

      原子性:将在合并期间被替换

      subjects 是此规则相关的普通用户、服务账号或组的列表。在这个列表中必须至少有一个成员。 同时包含 system:authenticated 和 system:unauthenticated 用户组的列表会与每个请求匹配。 此字段为必需。

      Subject 用来与匹配请求的发起方,请求的发起方由请求身份认证系统识别出来。 有三种方式来匹配一个发起方:按用户、按组或按服务账号。

      • rules.subjects.kind (string),必需

        kind 标示其他字段中的哪个字段必须非空。必需。

      • rules.subjects.group (GroupSubject)

        group 根据用户组名称进行匹配。

        GroupSubject 保存组类别主体的详细信息。

      • rules.subjects.serviceAccount (ServiceAccountSubject)

        serviceAccount 与 ServiceAccount 对象进行匹配。

        ServiceAccountSubject 保存服务账号类别主体的详细信息。

        • rules.subjects.serviceAccount.name (string),必需

          name 是要匹配的 ServiceAccount 对象的名称,可使用 * 匹配所有名称。必需。

        • rules.subjects.serviceAccount.namespace (string),必需

          namespace 是要匹配的 ServiceAccount 对象的名字空间。必需。

      • rules.subjects.user (UserSubject)

        user 根据用户名进行匹配。

        UserSubject 保存用户类别主体的详细信息。

        • rules.subjects.user.name (string),必需

          name 是要匹配的用户名,可使用 * 匹配所有用户名。必需。

    • rules.nonResourceRules ([]NonResourcePolicyRule)

      原子性:将在合并期间被替换

      nonResourceRules 是由 NonResourcePolicyRule 对象构成的列表, 根据请求的动作和目标非资源 URL 来识别匹配的请求。

      NonResourcePolicyRule 是根据请求的动作和目标非资源 URL 来匹配非资源请求的一种规则。 只有满足以下两个条件时,NonResourcePolicyRule 才会匹配一个请求: (a) 至少 verbs 的一个成员与请求匹配且 (b) 至少 nonResourceURLs 的一个成员与请求匹配。

      • rules.nonResourceRules.nonResourceURLs ([]string),必需

        集合:合并期间保留唯一值

        nonResourceURLs 是用户有权访问的一组 URL 前缀,不可以为空。 此字段为必需设置的字段。例如:

        • "/healthz" 是合法的
        • "/hea*" 是不合法的
        • "/hea" 是合法的但不会与任何项匹配
        • "/hea/*" 也不会与任何项匹配
        • "/healthz/*" 与所有组件自身的的健康检查路径匹配。 * 与所有非资源 URL 匹配。如果存在此字符,则必须是唯一的输入项。 必需。
      • rules.nonResourceRules.verbs ([]string),必需

        集合:在合并期间保留唯一值

        verbs 是与动作匹配的列表,不可以为空。* 与所有动作匹配。 如果存在此字符,则必须是唯一的输入项。必需。

    • rules.resourceRules ([]ResourcePolicyRule)

      原子性:将在合并期间被替换

      resourceRules 是 ResourcePolicyRule 对象的列表,根据请求的动作和目标资源识别匹配的请求。 resourceRulesnonResourceRules 两者必须至少有一个非空。

      ResourcePolicyRule 是用来匹配资源请求的规则,对请求的动作和目标资源进行测试。 只有满足以下条件时,ResourcePolicyRule 才会与某个资源请求匹配: (a) 至少 verbs 的一个成员与请求的动作匹配, (b) 至少 apiGroups 的一个成员与请求的 API 组匹配, (c) 至少 resources 的一个成员与请求的资源匹配, (d) 要么 (d1) 请求未指定一个名字空间(即,namespace=="")且 clusterScope 为 true, 要么 (d2) 请求指定了一个名字空间,且至少 namespaces 的一个成员与请求的名字空间匹配。

      • rules.resourceRules.apiGroups ([]string),必需

        集合:合并期间保留唯一值

        apiGroups 是与 API 组匹配的列表,不可以为空。* 表示与所有 API 组匹配。 如果存在此字符,则其必须是唯一的条目。必需。

      • rules.resourceRules.resources ([]string),必需

        集合:合并期间保留唯一值

        resources 是匹配的资源(即小写和复数)的列表,如果需要的话,还可以包括子资源。 例如 [ "services", "nodes/status" ]。此列表不可以为空。 * 表示与所有资源匹配。如果存在此字符,则必须是唯一的条目。必需。

      • rules.resourceRules.verbs ([]string),必需

        集合:合并期间保留唯一值

        verbs 是匹配的动作的列表,不可以为空。* 表示与所有动作匹配。 如果存在此字符,则必须是唯一的条目。必需。

      • rules.resourceRules.clusterScope (boolean)

        clusterScope 表示是否与未指定名字空间 (出现这种情况的原因是该资源没有名字空间或请求目标面向所有名字空间)的请求匹配。 如果此字段被省略或为 false,则 namespaces 字段必须包含一个非空的列表。

      • rules.resourceRules.namespaces ([]string)

        集合:合并期间保留唯一值

        namespaces 是限制匹配的目标的名字空间的列表。 指定一个目标名字空间的请求只会在以下某一个情况满足时进行匹配: (a) 此列表包含该目标名字空间或 (b) 此列表包含 *。 请注意,* 与所指定的任何名字空间匹配,但不会与未指定 名字空间的请求匹配 (请参阅 clusterScope 字段)。此列表可以为空,但前提是 clusterScope 为 true。

FlowSchemaStatus

FlowSchemaStatus 表示 FlowSchema 的当前状态。


  • conditions ([]FlowSchemaCondition)

    Map:合并期间保留根据键 type 保留其唯一值

    conditions 是 FlowSchema 当前状况的列表。

    FlowSchemaCondition 描述 FlowSchema 的状况。

    • conditions.lastTransitionTime (Time)

      lastTransitionTime 是状况上一次从一个状态转换为另一个状态的时间。

      Time 是对 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/v1beta2

  • kind: FlowSchemaList

操作


get 读取指定的 FlowSchema

HTTP 请求

GET /apis/flowcontrol.apiserver.k8s.io/v1beta2/flowschemas/{name}

参数

  • name (路径参数): string,必需

    FlowSchema 的名称

  • pretty (查询参数): string

    pretty

响应

200 (FlowSchema): OK

401: Unauthorized

get 读取指定 FlowSchema 的状态

HTTP 请求

GET /apis/flowcontrol.apiserver.k8s.io/v1beta2/flowschemas/{name}/status

参数

  • name (路径参数): string,必需

    FlowSchema 的名称

  • pretty (查询参数): string

    pretty

响应

200 (FlowSchema): OK

401: Unauthorized

list 列出或监视 FlowSchema 类别的对象

HTTP 请求

GET /apis/flowcontrol.apiserver.k8s.io/v1beta2/flowschemas

参数

响应

200 (FlowSchemaList): OK

401: Unauthorized

create 创建 FlowSchema

HTTP 请求

POST /apis/flowcontrol.apiserver.k8s.io/v1beta2/flowschemas

参数

响应

200 (FlowSchema): OK

201 (FlowSchema): Created

202 (FlowSchema): Accepted

401: Unauthorized

update 替换指定的 FlowSchema

HTTP 请求

PUT /apis/flowcontrol.apiserver.k8s.io/v1beta2/flowschemas/{name}

参数

  • name (路径参数): string,必需

    FlowSchema 的名称

  • body: FlowSchema,必需

  • dryRun (查询参数): string

    dryRun

  • fieldManager (查询参数): string

    fieldManager

  • fieldValidation (查询参数): string

    fieldValidation

  • pretty (查询参数): string

    pretty

响应

200 (FlowSchema): OK

201 (FlowSchema): Created

401: Unauthorized

update 替换指定的 FlowSchema 的状态

HTTP 请求

PUT /apis/flowcontrol.apiserver.k8s.io/v1beta2/flowschemas/{name}/status

参数

  • name (路径参数): string,必需

    FlowSchema 的名称

  • body: FlowSchema,必需

  • dryRun (查询参数): string

    dryRun

  • fieldManager (查询参数): string

    fieldManager

  • fieldValidation (查询参数): string

    fieldValidation

  • pretty (查询参数): string

    pretty

响应

200 (FlowSchema): OK

201 (FlowSchema): Created

401: Unauthorized

patch 部分更新指定的 FlowSchema

HTTP 请求

PATCH /apis/flowcontrol.apiserver.k8s.io/v1beta2/flowschemas/{name}

参数

  • name (路径参数): string,必需

    FlowSchema 的名称

  • body: Patch,必需

  • dryRun (查询参数): string

    dryRun

  • fieldManager (查询参数): string

    fieldManager

  • fieldValidation (查询参数): string

    fieldValidation

  • force (查询参数): boolean

    force

  • pretty (查询参数): string

    pretty

响应

200 (FlowSchema): OK

201 (FlowSchema): Created

401: Unauthorized

patch 部分更新指定的 FlowSchema 的状态

HTTP 请求

PATCH /apis/flowcontrol.apiserver.k8s.io/v1beta2/flowschemas/{name}/status

参数

  • name (路径参数): string,必需

    FlowSchema 的名称

  • body: Patch,必需

  • dryRun (查询参数): string

    dryRun

  • fieldManager (查询参数): string

    fieldManager

  • fieldValidation (查询参数): string

    fieldValidation

  • force (查询参数): boolean

    force

  • pretty (查询参数): string

    pretty

响应

200 (FlowSchema): OK

201 (FlowSchema): Created

401: Unauthorized

delete 删除 FlowSchema

HTTP 请求

DELETE /apis/flowcontrol.apiserver.k8s.io/v1beta2/flowschemas/{name}

参数

响应

200 (Status): OK

202 (Status): Accepted

401: Unauthorized

deletecollection 删除 FlowSchema 的集合

HTTP 请求

DELETE /apis/flowcontrol.apiserver.k8s.io/v1beta2/flowschemas

参数

响应

200 (Status): OK

401: Unauthorized

6 - PriorityLevelConfiguration v1beta2

PriorityLevelConfiguration 表示一个优先级的配置。

apiVersion: flowcontrol.apiserver.k8s.io/v1beta2

import "k8s.io/api/flowcontrol/v1beta2"

PriorityLevelConfiguration

PriorityLevelConfiguration 表示一个优先级的配置。


  • apiVersion: flowcontrol.apiserver.k8s.io/v1beta2

  • kind: PriorityLevelConfiguration

PriorityLevelConfigurationSpec

PriorityLevelConfigurationSpec 指定一个优先级的配置。


  • type (string),必需

    type 指示此优先级是否遵从有关请求执行的限制。 取值为 "Exempt" 意味着此优先级的请求不遵从某个限制(且因此从不排队)且不会减损其他优先级可用的容量。 取值为 "Limited" 意味着 (a) 此优先级的请求遵从这些限制且 (b) 服务器某些受限的容量仅可用于此优先级。必需。

  • limited (LimitedPriorityLevelConfiguration)

    limited 指定如何为某个受限的优先级处理请求。 当且仅当 type"Limited" 时,此字段必须为非空。

    LimitedPriorityLevelConfiguration 指定如何处理需要被限制的请求。它解决两个问题:

    • 如何限制此优先级的请求?
    • 应如何处理超出此限制的请求?
    • limited.assuredConcurrencyShares (int32)

      assuredConcurrencyShares (ACS) 配置执行限制,这是在给定时间可以执行的、此优先级的请求数量的限制。 ACS 必须是一个正数。服务器的并发限制(SCL)数量按其保证的并发份额划分到并发能力受限的各个优先级中。 这一计算会为所有这种优先级分别生成其确定的并发值(ACV),即一次可以执行的请求数量:

      ACV(l) = ceil( SCL * ACS(l) / ( sum[priority levels k] ACS(k) ) )
      

      较大的 ACS 值意味着(以影响所有其他优先级为代价)保留更多的并发请求。此字段的默认值为 30。

    • limited.limitResponse (LimitResponse)

      limitResponse 指示如何处理当前无法立即执行的请求。

      LimitResponse 定义如何处理当前无法立即执行的请求。

      • limited.limitResponse.type (string),必需

        type 是 “Queue” 或 “Reject”。此字段必须设置。 “Queue” 意味着在到达时无法被执行的请求可以被放到队列中,直到它们被执行或者队列长度超出限制为止。 “Reject” 意味着到达时无法执行的请求将被拒绝。

      • limited.limitResponse.queuing (QueuingConfiguration)

        queuing 包含排队所用的配置参数。只有 type"Queue" 时,此字段才可以为非空。

        QueuingConfiguration 保存排队所用的配置参数。

        • limited.limitResponse.queuing.handSize (int32)

          handSize 是一个小的正数,用于配置如何将请求随机分片到队列中。 当以该优先级将请求排队时,将对请求的流标识符(字符串对)进行哈希计算, 该哈希值用于打乱队列队列的列表,并处理此处指定的一批请求。 请求被放入这一批次中最短的队列中。 handSize 不得大于 queues,并且应该明显更小(以便几个大的流量不会使大多数队列饱和)。 有关设置此字段的更多详细指导,请参阅面向用户的文档。此字段的默认值为 8。

        • limited.limitResponse.queuing.queueLengthLimit (int32)

          queueLengthLimit 是任意时刻允许在此优先级的给定队列中等待的请求数上限; 额外的请求将被拒绝。 此值必须是正数。如果未指定,则默认为 50。

        • limited.limitResponse.queuing.queues (int32)

          queues 是这个优先级的队列数。此队列在每个 API 服务器上独立存在。此值必须是正数。 将其设置为 1 相当于禁止了混洗分片操作,进而使得对相关流模式的区分方法不再有意义。 此字段的默认值为 64。

PriorityLevelConfigurationStatus

PriorityLevelConfigurationStatus 表示 “请求优先级” 的当前状况。


  • conditions ([]PriorityLevelConfigurationCondition)

    Map:合并期间保留根据键 type 保留其唯一值

    conditions 是 “请求优先级” 的当前状况。

    PriorityLevelConfigurationCondition 定义优先级的状况。

    • conditions.lastTransitionTime (Time)

      lastTransitionTime 是状况上次从一个状态转换为另一个状态的时间。

      Time 是对 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 表示状况的类型,必需。

PriorityLevelConfigurationList

PriorityLevelConfigurationList 是 PriorityLevelConfiguration 对象的列表。


  • apiVersion: flowcontrol.apiserver.k8s.io/v1beta2

  • kind: PriorityLevelConfigurationList

操作


get 读取指定的 PriorityLevelConfiguration

HTTP 请求

GET /apis/flowcontrol.apiserver.k8s.io/v1beta2/prioritylevelconfigurations/{name}

参数

  • name (路径参数): string,必需

    PriorityLevelConfiguration 的名称

  • pretty (查询参数): string

    pretty

响应

200 (PriorityLevelConfiguration): OK

401: Unauthorized

get 读取指定的 PriorityLevelConfiguration 的状态

HTTP 请求

GET /apis/flowcontrol.apiserver.k8s.io/v1beta2/prioritylevelconfigurations/{name}/status

参数

  • name (路径参数): string,必需

    PriorityLevelConfiguration 的名称

  • pretty (查询参数): string

    pretty

响应

200 (PriorityLevelConfiguration): OK

401: Unauthorized

list 列出或监视 PriorityLevelConfiguration 类别的对象

HTTP 请求

GET /apis/flowcontrol.apiserver.k8s.io/v1beta2/prioritylevelconfigurations

参数

响应

200 (PriorityLevelConfigurationList): OK

401: Unauthorized

create 创建 PriorityLevelConfiguration

HTTP 请求

POST /apis/flowcontrol.apiserver.k8s.io/v1beta2/prioritylevelconfigurations

参数

响应

200 (PriorityLevelConfiguration): OK

201 (PriorityLevelConfiguration): Created

202 (PriorityLevelConfiguration): Accepted

401: Unauthorized

update 替换指定的 PriorityLevelConfiguration

HTTP 请求

PUT /apis/flowcontrol.apiserver.k8s.io/v1beta2/prioritylevelconfigurations/{name}

参数

响应

200 (PriorityLevelConfiguration): OK

201 (PriorityLevelConfiguration): Created

401: Unauthorized

update 替换指定的 PriorityLevelConfiguration 的状态

HTTP 请求

PUT /apis/flowcontrol.apiserver.k8s.io/v1beta2/prioritylevelconfigurations/{name}/status

参数

响应

200 (PriorityLevelConfiguration): OK

201 (PriorityLevelConfiguration): Created

401: Unauthorized

patch 部分更新指定的 PriorityLevelConfiguration

HTTP 请求

PATCH /apis/flowcontrol.apiserver.k8s.io/v1beta2/prioritylevelconfigurations/{name}

参数

  • name (路径参数): string,必需

    PriorityLevelConfiguration 的名称

  • body: Patch,必需

  • dryRun (查询参数): string

    dryRun

  • fieldManager (查询参数): string

    fieldManager

  • fieldValidation (查询参数): string

    fieldValidation

  • force (查询参数): boolean

    force

  • pretty (查询参数): string

    pretty

响应

200 (PriorityLevelConfiguration): OK

201 (PriorityLevelConfiguration): Created

401: Unauthorized

patch 部分更新指定的 PriorityLevelConfiguration 的状态

HTTP 请求

PATCH /apis/flowcontrol.apiserver.k8s.io/v1beta2/prioritylevelconfigurations/{name}/status

参数

  • name (路径参数): string,必需

    PriorityLevelConfiguration 的名称

  • body: Patch,必需

  • dryRun (查询参数): string

    dryRun

  • fieldManager (查询参数): string

    fieldManager

  • fieldValidation (查询参数): string

    fieldValidation

  • force (查询参数): boolean

    force

  • pretty (查询参数): string

    pretty

响应

200 (PriorityLevelConfiguration): OK

201 (PriorityLevelConfiguration): Created

401: Unauthorized

delete 删除 PriorityLevelConfiguration

HTTP 请求

DELETE /apis/flowcontrol.apiserver.k8s.io/v1beta2/prioritylevelconfigurations/{name}

参数

响应

200 (Status): OK

202 (Status): Accepted

401: Unauthorized

deletecollection 删除 PriorityLevelConfiguration 的集合

HTTP 请求

DELETE /apis/flowcontrol.apiserver.k8s.io/v1beta2/prioritylevelconfigurations

参数

响应

200 (Status): OK

401: Unauthorized

7 - Binding

Binding 将一个对象与另一个对象联系起来; 例如,一个 Pod 被调度程序绑定到一个节点。

apiVersion: v1

import "k8s.io/api/core/v1"

Binding

Binding 将一个对象与另一个对象联系起来; 例如,一个 Pod 被调度程序绑定到一个节点。 已在 1.7 版本弃用,请使用 Pod 的 binding 子资源。


  • apiVersion: v1

  • kind: Binding

  • metadata (ObjectMeta)

标准对象的元数据, 更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata

  • target (ObjectReference), 必需

    要绑定到标准对象的目标对象。

操作


create 创建一个 Binding

HTTP 请求

POST /api/v1/namespaces/{namespace}/bindings

参数

响应

200 (Binding): OK

201 (Binding): Created

202 (Binding): Accepted

401: Unauthorized

create 创建 Pod 的绑定

HTTP 请求

POST /api/v1/namespaces/{namespace}/pods/{name}/binding

参数

  • name (路径参数): string, 必需

    Binding 的名称

  • namespace (路径参数): string, 必需

    namespace

  • body: Binding, 必需

响应

200 (Binding): OK

201 (Binding): Created

202 (Binding): Accepted

401: Unauthorized

8 - ComponentStatus

ComponentStatus(和 ComponentStatusList)保存集群检验信息。

apiVersion: v1

import "k8s.io/api/core/v1"

ComponentStatus

ComponentStatus(和 ComponentStatusList)保存集群检验信息。 已废弃:该 API 在 v1.19 及更高版本中废弃。


  • apiVersion: v1

  • kind: ComponentStatus

  • metadata (ObjectMeta)

    标准的对象元数据。更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata

  • conditions ([]ComponentCondition)

    补丁策略:基于键 type 合并

    观测到的组件状况的列表。

    组件状况相关信息。

    • conditions.status (string),必需

      组件状况的状态。“Healthy” 的有效值为:“True”、“False” 或 “Unknown”。

    • conditions.type (string),必需

    组件状况的类型。有效值:“Healthy”

    • conditions.error (string)

      组件状况的错误码。例如,一个健康检查错误码。

    • conditions.message (string)

      组件状况相关消息。例如,有关健康检查的信息。

ComponentStatusList

作为 ComponentStatus 对象列表,所有组件状况的状态。 已废弃:该 API 在 v1.19 及更高版本中废弃。


  • apiVersion: v1

  • kind: ComponentStatusList

操作


get 读取指定的 ComponentStatus

HTTP 请求

GET /api/v1/componentstatuses/{name}

参数

  • name (路径参数): string,必需

    ComponentStatus 的名称

  • pretty (查询参数): string

    pretty

响应

200 (ComponentStatus): OK

401: Unauthorized

list 列出 ComponentStatus 类别的对象

HTTP 请求

GET /api/v1/componentstatuses

参数

响应

200 (ComponentStatusList): OK

401: Unauthorized