1 - Node

Node 是 Kubernetes 中的工作节点。

apiVersion: v1

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

Node

Node 是 Kubernetes 中的工作节点。 每个节点在缓存中(即在 etcd 中)都有一个唯一的标识符。


  • apiVersion: v1

  • kind: Node

NodeSpec

NodeSpec 描述了创建节点时使用的属性。


  • configSource (NodeConfigSource)

    已弃用:以前用于为 DynamicKubeletConfig 功能指定节点配置的来源。此功能已删除。

    NodeConfigSource 指定节点配置的来源。指定一个子字段(不包括元数据)必须为非空。此 API 自 1.22的版本起已被弃用

    • configSource.configMap (ConfigMapNodeConfigSource)

      configMap 是对 Node 的 ConfigMap 的引用。

      ConfigMapNodeConfigSource 包含引用某 ConfigMap 作为节点配置源的信息。 此 API 自 1.22 版本起已被弃用: https://git.k8s.io/enhancements/keps/sig-node/281-dynamic-kubelet-configuration

      • configSource.configMap.kubeletConfigKey (string), 必需

        kubeletConfigKey 声明所引用的 ConfigMap 的哪个键对应于 KubeletConfiguration 结构体, 该字段在所有情况下都是必需的。

      • configSource.configMap.name (string), 必需

        name 是被引用的 ConfigMap 的 metadata.name。 此字段在所有情况下都是必需的。

      • configSource.configMap.namespace (string), 必需

        namespace 是所引用的 ConfigMap 的 metadata.namespace。 此字段在所有情况下都是必需的。

      • configSource.configMap.resourceVersion (string)

        resourceVersion 是所引用的 ConfigMap 的 metadata.resourceVersion。 该字段在 Node.spec 中是禁止的,在 Node.status 中是必需的。

      • configSource.configMap.uid (string)

        uid 是所引用的 ConfigMap 的 metadata.uid。 该字段在 Node.spec 中是禁止的,在 Node.status 中是必需的。

  • externalID (string)

    已弃用。并非所有 kubelet 都会设置此字段。 1.13 的版本之后会删除该字段。参见: https://issues.k8s.io/61966

  • podCIDR (string)

    podCIDR 表示分配给节点的 Pod IP 范围。

  • podCIDRs ([]string)

    podCIDRs 表示分配给节点以供该节点上的 Pod 使用的 IP 范围。 如果指定了该字段,则第 0 个条目必须与 podCIDR 字段匹配。 对于 IPv4 和 IPv6,它最多可以包含 1 个值。

  • providerID (string)

    云提供商分配的节点ID,格式为:<ProviderName>://<ProviderSpecificNodeID>

  • taints ([]Taint)

    如果设置了,则为节点的污点。

    此污点附加到的节点对任何不容忍污点的 Pod 都有 “影响”。

    • taints.effect (string), 必需

      必需的。污点对不容忍污点的 Pod 的影响。合法的 effect 值有 NoSchedule、PreferNoSchedule 和 NoExecute。

    • taints.key (string), 必需

      必需的。被应用到节点上的污点的键。

    • taints.timeAdded (Time)

      timeAdded 表示添加污点的时间。它仅适用于 NoExecute 的污点。

      Time 是 time.Time 的包装器,它支持对 YAML 和 JSON 的正确编组。 time 包的许多工厂方法提供了包装器。

    • taints.value (string)

      与污点键对应的污点值。

  • unschedulable (boolean)

    unschedulable 控制新 Pod 的节点可调度性。 默认情况下,节点是可调度的。 更多信息: https://kubernetes.io/zh-cn/docs/concepts/architecture/nodes/#manual-node-administration

NodeStatus

NodeStatus 是有关节点当前状态的信息。


  • addresses ([]NodeAddress)

    补丁策略:根据 type 键执行合并操作

    节点可到达的地址列表。从云提供商处查询(如果有)。 更多信息: https://kubernetes.io/zh-cn/docs/concepts/architecture/nodes/#addresses

    注意:该字段声明为可合并,但合并键不够唯一,合并时可能导致数据损坏。 调用者应改为使用完全替换性质的补丁操作。 有关示例,请参见 https://pr.k8s.io/79391

    消费者应假设地址可以在节点的生命期内发生变化。 然而在一些例外情况下这是不可能的,例如在自身状态中继承 Node 地址的 Pod 或 downward API (status.hostIP) 的消费者。

    NodeAddress 包含节点地址的信息。

    • addresses.address (string), 必需

      节点地址。

    • addresses.type (string), 必需

      节点地址类型,Hostname、ExternalIP 或 InternalIP 之一。

  • allocatable (map[string]Quantity)

    allocatable 表示节点的可用于调度的资源。默认为容量。

  • capacity (map[string]Quantity)

    capacity 代表一个节点的总资源。 更多信息: https://kubernetes.io/zh-cn/docs/concepts/storage/persistent-volumes/#capacity

  • conditions ([]NodeCondition)

    补丁策略:根据 type 键执行合并操作

    conditions 是当前观测到的节点状况的数组。 更多信息: https://kubernetes.io/zh-cn/docs/concepts/architecture/nodes/#condition

    NodeCondition 包含节点状况的信息。

    • conditions.status (string), 必需

      状况的状态为 True、False、Unknown 之一。

    • conditions.type (string), 必需

      节点状况的类型。

    • conditions.lastHeartbeatTime (Time)

      给定状况最近一次更新的时间。

      Time 是 time.Time 的包装器,它支持对 YAML 和 JSON 的正确编组。 time 包的许多工厂方法提供了包装器。

    • conditions.lastTransitionTime (Time)

      状况最近一次从一种状态转换到另一种状态的时间。

      Time 是 time.Time 的包装器,它支持对 YAML 和 JSON 的正确编组。 time 包的许多工厂方法提供了包装器。

    • conditions.message (string)

      指示有关上次转换详细信息的人类可读消息。

    • conditions.reason (string)

      (简要)状况最后一次转换的原因。

  • config (NodeConfigStatus)

    通过动态 Kubelet 配置功能分配给节点的配置状态。

    NodeConfigStatus 描述了由 Node.spec.configSource 分配的配置的状态。

    • config.active (NodeConfigSource)

      active 报告节点正在使用的检查点配置。 active 将代表已分配配置的当前版本或当前 LastKnownGood 配置,具体取决于尝试使用已分配配置是否会导致错误。

      NodeConfigSource 指定节点配置的来源。指定一个子字段(不包括元数据)必须为非空。此 API 自 1.22 版本起已弃用

      • config.active.configMap (ConfigMapNodeConfigSource)

        configMap 是对 Node 的 ConfigMap 的引用。

        ConfigMapNodeConfigSource 包含引用某 ConfigMap 作为节点配置源的信息。 此 API 自 1.22 版本起已被弃用: https://git.k8s.io/enhancements/keps/sig-node/281-dynamic-kubelet-configuration

        • config.active.configMap.kubeletConfigKey (string), 必需

          kubeletConfigKey 声明所引用的 ConfigMap 的哪个键对应于 KubeletConfiguration 结构体, 该字段在所有情况下都是必需的。

        • config.active.configMap.name (string), 必需

          name 是所引用的 ConfigMap 的 metadata.name。 此字段在所有情况下都是必需的。

        • config.active.configMap.namespace (string), 必需

          namespace 是所引用的 ConfigMap 的 metadata.namespace。 此字段在所有情况下都是必需的。

        • config.active.configMap.resourceVersion (string)

          resourceVersion 是所引用的 ConfigMap 的 metadata.resourceVersion。 该字段在 Node.spec 中是禁止的,在 Node.status 中是必需的。

        • config.active.configMap.uid (string)

          uid 是所引用的 ConfigMap 的 metadata.uid。 该字段在 Node.spec 中是禁止的,在 Node.status 中是必需的。

    • config.assigned (NodeConfigSource)

      assigned 字段报告节点将尝试使用的检查点配置。 当 Node.spec.configSource 被更新时,节点将所关联的配置负载及指示预期配置的记录通过检查点操作加载到本地磁盘。 节点参考这条记录来选择它的配置检查点,并在 assigned 中报告这条记录。 仅在记录被保存到磁盘后才会更新 status 中的 assigned。 当 kubelet 重新启动时,它会尝试通过加载和验证由 assigned 标识的检查点有效负载来使 assigned 配置成为 active 配置。

      NodeConfigSource 指定节点配置的来源。指定一个子字段(不包括元数据)必须为非空。此 API 自 1.22 版本起已弃用

      • config.assigned.configMap (ConfigMapNodeConfigSource)

        configMap 是对 Node 的 ConfigMap 的引用。

        ConfigMapNodeConfigSource 包含引用某 ConfigMap 为节点配置源的信息。 此 API 自 1.22 版本起已被弃用: https://git.k8s.io/enhancements/keps/sig-node/281-dynamic-kubelet-configuration

        • config.assigned.configMap.kubeletConfigKey (string), 必需

          kubeletConfigKey 声明所引用的 ConfigMap 的哪个键对应于 KubeletConfiguration 结构体, 该字段在所有情况下都是必需的。

        • config.assigned.configMap.name (string), 必需

          name 是所引用的 ConfigMap 的 metadata.name。 此字段在所有情况下都是必需的。

        • config.assigned.configMap.namespace (string), 必需

          namespace 是所引用的 ConfigMap 的 metadata.namespace。 此字段在所有情况下都是必需的。

        • config.assigned.configMap.resourceVersion (string)

          resourceVersion 是所引用的 ConfigMap 的 metadata.resourceVersion。 该字段在 Node.spec 中是禁止的,在 Node.status 中是必需的。

        • config.assigned.configMap.uid (string)

          uid 是所引用的 ConfigMap 的 metadata.uid。 该字段在 Node.spec 中是禁止的,在 Node.status 中是必需的。

    • config.error (string)

      error 描述了在 spec.configSource 与活动配置间协调时发生的所有问题。 可能会发生的情况,例如,尝试将 spec.configSource 通过检查点操作复制到到本地 assigned 记录时, 尝试对与 spec.configSource 关联的有效负载执行检查点操作,尝试加​​载或验证 assigned 的配置时。 同步配置时可能会在不同位置发生错误,较早的错误(例如下载或检查点错误)不会导致回滚到 LastKnownGood, 并且可能会在 Kubelet 重试后解决。 后期发生的错误(例如加载或验证检查点配置)将导致回滚到 LastKnownGood。 在后一种情况下,通常可以通过修复 spec.sonfigSource 中 assigned 配置来解决错误。 你可以通过在 Kubelet 日志中搜索错误消息来找到更多的调试信息。 error 是错误状态的人类可读描述;机器可以检查 error 是否为空,但不应依赖跨 Kubelet 版本的 error 文本的稳定性。

    • config.lastKnownGood (NodeConfigSource)

      lastKnownGood 报告节点在尝试使用 assigned 配置时遇到错误时将回退到的检查点配置。 当节点确定 assigned 配置稳定且正确时,assigned 配置会成为 lastKnownGood 配置。 这当前实施为从更新分配配置的本地记录开始的 10 分钟浸泡期。 如果在此期间结束时分配的配置依旧处于活动状态,则它将成为 lastKnownGood。 请注意,如果 spec.configSource 重置为 nil(使用本地默认值), LastKnownGood 也会立即重置为 nil,因为始终假定本地默认配置是好的。 你不应该对节点确定配置稳定性和正确性的方法做出假设,因为这可能会在将来发生变化或变得可配置。

      NodeConfigSource 指定节点配置的来源。指定一个子字段(不包括元数据)必须为非空。此 API 自 1.22 版本起已弃用

      • config.lastKnownGood.configMap (ConfigMapNodeConfigSource)

        configMap 是对 Node 的 ConfigMap 的引用。

        ConfigMapNodeConfigSource 包含引用某 ConfigMap 作为节点配置源的信息。 此 API 自 1.22 版本起已被弃用: https://git.k8s.io/enhancements/keps/sig-node/281-dynamic-kubelet-configuration

        • config.lastKnownGood.configMap.kubeletConfigKey (string), 必需

          kubeletConfigKey 声明所引用的 ConfigMap 的哪个键对应于 KubeletConfiguration 结构体, 该字段在所有情况下都是必需的。

        • config.lastKnownGood.configMap.name (string), 必需

          name 是所引用的 ConfigMap 的 metadata.name。 此字段在所有情况下都是必需的。

        • config.lastKnownGood.configMap.namespace (string), 必需

          namespace 是所引用的 ConfigMap 的 metadata.namespace。 此字段在所有情况下都是必需的。

        • config.lastKnownGood.configMap.resourceVersion (string)

          resourceVersion 是所引用的 ConfigMap 的 metadata.resourceVersion。 该字段在 Node.spec 中是禁止的,在 Node.status 中是必需的。

        • config.lastKnownGood.configMap.uid (string)

          uid 是所引用的 ConfigMap 的 metadata.uid。 该字段在 Node.spec 中是禁止的,在 Node.status 中是必需的。

  • daemonEndpoints (NodeDaemonEndpoints)

    在节点上运行的守护进程的端点。

    NodeDaemonEndpoints 列出了节点上运行的守护进程打开的端口。

    • daemonEndpoints.kubeletEndpoint (DaemonEndpoint)

      Kubelet 正在侦听的端点。

      DaemonEndpoint 包含有关单个 Daemon 端点的信息。

      • daemonEndpoints.kubeletEndpoint.Port (int32), 必需

        给定端点的端口号。

  • images ([]ContainerImage)

    该节点上的容器镜像列表。

    描述一个容器镜像

    • images.names ([]string)

      已知此镜像的名称。 例如 ["kubernetes.example/hyperkube:v1.0.7", "cloud-vendor.registry.example/cloud-vendor/hyperkube:v1.0.7"]

    • images.sizeBytes (int64)

      镜像的大小(以字节为单位)。

  • nodeInfo (NodeSystemInfo)

    用于唯一标识节点的 ids/uuids 集。 更多信息: https://kubernetes.io/zh-cn/docs/concepts/architecture/nodes/#info

    NodeSystemInfo 是一组用于唯一标识节点的 ids/uuids。

    • nodeInfo.architecture (string), 必需

      节点报告的 architecture。

    • nodeInfo.bootID (string), 必需

      节点报告的 bootID。

    • nodeInfo.containerRuntimeVersion (string), 必需

      节点通过运行时远程 API 报告的 ContainerRuntime 版本(例如 containerd://1.4.2)。

    • nodeInfo.kernelVersion (string), 必需

      节点来自 “uname -r” 报告的内核版本(例如 3.16.0-0.bpo.4-amd64)。

    • nodeInfo.kubeProxyVersion (string), 必需

      节点报告的 KubeProxy 版本。

    • nodeInfo.kubeletVersion (string), 必需

      节点报告的 Kubelet 版本。

    • nodeInfo.operatingSystem (string), 必需

      节点上报的操作系统。

    • nodeInfo.osImage (string), 必需

      节点从 /etc/os-release 报告的操作系统映像(例如 Debian GNU/Linux 7 (wheezy))。

  • phase (string)

    NodePhase 是最近观测到的节点的生命周期阶段。 更多信息: https://kubernetes.io/zh-cn/docs/concepts/architecture/nodes/#phase

    该字段从未填充,现在已被弃用。

  • volumesAttached ([]AttachedVolume)

    附加到节点的卷的列表。

    AttachedVolume 描述附加到节点的卷

    • volumesAttached.devicePath (string), 必需

      devicePath 表示卷应该可用的设备路径。

    • volumesAttached.name (string), 必需

      附加卷的名称。

  • volumesInUse ([]string)

    节点正在使用(安装)的可附加卷的列表。

NodeList

NodeList 是已注册到 master 的所有节点的完整列表。


  • items ([]Node), 必需

    节点的列表。

操作


get 读取指定节点

HTTP 请求

GET /api/v1/nodes/{name}

参数

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

    节点的名称。

  • pretty (路径参数): string

    pretty

响应

200 (Node): OK

401: Unauthorized

get 读取指定节点的状态

HTTP 请求

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

参数

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

    节点的名称。

  • pretty (查询参数): string

    pretty

响应

200 (Node): OK

401: Unauthorized

list 列出或监视节点类型的对象

HTTP 请求

GET /api/v1/nodes

参数

响应

200 (NodeList): OK

401: Unauthorized

create 创建一个节点

HTTP 请求

POST /api/v1/nodes

参数

响应

200 (Node): OK

201 (Node): Created

202 (Node): Accepted

401: Unauthorized

update 替换指定节点

HTTP 请求

PUT /api/v1/nodes/{name}

参数

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

    节点的名称。

  • body: Node, 必需

  • dryRun (查询参数): string

    dryRun

  • fieldManager (查询参数): string

    fieldManager

  • fieldValidation (查询参数): string

    fieldValidation

  • pretty (查询参数): string

    pretty

响应

200 (Node): OK

201 (Node): Created

401: Unauthorized

update 替换指定节点的状态

HTTP 请求

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

参数

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

    节点的名称。

  • body: Node, 必需

  • dryRun (查询参数): string

    dryRun

  • fieldManager (查询参数): string

    fieldManager

  • fieldValidation (查询参数): string

    fieldValidation

  • pretty (查询参数): string

    pretty

响应

200 (Node): OK

201 (Node): Created

401: Unauthorized

patch 部分更新指定节点

HTTP 请求

PATCH /api/v1/nodes/{name}

参数

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

    节点的名称。

  • body: Patch, 必需

  • dryRun (查询参数): string

    dryRun

  • fieldManager (查询参数): string

    fieldManager

  • fieldValidation (查询参数): string

    fieldValidation

  • force (查询参数): boolean

    force

  • pretty (查询参数): string

    pretty

响应

200 (Node): OK

201 (Node): Created

401: Unauthorized

patch 部分更新指定节点的状态

HTTP 请求

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

参数

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

    节点的名称。

  • body: Patch, 必需

  • dryRun (查询参数): string

    dryRun

  • fieldManager (查询参数): string

    fieldManager

  • fieldValidation (查询参数): string

    fieldValidation

  • force (查询参数): boolean

    force

  • pretty (查询参数): string

    pretty

响应

200 (Node): OK

201 (Node): Created

401: Unauthorized

delete 删除一个节点

HTTP 请求

DELETE /api/v1/nodes/{name}

参数

响应

200 (Status): OK

202 (Status): Accepted

401: Unauthorized

deletecollection 删除节点的集合

HTTP 请求

DELETE /api/v1/nodes

响应

200 (Status): OK

401: Unauthorized

2 - 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/zh-cn/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

3 - Event

Event 是集群中某个事件的报告。

apiVersion: events.k8s.io/v1

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

Event

Event 是集群中某个事件的报告。它一般表示系统的某些状态变化。 Event 的保留时间有限,触发器和消息可能会随着时间的推移而演变。 事件消费者不应假定给定原因的事件的时间所反映的是一致的下层触发因素,或具有该原因的事件的持续存在。 Events 应被视为通知性质的、尽最大努力而提供的补充数据。


  • eventTime (MicroTime),必需

    evenTime 是该事件首次被观察到的时间。它是必需的。

    MicroTime 是微秒级精度的 Time 版本

  • action (string)

    action 是针对相关对象所采取的或已失败的动作。字段值是机器可读的。对于新的 Event,此字段不能为空, 且最多为 128 个字符。

  • deprecatedCount (int32)

    deprecatedCount 是确保与 core.v1 Event 类型向后兼容的已弃用字段。

  • deprecatedFirstTimestamp (Time)

    deprecatedFirstTimestamp 是确保与 core.v1 Event 类型向后兼容的已弃用字段。

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

  • deprecatedLastTimestamp (Time)

    deprecatedLastTimestamp 是确保与 core.v1 Event 类型向后兼容的已弃用字段。

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

  • deprecatedSource (EventSource)

    deprecatedSource 是确保与 core.v1 Event 类型向后兼容的已弃用字段。

    EventSource 包含事件信息。

    • deprecatedSource.component (string)

      生成事件的组件。

    • deprecatedSource.host (string)

      产生事件的节点名称。

  • note (string)

    node 是对该操作状态的可读描述。注释的最大长度是 1kB,但是库应该准备好处理最多 64kB 的值。

  • reason (string)

    reason 是采取行动的原因。它是人类可读的。对于新的 Event,此字段不能为空,且最多为128个字符。

  • regarding (ObjectReference)

    关于包含此 Event 所涉及的对象。在大多数情况下,所指的是报告事件的控制器所实现的一个 Object。 例如 ReplicaSetController 实现了 ReplicaSet,这个事件被触发是因为控制器对 ReplicaSet 对象做了一些变化。

  • related (ObjectReference)

    related 是用于更复杂操作的、可选的、从属性的对象。例如,当 regarding 对象触发 related 对象的创建或删除时。

  • reportingController (string)

    reportingController 是触发该事件的控制器的名称,例如 kubernetes.io/kubelet。对于新的 Event,此字段不能为空。

  • reportingInstance (string)

    reportingInstance 为控制器实例的 ID,例如 kubelet-xyzf。对于新的 Event,此字段不能为空,且最多为 128 个字符。

  • series (EventSeries)

    series 是该事件代表的事件系列的数据,如果是单事件,则为 nil。

    EventSeries 包含一系列事件的信息,即一段时间内持续发生的事情。 EventSeries 的更新频率由事件报告者决定。 默认事件报告程序在 "k8s.io/client-go/tools/events/event_broadcaster.go" 展示在发生心跳时该结构如何被更新,可以指导定制的报告者实现。

    • series.count (int32),必需

      count 是到最后一次心跳时间为止在该系列中出现的次数。

    • series.lastObservedTime (MicroTime),必需

      lastObservedTime 是在最后一次心跳时间之前看到最后一个 Event 的时间。

      MicroTime 是微秒级精度的 Time 版本。

  • type (string)

    type 是该事件的类型(Normal、Warning),未来可能会添加新的类型。字段值是机器可读的。 对于新的 Event,此字段不能为空。

EventList

EventList 是一个 Event 对象列表。


  • items ([]Event),必需

    items 是模式(Schema)对象的列表。

操作


get 读取特定 Event

HTTP 请求

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

参数

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

    Event 名称

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

    namespace

  • pretty (路径参数):string

    pretty

响应

200 (Event): OK

401: Unauthorized

list 列出或观察事件类型对象

HTTP 请求

GET /apis/events.k8s.io/v1/namespaces/{namespace}/events

参数

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

    namespace

  • continue (查询参数):string

    continue

  • limit (查询参数):integer

    limit

  • pretty (查询参数):string

    pretty

  • watch (查询参数):boolean

    watch

响应

200 (EventList): OK

401: Unauthorized

list 列出或观察事件类型对象

HTTP 请求

GET /apis/events.k8s.io/v1/events

参数

  • continue (查询参数):string

    continue

  • limit (查询参数):integer

    limit

  • pretty (查询参数):string

    pretty

  • watch (查询参数):boolean

    watch

响应

200 (EventList): OK

401: Unauthorized

create 创建一个 Event

HTTP 请求

POST /apis/events.k8s.io/v1/namespaces/{namespace}/events

参数

  • namespace (查询参数):string,必需

    namespace

  • dryRun (查询参数):string

    dryRun

  • pretty (查询参数):string

    pretty

响应

200 (Event): OK

201 (Event): Created

202 (Event): Accepted

401: Unauthorized

update 替换指定 Event

HTTP 请求

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

参数

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

    Event 名称

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

    namespace

  • dryRun (查询参数):必需

    dryRun

  • pretty (查询参数):string

    pretty

响应

200 (Event): OK

201 (Event): Created

401: Unauthorized

patch 部分更新指定的 Event

HTTP 请求

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

参数

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

    Event 名称

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

    namespace

  • dryRun (查询参数):string

    dryRun

  • force (查询参数):boolean

    force

  • pretty (查询参数):string

    pretty

响应

200 (Event): OK

201 (Event): Created

401: Unauthorized

delete 删除 Event

HTTP 请求

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

参数

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

    Event 名称

  • dryRun (查询参数):string

    dryRun

  • pretty (查询参数):string

    pretty

响应

200 (Status): OK

202 (Status): Accepted

401: Unauthorized

deletecollection 删除 Event 集合

HTTP 请求

DELETE /apis/events.k8s.io/v1/namespaces/{namespace}/events

参数

  • continue (查询参数):string

    continue

  • dryRun (查询参数):string

    dryRun

  • limit (查询参数):integer

    limit

  • pretty (查询参数):string

    pretty

响应

200 (Status): OK

401: Unauthorized

4 - 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

5 - Lease

Lease 定义了租约的概念。

apiVersion: coordination.k8s.io/v1

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

Lease

Lease 定义了租约的概念。


LeaseSpec

LeaseSpec 是一个 Lease 的规约。


  • acquireTime (MicroTime)

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

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

  • holderIdentity (string)

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

  • leaseDurationSeconds (int32)

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

  • leaseTransitions (int32)

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

  • renewTime (MicroTime)

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

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

LeaseList

LeaseList 是 Lease 对象的列表。


操作


get 读取指定的 Lease

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, 必需

    Lease 的名称。

  • 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, 必需

    Lease 的名称。

  • 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

6 - 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

7 - FlowSchema v1beta3

FlowSchema 定义一组流的模式。

apiVersion: flowcontrol.apiserver.k8s.io/v1beta3

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

FlowSchema

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


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

  • 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)

    补丁策略:根据键 type 合并

    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/v1beta3

  • kind: FlowSchemaList

操作


get 读取指定的 FlowSchema

HTTP 请求

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

参数

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

    FlowSchema 的名称

  • pretty (查询参数): string

    pretty

响应

200 (FlowSchema): OK

401: Unauthorized

get 读取指定 FlowSchema 的状态

HTTP 请求

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

参数

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

    FlowSchema 的名称

  • pretty (查询参数): string

    pretty

响应

200 (FlowSchema): OK

401: Unauthorized

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

HTTP 请求

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

参数

响应

200 (FlowSchemaList): OK

401: Unauthorized

create 创建 FlowSchema

HTTP 请求

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

参数

响应

200 (FlowSchema): OK

201 (FlowSchema): Created

202 (FlowSchema): Accepted

401: Unauthorized

update 替换指定的 FlowSchema

HTTP 请求

PUT /apis/flowcontrol.apiserver.k8s.io/v1beta3/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/v1beta3/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/v1beta3/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/v1beta3/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/v1beta3/flowschemas/{name}

参数

响应

200 (Status): OK

202 (Status): Accepted

401: Unauthorized

deletecollection 删除 FlowSchema 的集合

HTTP 请求

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

参数

响应

200 (Status): OK

401: Unauthorized

8 - PriorityLevelConfiguration v1beta3

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

apiVersion: flowcontrol.apiserver.k8s.io/v1beta3

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

PriorityLevelConfiguration

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


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

  • kind: PriorityLevelConfiguration

PriorityLevelConfigurationSpec

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


  • type (string),必需

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

  • exempt (ExemptPriorityLevelConfiguration)

    exempt 指定了对于豁免优先级的请求如何处理。 如果 type 取值为 "Limited",则此字段必须为空。 如果 type 取值为 "Exempt",则此字段可以非空。 如果为空且 type 取值为 "Exempt",则应用 ExemptPriorityLevelConfiguration 的默认值。

    ExemptPriorityLevelConfiguration 描述豁免请求处理的可配置方面。 在强制豁免配置对象中,与 spec 中的其余部分不同,此处字段的取值可以被授权用户修改。

    • exempt.lendablePercent (int32)

      lendablePercent 规定该级别的 NominalCL 可被其他优先级租借的百分比。 此字段的值必须在 0 到 100 之间,包括 0 和 100,默认为 0。 其他级别可以从该级别借用的席位数被称为此级别的 LendableConcurrencyLimit(LendableCL),定义如下。

      LendableCL(i) = round( NominalCL(i) * lendablePercent(i)/100.0 )

    • exempt.nominalConcurrencyShares (int32)

      nominalConcurrencyShares(NCS)也被用来计算该级别的 NominalConcurrencyLimit(NominalCL)。 字段值是为该优先级保留的执行席位的数量。这一设置不限制此优先级别的调度行为, 但会通过借用机制影响其他优先级。服务器的并发限制(ServerCL)会按照各个优先级的 NCS 值按比例分配:

      NominalCL(i) = ceil( ServerCL * NCS(i) / sum_ncs ) sum_ncs = sum[priority level k] NCS(k)

      较大的数字意味着更大的标称并发限制,且将影响其他优先级。此字段的默认值为零。

  • limited (LimitedPriorityLevelConfiguration)

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

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

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

      borrowingLimitPercent 配置如果存在,则可用来限制此优先级可以从其他优先级中租借多少资源。 该限制被称为该级别的 BorrowingConcurrencyLimit(BorrowingCL),它限制了该级别可以同时租借的资源总数。 该字段保存了该限制与该级别标称并发限制之比。当此字段非空时,必须为正整数,并按以下方式计算限制值:

      BorrowingCL(i) = round(NominalCL(i) * borrowingLimitPercent(i) / 100.0)

      该字段值可以大于100,表示该优先级可以大于自己标称并发限制(NominalCL)。当此字段为 nil 时,表示无限制。

    • limited.lendablePercent (int32)

      lendablePercent 规定了 NominalCL 可被其他优先级租借资源数百分比。 此字段的值必须在 0 到 100 之间,包括 0 和 100,默认为 0。 其他级别可以从该级别借用的资源数被称为此级别的 LendableConcurrencyLimit(LendableCL),定义如下。

      LendableCL(i) = round( NominalCL(i) * lendablePercent(i)/100.0 )

    • 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。

    • limited.nominalConcurrencyShares (int32)

      nominalConcurrencyShares(NCS)用于计算该优先级的标称并发限制(NominalCL)。 NCS 表示可以在此优先级同时运行的席位数量上限,包括来自本优先级的请求, 以及从此优先级租借席位的其他级别的请求。 服务器的并发度限制(ServerCL)根据 NCS 值按比例分别给各 Limited 优先级:

      NominalCL(i) = ceil( ServerCL * NCS(i) / sum_ncs ) sum_ncs = sum[priority level k] NCS(k)

      较大的数字意味着更大的标称并发限制,但是这将牺牲其他优先级的资源。该字段的默认值为 30。

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/v1beta3

  • kind: PriorityLevelConfigurationList

操作


get 读取指定的 PriorityLevelConfiguration

HTTP 请求

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

参数

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

    PriorityLevelConfiguration 的名称。

  • pretty查询参数):string

    pretty

响应

200 (PriorityLevelConfiguration): OK

401: Unauthorized

get 读取指定的 PriorityLevelConfiguration 的状态

HTTP 请求

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

参数

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

    PriorityLevelConfiguration 的名称。

  • pretty查询参数):string

    pretty

响应

200 (PriorityLevelConfiguration): OK

401: Unauthorized

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

HTTP 请求

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

参数

响应

200 (PriorityLevelConfigurationList): OK

401: Unauthorized

create 创建 PriorityLevelConfiguration

HTTP 请求

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

参数

响应

200 (PriorityLevelConfiguration): OK

201 (PriorityLevelConfiguration): Created

202 (PriorityLevelConfiguration): Accepted

401: Unauthorized

update 替换指定的 PriorityLevelConfiguration

HTTP 请求

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

参数

响应

200 (PriorityLevelConfiguration): OK

201 (PriorityLevelConfiguration): Created

401: Unauthorized

update 替换指定的 PriorityLevelConfiguration 的状态

HTTP 请求

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

参数

响应

200 (PriorityLevelConfiguration): OK

201 (PriorityLevelConfiguration): Created

401: Unauthorized

patch 部分更新指定的 PriorityLevelConfiguration

HTTP 请求

PATCH /apis/flowcontrol.apiserver.k8s.io/v1beta3/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/v1beta3/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/v1beta3/prioritylevelconfigurations/{name}

参数

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

    PriorityLevelConfiguration 的名称。

  • body: DeleteOptions

  • dryRun查询参数):string

    dryRun

  • gracePeriodSeconds查询参数):integer

    gracePeriodSeconds

  • pretty查询参数):string

    pretty

  • propagationPolicy查询参数):string

    propagationPolicy

响应

200 (Status): OK

202 (Status): Accepted

401: Unauthorized

deletecollection 删除 PriorityLevelConfiguration 的集合

HTTP 请求

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

参数

响应

200 (Status): OK

401: Unauthorized

9 - Binding

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

apiVersion: v1

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

Binding

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


标准对象的元数据, 更多信息: 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

10 - 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

11 - ClusterCIDR v1alpha1

ClusterCIDR 表示启用 MultiCIDRRangeAllocator 时针对每个节点 Pod CIDR 分配进行的单个配置(参阅针对 kube-controller-manager 的配置)。

apiVersion: networking.k8s.io/v1alpha1

import "k8s.io/api/networking/v1alpha1"

ClusterCIDR

ClusterCIDR 表示启用 MultiCIDRRangeAllocator 时针对每个节点 Pod CIDR 分配进行的单个配置 (参阅针对 kube-controller-manager 的配置)。 一个集群可能有任意数量的 ClusterCIDR 资源,在为节点分配 CIDR 时将考虑所有这些资源。 当节点选择算符与相关节点匹配并且有空闲 CIDR 可供分配时,ClusterCIDR 才能有资格用于给定的节点。 在存在多个匹配的 ClusterCIDR 资源的情况下,分配器将尝试使用内部启发式算法来解决这一问题, 但可以使用节点选择算符与该节点匹配的任何 ClusterCIDR。


ClusterCIDRSpec

ClusterCIDRSpec 定义 ClusterCIDR 的预期状态。


  • perNodeHostBits (int32),必需

    perNodeHostBits 定义每个节点要配置的主机位数。 子网掩码决定有多少地址用于网络位和主机位。 例如 IPv4 地址 192.168.0.0/24 将该地址拆分为 24 位用于网络部分和 8 位用于主机部分。 要分配 256 个 IP,需将此字段设置为 8(针对 IPv4 的掩码为 /24,针对 IPv6 的掩码为 /120)。 最小值为 4(16 个 IP)。此字段是不可变的。

  • ipv4 (string)

    ipv4 以 CIDR 表示法定义 IPv4 IP 块(例如 “10.0.0.0/8”)。 必须至少指定 ipv4 和 ipv6 之一。该字段是不可变的。

  • ipv6 (string)

    ipv6 以 CIDR 表示法定义 IPv6 IP 块(例如 “2001:db8::/64”)。 必须至少指定 ipv4 和 ipv6 之一。 该字段是不可变的。

  • nodeSelector (NodeSelector)

    nodeSelector 定义该配置适用于哪些节点。 空白或值为 nil 的 nodeSelector 选择所有节点。该字段是不可变的。

    节点选择算符表示在一组节点上一个或多个标签查询结果的并集; 也就是说,它表示由节点选择算符条件表示的选择算符的逻辑或计算结果。

    • nodeSelector.nodeSelectorTerms ([]NodeSelectorTerm),必需

      必需。节点选择算符条件的列表。这些条件以逻辑与进行计算。

      一个 null 或空的节点选择算符条件不会与任何对象匹配。这些要求会按逻辑与的关系来计算。 TopologySelectorTerm 类别实现了 NodeSelectorTerm 的子集。

      • nodeSelector.nodeSelectorTerms.matchExpressions ([]NodeSelectorRequirement)

        基于节点标签所设置的节点选择算符要求的列表。

      • nodeSelector.nodeSelectorTerms.matchFields ([]NodeSelectorRequirement)

        基于节点字段所设置的节点选择算符要求的列表。

ClusterCIDRList

ClusterCIDRList 包含 ClusterCIDR 的列表。


  • items ([]ClusterCIDR),必需

    items 是 ClusterCIDRs 的列表。

操作


get 读取指定的 ClusterCIDR

HTTP 请求

GET /apis/networking.k8s.io/v1alpha1/clustercidrs/{name}

参数

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

    ClusterCIDR 的名称

  • pretty (查询参数):string

    pretty

响应

200 (ClusterCIDR): OK

401: Unauthorized

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

HTTP 请求

GET /apis/networking.k8s.io/v1alpha1/clustercidrs

参数

响应

200 (ClusterCIDRList): OK

401: Unauthorized

create 创建 ClusterCIDR

HTTP 请求

POST /apis/networking.k8s.io/v1alpha1/clustercidrs

参数

响应

200 (ClusterCIDR): OK

201 (ClusterCIDR): Created

202 (ClusterCIDR): Accepted

401: Unauthorized

update 替换指定的 ClusterCIDR

HTTP 请求

PUT /apis/networking.k8s.io/v1alpha1/clustercidrs/{name}

参数

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

    ClusterCIDR 的名称

  • body: ClusterCIDR,必需

  • dryRun (查询参数):string

    dryRun

  • fieldManager (查询参数):string

    fieldManager

  • fieldValidation (查询参数):string

    fieldValidation

  • pretty (查询参数):string

    pretty

响应

200 (ClusterCIDR): OK

201 (ClusterCIDR): Created

401: Unauthorized

patch 部分更新指定的 ClusterCIDR

HTTP 请求

PATCH /apis/networking.k8s.io/v1alpha1/clustercidrs/{name}

参数

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

    ClusterCIDR 的名称

  • body: Patch,必需

  • dryRun (查询参数):string

    dryRun

  • fieldManager (查询参数):string

    fieldManager

  • fieldValidation (查询参数):string

    fieldValidation

  • force (查询参数):boolean

    force

  • pretty (查询参数):string

    pretty

响应

200 (ClusterCIDR): OK

201 (ClusterCIDR): Created

401: Unauthorized

delete 删除 ClusterCIDR

HTTP 请求

DELETE /apis/networking.k8s.io/v1alpha1/clustercidrs/{name}

参数

响应

200 (Status): OK

202 (Status): Accepted

401: Unauthorized

deletecollection 删除 ClusterCIDR 的集合

HTTP 请求

DELETE /apis/networking.k8s.io/v1alpha1/clustercidrs

参数

响应

200 (Status): OK

401: Unauthorized