Kubernetes API

Kubernetes API 是通过 RESTful 接口提供 Kubernetes 功能服务并负责集群状态存储的应用程序。

Kubernetes 资源和"意向记录"都是作为 API 对象储存的,并可以通过调用 RESTful 风格的 API 进行修改。 API 允许以声明方式管理配置。 用户可以直接和 Kubernetes API 交互,也可以通过 kubectl 这样的工具进行交互。 核心的 Kubernetes API 是很灵活的,可以扩展以支持定制资源。

1 - 工作负载资源

1.1 - Pod

Pod 是可以在主机上运行的容器的集合。

apiVersion: v1

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

Pod

Pod 是可以在主机上运行的容器的集合。此资源由客户端创建并调度到主机上。


PodSpec

PodSpec 是对 Pod 的描述。


容器

调度

生命周期

主机名和名称解析

主机名字空间

服务账号

安全上下文

Alpha 级别

resourceClaims 定义了在允许 Pod 启动之前必须分配和保留哪些 ResourceClaims。 这些资源将可供那些按名称使用它们的容器使用。

这是一个 Alpha 特性的字段,需要启用 DynamicResourceAllocation 特性门控来开启此功能。

此字段不可变更。

PodResourceClaim 通过 ClaimSource 引用一个 ResourceClaim。 它为 ClaimSource 添加一个名称,作为 Pod 内 ResourceClaim 的唯一标识。 需要访问 ResourceClaim 的容器可使用此名称引用它。

已弃用

容器

要在 Pod 中运行的单个应用容器。


镜像

Entrypoint

端口

环境变量

资源

生命周期

安全上下文

调试

EphemeralContainer

EphemeralContainer 是一个临时容器,你可以将其添加到现有 Pod 以用于用户发起的活动,例如调试。 临时容器没有资源或调度保证,它们在退出或 Pod 被移除或重新启动时不会重新启动。 如果临时容器导致 Pod 超出其资源分配,kubelet 可能会驱逐 Pod。

要添加临时容器,请使用现有 Pod 的 ephemeralcontainers 子资源。临时容器不能被删除或重新启动。


镜像

入口点

环境变量

生命周期

调试

安全上下文

不允许

LifecycleHandler

LifecycleHandler 定义了应在生命周期挂钩中执行的特定操作。 必须指定一个且只能指定一个字段,tcpSocket 除外。


NodeAffinity

节点亲和性是一组节点亲和性调度规则。


PodAffinity

Pod 亲和性是一组 Pod 间亲和性调度规则。


PodAntiAffinity

Pod 反亲和性是一组 Pod 间反亲和性调度规则。


探针

探针描述了要对容器执行的健康检查,以确定它是否处于活动状态或准备好接收流量。


PodStatus

PodStatus 表示有关 Pod 状态的信息。状态内容可能会滞后于系统的实际状态, 尤其是在托管 Pod 的节点无法联系控制平面的情况下。


PodList

PodList 是 Pod 的列表。


操作


get 读取指定的 Pod

HTTP 请求

GET /api/v1/namespaces/{namespace}/pods/{name}

参数

响应

200 (Pod): OK

401: Unauthorized

get 读取指定 Pod 的 ephemeralcontainers

HTTP 请求

GET /api/v1/namespaces/{namespace}/pods/{name}/ephemeralcontainers

参数

响应

200 (Pod): OK

401: Unauthorized

get 读取指定 Pod 的日志

HTTP 请求

GET /api/v1/namespaces/{namespace}/pods/{name}/log

参数

响应

200 (string): OK

401: Unauthorized

get 读取指定 Pod 的状态

HTTP 请求

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

参数

响应

200 (Pod): OK

401: Unauthorized

list 列出或观察 Pod 种类的对象

HTTP 请求

GET /api/v1/namespaces/{namespace}/pods

参数

响应

200 (PodList): OK

401: Unauthorized

list 列出或观察 Pod 种类的对象

HTTP 请求

GET /api/v1/pods

参数

响应

200 (PodList): OK

401: Unauthorized

create 创建一个 Pod

HTTP 请求

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

参数

响应

200 (Pod): OK

201 (Pod): Created

202 (Pod): Accepted

401: Unauthorized

update 替换指定的 Pod

HTTP 请求

PUT /api/v1/namespaces/{namespace}/pods/{name}

参数

响应

200 (Pod): OK

201 (Pod): Created

401: Unauthorized

update 替换指定 Pod 的 ephemeralcontainers

HTTP 请求

PUT /api/v1/namespaces/{namespace}/pods/{name}/ephemeralcontainers

参数

响应

200 (Pod): OK

201 (Pod): Created

401: Unauthorized

update 替换指定 Pod 的状态

HTTP 请求

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

参数

响应

200 (Pod): OK

201 (Pod): Created

401: Unauthorized

patch 部分更新指定 Pod

HTTP 请求

PATCH /api/v1/namespaces/{namespace}/pods/{name}

参数

响应

200 (Pod): OK

201 (Pod): Created

401: Unauthorized

patch 部分更新指定 Pod 的 ephemeralcontainers

HTTP 请求

PATCH /api/v1/namespaces/{namespace}/pods/{name}/ephemeralcontainers

参数

响应

200 (Pod): OK

201 (Pod): Created

401: Unauthorized

patch 部分更新指定 Pod 的状态

HTTP 请求

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

参数

响应

200 (Pod): OK

201 (Pod): Created

401: Unauthorized

delete 删除一个 Pod

HTTP 请求

DELETE /api/v1/namespaces/{namespace}/pods/{name}

参数

响应

200 (Pod): OK

202 (Pod): Accepted

401: Unauthorize

deletecollection 删除 Pod 的集合

HTTP 请求

DELETE /api/v1/namespaces/{namespace}/pods

参数

响应

200 (Status): OK

401: Unauthorized

1.2 - Binding

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

apiVersion: v1

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

Binding

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


操作


create 创建 Binding

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

参数

响应

200 (Binding): OK

201 (Binding): Created

202 (Binding): Accepted

401: Unauthorized

create 创建 Pod 的 binding

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

参数

响应

200 (Binding): OK

201 (Binding): Created

202 (Binding): Accepted

401: Unauthorized

1.3 - PodTemplate

PodTemplate 描述一种模板,用来为预定义的 Pod 生成副本。

apiVersion: v1

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

PodTemplate

PodTemplate 描述一种模板,用来为预定义的 Pod 生成副本。


PodTemplateSpec

PodTemplateSpec 描述基于某模板所创建的 Pod 所应具有的数据。


PodTemplateList

PodTemplateList 是 PodTemplate 对象的列表。


操作


get 读取指定的 PodTemplate

HTTP 请求

GET /api/v1/namespaces/{namespace}/podtemplates/{name}

参数

响应

200 (PodTemplate): OK

401: Unauthorized

list 列出或监视 PodTemplate 类型的对象

HTTP 请求

GET /api/v1/namespaces/{namespace}/podtemplates

参数

响应

200 (PodTemplateList): OK

401: Unauthorized

list 列出或监视 PodTemplate 类型的对象

HTTP 请求

GET /api/v1/podtemplates

参数

响应

200 (PodTemplateList): OK

401: Unauthorized

create 创建一个 PodTemplate

HTTP 请求

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

参数

响应

200 (PodTemplate): OK

201 (PodTemplate): Created

202 (PodTemplate): Accepted

401: Unauthorized

update 替换指定的 PodTemplate

HTTP 请求

PUT /api/v1/namespaces/{namespace}/podtemplates/{name}

参数

响应

200 (PodTemplate): OK

201 (PodTemplate): Created

401: Unauthorized

patch 部分更新指定的 PodTemplate

HTTP 请求

PATCH /api/v1/namespaces/{namespace}/podtemplates/{name}

参数

响应

200 (PodTemplate): OK

201 (PodTemplate): Created

401: Unauthorized

delete 删除一个 PodTemplate

HTTP 请求

DELETE /api/v1/namespaces/{namespace}/podtemplates/{name}

参数

响应

200 (PodTemplate): OK

202 (PodTemplate): Accepted

401: Unauthorized

deletecollection 删除 PodTemplate 的集合

HTTP 请求

DELETE /api/v1/namespaces/{namespace}/podtemplates

参数

响应

200 (Status): OK

401: Unauthorized

1.4 - ReplicaSet

ReplicaSet 确保在任何给定的时刻都在运行指定数量的 Pod 副本。

apiVersion: apps/v1

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

ReplicaSet

ReplicaSet 确保在任何给定的时刻都在运行指定数量的 Pod 副本。


ReplicaSetSpec

ReplicaSetSpec 是 ReplicaSet 的规约。


ReplicaSetStatus

ReplicaSetStatus 表示 ReplicaSet 的当前状态。


ReplicaSetList

ReplicaSetList 是多个 ReplicaSet 的集合。


操作


get 读取指定的 ReplicaSet

HTTP 请求

GET /apis/apps/v1/namespaces/{namespace}/replicasets/{name}

参数

响应

200 (ReplicaSet): OK

401: Unauthorized

get 读取指定的 ReplicaSet 的状态

HTTP 请求

GET /apis/apps/v1/namespaces/{namespace}/replicasets/{name}/status

参数

响应

200 (ReplicaSet): OK

401: Unauthorized

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

HTTP 请求

GET /apis/apps/v1/namespaces/{namespace}/replicasets

参数

响应

200 (ReplicaSetList): OK

401: Unauthorized

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

HTTP 请求

GET /apis/apps/v1/replicasets

参数

响应

200 (ReplicaSetList): OK

401: Unauthorized

create 创建 ReplicaSet

HTTP 请求

POST /apis/apps/v1/namespaces/{namespace}/replicasets

参数

响应

200 (ReplicaSet): OK

201 (ReplicaSet): Created

202 (ReplicaSet): Accepted

401: Unauthorized

update 替换指定的 ReplicaSet

HTTP 请求

PUT /apis/apps/v1/namespaces/{namespace}/replicasets/{name}

参数

响应

200 (ReplicaSet): OK

201 (ReplicaSet): Created

401: Unauthorized

update 替换指定的 ReplicaSet 的状态

HTTP 请求

PUT /apis/apps/v1/namespaces/{namespace}/replicasets/{name}/status

参数

响应

200 (ReplicaSet): OK

201 (ReplicaSet): Created

401: Unauthorized

patch 部分更新指定的 ReplicaSet

HTTP 请求

PATCH /apis/apps/v1/namespaces/{namespace}/replicasets/{name}

参数

响应

200 (ReplicaSet): OK

201 (ReplicaSet): Created

401: Unauthorized

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

HTTP 请求

PATCH /apis/apps/v1/namespaces/{namespace}/replicasets/{name}/status

参数

响应

200 (ReplicaSet): OK

201 (ReplicaSet): Created

401: Unauthorized

delete 删除 ReplicaSet

HTTP 请求

DELETE /apis/apps/v1/namespaces/{namespace}/replicasets/{name}

参数

响应

200 (Status): OK

202 (Status): Accepted

401: Unauthorized

deletecollection 删除 ReplicaSet 的集合

HTTP 请求

DELETE /apis/apps/v1/namespaces/{namespace}/replicasets

参数

响应

200 (Status): OK

401: Unauthorized

1.5 - ReplicationController

ReplicationController 表示一个副本控制器的配置。

apiVersion: v1

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

ReplicationController

ReplicationController 表示一个副本控制器的配置。


ReplicationControllerSpec

ReplicationControllerSpec 表示一个副本控制器的规约。


ReplicationControllerStatus

ReplicationControllerStatus 表示一个副本控制器的当前状态。


ReplicationControllerList

ReplicationControllerList 是副本控制器的集合。


操作


get 读取指定的 ReplicationController

HTTP 请求

GET /api/v1/namespaces/{namespace}/replicationcontrollers/{name}

参数

响应

200 (ReplicationController): OK

401: Unauthorized

get 读取指定的 ReplicationController 的状态

HTTP 请求

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

参数

响应

200 (ReplicationController): OK

401: Unauthorized

list 列举或监视 ReplicationController 类别的对象

HTTP 请求

GET /api/v1/namespaces/{namespace}/replicationcontrollers

参数

响应

200 (ReplicationControllerList): OK

401: Unauthorized

list 列举或监视 ReplicationController 类别的对象

HTTP 请求

GET /api/v1/replicationcontrollers

参数

响应

200 (ReplicationControllerList): OK

401: Unauthorized

create 创建 ReplicationController

HTTP 请求

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

参数

响应

200 (ReplicationController): OK

201 (ReplicationController): Created

202 (ReplicationController): Accepted

401: Unauthorized

update 替换指定的 ReplicationController

HTTP 请求

PUT /api/v1/namespaces/{namespace}/replicationcontrollers/{name}

参数

响应

200 (ReplicationController): OK

201 (ReplicationController): Created

401: Unauthorized

update 替换指定的 ReplicationController 的状态

HTTP 请求

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

参数

响应

200 (ReplicationController): OK

201 (ReplicationController): Created

401: Unauthorized

patch 部分更新指定的 ReplicationController

HTTP 请求

PATCH /api/v1/namespaces/{namespace}/replicationcontrollers/{name}

参数

响应

200 (ReplicationController): OK

201 (ReplicationController): Created

401: Unauthorized

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

HTTP 请求

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

参数

响应

200 (ReplicationController): OK

201 (ReplicationController): Created

401: Unauthorized

delete 删除 ReplicationController

HTTP 请求

DELETE /api/v1/namespaces/{namespace}/replicationcontrollers/{name}

参数

响应

200 (Status): OK

202 (Status): Accepted

401: Unauthorized

deletecollection 删除 ReplicationController 的集合

HTTP 请求

DELETE /api/v1/namespaces/{namespace}/replicationcontrollers

参数

响应

200 (Status): OK

401: Unauthorized

1.6 - Deployment

Deployment 使得 Pod 和 ReplicaSet 能够进行声明式更新。

apiVersion: apps/v1

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

Deployment

Deployment 使得 Pod 和 ReplicaSet 能够进行声明式更新。


DeploymentSpec

DeploymentSpec 定义 Deployment 预期行为的规约。


DeploymentStatus

DeploymentStatus 是最近观测到的 Deployment 状态。


DeploymentList

DeploymentList 是 Deployment 的列表。


操作


get 读取指定的 Deployment

HTTP 请求

GET /apis/apps/v1/namespaces/{namespace}/deployments/{name}

参数

响应

200 (Deployment): OK

401: Unauthorized

get 读取指定的 Deployment 的状态

HTTP 请求

GET /apis/apps/v1/namespaces/{namespace}/deployments/{name}/status

参数

响应

200 (Deployment): OK

401: Unauthorized

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

HTTP 请求

GET /apis/apps/v1/namespaces/{namespace}/deployments

参数

响应

200 (DeploymentList): OK

401: Unauthorized

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

HTTP 请求

GET /apis/apps/v1/deployments

参数

响应

200 (DeploymentList): OK

401: Unauthorized

create 创建 Deployment

HTTP 请求

POST /apis/apps/v1/namespaces/{namespace}/deployments

参数

响应

200 (Deployment): OK

201 (Deployment): Created

202 (Deployment): Accepted

401: Unauthorized

update 替换指定的 Deployment

HTTP 请求

PUT /apis/apps/v1/namespaces/{namespace}/deployments/{name}

参数

响应

200 (Deployment): OK

201 (Deployment): Created

401: Unauthorized

update 替换指定的 Deployment 的状态

HTTP 请求

PUT /apis/apps/v1/namespaces/{namespace}/deployments/{name}/status

参数

响应

200 (Deployment): OK

201 (Deployment): Created

401: Unauthorized

patch 部分更新指定的 Deployment

HTTP 请求

PATCH /apis/apps/v1/namespaces/{namespace}/deployments/{name}

参数

响应

200 (Deployment): OK

201 (Deployment): Created

401: Unauthorized

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

HTTP 请求

PATCH /apis/apps/v1/namespaces/{namespace}/deployments/{name}/status

参数

响应

200 (Deployment): OK

201 (Deployment): Created

401: Unauthorized

delete 删除 Deployment

HTTP 请求

DELETE /apis/apps/v1/namespaces/{namespace}/deployments/{name}

参数

响应

200 (Status): OK

202 (Status): Accepted

401: Unauthorized

deletecollection 删除 Deployment 的集合

HTTP 请求

DELETE /apis/apps/v1/namespaces/{namespace}/deployments

参数

响应

200 (Status): OK

401: Unauthorized

1.7 - StatefulSet

StatefulSet 表示一组具有一致身份的 Pod

apiVersion: apps/v1

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

StatefulSet

StatefulSet 表示一组具有一致身份的 Pod。身份定义为:

StatefulSet 保证给定的网络身份将始终映射到相同的存储身份。


StatefulSetSpec

StatefulSetSpec 是 StatefulSet 的规约。


StatefulSetStatus

StatefulSetStatus 表示 StatefulSet 的当前状态。


StatefulSetList

StatefulSetList 是 StatefulSet 的集合。


操作


get 读取指定的 StatefulSet

HTTP 请求

GET /apis/apps/v1/namespaces/{namespace}/statefulsets/{name}

参数

响应

200 (StatefulSet): OK

401: Unauthorized

get 读取指定 StatefulSet 的状态

HTTP 请求

GET /apis/apps/v1/namespaces/{namespace}/statefulsets/{name}/status

参数

响应

200 (StatefulSet): OK

401: Unauthorized

list 列出或监视 StatefulSet 类型的对象

HTTP 请求

GET /apis/apps/v1/namespaces/{namespace}/statefulsets

参数

响应

200 (StatefulSetList): OK

401: Unauthorized

list 列出或监视 StatefulSet 类型的对象

HTTP 请求

GET /apis/apps/v1/statefulsets

参数

响应

200 (StatefulSetList): OK

401: Unauthorized

create 创建一个 StatefulSet

HTTP 请求

POST /apis/apps/v1/namespaces/{namespace}/statefulsets

参数

pretty

响应

200 (StatefulSet): OK

201 (StatefulSet): Created

202 (StatefulSet): Accepted

401: Unauthorized

update 替换指定的 StatefulSet

HTTP 请求

PUT /apis/apps/v1/namespaces/{namespace}/statefulsets/{name}

参数

响应

200 (StatefulSet): OK

201 (StatefulSet): Created

401: Unauthorized

update 替换指定 StatefulSet 的状态

HTTP 请求

PUT /apis/apps/v1/namespaces/{namespace}/statefulsets/{name}/status

参数

响应

200 (StatefulSet): OK

201 (StatefulSet): Created

401: Unauthorized

patch 部分更新指定的 StatefulSet

HTTP 请求

PATCH /apis/apps/v1/namespaces/{namespace}/statefulsets/{name}

参数

响应

200 (StatefulSet): OK

201 (StatefulSet): Created

401: Unauthorized

patch 部分更新指定 StatefulSet 的状态

HTTP 请求

PATCH /apis/apps/v1/namespaces/{namespace}/statefulsets/{name}/status

参数

响应

200 (StatefulSet): OK

201 (StatefulSet): Created

401: Unauthorized

delete 删除一个 StatefulSet

HTTP 请求

DELETE /apis/apps/v1/namespaces/{namespace}/statefulsets/{name}

参数

响应

200 (Status): OK

202 (Status): Accepted

401: Unauthorized

deletecollection 删除 StatefulSet 的集合

HTTP 请求

DELETE /apis/apps/v1/namespaces/{namespace}/statefulsets

参数

响应

200 (Status): OK

401: Unauthorized

1.8 - ControllerRevision

ControllerRevision 实现了状态数据的不可变快照。

apiVersion: apps/v1

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

ControllerRevision

ControllerRevision 实现了状态数据的不可变快照。 客户端负责序列化和反序列化对象,包含对象内部状态。 成功创建 ControllerRevision 后,将无法对其进行更新。 API 服务器将无法成功验证所有尝试改变 data 字段的请求。 但是,可以删除 ControllerRevisions。 请注意,由于 DaemonSet 和 StatefulSet 控制器都使用它来进行更新和回滚,所以这个对象是 Beta 版。 但是,它可能会在未来版本中更改名称和表示形式,客户不应依赖其稳定性。 它主要供控制器内部使用。


ControllerRevisionList

ControllerRevisionList 是一个包含 ControllerRevision 对象列表的资源。


操作


get 读取特定的 ControllerRevision

HTTP 请求

GET /apis/apps/v1/namespaces/{namespace}/controllerrevisions/{name}

参数

响应

200 (ControllerRevision): OK

401: Unauthorized

list 列举或监视 ControllerRevision 类别的对象

HTTP 请求

GET /apis/apps/v1/namespaces/{namespace}/controllerrevisions

参数

响应

200 (ControllerRevisionList): OK

401: Unauthorized

list 列举或监视 ControllerRevision 类别的对象

HTTP 请求

GET /apis/apps/v1/controllerrevisions

参数

响应

200 (ControllerRevisionList): OK

401: Unauthorized

create 创建一个 ControllerRevision

HTTP 请求

POST /apis/apps/v1/namespaces/{namespace}/controllerrevisions

参数

响应

200 (ControllerRevision): OK

201 (ControllerRevision): Created

202 (ControllerRevision): Accepted

401: Unauthorized

update 替换特定的 ControllerRevision

HTTP 参数

PUT /apis/apps/v1/namespaces/{namespace}/controllerrevisions/{name}

参数

响应

200 (ControllerRevision): OK

201 (ControllerRevision): Created

401: Unauthorized

patch 部分更新特定的 ControllerRevision

HTTP 请求

PATCH /apis/apps/v1/namespaces/{namespace}/controllerrevisions/{name}

参数

响应

200 (ControllerRevision): OK

201 (ControllerRevision): Created

401: Unauthorized

delete 删除一个 ControllerRevision

HTTP 请求

DELETE /apis/apps/v1/namespaces/{namespace}/controllerrevisions/{name}

参数

响应

200 (Status): OK

202 (Status): Accepted

401: Unauthorized

deletecollection 删除 ControllerRevision 集合

HTTP 请求

DELETE /apis/apps/v1/namespaces/{namespace}/controllerrevisions

参数

响应

200 (Status): OK

401: Unauthorized

1.9 - DaemonSet

DaemonSet 表示守护进程集的配置。

apiVersion: apps/v1

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

DaemonSet

DaemonSet 表示守护进程集的配置。


DaemonSetSpec

DaemonSetSpec 是守护进程集的规约。


DaemonSetStatus

DaemonSetStatus 表示守护进程集的当前状态。


DaemonSetList

DaemonSetList 是守护进程集的集合。


Operations


get 读取指定的 DaemonSet

HTTP 请求

GET /apis/apps/v1/namespaces/{namespace}/daemonsets/{name}

参数

响应

200 (DaemonSet): OK

401: 未授权

get 读取指定的 DaemonSet 的状态

HTTP 请求

GET /apis/apps/v1/namespaces/{namespace}/daemonsets/{name}/status

参数

响应

200 (DaemonSet): OK

401: 未授权

list 列表或查看 DaemonSet 类型的对象

HTTP 请求

GET /apis/apps/v1/namespaces/{namespace}/daemonsets

参数

响应

200 (DaemonSetList): OK

401: 未授权

list 列表或查看 DaemonSet 类型的对象

HTTP 请求

GET /apis/apps/v1/daemonsets

参数

响应

200 (DaemonSetList): OK

401: 未授权

create 创建一个 DaemonSet

HTTP 请求

POST /apis/apps/v1/namespaces/{namespace}/daemonsets

参数

响应

200 (DaemonSet): OK

201 (DaemonSet): 已创建

202 (DaemonSet): 已接受

401: 未授权

update 替换指定的 DaemonSet

HTTP 请求

PUT /apis/apps/v1/namespaces/{namespace}/daemonsets/{name}

参数

响应

200 (DaemonSet): OK

201 (DaemonSet): 已创建

401: 未授权

update 替换指定 DaemonSet 的状态

HTTP 请求

PUT /apis/apps/v1/namespaces/{namespace}/daemonsets/{name}/status

参数

响应

200 (DaemonSet): OK

201 (DaemonSet): 已创建

401: 未授权

patch 部分更新指定的 DaemonSet

HTTP 请求

PATCH /apis/apps/v1/namespaces/{namespace}/daemonsets/{name}

参数

响应

200 (DaemonSet): OK

201 (DaemonSet): 已创建

401: 未授权

patch 部分更新指定 DaemonSet 的状态

HTTP 请求

PATCH /apis/apps/v1/namespaces/{namespace}/daemonsets/{name}/status

参数

响应

200 (DaemonSet): OK

201 (DaemonSet): 已创建

401: 未授权

delete 删除一个 DaemonSet

HTTP 请求

DELETE /apis/apps/v1/namespaces/{namespace}/daemonsets/{name}

参数

响应

200 (Status): OK

202 (Status): 已接受

401: 未授权

deletecollection 删除 DaemonSet 的集合

HTTP 请求

DELETE /apis/apps/v1/namespaces/{namespace}/daemonsets

参数

响应

200 (Status): OK

401: 未授权

1.10 - Job

Job 表示单个任务的配置。

apiVersion: batch/v1

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

Job

Job 表示单个任务的配置。


JobSpec

JobSpec 描述了任务执行的情况。


Replicas

Lifecycle

Selector

Beta 级别

Alpha 级别

JobStatus

JobStatus 表示 Job 的当前状态。


Beta 级别

Alpha 级别

JobList

JobList 是 Job 的集合。


操作


get 读取指定的 Job

HTTP 请求

GET /apis/batch/v1/namespaces/{namespace}/jobs/{name}

参数

响应

200 (Job): OK

401: Unauthorized

get 读取指定任务的状态

HTTP 请求

GET /apis/batch/v1/namespaces/{namespace}/jobs/{name}/status

参数

响应

200 (Job): OK

401: Unauthorized

list 列举或监测 Job 类别的对象

HTTP 请求

GET /apis/batch/v1/namespaces/{namespace}/jobs

参数

响应

200 (JobList): OK

401: Unauthorized

list 列举或监测 Job 类别的对象

HTTP 请求

GET /apis/batch/v1/jobs

参数

响应

200 (JobList): OK

401: Unauthorized

create 创建一个 Job

HTTP 请求

POST /apis/batch/v1/namespaces/{namespace}/jobs

参数

响应

200 (Job): OK

201 (Job): Created

202 (Job): Accepted

401: Unauthorized

update 替换指定的 Job

HTTP 请求

PUT /apis/batch/v1/namespaces/{namespace}/jobs/{name}

参数

响应

200 (Job): OK

201 (Job): Created

401: Unauthorized

update 替换指定 Job 的状态

HTTP 请求

PUT /apis/batch/v1/namespaces/{namespace}/jobs/{name}/status

参数

响应

200 (Job): OK

201 (Job): Created

401: Unauthorized

patch 部分更新指定的 Job

HTTP 请求

PATCH /apis/batch/v1/namespaces/{namespace}/jobs/{name}

参数

响应

200 (Job): OK

201 (Job): Created

401: Unauthorized

patch 部分更新指定 Job 的状态

HTTP 请求

PATCH /apis/batch/v1/namespaces/{namespace}/jobs/{name}/status

参数

响应

200 (Job): OK

201 (Job): Created

401: Unauthorized

delete 删除一个 Job

HTTP 请求

DELETE /apis/batch/v1/namespaces/{namespace}/jobs/{name}

参数

响应

200 (Status): OK

202 (Status): Accepted

401: Unauthorized

deletecollection 删除 Job 的集合

HTTP 请求

DELETE /apis/batch/v1/namespaces/{namespace}/jobs

参数

响应

200 (Status): OK

401: Unauthorized

1.11 - CronJob

CronJob 代表单个定时作业(Cron Job)的配置。

apiVersion: batch/v1

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

CronJob

CronJob 代表单个定时作业(Cron Job)的配置。


CronJobSpec

CronJobSpec 描述了作业的执行方式和实际将运行的时间。


CronJobStatus

CronJobStatus 表示某个定时作业的当前状态。


CronJobList

CronJobList 是定时作业的集合。


操作


get 查看指定的 CronJob

HTTP 请求

GET /apis/batch/v1/namespaces/{namespace}/cronjobs/{name}

参数

响应

200 (CronJob): OK

401: Unauthorized

get 查看指定 CronJob 的状态

HTTP 请求

GET /apis/batch/v1/namespaces/{namespace}/cronjobs/{name}/status

参数

响应

200 (CronJob): OK

401: Unauthorized

list 查看或监视 CronJob 类别的对象

HTTP 请求

GET /apis/batch/v1/namespaces/{namespace}/cronjobs

参数

响应

200 (CronJobList): OK

401: Unauthorized

list 查看或监视 CronJob 类型的对象

HTTP 请求

GET /apis/batch/v1/cronjobs

参数

响应

200 (CronJobList): OK

401: Unauthorized

create 创建一个 CronJob

HTTP 请求

POST /apis/batch/v1/namespaces/{namespace}/cronjobs

参数

响应

200 (CronJob): OK

201 (CronJob): Created

202 (CronJob): Accepted

401: Unauthorized

update 替换指定的 CronJob

HTTP 请求

PUT /apis/batch/v1/namespaces/{namespace}/cronjobs/{name}

参数

响应

200 (CronJob): OK

201 (CronJob): Created

401: Unauthorized

update 替换指定 CronJob 的状态

HTTP 请求

PUT /apis/batch/v1/namespaces/{namespace}/cronjobs/{name}/status

参数

响应

200 (CronJob): OK

201 (CronJob): Created

401: Unauthorized

patch 部分更新指定的 CronJob

HTTP 请求

PATCH /apis/batch/v1/namespaces/{namespace}/cronjobs/{name}

参数

响应

200 (CronJob): OK

201 (CronJob): Created

401: Unauthorized

patch 部分更新指定 CronJob 的状态

HTTP 请求

PATCH /apis/batch/v1/namespaces/{namespace}/cronjobs/{name}/status

参数

响应

200 (CronJob): OK

201 (CronJob): Created

401: Unauthorized

delete 删除一个 CronJob

HTTP 请求

DELETE /apis/batch/v1/namespaces/{namespace}/cronjobs/{name}

参数

响应

200 (Status): OK

202 (Status): Accepted

401: Unauthorized

deletecollection 删除一组 CronJob

HTTP 请求

DELETE /apis/batch/v1/namespaces/{namespace}/cronjobs

参数

响应

200 (Status): OK

401: Unauthorized

1.12 - HorizontalPodAutoscaler

水平 Pod 自动缩放器的配置。

apiVersion: autoscaling/v1

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

HorizontalPodAutoscaler

水平 Pod 自动缩放器的配置。


HorizontalPodAutoscalerSpec

水平 Pod 自动缩放器的规约。


HorizontalPodAutoscalerStatus

水平 Pod 自动缩放器的当前状态


HorizontalPodAutoscalerList

水平 Pod 自动缩放器对象列表。


操作


get 读取特定的 HorizontalPodAutoscaler

HTTP 请求

GET /apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}

参数

响应

200 (HorizontalPodAutoscaler): OK

401: Unauthorized

get 读取特定 HorizontalPodAutoscaler 的状态

HTTP 请求

GET /apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}/status

参数

响应

200 (HorizontalPodAutoscaler): OK

401: Unauthorized

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

HTTP 参数

GET /apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers

参数

响应

200 (HorizontalPodAutoscalerList): OK

401: Unauthorized

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

HTTP 请求

GET /apis/autoscaling/v1/horizontalpodautoscalers

参数

响应

200 (HorizontalPodAutoscalerList): OK

401: Unauthorized

create 创建一个 HorizontalPodAutoscaler

HTTP 请求

POST /apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers

参数

响应

200 (HorizontalPodAutoscaler): OK

201 (HorizontalPodAutoscaler): Created

202 (HorizontalPodAutoscaler): Accepted

401: Unauthorized

update 替换特定的 HorizontalPodAutoscaler

HTTP 请求

PUT /apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}

参数

响应

200 (HorizontalPodAutoscaler): OK

201 (HorizontalPodAutoscaler): Created

401: Unauthorized

update 替换特定 HorizontalPodAutoscaler 的状态

HTTP 请求

PUT /apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}/status

参数

响应

200 (HorizontalPodAutoscaler): OK

201 (HorizontalPodAutoscaler): Created

401: Unauthorized

patch 部分更新特定的 HorizontalPodAutoscaler

HTTP 请求

PATCH /apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}

参数

响应

200 (HorizontalPodAutoscaler): OK

201 (HorizontalPodAutoscaler): Created

401: Unauthorized

patch 部分更新特定 HorizontalPodAutoscaler 的状态

HTTP 请求

PATCH /apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}/status

参数

响应

200 (HorizontalPodAutoscaler): OK

201 (HorizontalPodAutoscaler): Created

401: Unauthorized

delete 删除一个 HorizontalPodAutoscaler

HTTP 请求

DELETE /apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}

参数

响应

200 (Status): OK

202 (Status): Accepted

401: Unauthorized

deletecollection 删除 HorizontalPodAutoscaler 的集合

HTTP 请求

DELETE /apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers

参数

响应

200 (Status): OK

401: Unauthorized

1.13 - HorizontalPodAutoscaler

HorizontalPodAutoscaler 是水平 Pod 自动扩缩器的配置,它根据指定的指标自动管理实现 scale 子资源的任何资源的副本数。

apiVersion: autoscaling/v2

import "k8s.io/api/autoscaling/v2"

HorizontalPodAutoscaler

HorizontalPodAutoscaler 是水平 Pod 自动扩缩器的配置, 它根据指定的指标自动管理实现 scale 子资源的任何资源的副本数。


HorizontalPodAutoscalerSpec

HorizontalPodAutoscalerSpec 描述了 HorizontalPodAutoscaler 预期的功能。


HorizontalPodAutoscalerStatus

HorizontalPodAutoscalerStatus 描述了水平 Pod 自动扩缩器的当前状态。


HorizontalPodAutoscalerList

HorizontalPodAutoscalerList 是水平 Pod 自动扩缩器对象列表。


Operations


get 读取指定的 HorizontalPodAutoscaler

HTTP 请求

GET /apis/autoscaling/v2/namespaces/{namespace}/horizontalpodautoscalers/{name}

参数

响应

200 (HorizontalPodAutoscaler): OK

401: Unauthorized

get 读取指定 HorizontalPodAutoscaler 的状态

HTTP 请求

GET /apis/autoscaling/v2/namespaces/{namespace}/horizontalpodautoscalers/{name}/status

参数

响应

200 (HorizontalPodAutoscaler): OK

401: Unauthorized

list 列出或观察 HorizontalPodAutoscaler 类别的对象

HTTP 请求

GET /apis/autoscaling/v2/namespaces/{namespace}/horizontalpodautoscalers

参数

响应

200 (HorizontalPodAutoscalerList): OK

401: Unauthorized

list 列出或观察 HorizontalPodAutoscaler 类别的对象

HTTP 请求

GET /apis/autoscaling/v2/horizontalpodautoscalers

参数

响应

200 (HorizontalPodAutoscalerList): OK

401: Unauthorized

create 创建一个 HorizontalPodAutoscaler

HTTP 请求

POST /apis/autoscaling/v2/namespaces/{namespace}/horizontalpodautoscalers

参数

响应

200 (HorizontalPodAutoscaler): OK

201 (HorizontalPodAutoscaler): Created

202 (HorizontalPodAutoscaler): Accepted

401: Unauthorized

update 替换指定的 HorizontalPodAutoscaler

HTTP 请求

PUT /apis/autoscaling/v2/namespaces/{namespace}/horizontalpodautoscalers/{name}

参数

响应

200 (HorizontalPodAutoscaler): OK

201 (HorizontalPodAutoscaler): Created

401: Unauthorized

update 替换指定 HorizontalPodAutoscaler 的状态

HTTP 请求

PUT /apis/autoscaling/v2/namespaces/{namespace}/horizontalpodautoscalers/{name}/status

参数

响应

200 (HorizontalPodAutoscaler): OK

201 (HorizontalPodAutoscaler): Created

401: Unauthorized

patch 部分更新指定的 HorizontalPodAutoscaler

HTTP 请求

PATCH /apis/autoscaling/v2/namespaces/{namespace}/horizontalpodautoscalers/{name}

参数

响应

200 (HorizontalPodAutoscaler): OK

201 (HorizontalPodAutoscaler): Created

401: Unauthorized

patch 部分更新指定 HorizontalPodAutoscaler 的状态

HTTP 请求

PATCH /apis/autoscaling/v2/namespaces/{namespace}/horizontalpodautoscalers/{name}/status

参数

响应

200 (HorizontalPodAutoscaler): OK

201 (HorizontalPodAutoscaler): Created

401: Unauthorized

delete 删除一个 HorizontalPodAutoscaler

HTTP 请求

DELETE /apis/autoscaling/v2/namespaces/{namespace}/horizontalpodautoscalers/{name}

参数

响应

200 (Status): OK

202 (Status): Accepted

401: Unauthorized

deletecollection 删除 HorizontalPodAutoscaler 的集合

HTTP 请求

DELETE /apis/autoscaling/v2/namespaces/{namespace}/horizontalpodautoscalers

参数

响应

200 (Status): OK

401: Unauthorized

1.14 - PriorityClass

PriorityClass 定义了从优先级类名到优先级数值的映射。

apiVersion: scheduling.k8s.io/v1

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

PriorityClass

PriorityClass 定义了从优先级类名到优先级数值的映射。 该值可以是任何有效的整数。


PriorityClassList

PriorityClassList 是优先级类的集合。


操作


get 读取特定的 PriorityClass

HTTP 请求

GET /apis/scheduling.k8s.io/v1/priorityclasses/{name}

参数

响应

200 (PriorityClass): OK

401: Unauthorized

list 列出或观察 PriorityClass类的对象

HTTP 请求

GET /apis/scheduling.k8s.io/v1/priorityclasses

参数

响应

200 (PriorityClassList): OK

401: Unauthorized

create 创建一个 PriorityClass

HTTP 请求

POST /apis/scheduling.k8s.io/v1/priorityclasses

参数

响应

200 (PriorityClass): OK

201 (PriorityClass): Created

202 (PriorityClass): Accepted

401: Unauthorized

update 替换指定的 PriorityClass

HTTP 请求

PUT /apis/scheduling.k8s.io/v1/priorityclasses/{name}

参数

响应

200 (PriorityClass): OK

201 (PriorityClass): Created

401: Unauthorized

patch 部分更新特定的 PriorityClass

HTTP 请求

PATCH /apis/scheduling.k8s.io/v1/priorityclasses/{name}

参数

响应

200 (PriorityClass): OK

201 (PriorityClass): Created

401: Unauthorized

delete 删除一个 PriorityClass

HTTP 请求

DELETE /apis/scheduling.k8s.io/v1/priorityclasses/{name}

参数

响应

200 (Status): OK

202 (Status): Accepted

401: Unauthorized

deletecollection 删除 PriorityClass 集合

HTTP 请求

DELETE /apis/scheduling.k8s.io/v1/priorityclasses

参数

响应

200 (Status): OK

401: Unauthorized

1.15 - DeviceTaintRule v1alpha3

DeviceTaintRule 添加一个污点到与选择算符匹配的所有设备上。

apiVersion: resource.k8s.io/v1alpha3

import "k8s.io/api/resource/v1alpha3"

DeviceTaintRule

DeviceTaintRule 添加一个污点到与选择算符匹配的所有设备上。 这与通过 DRA 驱动直接在 ResourceSlice 中指定污点具有同样的效果。


DeviceTaintRuleSpec

DeviceTaintRuleSpec 指定选择算符和一个污点。


DeviceTaintRuleList

DeviceTaintRuleList 是 DeviceTaintRules 的集合。


操作


get 读取指定的 DeviceTaintRule

HTTP 请求

GET /apis/resource.k8s.io/v1alpha3/devicetaintrules/{name}

参数

响应

200 (DeviceTaintRule): OK

401: Unauthorized

list 列举或监视类别为 DeviceTaintRule 的对象

HTTP 请求

GET /apis/resource.k8s.io/v1alpha3/devicetaintrules

参数

响应

200 (DeviceTaintRuleList): OK

401: Unauthorized

create 创建 DeviceTaintRule

HTTP 请求

POST /apis/resource.k8s.io/v1alpha3/devicetaintrules

参数

响应

200 (DeviceTaintRule): OK

201 (DeviceTaintRule): Created

202 (DeviceTaintRule): Accepted

401: Unauthorized

update 替换指定的 DeviceTaintRule

HTTP 请求

PUT /apis/resource.k8s.io/v1alpha3/devicetaintrules/{name}

参数

响应

200 (DeviceTaintRule): OK

201 (DeviceTaintRule): Created

401: Unauthorized

patch 部分更新指定的 DeviceTaintRule

HTTP 请求

PATCH /apis/resource.k8s.io/v1alpha3/devicetaintrules/{name}

参数

响应

200 (DeviceTaintRule): OK

201 (DeviceTaintRule): Created

401: Unauthorized

delete 删除 DeviceTaintRule

HTTP 请求

DELETE /apis/resource.k8s.io/v1alpha3/devicetaintrules/{name}

参数

响应

200 (DeviceTaintRule): OK

202 (DeviceTaintRule): Accepted

401: Unauthorized

deletecollection 删除 DeviceTaintRule 的集合

HTTP 请求

DELETE /apis/resource.k8s.io/v1alpha3/devicetaintrules

参数

响应

200 (Status): OK

401: Unauthorized

1.16 - ResourceClaim v1beta2

ResourceClaim 描述对集群中供工作负载使用的资源的访问请求。

apiVersion: resource.k8s.io/v1beta2

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

ResourceClaim

ResourceClaim 描述对集群中供工作负载使用的资源的访问请求。 例如,如果某个工作负载需要具有特定属性的加速器设备,这就是表达该请求的方式。 状态部分跟踪此申领是否已被满足,以及具体分配了哪些资源。

这是一个 Alpha 级别的资源类型,需要启用 DynamicResourceAllocation 特性门控。


ResourceClaimSpec

ResourceClaimSpec 定义在 ResourceClaim 中正在被请求的资源及其配置方式。


ResourceClaimStatus

ResourceClaimStatus 跟踪资源是否已被分配以及产生的结果是什么。


ResourceClaimList

ResourceClaimList 是申领的集合。


操作


get 读取指定的 ResourceClaim

HTTP 请求

GET /apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaims/{name}

参数

响应

200 (ResourceClaim): OK

401: Unauthorized

get 读取指定 ResourceClaim 的状态

HTTP 请求

GET /apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaims/{name}/status

参数

响应

200 (ResourceClaim): OK

401: Unauthorized

list 列举或监视 ResourceClaim 类别的对象

HTTP 请求

GET /apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaims

参数

响应

200 (ResourceClaimList): OK

401: Unauthorized

list 列举或监视 ResourceClaim 类别的对象

HTTP 请求

GET /apis/resource.k8s.io/v1beta2/resourceclaims

参数

响应

200 (ResourceClaimList): OK

401: Unauthorized

create 创建 ResourceClaim

HTTP 请求

POST /apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaims

参数

响应

200 (ResourceClaim): OK

201 (ResourceClaim): Created

202 (ResourceClaim): Accepted

401: Unauthorized

update 替换指定的 ResourceClaim

HTTP 请求

PUT /apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaims/{name}

参数

响应

200 (ResourceClaim): OK

201 (ResourceClaim): Created

401: Unauthorized

update 替换指定 ResourceClaim 的状态

HTTP 请求

PUT /apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaims/{name}/status

参数

响应

200 (ResourceClaim): OK

201 (ResourceClaim): Created

401: Unauthorized

patch 部分更新指定的 ResourceClaim

HTTP 请求

PATCH /apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaims/{name}

参数

响应

200 (ResourceClaim): OK

201 (ResourceClaim): Created

401: Unauthorized

patch 部分更新指定 ResourceClaim 的状态

HTTP 请求

PATCH /apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaims/{name}/status

参数

响应

200 (ResourceClaim): OK

201 (ResourceClaim): Created

401: Unauthorized

delete 删除 ResourceClaim

HTTP 请求

DELETE /apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaims/{name}

参数

响应

200 (ResourceClaim): OK

202 (ResourceClaim): Accepted

401: Unauthorized

deletecollection 删除 ResourceClaim 的集合

HTTP 请求

DELETE /apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaims

参数

响应

200 (Status): OK

401: Unauthorized

1.17 - ResourceClaimTemplate v1beta2

ResourceClaimTemplate 用于生成 ResourceClaim 对象。

apiVersion: resource.k8s.io/v1beta2

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

ResourceClaimTemplate

ResourceClaimTemplate 用于生成 ResourceClaim 对象。

这是一个 Alpha 类型的特性,需要启用 DynamicResourceAllocation 特性门控。


ResourceClaimTemplateSpec

ResourceClaimTemplateSpec 包含针对 ResourceClaim 的元数据和字段。


ResourceClaimTemplateList

ResourceClaimTemplateList 是申领模板的集合。


操作


get 读取指定的 ResourceClaimTemplate

HTTP 请求

GET /apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaimtemplates/{name}

参数

响应

200 (ResourceClaimTemplate): OK

401: Unauthorized

list 列举或监视 ResourceClaimTemplate 类别的对象

HTTP 请求

GET /apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaimtemplates

参数

响应

200 (ResourceClaimTemplateList): OK

401: Unauthorized

list 列举或监视 ResourceClaimTemplate 类别的对象

HTTP 请求

GET /apis/resource.k8s.io/v1beta2/resourceclaimtemplates

参数

响应

200 (ResourceClaimTemplateList): OK

401: Unauthorized

create 创建 ResourceClaimTemplate

HTTP 请求

POST /apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaimtemplates

参数

响应

200 (ResourceClaimTemplate): OK

201 (ResourceClaimTemplate): Created

202 (ResourceClaimTemplate): Accepted

401: Unauthorized

update 替换指定的 ResourceClaimTemplate

HTTP 请求

PUT /apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaimtemplates/{name}

参数

响应

200 (ResourceClaimTemplate): OK

201 (ResourceClaimTemplate): Created

401: Unauthorized

patch 部分更新指定的 ResourceClaimTemplate

HTTP 请求

PATCH /apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaimtemplates/{name}

参数

响应

200 (ResourceClaimTemplate): OK

201 (ResourceClaimTemplate): Created

401: Unauthorized

delete 删除 ResourceClaimTemplate

HTTP 请求

DELETE /apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaimtemplates/{name}

参数

响应

200 (ResourceClaimTemplate): OK

202 (ResourceClaimTemplate): Accepted

401: Unauthorized

deletecollection 删除 ResourceClaimTemplate 的集合

HTTP 请求

DELETE /apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaimtemplates

参数

响应

200 (Status): OK

401: Unauthorized

1.18 - ResourceSlice v1beta1

ResourceSlice 表示一个或多个资源,这些资源位于同一个驱动所管理的、彼此相似的资源构成的资源池。

apiVersion: resource.k8s.io/v1beta1

import "k8s.io/api/resource/v1beta1"

ResourceSlice

ResourceSlice 表示一个或多个资源,这些资源位于同一个驱动所管理的、彼此相似的资源构成的资源池。 一个池可以包含多个 ResourceSlice,一个池包含多少个 ResourceSlice 由驱动确定。

目前,所支持的资源只能是具有属性和容量的设备。 给定池中的每个设备,无论有多少个 ResourceSlice,必须具有唯一名称。 发布设备的 ResourceSlice 可能会随着时间的推移而变化。 设备的唯一标识符是元组 <驱动名称>、<池名称>、<设备名称>。

每当驱动需要更新池时,pool.spec.pool.generation 编号加一, 并用新的编号和新的资源定义来更新所有 ResourceSlice。 资源用户必须仅使用 generation 编号最大的 ResourceSlice,并忽略所有其他 ResourceSlice。

从池中分配符合某些条件的所有资源或在多个不同分配方案间寻找最佳方案时, 资源用户应检查池中的 ResourceSlice 数量(包含在每个 ResourceSlice 中), 以确定其对池的视图是否完整,如果不完整,则应等到驱动完成对池的更新。

对于非某节点本地的资源,节点名称不会被设置。 驱动可以使用节点选择算符来给出设备的可用位置。

此特性为 Alpha 级别,需要启用 DynamicResourceAllocation 特性门控。


ResourceSliceSpec

ResourceSliceSpec 包含驱动在一个 ResourceSlice 中所发布的信息。


ResourceSliceList

ResourceSliceList 是 ResourceSlice 的集合。


操作


get 读取指定的 ResourceSlice

HTTP 请求

GET /apis/resource.k8s.io/v1beta1/resourceslices/{name}

参数

响应

200 (ResourceSlice): OK

401: Unauthorized

list 列举或监视类别为 ResourceSlice 的对象

HTTP 请求

GET /apis/resource.k8s.io/v1beta1/resourceslices

参数

响应

200 (ResourceSliceList): OK

401: Unauthorized

create 创建 ResourceSlice

HTTP 请求

POST /apis/resource.k8s.io/v1beta1/resourceslices

参数

响应

200 (ResourceSlice): OK

201 (ResourceSlice): Created

202 (ResourceSlice): Accepted

401: Unauthorized

update 替换指定的 ResourceSlice

HTTP 请求

PUT /apis/resource.k8s.io/v1beta1/resourceslices/{name}

参数

响应

200 (ResourceSlice): OK

201 (ResourceSlice): Created

401: Unauthorized

patch 部分更新指定的 ResourceSlice

HTTP 请求

PATCH /apis/resource.k8s.io/v1beta1/resourceslices/{name}

参数

响应

200 (ResourceSlice): OK

201 (ResourceSlice): Created

401: Unauthorized

delete 删除 ResourceSlice

HTTP 请求

DELETE /apis/resource.k8s.io/v1beta1/resourceslices/{name}

参数

响应

200 (ResourceSlice): OK

202 (ResourceSlice): Accepted

401: Unauthorized

deletecollection 删除 ResourceSlice 的集合

HTTP 请求

DELETE /apis/resource.k8s.io/v1beta1/resourceslices

参数

响应

200 (Status): OK

401: Unauthorized

1.19 - ResourceSlice v1alpha3

ResourceSlice 表示一个或多个资源,这些资源位于同一个驱动所管理的、彼此相似的资源构成的资源池。

apiVersion: resource.k8s.io/v1alpha3

import "k8s.io/api/resource/v1alpha3"

ResourceSlice

ResourceSlice 表示一个或多个资源,这些资源位于同一个驱动所管理的、彼此相似的资源构成的资源池。 一个池可以包含多个 ResourceSlice,一个池包含多少个 ResourceSlice 由驱动确定。

目前,所支持的资源只能是具有属性和容量的设备。 给定池中的每个设备,无论有多少个 ResourceSlice,必须具有唯一名称。 发布设备的 ResourceSlice 可能会随着时间的推移而变化。 设备的唯一标识符是元组 <驱动名称>、<池名称>、<设备名称>。

每当驱动需要更新池时,pool.spec.pool.generation 编号加一, 并用新的编号和新的资源定义来更新所有 ResourceSlice。 资源用户必须仅使用 generation 编号最大的 ResourceSlice,并忽略所有其他 ResourceSlice。

从池中分配符合某些条件的所有资源或在多个不同分配方案间寻找最佳方案时, 资源用户应检查池中的 ResourceSlice 数量(包含在每个 ResourceSlice 中), 以确定其对池的视图是否完整,如果不完整,则应等到驱动完成对池的更新。

对于非某节点本地的资源,节点名称不会被设置。 驱动可以使用节点选择算符来给出设备的可用位置。

此特性为 Alpha 级别,需要启用 DynamicResourceAllocation 特性门控。


ResourceSliceSpec

ResourceSliceSpec 包含驱动在一个 ResourceSlice 中所发布的信息。


ResourceSliceList

ResourceSliceList 是 ResourceSlice 的集合。


操作


get 读取指定的 ResourceSlice

HTTP 请求

GET /apis/resource.k8s.io/v1alpha3/resourceslices/{name}

参数

响应

200 (ResourceSlice): OK

401: Unauthorized

list 列举或监视类别为 ResourceSlice 的对象

HTTP 请求

GET /apis/resource.k8s.io/v1alpha3/resourceslices

参数

响应

200 (ResourceSliceList): OK

401: Unauthorized

create 创建 ResourceSlice

HTTP 请求

POST /apis/resource.k8s.io/v1alpha3/resourceslices

参数

响应

200 (ResourceSlice): OK

201 (ResourceSlice): Created

202 (ResourceSlice): Accepted

401: Unauthorized

update 替换指定的 ResourceSlice

HTTP 请求

PUT /apis/resource.k8s.io/v1alpha3/resourceslices/{name}

参数

响应

200 (ResourceSlice): OK

201 (ResourceSlice): Created

401: Unauthorized

patch 部分更新指定的 ResourceSlice

HTTP 请求

PATCH /apis/resource.k8s.io/v1alpha3/resourceslices/{name}

参数

响应

200 (ResourceSlice): OK

201 (ResourceSlice): Created

401: Unauthorized

delete 删除 ResourceSlice

HTTP 请求

DELETE /apis/resource.k8s.io/v1alpha3/resourceslices/{name}

参数

响应

200 (ResourceSlice): OK

202 (ResourceSlice): Accepted

401: Unauthorized

deletecollection 删除 ResourceSlice 的集合

HTTP 请求

DELETE /apis/resource.k8s.io/v1alpha3/resourceslices

参数

响应

200 (Status): OK

401: Unauthorized

2 - Service 资源

2.1 - Service

Service 是软件服务(例如 mysql)的命名抽象,包含代理要侦听的本地端口(例如 3306)和一个选择算符,选择算符用来确定哪些 Pod 将响应通过代理发送的请求。

apiVersion: v1

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

Service

Service 是软件服务(例如 mysql)的命名抽象,包含代理要侦听的本地端口(例如 3306)和一个选择算符, 选择算符用来确定哪些 Pod 将响应通过代理发送的请求。


ServiceSpec

ServiceSpec 描述用户在服务上创建的属性。


ServiceStatus

ServiceStatus 表示 Service 的当前状态。


ServiceList

ServiceList 包含一个 Service 列表。


操作


get 读取指定的 Service

HTTP 请求

GET /api/v1/namespaces/{namespace}/services/{name}

参数

响应

200(Service): OK

401: Unauthorized

get 读取指定 Service 的状态

HTTP 请求

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

参数

响应

200(Service): OK

401: Unauthorized

list 列出或监测 Service 类型的对象

HTTP 请求

GET /api/v1/namespaces/{namespace}/services

参数

响应

200(ServiceList): OK

401: Unauthorized

list 列出或监测 Service 类型的对象

HTTP 请求

GET /api/v1/services

参数

响应

200(ServiceList): OK

401: Unauthorized

create 创建一个 Service

HTTP 请求

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

参数

响应

200(Service): OK

201(Service): Created

202(Service): Accepted

401: Unauthorized

update 替换指定的 Service

HTTP 请求

PUT /api/v1/namespaces/{namespace}/services/{name}

参数

响应

200(Service): OK

201(Service): Created

401: Unauthorized

update 替换指定 Service 的状态

HTTP 请求

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

参数

响应

200(Service): OK

201(Service): Created

401: Unauthorized

patch 部分更新指定的 Service

HTTP 请求

PATCH /api/v1/namespaces/{namespace}/services/{name}

参数

响应

200(Service): OK

201(Service): Created

401: Unauthorized

patch 部分更新指定 Service 的状态

HTTP 请求

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

参数

响应

200(Service): OK

201(Service): Created

401: Unauthorized

delete 删除 Service

HTTP 请求

DELETE /api/v1/namespaces/{namespace}/services/{name}

参数

响应

200(Service): OK

202(Service): Accepted

401: Unauthorized

deletecollection 删除 Service 集合

HTTP 请求

DELETE /api/v1/namespaces/{namespace}/services

参数

响应

200(Status): OK

401: Unauthorized

2.2 - Endpoints

Endpoints 是实现实际服务的端点的集合。

apiVersion: v1

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

Endpoints

Endpoints 是实现实际 Service 的端点的集合。举例:

Name: "mysvc",
Subsets: [
  {
    Addresses: [{"ip": "10.10.1.1"}, {"ip": "10.10.2.2"}],
    Ports: [{"name": "a", "port": 8675}, {"name": "b", "port": 309}]
  },
  {
    Addresses: [{"ip": "10.10.3.3"}],
    Ports: [{"name": "a", "port": 93}, {"name": "b", "port": 76}]
  },
]

Endpoints 是遗留 API,不包含所有 Service 特性的信息。使用 discoveryv1.EndpointSlice 获取关于 Service 端点的完整信息。

已弃用:此 API 在 v1.33+ 中已被弃用。请使用 discoveryv1.EndpointSlice

EndpointsList

EndpointsList 是端点列表。已弃用:此 API 在 v1.33+ 中已被弃用。


操作


get 读取指定的 Endpoints

HTTP 请求

GET /api/v1/namespaces/{namespace}/endpoints/{name}

参数

响应

200 (Endpoints): OK

401: Unauthorized

list 列出或监测 Endpoints 类型的对象

HTTP 请求

GET /api/v1/namespaces/{namespace}/endpoints

参数

响应

200 (EndpointsList): OK

401: Unauthorized

list 列出或监测 Endpoints 类型的对象

HTTP 请求

GET /api/v1/endpoints

参数

响应

200 (EndpointsList): OK

401: Unauthorized

create 创建 Endpoints

HTTP 请求

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

参数

响应

200 (Endpoints): OK

201 (Endpoints): Created

202 (Endpoints): Accepted

401: Unauthorized

update 替换指定的 Endpoints

HTTP 请求

PUT /api/v1/namespaces/{namespace}/endpoints/{name}

参数

响应

200 (Endpoints): OK

201 (Endpoints): Created

401: Unauthorized

patch 部分更新指定的 Endpoints

HTTP 请求

PATCH /api/v1/namespaces/{namespace}/endpoints/{name}

参数

响应

200 (Endpoints): OK

201 (Endpoints): Created

401: Unauthorized

delete 删除 Endpoints

HTTP 请求

DELETE /api/v1/namespaces/{namespace}/endpoints/{name}

参数

响应

200 (Status): OK

202 (Status): Accepted

401: Unauthorized

deletecollection 删除 Endpoints 组

HTTP 请求

DELETE /api/v1/namespaces/{namespace}/endpoints

参数

响应

200 (Status): OK

401: Unauthorized

2.3 - EndpointSlice

EndpointSlice 代表一组服务端点。

apiVersion: discovery.k8s.io/v1

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

EndpointSlice

EndpointSlice 表示一组服务端点。大多数 EndpointSlice 由 EndpointSlice 控制器创建,用于表示被 Service 对象选中的 Pod。对于一个给定的服务,可能存在多个 EndpointSlice 对象,这些对象必须被组合在一起以产生完整的端点集合; 你可以通过在服务的命名空间中列出 kubernetes.io/service-name 标签包含 Service 名称的 EndpointSlices 来找到给定 Service 的所有 slices。


EndpointSliceList

EndpointSliceList 是 EndpointSlice 的列表。


操作


get 读取指定的 EndpointSlice

HTTP 请求

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

参数

响应

200 (EndpointSlice):OK

401:Unauthorized

list 列举或监测 EndpointSlice 类别的对象

HTTP 请求

GET /apis/discovery.k8s.io/v1/namespaces/{namespace}/endpointslices

参数

响应

200 (EndpointSliceList): OK

401:Unauthorized

list 列举或监测 EndpointSlice 类别的对象

HTTP 请求

GET /apis/discovery.k8s.io/v1/endpointslices

参数

响应

200 (EndpointSliceList):OK

401:Unauthorized

create 创建 EndpointSlice

HTTP 请求

POST /apis/discovery.k8s.io/v1/namespaces/{namespace}/endpointslices

参数

响应

200 (EndpointSlice):OK

201 (EndpointSlice):Created

202 (EndpointSlice):Accepted

401:Unauthorized

update 替换指定的 EndpointSlice

HTTP 请求

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

参数

响应

200 (EndpointSlice):OK

201 (EndpointSlice):Created

401:Unauthorized

patch 部分更新指定的 EndpointSlice

HTTP 请求

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

参数

响应

200 (EndpointSlice):OK

201 (EndpointSlice):Created

401:Unauthorized

delete 删除 EndpointSlice

HTTP 请求

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

参数

响应

200 (Status):OK

202 (Status):Accepted

401:Unauthorized

deletecollection 删除 EndpointSlice 的集合

HTTP 请求

DELETE /apis/discovery.k8s.io/v1/namespaces/{namespace}/endpointslices

参数

响应

200 (Status):OK

401:Unauthorized

2.4 - Ingress

Ingress 是允许入站连接到达后端定义的端点的规则集合。

apiVersion: networking.k8s.io/v1

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

Ingress

Ingress 是允许入站连接到达后端定义的端点的规则集合。 Ingress 可以配置为向服务提供外部可访问的 URL、负载均衡流量、终止 SSL、提供基于名称的虚拟主机等。


IngressSpec

IngressSpec 描述用户希望存在的 Ingress。


IngressBackend

IngressBackend 描述给定服务和端口的所有端点。


IngressStatus

IngressStatus 描述 Ingress 的当前状态。


IngressList

IngressList 是 Ingress 的集合。


操作


get 读取指定的 Ingress

HTTP 请求

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

参数

响应

200 (Ingress): OK

401: Unauthorized

get 读取指定 Ingress 状态

HTTP 请求

GET /apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses/{name}/status

参数

响应

200 (Ingress): OK

401: Unauthorized

list 列出或监测 Ingress 类型对象

HTTP 请求

GET /apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses

参数

响应

200 (IngressList): OK

401: Unauthorized

list 列出或监测 Ingress 类型对象

HTTP 请求

GET /apis/networking.k8s.io/v1/ingresses

参数

响应

200 (IngressList): OK

401: Unauthorized

create 创建一个 Ingress

HTTP 请求

POST /apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses

参数

响应

200 (Ingress): OK

201 (Ingress): Created

202 (Ingress): Accepted

401: Unauthorized

update 替换指定的 Ingress

HTTP 请求

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

参数

响应

200 (Ingress): OK

201 (Ingress): Created

401: Unauthorized

update 替换指定 Ingress 的状态

HTTP 请求

PUT /apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses/{name}/status

参数

响应

200 (Ingress): OK

201 (Ingress): Created

401: Unauthorized

patch 部分更新指定的 Ingress

HTTP 请求

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

参数

响应

200 (Ingress): OK

201 (Ingress): Created

401: Unauthorized

patch 部分更新指定 Ingress 的状态

HTTP 请求

PATCH /apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses/{name}/status

参数

响应

200 (Ingress): OK

201 (Ingress): Created

401: Unauthorized

delete 删除一个 Ingress

HTTP 请求

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

参数

响应

200 (Status): OK

202 (Status): Accepted

401: Unauthorized

deletecollection 删除 Ingress 的集合

HTTP 请求

DELETE /apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses

参数

响应

200 (Status): OK

401: Unauthorized

2.5 - IngressClass

IngressClass 代表 Ingress 的类,被 Ingress 的规约引用。

apiVersion: networking.k8s.io/v1

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

IngressClass

IngressClass 代表 Ingress 的类,被 Ingress 的规约引用。 ingressclass.kubernetes.io/is-default-class 注解可以用来标明一个 IngressClass 应该被视为默认的 Ingress 类。 当某个 IngressClass 资源将此注解设置为 true 时, 没有指定类的新 Ingress 资源将被分配到此默认类。


IngressClassSpec

IngressClassSpec 提供有关 Ingress 类的信息。


IngressClassList

IngressClassList 是 IngressClasses 的集合。


操作


get 读取指定的 IngressClass

HTTP 请求

GET /apis/networking.k8s.io/v1/ingressclasses/{name}

参数

响应

200 (IngressClass): OK

401: Unauthorized

list 列出或监视 IngressClass 类型的对象

HTTP 请求

GET /apis/networking.k8s.io/v1/ingressclasses

参数

响应

200 (IngressClassList): OK

401: Unauthorized

create 创建一个 IngressClass

HTTP 请求

POST /apis/networking.k8s.io/v1/ingressclasses

参数

响应

200 (IngressClass): OK

201 (IngressClass): Created

202 (IngressClass): Accepted

401: Unauthorized

update 替换指定的 IngressClass

HTTP 请求

PUT /apis/networking.k8s.io/v1/ingressclasses/{name}

参数

响应

200 (IngressClass): OK

201 (IngressClass): Created

401: Unauthorized

patch 部分更新指定的 IngressClass

HTTP 请求

PATCH /apis/networking.k8s.io/v1/ingressclasses/{name}

参数

响应

200 (IngressClass): OK

201 (IngressClass): Created

401: Unauthorized

delete 删除一个 IngressClass

HTTP 请求

DELETE /apis/networking.k8s.io/v1/ingressclasses/{name}

参数

响应

200 (Status): OK

202 (Status): Accepted

401: Unauthorized

deletecollection 删除 IngressClass 的集合

DELETE /apis/networking.k8s.io/v1/ingressclasses

参数

响应

200 (Status): OK

401: Unauthorized

3 - 配置和存储资源

3.1 - ConfigMap

ConfigMap 包含供 Pod 使用的配置数据。

apiVersion: v1

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

ConfigMap

ConfigMap 包含供 Pod 使用的配置数据。


ConfigMapList

ConfigMapList 是包含 ConfigMap 对象列表的资源。


操作


get 读取指定的 ConfigMap

HTTP 请求

GET /api/v1/namespaces/{namespace}/configmaps/{name}

参数

响应

200 (ConfigMap): OK

401: Unauthorized

list 列出或观测类别为 ConfigMap 的对象

HTTP 请求

GET /api/v1/namespaces/{namespace}/configmaps

参数

响应

200 (ConfigMapList): OK

401: Unauthorized

list 列出或观测类别为 ConfigMap 的对象

HTTP 请求

GET /api/v1/configmaps

参数

响应

200 (ConfigMapList): OK

401: Unauthorized

create 创建 ConfigMap

HTTP 请求

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

参数

响应

200 (ConfigMap): OK

201 (ConfigMap): Created

202 (ConfigMap): Accepted

401: Unauthorized

update 替换指定的 ConfigMap

HTTP 请求

PUT /api/v1/namespaces/{namespace}/configmaps/{name}

参数

响应

200 (ConfigMap): OK

201 (ConfigMap): Created

401: Unauthorized

patch 部分更新指定的 ConfigMap

HTTP 请求

PATCH /api/v1/namespaces/{namespace}/configmaps/{name}

参数

响应

200 (ConfigMap): OK

201 (ConfigMap): Created

401: Unauthorized

delete 删除 ConfigMap

HTTP 请求

DELETE /api/v1/namespaces/{namespace}/configmaps/{name}

参数

响应

200 (Status): OK

202 (Status): Accepted

401: Unauthorized

deletecollection 删除 ConfigMap 的集合

HTTP 请求

DELETE /api/v1/namespaces/{namespace}/configmaps

参数

响应

200 (Status): OK

401: Unauthorized

3.2 - Secret

Secret 包含某些类别的秘密数据。

apiVersion: v1

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

Secret

Secret 包含某些类别的秘密数据。 data 字段值的总字节必须小于 MaxSecretSize 字节。


SecretList

SecretList 是 Secret 的列表。


操作


get 读取指定的 Secret

HTTP 请求

GET /api/v1/namespaces/{namespace}/secrets/{name}

参数

响应

200 (Secret): OK

401: Unauthorized

list 列举或观测类别为 Secret 的对象

HTTP 请求

GET /api/v1/namespaces/{namespace}/secrets

参数

响应

200 (SecretList): OK

401: Unauthorized

list 列举或观测类别为 Secret 的对象

HTTP 请求

GET /api/v1/secrets

参数

响应

200 (SecretList): OK

401: Unauthorized

create 创建 Secret

HTTP 请求

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

参数

响应

200 (Secret): OK

201 (Secret): Created

202 (Secret): Accepted

401: Unauthorized

update 替换指定的 Secret

HTTP 请求

PUT /api/v1/namespaces/{namespace}/secrets/{name}

参数

响应

200 (Secret): OK

201 (Secret): Created

401: Unauthorized

patch 部分更新指定的 Secret

HTTP 请求

PATCH /api/v1/namespaces/{namespace}/secrets/{name}

参数

响应

200 (Secret): OK

201 (Secret): Created

401: Unauthorized

delete 删除 Secret

HTTP 请求

DELETE /api/v1/namespaces/{namespace}/secrets/{name}

参数

响应

200 (Status): OK

202 (Status): Accepted

401: Unauthorized

deletecollection 删除 Secret 的集合

HTTP 请求

DELETE /api/v1/namespaces/{namespace}/secrets

参数

响应

200 (Status): OK

401: Unauthorized

3.3 - CSIDriver

CSIDriver 抓取集群上部署的容器存储接口(CSI)卷驱动有关的信息。

apiVersion: storage.k8s.io/v1

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

CSIDriver

CSIDriver 抓取集群上部署的容器存储接口(CSI)卷驱动有关的信息。 Kubernetes 挂接/解除挂接控制器使用此对象来决定是否需要挂接。 kubelet 使用此对象决定挂载时是否需要传递 Pod 信息。 CSIDriver 对象未划分命名空间。


CSIDriverSpec

CSIDriverSpec 是 CSIDriver 的规约。


CSIDriverList

CSIDriverList 是 CSIDriver 对象的集合。


操作


get 读取指定的 CSIDriver

HTTP 请求

GET /apis/storage.k8s.io/v1/csidrivers/{name}

参数

响应

200 (CSIDriver): OK

401: Unauthorized

list 列出或观测类别为 CSIDriver 的对象

HTTP 请求

GET /apis/storage.k8s.io/v1/csidrivers

参数

响应

200 (CSIDriverList): OK

401: Unauthorized

create 创建 CSIDriver

HTTP 请求

POST /apis/storage.k8s.io/v1/csidrivers

参数

响应

200 (CSIDriver): OK

201 (CSIDriver): Created

202 (CSIDriver): Accepted

401: Unauthorized

update 替换指定的 CSIDriver

HTTP 请求

PUT /apis/storage.k8s.io/v1/csidrivers/{name}

参数

响应

200 (CSIDriver): OK

201 (CSIDriver): Created

401: Unauthorized

patch 部分更新指定的 CSIDriver

HTTP 请求

PATCH /apis/storage.k8s.io/v1/csidrivers/{name}

参数

响应

200 (CSIDriver): OK

201 (CSIDriver): Created

401: Unauthorized

delete 删除 CSIDriver

HTTP 请求

DELETE /apis/storage.k8s.io/v1/csidrivers/{name}

参数

响应

200 (CSIDriver): OK

202 (CSIDriver): Accepted

401: Unauthorized

deletecollection 删除 CSIDriver 的集合

HTTP 请求

DELETE /apis/storage.k8s.io/v1/csidrivers

参数

响应

200 (Status): OK

401: Unauthorized

3.4 - CSINode

CSINode 包含节点上安装的所有 CSI 驱动有关的信息。

apiVersion: storage.k8s.io/v1

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

CSINode

CSINode 包含节点上安装的所有 CSI 驱动有关的信息。CSI 驱动不需要直接创建 CSINode 对象。 只要这些驱动使用 node-driver-registrar 边车容器,kubelet 就会自动为 CSI 驱动填充 CSINode 对象, 作为 kubelet 插件注册操作的一部分。CSINode 的名称与节点名称相同。 如果不存在此对象,则说明该节点上没有可用的 CSI 驱动或 Kubelet 版本太低无法创建该对象。 CSINode 包含指向相应节点对象的 OwnerReference。


CSINodeSpec

CSINodeSpec 包含一个节点上安装的所有 CSI 驱动规约有关的信息。


CSINodeList

CSINodeList 是 CSINode 对象的集合。


操作


get 读取指定的 CSINode

HTTP 请求

GET /apis/storage.k8s.io/v1/csinodes/{name}

参数

响应

200 (CSINode): OK

401: Unauthorized

list 列举或观测类别为 CSINode 的对象

HTTP 请求

GET /apis/storage.k8s.io/v1/csinodes

参数

响应

200 (CSINodeList): OK

401: Unauthorized

create 创建 CSINode

HTTP 请求

POST /apis/storage.k8s.io/v1/csinodes

参数

响应

200 (CSINode): OK

201 (CSINode): Created

202 (CSINode): Accepted

401: Unauthorized

update 替换指定的 CSINode

HTTP 请求

PUT /apis/storage.k8s.io/v1/csinodes/{name}

参数

响应

200 (CSINode): OK

201 (CSINode): Created

401: Unauthorized

patch 部分更新指定的 CSINode

HTTP 请求

PATCH /apis/storage.k8s.io/v1/csinodes/{name}

参数

响应

200 (CSINode): OK

201 (CSINode): Created

401: Unauthorized

delete 删除 CSINode

HTTP 请求

DELETE /apis/storage.k8s.io/v1/csinodes/{name}

参数

响应

200 (CSINode): OK

202 (CSINode): Accepted

401: Unauthorized

deletecollection 删除 CSINode 的集合

HTTP 请求

DELETE /apis/storage.k8s.io/v1/csinodes

参数

响应

200 (Status): OK

401: Unauthorized

3.5 - CSIStorageCapacity

CSIStorageCapacity 存储一个 CSI GetCapacity 调用的结果。

apiVersion: storage.k8s.io/v1

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

CSIStorageCapacity

CSIStorageCapacity 存储一个 CSI GetCapacity 调用的结果。 对于给定的 StorageClass,此结构描述了特定拓扑段中可用的容量。 当考虑在哪里实例化新的 PersistentVolume 时可以使用此项。

例如,此结构可以描述如下内容:

以下三种情况均暗示了某些组合没有可用的容量:

这些对象的制作方可以决定哪种方法更合适。

当 CSI 驱动选择使用 CSIDriverSpec.StorageCapacity 进行容量感知调度时,kube-scheduler 会使用这些对象。 该调度器将 MaximumVolumeSize 与 pending 卷的请求大小进行比较,以过滤掉不合适的节点。 如果未设置 MaximumVolumeSize,则回退为与不太精确的容量(Capacity)进行比较。 如果还是未设置,则该调度器假定容量不足并尝试某些其他节点。


CSIStorageCapacityList

CSIStorageCapacityList 是 CSIStorageCapacity 对象的集合。


操作


get 读取指定的 CSIStorageCapacity

HTTP 请求

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

参数

响应

200 (CSIStorageCapacity): OK

401: Unauthorized

list 列出或观测类别为 CSIStorageCapacity 的对象

HTTP 请求

GET /apis/storage.k8s.io/v1/namespaces/{namespace}/csistoragecapacities

参数

响应

200 (CSIStorageCapacityList): OK

401: Unauthorized

list 列出或观测类别为 CSIStorageCapacity 的对象

HTTP 请求

GET /apis/storage.k8s.io/v1/csistoragecapacities

参数

响应

200 (CSIStorageCapacityList): OK

401: Unauthorized

create 创建 CSIStorageCapacity

HTTP 请求

POST /apis/storage.k8s.io/v1/namespaces/{namespace}/csistoragecapacities

参数

响应

200 (CSIStorageCapacity): OK

201 (CSIStorageCapacity): Created

202 (CSIStorageCapacity): Accepted

401: Unauthorized

update 替换指定的 CSIStorageCapacity

HTTP 请求

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

参数

响应

200 (CSIStorageCapacity): OK

201 (CSIStorageCapacity): Created

401: Unauthorized

patch 部分更新指定的 CSIStorageCapacity

HTTP 请求

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

参数

响应

200 (CSIStorageCapacity): OK

201 (CSIStorageCapacity): Created

401: Unauthorized

delete 删除 CSIStorageCapacity

HTTP 请求

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

参数

响应

200 (Status): OK

202 (Status): Accepted

401: Unauthorized

deletecollection 删除 CSIStorageCapacity 的集合

HTTP 请求

DELETE /apis/storage.k8s.io/v1/namespaces/{namespace}/csistoragecapacities

参数

响应

200 (Status): OK

401: Unauthorized

3.6 - PersistentVolumeClaim

PersistentVolumeClaim 是用户针对一个持久卷的请求和申领。

apiVersion: v1

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

PersistentVolumeClaim

PersistentVolumeClaim 是用户针对一个持久卷的请求和申领。


PersistentVolumeClaimSpec

PersistentVolumeClaimSpec 描述存储设备的常用参数,并支持通过 source 来设置特定于提供商的属性。


resources 表示卷应拥有的最小资源。用户指定这些资源要求,此值必须低于之前的值, 但必须高于申领的状态字段中记录的容量。更多信息: https://kubernetes.io/zh-cn/docs/concepts/storage/persistent-volumes#resources

VolumeResourceRequirements 描述了卷的存储资源要求。

Beta 级别

PersistentVolumeClaimStatus

PersistentVolumeClaimStatus 是持久卷申领的当前状态。


PersistentVolumeClaimList

PersistentVolumeClaimList 是 PersistentVolumeClaim 各项的列表。


操作


get 读取指定的 PersistentVolumeClaim

HTTP 请求

GET /api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}

参数

响应

200 (PersistentVolumeClaim): OK

401: Unauthorized

get 读取指定的 PersistentVolumeClaim 的状态

HTTP 请求

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

参数

响应

200 (PersistentVolumeClaim): OK

401: Unauthorized

list 列出或观测类别为 PersistentVolumeClaim 的对象

HTTP 请求

GET /api/v1/namespaces/{namespace}/persistentvolumeclaims

参数

响应

200 (PersistentVolumeClaimList): OK

401: Unauthorized

list 列出或观测类别为 PersistentVolumeClaim 的对象

HTTP 请求

GET /api/v1/persistentvolumeclaims

参数

响应

200 (PersistentVolumeClaimList): OK

401: Unauthorized

create 创建 PersistentVolumeClaim

HTTP 请求

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

参数

响应

200 (PersistentVolumeClaim): OK

201 (PersistentVolumeClaim): Created

202 (PersistentVolumeClaim): Accepted

401: Unauthorized

update 替换指定的 PersistentVolumeClaim

HTTP 请求

PUT /api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}

参数

响应

200 (PersistentVolumeClaim): OK

201 (PersistentVolumeClaim): Created

401: Unauthorized

update 替换指定的 PersistentVolumeClaim 的状态

HTTP 请求

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

参数

响应

200 (PersistentVolumeClaim): OK

201 (PersistentVolumeClaim): Created

401: Unauthorized

patch 部分更新指定的 PersistentVolumeClaim

HTTP 请求

PATCH /api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}

参数

响应

200 (PersistentVolumeClaim): OK

201 (PersistentVolumeClaim): Created

401: Unauthorized

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

HTTP 请求

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

参数

响应

200 (PersistentVolumeClaim): OK

201 (PersistentVolumeClaim): Created

401: Unauthorized

delete 删除 PersistentVolumeClaim

HTTP 请求

DELETE /api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}

参数

响应

200 (PersistentVolumeClaim): OK

202 (PersistentVolumeClaim): Accepted

401: Unauthorized

deletecollection 删除 PersistentVolumeClaim 的集合

HTTP 请求

DELETE /api/v1/namespaces/{namespace}/persistentvolumeclaims

参数

响应

200 (Status): OK

401: Unauthorized

3.7 - PersistentVolume

PersistentVolume (PV) 是管理员制备的一个存储资源。

apiVersion: v1

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

PersistentVolume

PersistentVolume (PV) 是管理员制备的一个存储资源。它类似于一个节点。更多信息: https://kubernetes.io/zh-cn/docs/concepts/storage/persistent-volumes


PersistentVolumeSpec

PersistentVolumeSpec 是持久卷的规约。


Local

持久卷

PersistentVolumeStatus

PersistentVolumeStatus 是持久卷的当前状态。


PersistentVolumeList

PersistentVolumeList 是 PersistentVolume 各项的列表。


操作


get 读取指定的 PersistentVolume

HTTP 请求

GET /api/v1/persistentvolumes/{name}

参数

响应

200 (PersistentVolume): OK

401: Unauthorized

get 读取指定的 PersistentVolume 的状态

HTTP 请求

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

参数

响应

200 (PersistentVolume): OK

401: Unauthorized

list 列出或观测类别为 PersistentVolume 的对象

HTTP 请求

GET /api/v1/persistentvolumes

参数

响应

200 (PersistentVolumeList): OK

401: Unauthorized

create 创建 PersistentVolume

HTTP 请求

POST /api/v1/persistentvolumes

参数

响应

200 (PersistentVolume): OK

201 (PersistentVolume): Created

202 (PersistentVolume): Accepted

401: Unauthorized

update 替换指定的 PersistentVolume

HTTP 请求

PUT /api/v1/persistentvolumes/{name}

参数

响应

200 (PersistentVolume): OK

201 (PersistentVolume): Created

401: Unauthorized

update 替换指定的 PersistentVolume 的状态

HTTP 请求

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

参数

响应

200 (PersistentVolume): OK

201 (PersistentVolume): Created

401: Unauthorized

patch 部分更新指定的 PersistentVolume

HTTP 请求

PATCH /api/v1/persistentvolumes/{name}

参数

响应

200 (PersistentVolume): OK

201 (PersistentVolume): Created

401: Unauthorized

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

HTTP 请求

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

参数

响应

200 (PersistentVolume): OK

201 (PersistentVolume): Created

401: Unauthorized

delete 删除 PersistentVolume

HTTP 请求

DELETE /api/v1/persistentvolumes/{name}

参数

响应

200 (PersistentVolume): OK

202 (PersistentVolume): Accepted

401: Unauthorized

deletecollection 删除 PersistentVolume 的集合

HTTP 请求

DELETE /api/v1/persistentvolumes

参数

响应

200 (Status): OK

401: Unauthorized

3.8 - StorageClass

StorageClass 为可以动态制备 PersistentVolume 的存储类描述参数。

apiVersion: storage.k8s.io/v1

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

StorageClass

StorageClass 为可以动态制备 PersistentVolume 的存储类描述参数。

StorageClass 是不受名字空间作用域限制的;按照 etcd 设定的存储类的名称位于 ObjectMeta.Name 中。


StorageClassList

StorageClassList 是存储类的集合。


操作


get 读取指定的 StorageClass

HTTP 请求

GET /apis/storage.k8s.io/v1/storageclasses/{name}

参数

响应

200 (StorageClass): OK

401: Unauthorized

list 列举或观测类别为 StorageClass 的对象

HTTP 请求

GET /apis/storage.k8s.io/v1/storageclasses

参数

响应

200 (StorageClassList): OK

401: Unauthorized

create 创建 StorageClass

HTTP 请求

POST /apis/storage.k8s.io/v1/storageclasses

参数

响应

200 (StorageClass): OK

201 (StorageClass): Created

202 (StorageClass): Accepted

401: Unauthorized

update 替换指定的 StorageClass

HTTP 请求

PUT /apis/storage.k8s.io/v1/storageclasses/{name}

参数

响应

200 (StorageClass): OK

201 (StorageClass): Created

401: Unauthorized

patch 部分更新指定的 StorageClass

HTTP 请求

PATCH /apis/storage.k8s.io/v1/storageclasses/{name}

参数

响应

200 (StorageClass): OK

201 (StorageClass): Created

401: Unauthorized

delete 删除 StorageClass

HTTP 请求

DELETE /apis/storage.k8s.io/v1/storageclasses/{name}

参数

响应

200 (StorageClass): OK

202 (StorageClass): Accepted

401: Unauthorized

deletecollection 删除 StorageClass 的集合

HTTP 请求

DELETE /apis/storage.k8s.io/v1/storageclasses

参数

响应

200 (Status): OK

401: Unauthorized

3.9 - StorageVersionMigration v1alpha1

StorageVersionMigration 表示存储的数据向最新存储版本的一次迁移。

apiVersion: storagemigration.k8s.io/v1alpha1

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

StorageVersionMigration

StorageVersionMigration 表示存储的数据向最新存储版本的一次迁移。


StorageVersionMigrationSpec

存储版本迁移的规约。


StorageVersionMigrationStatus

存储版本迁移的状态。


StorageVersionMigrationList

StorageVersionMigrationList 是 StorageVersionMigration 对象的集合。


操作


get 读取指定的 StorageVersionMigration

HTTP 请求

GET /apis/storagemigration.k8s.io/v1alpha1/storageversionmigrations/{name}

参数

响应

200 (StorageVersionMigration): OK

401: Unauthorized

get 读取指定 StorageVersionMigration 的状态

HTTP 请求

GET /apis/storagemigration.k8s.io/v1alpha1/storageversionmigrations/{name}/status

参数

响应

200 (StorageVersionMigration): OK

401: Unauthorized

list 列举或监视类别为 StorageVersionMigration 的对象

HTTP 请求

GET /apis/storagemigration.k8s.io/v1alpha1/storageversionmigrations

参数

响应

200 (StorageVersionMigrationList): OK

401: Unauthorized

create 创建 StorageVersionMigration

HTTP 请求

POST /apis/storagemigration.k8s.io/v1alpha1/storageversionmigrations

参数

响应

200 (StorageVersionMigration): OK

201 (StorageVersionMigration): Created

202 (StorageVersionMigration): Accepted

401: Unauthorized

update 替换指定的 StorageVersionMigration

HTTP 请求

PUT /apis/storagemigration.k8s.io/v1alpha1/storageversionmigrations/{name}

参数

响应

200 (StorageVersionMigration): OK

201 (StorageVersionMigration): Created

401: Unauthorized

update 替换指定 StorageVersionMigration 的状态

HTTP 请求

PUT /apis/storagemigration.k8s.io/v1alpha1/storageversionmigrations/{name}/status

参数

响应

200 (StorageVersionMigration): OK

201 (StorageVersionMigration): Created

401: Unauthorized

patch 部分更新指定的 StorageVersionMigration

HTTP 请求

PATCH /apis/storagemigration.k8s.io/v1alpha1/storageversionmigrations/{name}

参数

响应

200 (StorageVersionMigration): OK

201 (StorageVersionMigration): Created

401: Unauthorized

patch 部分更新指定 StorageVersionMigration 的状态

HTTP 请求

PATCH /apis/storagemigration.k8s.io/v1alpha1/storageversionmigrations/{name}/status

参数

响应

200 (StorageVersionMigration): OK

201 (StorageVersionMigration): Created

401: Unauthorized

delete 删除 StorageVersionMigration

HTTP 请求

DELETE /apis/storagemigration.k8s.io/v1alpha1/storageversionmigrations/{name}

参数

响应

200 (Status): OK

202 (Status): Accepted

401: Unauthorized

deletecollection 删除 StorageVersionMigration 的集合

HTTP 请求

DELETE /apis/storagemigration.k8s.io/v1alpha1/storageversionmigrations

参数

响应

200 (Status): OK

401: Unauthorized

3.10 - Volume

Volume 表示 Pod 中一个有名字的卷,可以由 Pod 中的任意容器进行访问。

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

Volume

Volume 表示 Pod 中一个有名字的卷,可以由 Pod 中的任意容器进行访问。


暴露的持久卷

投射

本地/临时目录

持久卷

已弃用

DownwardAPIVolumeFile

DownwardAPIVolumeFile 表示创建包含 Pod 字段的文件的信息。


KeyToPath

将一个字符串键映射到卷中的一个路径。


3.11 - VolumeAttachment

VolumeAttachment 抓取将指定卷挂接到指定节点或从指定节点解除挂接指定卷的意图。

apiVersion: storage.k8s.io/v1

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

VolumeAttachment

VolumeAttachment 抓取将指定卷挂接到指定节点或从指定节点解除挂接指定卷的意图。

VolumeAttachment 对象未划分命名空间。


VolumeAttachmentSpec

VolumeAttachmentSpec 是 VolumeAttachment 请求的规约。


VolumeAttachmentStatus

VolumeAttachmentStatus 是 VolumeAttachment 请求的状态。


VolumeAttachmentList

VolumeAttachmentList 是 VolumeAttachment 对象的集合。


操作


get 读取指定的 VolumeAttachment

HTTP 请求

GET /apis/storage.k8s.io/v1/volumeattachments/{name}

参数

响应

200 (VolumeAttachment): OK

401: Unauthorized

get 读取指定的 VolumeAttachment 的状态

HTTP 请求

GET /apis/storage.k8s.io/v1/volumeattachments/{name}/status

参数

响应

200 (VolumeAttachment): OK

401: Unauthorized

list 列举或观测类别为 VolumeAttachment 的对象

HTTP 请求

GET /apis/storage.k8s.io/v1/volumeattachments

参数

响应

200 (VolumeAttachmentList): OK

401: Unauthorized

create 创建 VolumeAttachment

HTTP 请求

POST /apis/storage.k8s.io/v1/volumeattachments

参数

响应

200 (VolumeAttachment): OK

201 (VolumeAttachment): Created

202 (VolumeAttachment): Accepted

401: Unauthorized

update 替换指定的 VolumeAttachment

HTTP 请求

PUT /apis/storage.k8s.io/v1/volumeattachments/{name}

参数

响应

200 (VolumeAttachment): OK

201 (VolumeAttachment): Created

401: Unauthorized

update 替换指定的 VolumeAttachment 的状态

HTTP 请求

PUT /apis/storage.k8s.io/v1/volumeattachments/{name}/status

参数

响应

200 (VolumeAttachment): OK

201 (VolumeAttachment): Created

401: Unauthorized

patch 部分更新指定的 VolumeAttachment

HTTP 请求

PATCH /apis/storage.k8s.io/v1/volumeattachments/{name}

参数

响应

200 (VolumeAttachment): OK

201 (VolumeAttachment): Created

401: Unauthorized

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

HTTP 请求

PATCH /apis/storage.k8s.io/v1/volumeattachments/{name}/status

参数

响应

200 (VolumeAttachment): OK

201 (VolumeAttachment): Created

401: Unauthorized

delete 删除 VolumeAttachment

HTTP 请求

DELETE /apis/storage.k8s.io/v1/volumeattachments/{name}

参数

响应

200 (VolumeAttachment): OK

202 (VolumeAttachment): Accepted

401: Unauthorized

deletecollection 删除 VolumeAttachment 的集合

HTTP 请求

DELETE /apis/storage.k8s.io/v1/volumeattachments

参数

响应

200 (Status): OK

401: Unauthorized

3.12 - VolumeAttributesClass

VolumeAttributesClass 表示由 CSI 驱动所定义的可变更卷属性的规约。

apiVersion: storage.k8s.io/v1

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

VolumeAttributesClass

VolumeAttributesClass 表示由 CSI 驱动所定义的可变更卷属性的规约。 此类可以在动态制备 PersistentVolumeClaim 期间被指定, 并且可以在制备之后在 PersistentVolumeClaim 规约中更改。


VolumeAttributesClassList

VolumeAttributesClassList 是 VolumeAttributesClass 对象的集合。


操作


get 读取指定的 VolumeAttributesClass

HTTP 请求

GET /apis/storage.k8s.io/v1/volumeattributesclasses/{name}

参数

响应

200 (VolumeAttributesClass): OK

401: Unauthorized

list 列举或监视类别为 VolumeAttributesClass 的对象

HTTP 请求

GET /apis/storage.k8s.io/v1/volumeattributesclasses

参数

响应

200 (VolumeAttributesClassList): OK

401: Unauthorized

create 创建 VolumeAttributesClass

HTTP 请求

POST /apis/storage.k8s.io/v1/volumeattributesclasses

参数

响应

200 (VolumeAttributesClass): OK

201 (VolumeAttributesClass): Created

202 (VolumeAttributesClass): Accepted

401: Unauthorized

update 替换指定的 VolumeAttributesClass

HTTP 请求

PUT /apis/storage.k8s.io/v1/volumeattributesclasses/{name}

参数

响应

200 (VolumeAttributesClass): OK

201 (VolumeAttributesClass): Created

401: Unauthorized

patch 部分更新指定的 VolumeAttributesClass

HTTP 请求

PATCH /apis/storage.k8s.io/v1/volumeattributesclasses/{name}

参数

响应

200 (VolumeAttributesClass): OK

201 (VolumeAttributesClass): Created

401: Unauthorized

delete 删除 VolumeAttributesClass

HTTP 请求

DELETE /apis/storage.k8s.io/v1/volumeattributesclasses/{name}

参数

响应

200 (VolumeAttributesClass): OK

202 (VolumeAttributesClass): Accepted

401: Unauthorized

deletecollection 删除 VolumeAttributesClass 的集合

HTTP 请求

DELETE /apis/storage.k8s.io/v1/volumeattributesclasses

参数

响应

200 (Status): OK

401: Unauthorized

4 - 身份认证资源

4.1 - ServiceAccount

ServiceAccount 将以下内容绑定在一起:1. 用户可以理解的名称,也可能是外围系统理解的身份标识 2. 可以验证和授权的主体 3. 一组 Secret。

apiVersion: v1

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

ServiceAccount

ServiceAccount 将以下内容绑定在一起:


ServiceAccountList

ServiceAccountList 是 ServiceAccount 对象的列表


操作


get 读取指定的 ServiceAccount

HTTP 请求

GET /api/v1/namespaces/{namespace}/serviceaccounts/{name}

参数

响应

200 (ServiceAccount): OK

401: Unauthorized

list 列出或监控 ServiceAccount 类型的对象

HTTP 请求

GET /api/v1/namespaces/{namespace}/serviceaccounts

参数

sendInitialEvents

响应

200 (ServiceAccountList): OK

401: Unauthorized

list 列出或监控 ServiceAccount 类型的对象

HTTP 请求

GET /api/v1/serviceaccounts

参数

响应

200 (ServiceAccountList): OK

401: Unauthorized

create 创建一个 ServiceAccount

HTTP 请求

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

参数

响应

200 (ServiceAccount): OK

201 (ServiceAccount): Created

202 (ServiceAccount): Accepted

401: Unauthorized

update 替换指定的 ServiceAccount

HTTP 请求

PUT /api/v1/namespaces/{namespace}/serviceaccounts/{name}

参数

响应

200 (ServiceAccount): OK

201 (ServiceAccount): Created

401: Unauthorized

patch 部分更新指定的 ServiceAccount

HTTP 请求

PATCH /api/v1/namespaces/{namespace}/serviceaccounts/{name}

参数

响应

200 (ServiceAccount): OK

201 (ServiceAccount): Created

401: Unauthorized

delete 删除一个 ServiceAccount

HTTP 请求

DELETE /api/v1/namespaces/{namespace}/serviceaccounts/{name}

参数

响应

200 (ServiceAccount): OK

202 (ServiceAccount): Accepted

401: Unauthorized

deletecollection 删除 ServiceAccount 的集合

HTTP 请求

DELETE /api/v1/namespaces/{namespace}/serviceaccounts

参数

sendInitialEvents

响应

200 (Status): OK

401: Unauthorized

4.2 - TokenRequest

TokenRequest 为给定的服务账号请求一个令牌。

apiVersion: authentication.k8s.io/v1

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

TokenRequest

TokenRequest 为给定的服务账号请求一个令牌。


TokenRequestSpec

TokenRequestSpec 包含客户端提供的令牌请求参数。


TokenRequestStatus

TokenRequestStatus 是一个令牌请求的结果。


操作


create 创建 ServiceAccount 的令牌

HTTP 请求

POST /api/v1/namespaces/{namespace}/serviceaccounts/{name}/token

参数

响应

200 (TokenRequest): OK

201 (TokenRequest): Created

202 (TokenRequest): Accepted

401: Unauthorized

4.3 - TokenReview

TokenReview 尝试通过验证令牌来确认已知用户。

apiVersion: authentication.k8s.io/v1

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

TokenReview

TokenReview 尝试通过验证令牌来确认已知用户。 注意:TokenReview 请求可能会被 kube-apiserver 中的 Webhook 令牌验证器插件缓存。


TokenReviewSpec

TokenReviewPec 是对令牌身份验证请求的描述。


TokenReviewStatus

TokenReviewStatus 是令牌认证请求的结果。


操作


create 创建一个TokenReview

HTTP 请求

POST /apis/authentication.k8s.io/v1/tokenreviews

参数

响应

200 (TokenReview): OK

201 (TokenReview): Created

202 (TokenReview): Accepted

401: Unauthorized

4.4 - CertificateSigningRequest

CertificateSigningRequest 对象提供了一种通过提交证书签名请求并异步批准和颁发 x509 证书的机制。

apiVersion: certificates.k8s.io/v1

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

证书签名请求 CertificateSigningRequest

CertificateSigningRequest 对象提供了一种通过提交证书签名请求并异步批准和颁发 x509 证书的机制。

kubelet 使用 CertificateSigningRequest API 来获取:

  1. 向 kube-apiserver 进行身份认证的客户端证书(使用 “kubernetes.io/kube-apiserver-client-kubelet” signerName)。
  2. kube-apiserver 可以安全连接到 TLS 端点的服务证书(使用 “kubernetes.io/kubelet-serving” signerName)。

此 API 可用于请求客户端证书以向 kube-apiserver 进行身份验证(使用 “kubernetes.io/kube-apiserver-client” 签名者名称),或从自定义非 Kubernetes 签名者那里获取证书。


CertificateSigningRequestSpec

CertificateSigningRequestSpec 包含证书请求。


CertificateSigningRequestStatus

CertificateSigningRequestStatus 包含用于指示请求的批准/拒绝/失败状态和颁发证书的状况。


CertificateSigningRequestList

CertificateSigningRequestList 是 CertificateSigningRequest 对象的集合。


操作


get 读取指定的 CertificateSigningRequest

HTTP 请求

GET /apis/certificates.k8s.io/v1/certificatesigningrequests/{name}

参数

响应

200 (CertificateSigningRequest): OK

401: Unauthorized

get 读取指定 CertificateSigningRequest 的批准信息

HTTP 请求

GET /apis/certificates.k8s.io/v1/certificatesigningrequests/{name}/approval

参数

响应

200 (CertificateSigningRequest): OK

401: Unauthorized

get 读取指定 CertificateSigningRequest 的状态

HTTP 请求

GET /apis/certificates.k8s.io/v1/certificatesigningrequests/{name}/status

参数

响应

200 (CertificateSigningRequest): OK

401: Unauthorized

list list 或 watch CertificateSigningRequest 类型的对象

HTTP 请求

GET /apis/certificates.k8s.io/v1/certificatesigningrequests

参数

响应

200 (CertificateSigningRequestList): OK

401: Unauthorized

create 创建一个 CertificateSigningRequest

HTTP 请求

POST /apis/certificates.k8s.io/v1/certificatesigningrequests

参数

响应

200 (CertificateSigningRequest): OK

201 (CertificateSigningRequest): Created

202 (CertificateSigningRequest): Accepted

401: Unauthorized

update 替换指定的 CertificateSigningRequest

HTTP 请求

PUT /apis/certificates.k8s.io/v1/certificatesigningrequests/{name}

参数

响应

200 (CertificateSigningRequest): OK

201 (CertificateSigningRequest): Created

401: Unauthorized

update 替换对指定 CertificateSigningRequest 的批准信息

HTTP 请求

PUT /apis/certificates.k8s.io/v1/certificatesigningrequests/{name}/approval

参数

响应

200 (CertificateSigningRequest): OK

201 (CertificateSigningRequest): Created

401: Unauthorized

update 替换指定 CertificateSigningRequest 的状态

HTTP 请求

PUT /apis/certificates.k8s.io/v1/certificatesigningrequests/{name}/status

参数

响应

200 (CertificateSigningRequest): OK

201 (CertificateSigningRequest): Created

401: Unauthorized

patch 部分更新指定的 CertificateSigningRequest

HTTP 请求

PATCH /apis/certificates.k8s.io/v1/certificatesigningrequests/{name}

参数

响应

200 (CertificateSigningRequest): OK

201 (CertificateSigningRequest): Created

401: Unauthorized

patch 部分更新指定 CertificateSigningRequest 的批准信息

HTTP 请求

PATCH /apis/certificates.k8s.io/v1/certificatesigningrequests/{name}/approval

参数

响应

200 (CertificateSigningRequest): OK

201 (CertificateSigningRequest): Created

401: Unauthorized

patch 部分更新指定 CertificateSigningRequest 的状态

HTTP 请求

PATCH /apis/certificates.k8s.io/v1/certificatesigningrequests/{name}/status

参数

响应

200 (CertificateSigningRequest): OK

201 (CertificateSigningRequest): Created

401: Unauthorized

delete 删除一个 CertificateSigningRequest

HTTP 请求

DELETE /apis/certificates.k8s.io/v1/certificatesigningrequests/{name}

参数

响应

200 (Status): OK

202 (Status): Accepted

401: Unauthorized

deletecollection 删除 CertificateSigningRequest 集合

HTTP 请求

DELETE /apis/certificates.k8s.io/v1/certificatesigningrequests

参数

响应

200 (Status): OK

401: Unauthorized

4.5 - ClusterTrustBundle v1beta1

ClusterTrustBundle 是一个集群范围的容器,用于存放 X.509 信任锚(根证书)。

apiVersion: certificates.k8s.io/v1beta1

import "k8s.io/api/certificates/v1beta1"

ClusterTrustBundle

ClusterTrustBundle 是一个集群范围的容器,用于存放 X.509 信任锚(根证书)。

ClusterTrustBundle 对象被视为可被集群中的任何已通过身份验证的用户读取, 因为此对象可以由使用 clusterTrustBundle 投射的 Pod 挂载。 所有服务账号默认都有对 ClusterTrustBundle 的读取权限。 对于仅对集群具有命名空间级访问权限的用户,可以通过伪装他们可以访问的服务账号来读取 ClusterTrustBundle。

ClusterTrustBundle 可以选择与特定的签名程序相关联,此时它包含该签名程序的一组有效信任锚。 签名程序可以有多个关联的 ClusterTrustBundle; 对于该签名程序而言每个 ClusterTrustBundle 都是独立的一组信任锚。 准入控制用于确保只有对签名程序有访问权限的用户才能创建或修改相应的捆绑包。


ClusterTrustBundleSpec

ClusterTrustBundleSpec 包含签名程序和信任锚。


ClusterTrustBundleList

ClusterTrustBundleList 是 ClusterTrustBundle 对象的集合。


操作


get 读取指定的 ClusterTrustBundle

HTTP 请求

GET /apis/certificates.k8s.io/v1beta1/clustertrustbundles/{name}

参数

响应

200 (ClusterTrustBundle): OK

401: Unauthorized

list 列举或监视类别为 ClusterTrustBundle 的对象

HTTP 请求

GET /apis/certificates.k8s.io/v1beta1/clustertrustbundles

参数

响应

200 (ClusterTrustBundleList): OK

401: Unauthorized

create 创建 ClusterTrustBundle

HTTP 请求

POST /apis/certificates.k8s.io/v1beta1/clustertrustbundles

参数

响应

200 (ClusterTrustBundle): OK

201 (ClusterTrustBundle): Created

202 (ClusterTrustBundle): Accepted

401: Unauthorized

update 替换指定的 ClusterTrustBundle

HTTP 请求

PUT /apis/certificates.k8s.io/v1beta1/clustertrustbundles/{name}

参数

响应

200 (ClusterTrustBundle): OK

201 (ClusterTrustBundle): Created

401: Unauthorized

patch 部分更新指定的 ClusterTrustBundle

HTTP 请求

PATCH /apis/certificates.k8s.io/v1beta1/clustertrustbundles/{name}

参数

响应

200 (ClusterTrustBundle): OK

201 (ClusterTrustBundle): Created

401: Unauthorized

delete 删除 ClusterTrustBundle

HTTP 请求

DELETE /apis/certificates.k8s.io/v1beta1/clustertrustbundles/{name}

参数

响应

200 (Status): OK

202 (Status): Accepted

401: Unauthorized

deletecollection 删除 ClusterTrustBundle 的集合

HTTP 请求

DELETE /apis/certificates.k8s.io/v1beta1/clustertrustbundles

参数

响应

200 (Status): OK

401: Unauthorized

4.6 - SelfSubjectReview

SelfSubjectReview 包含 kube-apiserver 所拥有的与发出此请求的用户有关的用户信息。

apiVersion: authentication.k8s.io/v1

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

SelfSubjectReview

SelfSubjectReview 包含 kube-apiserver 所拥有的与发出此请求的用户有关的用户信息。 使用伪装时,用户将收到被伪装用户的用户信息。 如果使用伪装或请求头部进行身份验证,则所有额外的键都将被忽略大小写并以小写形式返回结果。


SelfSubjectReviewStatus

SelfSubjectReviewStatus 由 kube-apiserver 进行填充并发送回用户。


操作


create 创建 SelfSubjectReview

HTTP 请求

POST /apis/authentication.k8s.io/v1/selfsubjectreviews

参数

响应

200 (SelfSubjectReview): OK

201 (SelfSubjectReview): Created

202 (SelfSubjectReview): Accepted

401: Unauthorized

5 - 鉴权资源

5.1 - LocalSubjectAccessReview

LocalSubjectAccessReview 检查用户或组是否可以在给定的命名空间内执行某操作。

apiVersion: authorization.k8s.io/v1

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

LocalSubjectAccessReview

LocalSubjectAccessReview 检查用户或组是否可以在给定的命名空间内执行某操作。 划分命名空间范围的资源简化了命名空间范围的策略设置,例如权限检查。


操作


create 创建 LocalSubjectAccessReview

HTTP 请求

POST /apis/authorization.k8s.io/v1/namespaces/{namespace}/localsubjectaccessreviews

参数

响应

200 (LocalSubjectAccessReview): OK

201 (LocalSubjectAccessReview): Created

202 (LocalSubjectAccessReview): Accepted

401: Unauthorized

5.2 - SelfSubjectAccessReview

SelfSubjectAccessReview 检查当前用户是否可以执行某操作。

apiVersion: authorization.k8s.io/v1

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

SelfSubjectAccessReview

SelfSubjectAccessReview 检查当前用户是否可以执行某操作。 不填写 spec.namespace 表示“在所有命名空间中”。 Self 是一个特殊情况,因为用户应始终能够检查自己是否可以执行某操作。


SelfSubjectAccessReviewSpec

SelfSubjectAccessReviewSpec 是访问请求的描述。 resourceAuthorizationAttributes 和 nonResourceAuthorizationAttributes 二者必须设置其一,并且只能设置其一。


操作


create 创建 SelfSubjectAccessReview

HTTP 请求

POST /apis/authorization.k8s.io/v1/selfsubjectaccessreviews

参数

响应

200 (SelfSubjectAccessReview): OK

201 (SelfSubjectAccessReview): Created

202 (SelfSubjectAccessReview): Accepted

401: Unauthorized

5.3 - SelfSubjectRulesReview

SelfSubjectRulesReview 枚举当前用户可以在某命名空间内执行的操作集合。

apiVersion: authorization.k8s.io/v1

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

SelfSubjectRulesReview

SelfSubjectRulesReview 枚举当前用户可以在某命名空间内执行的操作集合。 返回的操作列表可能不完整,具体取决于服务器的鉴权模式以及评估过程中遇到的任何错误。 SelfSubjectRulesReview 应由 UI 用于显示/隐藏操作,或让最终用户尽快理解自己的权限。 SelfSubjectRulesReview 不得被外部系统使用以驱动鉴权决策, 因为这会引起混淆代理人(Confused deputy)、缓存有效期/吊销(Cache lifetime/revocation)和正确性问题。 SubjectAccessReview 和 LocalAccessReview 是遵从 API 服务器所做鉴权决策的正确方式。


SelfSubjectRulesReviewSpec

SelfSubjectRulesReviewSpec 定义 SelfSubjectRulesReview 的规范。


操作


create 创建 SelfSubjectRulesReview

HTTP 请求

POST /apis/authorization.k8s.io/v1/selfsubjectrulesreviews

参数

响应

200 (SelfSubjectRulesReview): OK

201 (SelfSubjectRulesReview): Created

202 (SelfSubjectRulesReview): Accepted

401: Unauthorized

5.4 - SubjectAccessReview

SubjectAccessReview 检查用户或组是否可以执行某操作。

apiVersion: authorization.k8s.io/v1

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

SubjectAccessReview

SubjectAccessReview 检查用户或组是否可以执行某操作。


SubjectAccessReviewSpec

SubjectAccessReviewSpec 是访问请求的描述。 resourceAuthorizationAttributes 和 nonResourceAuthorizationAttributes 二者必须设置其一,并且只能设置其一。


SubjectAccessReviewStatus

SubjectAccessReviewStatus


操作


create 创建 SubjectAccessReview

HTTP 请求

POST /apis/authorization.k8s.io/v1/subjectaccessreviews

参数

响应

200 (SubjectAccessReview): OK

201 (SubjectAccessReview): Created

202 (SubjectAccessReview): Accepted

401: Unauthorized

5.5 - ClusterRole

ClusterRole 是一个集群级别的 PolicyRule 逻辑分组,可以被 RoleBinding 或 ClusterRoleBinding 作为一个单元引用。

apiVersion: rbac.authorization.k8s.io/v1

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

ClusterRole

ClusterRole 是一个集群级别的 PolicyRule 逻辑分组, 可以被 RoleBinding 或 ClusterRoleBinding 作为一个单元引用。


ClusterRoleList

ClusterRoleList 是 ClusterRole 的集合。


操作


get 读取指定的 ClusterRole

HTTP 请求

GET /apis/rbac.authorization.k8s.io/v1/clusterroles/{name}

参数

响应

200 (ClusterRole): OK

401: Unauthorized

list 列出或观测类别为 ClusterRole 的对象

HTTP 请求

GET /apis/rbac.authorization.k8s.io/v1/clusterroles

参数

响应

200 (ClusterRoleList): OK

401: Unauthorized

create 创建一个 ClusterRole

HTTP 请求

POST /apis/rbac.authorization.k8s.io/v1/clusterroles

参数

响应

200 (ClusterRole): OK

201 (ClusterRole): Created

202 (ClusterRole): Accepted

401: Unauthorized

update 替换指定的 ClusterRole

HTTP 请求

PUT /apis/rbac.authorization.k8s.io/v1/clusterroles/{name}

参数

响应

200 (ClusterRole): OK

201 (ClusterRole): Created

401: Unauthorized

patch 部分更新指定的 ClusterRole

HTTP 请求

PATCH /apis/rbac.authorization.k8s.io/v1/clusterroles/{name}

参数

响应

200 (ClusterRole): OK

201 (ClusterRole): Created

401: Unauthorized

delete 删除一个 ClusterRole

HTTP 请求

DELETE /apis/rbac.authorization.k8s.io/v1/clusterroles/{name}

参数

响应

200 (Status): OK

202 (Status): Accepted

401: Unauthorized

deletecollection 删除 ClusterRole 的集合

HTTP 请求

DELETE /apis/rbac.authorization.k8s.io/v1/clusterroles

参数

响应

200 (Status): OK

401: Unauthorized

5.6 - ClusterRoleBinding

ClusterRoleBinding 引用 ClusterRole,但不包含它。

apiVersion: rbac.authorization.k8s.io/v1

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

ClusterRoleBinding

ClusterRoleBinding 引用 ClusterRole,但不包含它。 它可以引用全局命名空间中的 ClusterRole,并通过 Subject 添加主体信息。


ClusterRoleBindingList

ClusterRoleBindingList 是 ClusterRoleBinding 的集合。


操作


get 读取指定的 ClusterRoleBinding

HTTP 请求

GET /apis/rbac.authorization.k8s.io/v1/clusterrolebindings/{name}

参数

响应

200 (ClusterRoleBinding): OK

401: Unauthorized

list 列出或观测类别为 ClusterRoleBinding 的对象

HTTP 请求

GET /apis/rbac.authorization.k8s.io/v1/clusterrolebindings

参数

响应

200 (ClusterRoleBindingList): OK

401: Unauthorized

create 创建 ClusterRoleBinding

HTTP 请求

POST /apis/rbac.authorization.k8s.io/v1/clusterrolebindings

参数

响应

200 (ClusterRoleBinding): OK

201 (ClusterRoleBinding): Created

202 (ClusterRoleBinding): Accepted

401: Unauthorized

update 替换指定的 ClusterRoleBinding

HTTP 请求

PUT /apis/rbac.authorization.k8s.io/v1/clusterrolebindings/{name}

参数

响应

200 (ClusterRoleBinding): OK

201 (ClusterRoleBinding): Created

401: Unauthorized

patch 部分更新指定的 ClusterRoleBinding

HTTP 请求

PATCH /apis/rbac.authorization.k8s.io/v1/clusterrolebindings/{name}

参数

响应

200 (ClusterRoleBinding): OK

201 (ClusterRoleBinding): Created

401: Unauthorized

delete 删除 ClusterRoleBinding

HTTP 请求

DELETE /apis/rbac.authorization.k8s.io/v1/clusterrolebindings/{name}

参数

响应

200 (Status): OK

202 (Status): Accepted

401: Unauthorized

deletecollection 删除 ClusterRoleBinding 的集合

HTTP 请求

DELETE /apis/rbac.authorization.k8s.io/v1/clusterrolebindings

参数

响应

200 (Status): OK

401: Unauthorized

5.7 - Role

Role 是一个按命名空间划分的 PolicyRule 逻辑分组,可以被 RoleBinding 作为一个单元引用。

apiVersion: rbac.authorization.k8s.io/v1

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

Role

Role 是一个按命名空间划分的 PolicyRule 逻辑分组,可以被 RoleBinding 作为一个单元引用。


RoleList

RoleList 是 Role 的集合。


操作


get 读取指定的 Role

HTTP 请求

GET /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}

参数

响应

200 (Role): OK

401: Unauthorized

list 列出或观测类别为 Role 的对象

HTTP 请求

GET /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles

参数

响应

200 (RoleList): OK

401: Unauthorized

list 列出或观测类别为 Role 的对象

HTTP 请求

GET /apis/rbac.authorization.k8s.io/v1/roles

参数

响应

200 (RoleList): OK

401: Unauthorized

create 创建 Role

HTTP 请求

POST /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles

参数

响应

200 (Role): OK

201 (Role): Created

202 (Role): Accepted

401: Unauthorized

update 替换指定的 Role

HTTP 请求

PUT /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}

参数

响应

200 (Role): OK

201 (Role): Created

401: Unauthorized

patch 部分更新指定的 Role

HTTP 请求

PATCH /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}

参数

响应

200 (Role): OK

201 (Role): Created

401: Unauthorized

delete 删除 Role

HTTP 请求

DELETE /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}

参数

响应

200 (Status): OK

202 (Status): Accepted

401: Unauthorized

deletecollection 删除 Role 的集合

HTTP 请求

DELETE /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles

参数

响应

200 (Status): OK

401: Unauthorized

5.8 - RoleBinding

RoleBinding 引用一个角色,但不包含它。

apiVersion: rbac.authorization.k8s.io/v1

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

RoleBinding

RoleBinding 引用一个角色,但不包含它。 RoleBinding 可以引用相同命名空间中的 Role 或全局命名空间中的 ClusterRole。 RoleBinding 通过 Subjects 和所在的命名空间信息添加主体信息。 处于给定命名空间中的 RoleBinding 仅在该命名空间中有效。


标准的对象元数据。

RoleBindingList

RoleBindingList 是 RoleBinding 的集合。


标准的对象元数据。

操作


get 读取指定的 RoleBinding

HTTP 请求

GET /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings/{name}

参数

响应

200 (RoleBinding): OK

401: Unauthorized

list 列出或观测类别为 RoleBinding 的对象

HTTP 请求

GET /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings

参数

响应

200 (RoleBindingList): OK

401: Unauthorized

list 列出或观测类别为 RoleBinding 的对象

HTTP 请求

GET /apis/rbac.authorization.k8s.io/v1/rolebindings

参数

响应

200 (RoleBindingList): OK

401: Unauthorized

create 创建 RoleBinding

HTTP 请求

POST /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings

参数

响应

200 (RoleBinding): OK

201 (RoleBinding): Created

202 (RoleBinding): Accepted

401: Unauthorized

update 替换指定的 RoleBinding

HTTP 请求

PUT /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings/{name}

参数

响应

200 (RoleBinding): OK

201 (RoleBinding): Created

401: Unauthorized

patch 部分更新指定的 RoleBinding

HTTP 请求

PATCH /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings/{name}

参数

响应

200 (RoleBinding): OK

201 (RoleBinding): Created

401: Unauthorized

delete 删除 RoleBinding

HTTP 请求

DELETE /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings/{name}

参数

响应

200 (Status): OK

202 (Status): Accepted

401: Unauthorized

deletecollection 删除 RoleBinding 的集合

HTTP 请求

DELETE /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings

参数

响应

200 (Status): OK

401: Unauthorized

6 - 策略资源

6.1 - FlowSchema

FlowSchema 定义一组流的模式。

apiVersion: flowcontrol.apiserver.k8s.io/v1

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

FlowSchema

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


FlowSchemaSpec

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


FlowSchemaStatus

FlowSchemaStatus 表示 FlowSchema 的当前状态。


FlowSchemaList

FlowSchemaList 是 FlowSchema 对象的列表。


操作


get 读取指定的 FlowSchema

HTTP 请求

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

参数

响应

200 (FlowSchema): OK

401: Unauthorized

get 读取指定 FlowSchema 的状态

HTTP 请求

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

参数

响应

200 (FlowSchema): OK

401: Unauthorized

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

HTTP 请求

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

参数

响应

200 (FlowSchemaList): OK

401: Unauthorized

create 创建 FlowSchema

HTTP 请求

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

参数

响应

200 (FlowSchema): OK

201 (FlowSchema): Created

202 (FlowSchema): Accepted

401: Unauthorized

update 替换指定的 FlowSchema

HTTP 请求

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

参数

响应

200 (FlowSchema): OK

201 (FlowSchema): Created

401: Unauthorized

update 替换指定的 FlowSchema 的状态

HTTP 请求

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

参数

响应

200 (FlowSchema): OK

201 (FlowSchema): Created

401: Unauthorized

patch 部分更新指定的 FlowSchema

HTTP 请求

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

参数

响应

200 (FlowSchema): OK

201 (FlowSchema): Created

401: Unauthorized

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

HTTP 请求

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

参数

响应

200 (FlowSchema): OK

201 (FlowSchema): Created

401: Unauthorized

delete 删除 FlowSchema

HTTP 请求

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

参数

响应

200 (Status): OK

202 (Status): Accepted

401: Unauthorized

deletecollection 删除 FlowSchema 的集合

HTTP 请求

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

参数

响应

200 (Status): OK

401: Unauthorized

6.2 - LimitRange

LimitRange 设置名字空间中每个资源类别的资源用量限制。

apiVersion: v1

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

LimitRange

LimitRange 设置名字空间中每个资源类别的资源用量限制。


LimitRangeSpec

LimitRangeSpec 定义与类别匹配的资源的最小/最大使用限制。


LimitRangeList

LimitRangeList 是 LimitRange 项的列表。


操作


get 读取指定的 LimitRange

HTTP 请求

GET /api/v1/namespaces/{namespace}/limitranges/{name}

参数

响应

200 (LimitRange): OK

401: Unauthorized

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

HTTP 请求

GET /api/v1/namespaces/{namespace}/limitranges

参数

响应

200 (LimitRangeList): OK

401: Unauthorized

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

HTTP 请求

GET /api/v1/limitranges

参数

响应

200 (LimitRangeList): OK

401: Unauthorized

create 创建 LimitRange

HTTP 请求

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

参数

响应

200 (LimitRange): OK

201 (LimitRange): Created

202 (LimitRange): Accepted

401: Unauthorized

update 替换指定的 LimitRange

HTTP 请求

PUT /api/v1/namespaces/{namespace}/limitranges/{name}

参数

响应

200 (LimitRange): OK

201 (LimitRange): Created

401: Unauthorized

patch 部分更新指定的 LimitRange

HTTP 请求

PATCH /api/v1/namespaces/{namespace}/limitranges/{name}

参数

响应

200 (LimitRange): OK

201 (LimitRange): Created

401: Unauthorized

delete 删除 LimitRange

HTTP 请求

DELETE /api/v1/namespaces/{namespace}/limitranges/{name}

参数

响应

200 (Status): OK

202 (Status): Accepted

401: Unauthorized

deletecollection 删除 LimitRange 的集合

HTTP 请求

DELETE /api/v1/namespaces/{namespace}/limitranges

参数

响应

200 (Status): OK

401: Unauthorized

6.3 - ResourceQuota

ResourceQuota 设置每个命名空间强制执行的聚合配额限制。

apiVersion: v1

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

ResourceQuota

ResourceQuota 设置每个命名空间强制执行的聚合配额限制。


ResourceQuotaSpec

ResourceQuotaSpec 定义为 Quota 强制执行所需的硬限制。


ResourceQuotaStatus

ResourceQuotaStatus 定义硬性限制和观测到的用量。


ResourceQuotaList

ResourceQuotaList 是 ResourceQuota 列表。


操作


get 读取指定的 ResourceQuota

HTTP 请求

GET /api/v1/namespaces/{namespace}/resourcequotas/{name}

参数

响应

200 (ResourceQuota): OK

401: Unauthorized

get 读取指定的 ResourceQuota 的状态

HTTP 请求

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

参数

响应

200 (ResourceQuota): OK

401: Unauthorized

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

HTTP 请求

GET /api/v1/namespaces/{namespace}/resourcequotas

参数

响应

200 (ResourceQuotaList): OK

401: Unauthorized

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

HTTP 请求

GET /api/v1/resourcequotas

参数

响应

200 (ResourceQuotaList): OK

401: Unauthorized

create 创建一个 ResourceQuota

HTTP 请求

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

参数

响应

200 (ResourceQuota): OK

201 (ResourceQuota): Created

202 (ResourceQuota): Accepted

401: Unauthorized

update 更新指定的 ResourceQuota

HTTP 请求

PUT /api/v1/namespaces/{namespace}/resourcequotas/{name}

参数

响应

200 (ResourceQuota): OK

201 (ResourceQuota): Created

401: Unauthorized

update 更新指定 ResourceQuota 的状态

HTTP 请求

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

参数

响应

200 (ResourceQuota): OK

201 (ResourceQuota): Created

401: Unauthorized

patch 部分更新指定的 ResourceQuota

HTTP 请求

PATCH /api/v1/namespaces/{namespace}/resourcequotas/{name}

参数

响应

200 (ResourceQuota): OK

201 (ResourceQuota): Created

401: Unauthorized

patch 部分更新指定 ResourceQuota 的状态

HTTP 请求

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

参数

响应

200 (ResourceQuota): OK

201 (ResourceQuota): Created

401: Unauthorized

delete 删除 ResourceQuota

HTTP 请求

DELETE /api/v1/namespaces/{namespace}/resourcequotas/{name}

参数

响应

200 (ResourceQuota): OK

202 (ResourceQuota): Accepted

401: Unauthorized

deletecollection 删除 ResourceQuota 的集合

HTTP 请求

DELETE /api/v1/namespaces/{namespace}/resourcequotas

参数

响应

200 (Status): OK

401: Unauthorized

6.4 - NetworkPolicy

NetworkPolicy 描述针对一组 Pod 所允许的网络流量。

apiVersion: networking.k8s.io/v1

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

NetworkPolicy

NetworkPolicy 描述针对一组 Pod 所允许的网络流量。


NetworkPolicySpec

NetworkPolicySpec 定义特定 NetworkPolicy 所需的所有信息.


NetworkPolicyList

NetworkPolicyList 是 NetworkPolicy 的集合。


操作


get 读取指定的 NetworkPolicy

HTTP 请求

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

参数

响应

200 (NetworkPolicy): OK

401: Unauthorized

list 列出或监视 NetworkPolicy 类型的对象

HTTP 请求

GET /apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies

参数

响应

200 (NetworkPolicyList): OK

401: Unauthorized

list 列出或监视 NetworkPolicy 类

HTTP Request

GET /apis/networking.k8s.io/v1/networkpolicies

参数

响应

200 (NetworkPolicyList): OK

401: Unauthorized

create 创建 NetworkPolicy

HTTP 请求

POST /apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies

参数

响应

200 (NetworkPolicy): OK

201 (NetworkPolicy): Created

202 (NetworkPolicy): Accepted

401: Unauthorized

update 替换指定的 NetworkPolicy

HTTP 请求

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

参数

响应

200 (NetworkPolicy): OK

201 (NetworkPolicy): Created

401: Unauthorized

patch 部分更新指定的 NetworkPolicy

HTTP 请求

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

参数

响应

200 (NetworkPolicy): OK

201 (NetworkPolicy): Created

401: Unauthorized

delete 删除 NetworkPolicy

HTTP 请求

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

参数

响应

200 (Status): OK

202 (Status): Accepted

401: Unauthorized

deletecollection 删除 NetworkPolicy 的集合

HTTP 请求

DELETE /apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies

参数

响应

200 (Status): OK

401: Unauthorized

6.5 - PodDisruptionBudget

PodDisruptionBudget 是一个对象,用于定义可能对一组 Pod 造成的最大干扰。

apiVersion: policy/v1

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

PodDisruptionBudget

PodDisruptionBudget 是一个对象,用于定义可能对一组 Pod 造成的最大干扰。


PodDisruptionBudgetSpec

PodDisruptionBudgetSpec 是对 PodDisruptionBudget 的描述。


PodDisruptionBudgetStatus

PodDisruptionBudgetStatus 表示有关此 PodDisruptionBudget 状态的信息。 状态可能会反映系统的实际状态。


PodDisruptionBudgetList

PodDisruptionBudgetList 是 PodDisruptionBudget 的集合。


操作


get 读取指定的 PodDisruptionBudget

HTTP 请求

GET /apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets/{name}

参数

响应

200 (PodDisruptionBudget): OK

401: Unauthorized

get 读取指定 PodDisruptionBudget 的状态

HTTP 请求

GET /apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets/{name}/status

参数

响应

200 (PodDisruptionBudget): OK

401: Unauthorized

list 列出或监视 PodDisruptionBudget 类型的对象

HTTP 请求

GET /apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets

参数

响应

200 (PodDisruptionBudgetList): OK

401: Unauthorized

list 列出或监视 PodDisruptionBudget 类型的对象

HTTP 请求

GET /apis/policy/v1/poddisruptionbudgets

参数

响应

200 (PodDisruptionBudgetList): OK

401: Unauthorized

create 创建一个 PodDisruptionBudget

HTTP 请求

POST /apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets

参数

响应

200 (PodDisruptionBudget): OK

201 (PodDisruptionBudget): Created

202 (PodDisruptionBudget): Accepted

401: Unauthorized

update 替换指定的 PodDisruptionBudget

HTTP 请求

PUT /apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets/{name}

参数

响应

200 (PodDisruptionBudget): OK

201 (PodDisruptionBudget): Created

401: Unauthorized

update 替换指定 PodDisruptionBudget 的状态

HTTP 请求

PUT /apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets/{name}/status

参数

响应

200 (PodDisruptionBudget): OK

201 (PodDisruptionBudget): Created

401: Unauthorized

patch 部分更新指定的 PodDisruptionBudget

HTTP 请求

PATCH /apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets/{name}

参数

响应

200 (PodDisruptionBudget): OK

201 (PodDisruptionBudget): Created

401: Unauthorized

patch 部分更新指定 PodDisruptionBudget 的状态

HTTP 请求

PATCH /apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets/{name}/status

参数

响应

200 (PodDisruptionBudget): OK

201 (PodDisruptionBudget): Created

401: Unauthorized

delete 删除 PodDisruptionBudget

HTTP 请求

DELETE /apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets/{name}

参数

响应

200 (Status): OK

202 (Status): Accepted

401: Unauthorized

deletecollection 删除 PodDisruptionBudget 的集合

HTTP Request

DELETE /apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets

参数

响应

200 (Status): OK

401: Unauthorized

6.6 - PriorityLevelConfiguration v1

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

apiVersion: flowcontrol.apiserver.k8s.io/v1

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

PriorityLevelConfiguration

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


PriorityLevelConfigurationSpec

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


PriorityLevelConfigurationStatus

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


PriorityLevelConfigurationList

PriorityLevelConfigurationList 是 PriorityLevelConfiguration 对象的列表。


操作


get 读取指定的 PriorityLevelConfiguration

HTTP 请求

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

参数

响应

200 (PriorityLevelConfiguration): OK

401: Unauthorized

get 读取指定的 PriorityLevelConfiguration 的状态

HTTP 请求

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

参数

响应

200 (PriorityLevelConfiguration): OK

401: Unauthorized

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

HTTP 请求

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

参数

响应

200 (PriorityLevelConfigurationList): OK

401: Unauthorized

create 创建 PriorityLevelConfiguration

HTTP 请求

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

参数

响应

200 (PriorityLevelConfiguration): OK

201 (PriorityLevelConfiguration): Created

202 (PriorityLevelConfiguration): Accepted

401: Unauthorized

update 替换指定的 PriorityLevelConfiguration

HTTP 请求

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

参数

响应

200 (PriorityLevelConfiguration): OK

201 (PriorityLevelConfiguration): Created

401: Unauthorized

update 替换指定的 PriorityLevelConfiguration 的状态

HTTP 请求

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

参数

响应

200 (PriorityLevelConfiguration): OK

201 (PriorityLevelConfiguration): Created

401: Unauthorized

patch 部分更新指定的 PriorityLevelConfiguration

HTTP 请求

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

参数

响应

200 (PriorityLevelConfiguration): OK

201 (PriorityLevelConfiguration): Created

401: Unauthorized

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

HTTP 请求

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

参数

响应

200 (PriorityLevelConfiguration): OK

201 (PriorityLevelConfiguration): Created

401: Unauthorized

delete 删除 PriorityLevelConfiguration

HTTP 请求

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

参数

响应

200 (Status): OK

202 (Status): Accepted

401: Unauthorized

deletecollection 删除 PriorityLevelConfiguration 的集合

HTTP 请求

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

参数

响应

200 (Status): OK

401: Unauthorized

6.7 - ValidatingAdmissionPolicy

ValidatingAdmissionPolicy 描述了一种准入验证策略的定义,这种策略接受或拒绝一个对象而不对其进行修改。

apiVersion: admissionregistration.k8s.io/v1

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

ValidatingAdmissionPolicy

ValidatingAdmissionPolicy 描述了一种准入验证策略的定义, 这种策略用于接受或拒绝一个对象,而不对其进行修改。


ValidatingAdmissionPolicyList

ValidatingAdmissionPolicyList 是 ValidatingAdmissionPolicy 的列表。


ValidatingAdmissionPolicyBinding

ValidatingAdmissionPolicyBinding 将 ValidatingAdmissionPolicy 与参数化资源绑定。 ValidatingAdmissionPolicyBinding 和参数 CRD 共同定义了集群管理员如何为集群配置策略。

对于一个给定的准入请求,每个绑定将导致其策略被计算 N 次,其中 N 对于不使用参数的策略/绑定是 1, 否则 N 是由绑定选择的参数数量。

策略的 CEL 表达式必须具有低于最大 CEL 预算的计算 CEL 成本。每次策略计算都有独立的 CEL 成本预算。添加/移除策略、绑定或参数不会影响特定(策略,绑定,参数)组合是否在其自身的 CEL 预算内。


操作


get 读取指定的 ValidatingAdmissionPolicy

HTTP 请求

GET /apis/admissionregistration.k8s.io/v1/validatingadmissionpolicies/{name}

参数

响应

200 (ValidatingAdmissionPolicy): OK

401: Unauthorized

get 读取指定 ValidatingAdmissionPolicy 的状态

HTTP 请求

GET /apis/admissionregistration.k8s.io/v1/validatingadmissionpolicies/{name}/status

参数

响应

200 (ValidatingAdmissionPolicy): OK

401: Unauthorized

list 列出或监视 ValidatingAdmissionPolicy 类型的对象

HTTP 请求

GET /apis/admissionregistration.k8s.io/v1/validatingadmissionpolicies

参数

响应

200 (ValidatingAdmissionPolicyList): OK

401: Unauthorized

create 创建 ValidatingAdmissionPolicy

HTTP 请求

POST /apis/admissionregistration.k8s.io/v1/validatingadmissionpolicies

参数

响应

200 (ValidatingAdmissionPolicy): OK

201 (ValidatingAdmissionPolicy): Created

202 (ValidatingAdmissionPolicy): Accepted

401: Unauthorized

update 替换指定的 ValidatingAdmissionPolicy

HTTP 请求

PUT /apis/admissionregistration.k8s.io/v1/validatingadmissionpolicies/{name}

参数

响应

200 (ValidatingAdmissionPolicy): OK

201 (ValidatingAdmissionPolicy): Created

401: Unauthorized

update 替换指定 ValidatingAdmissionPolicy 的状态

HTTP 请求

PUT /apis/admissionregistration.k8s.io/v1/validatingadmissionpolicies/{name}/status

参数

响应

200 (ValidatingAdmissionPolicy): OK

201 (ValidatingAdmissionPolicy): Created

401: Unauthorized

patch 部分更新指定的 ValidatingAdmissionPolicy

HTTP 请求

PATCH /apis/admissionregistration.k8s.io/v1/validatingadmissionpolicies/{name}

参数

响应

200 (ValidatingAdmissionPolicy): OK

201 (ValidatingAdmissionPolicy): Created

401: Unauthorized

patch 部分更新指定 ValidatingAdmissionPolicy 的状态

HTTP 请求

PATCH /apis/admissionregistration.k8s.io/v1/validatingadmissionpolicies/{name}/status

参数

响应

200 (ValidatingAdmissionPolicy): OK

201 (ValidatingAdmissionPolicy): Created

401: Unauthorized

delete 删除 ValidatingAdmissionPolicy

HTTP 请求

DELETE /apis/admissionregistration.k8s.io/v1/validatingadmissionpolicies/{name}

参数

响应

200 (Status): OK

202 (Status): Accepted

401: Unauthorized

deletecollection 删除 ValidatingAdmissionPolicy 的集合

HTTP 请求

DELETE /apis/admissionregistration.k8s.io/v1/validatingadmissionpolicies

参数

响应

200 (Status): OK

401: Unauthorized

6.8 - ValidatingAdmissionPolicyBinding

ValidatingAdmissionPolicyBinding binds the ValidatingAdmissionPolicy with paramerized resources.

apiVersion: admissionregistration.k8s.io/v1

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

ValidatingAdmissionPolicyBinding

ValidatingAdmissionPolicyBinding binds the ValidatingAdmissionPolicy with paramerized resources. ValidatingAdmissionPolicyBinding and parameter CRDs together define how cluster administrators configure policies for clusters.

For a given admission request, each binding will cause its policy to be evaluated N times, where N is 1 for policies/bindings that don't use params, otherwise N is the number of parameters selected by the binding.

The CEL expressions of a policy must have a computed CEL cost below the maximum CEL budget. Each evaluation of the policy is given an independent CEL cost budget. Adding/removing policies, bindings, or params can not affect whether a given (policy, binding, param) combination is within its own CEL budget.


ValidatingAdmissionPolicy

ValidatingAdmissionPolicy describes the definition of an admission validation policy that accepts or rejects an object without changing it.


ValidatingAdmissionPolicyBindingList

ValidatingAdmissionPolicyBindingList is a list of ValidatingAdmissionPolicyBinding.


Operations


get read the specified ValidatingAdmissionPolicyBinding

HTTP Request

GET /apis/admissionregistration.k8s.io/v1/validatingadmissionpolicybindings/{name}

Parameters

Response

200 (ValidatingAdmissionPolicyBinding): OK

401: Unauthorized

list list or watch objects of kind ValidatingAdmissionPolicyBinding

HTTP Request

GET /apis/admissionregistration.k8s.io/v1/validatingadmissionpolicybindings

Parameters

Response

200 (ValidatingAdmissionPolicyBindingList): OK

401: Unauthorized

create create a ValidatingAdmissionPolicyBinding

HTTP Request

POST /apis/admissionregistration.k8s.io/v1/validatingadmissionpolicybindings

Parameters

Response

200 (ValidatingAdmissionPolicyBinding): OK

201 (ValidatingAdmissionPolicyBinding): Created

202 (ValidatingAdmissionPolicyBinding): Accepted

401: Unauthorized

update replace the specified ValidatingAdmissionPolicyBinding

HTTP Request

PUT /apis/admissionregistration.k8s.io/v1/validatingadmissionpolicybindings/{name}

Parameters

Response

200 (ValidatingAdmissionPolicyBinding): OK

201 (ValidatingAdmissionPolicyBinding): Created

401: Unauthorized

patch partially update the specified ValidatingAdmissionPolicyBinding

HTTP Request

PATCH /apis/admissionregistration.k8s.io/v1/validatingadmissionpolicybindings/{name}

Parameters

Response

200 (ValidatingAdmissionPolicyBinding): OK

201 (ValidatingAdmissionPolicyBinding): Created

401: Unauthorized

delete delete a ValidatingAdmissionPolicyBinding

HTTP Request

DELETE /apis/admissionregistration.k8s.io/v1/validatingadmissionpolicybindings/{name}

Parameters

Response

200 (Status): OK

202 (Status): Accepted

401: Unauthorized

deletecollection delete collection of ValidatingAdmissionPolicyBinding

HTTP Request

DELETE /apis/admissionregistration.k8s.io/v1/validatingadmissionpolicybindings

Parameters

Response

200 (Status): OK

401: Unauthorized

7 - 扩展资源

7.1 - CustomResourceDefinition

CustomResourceDefinition 表示应在 API 服务器上公开的资源。

apiVersion: apiextensions.k8s.io/v1

import "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"

CustomResourceDefinition

CustomResourceDefinition 表示应在 API 服务器上公开的资源。其名称必须采用 <.spec.name>.<.spec.group> 格式。


CustomResourceDefinitionSpec

CustomResourceDefinitionSpec 描述了用户希望资源的呈现方式。


JSONSchemaProps

JSONSchemaProps 是JSON 模式(JSON-Schema),遵循其规范草案第 4 版(http://json-schema.org/)。


CustomResourceDefinitionStatus

CustomResourceDefinitionStatus 表示 CustomResourceDefinition 的状态。


CustomResourceDefinitionList

CustomResourceDefinitionList 是 CustomResourceDefinition 对象的列表。


Operations


get 读取指定的 CustomResourceDefinition

HTTP 请求

GET /apis/apiextensions.k8s.io/v1/customresourcedefinitions/{name}

参数

响应

200 (CustomResourceDefinition): OK

401: Unauthorized

get 读取指定 CustomResourceDefinition 的状态

HTTP 请求

GET /apis/apiextensions.k8s.io/v1/customresourcedefinitions/{name}/status

参数

响应

200 (CustomResourceDefinition): OK

401: Unauthorized

list 列出或观察 CustomResourceDefinition 类型的对象

HTTP 请求

GET /apis/apiextensions.k8s.io/v1/customresourcedefinitions

参数

响应

200 (CustomResourceDefinitionList): OK

401: Unauthorized

create 创建一个 CustomResourceDefinition

HTTP 请求

POST /apis/apiextensions.k8s.io/v1/customresourcedefinitions

参数

响应

200 (CustomResourceDefinition): OK

201 (CustomResourceDefinition): Created

202 (CustomResourceDefinition): Accepted

401: Unauthorized

update 替换指定的 CustomResourceDefinition

HTTP 请求

PUT /apis/apiextensions.k8s.io/v1/customresourcedefinitions/{name}

参数

响应

200 (CustomResourceDefinition): OK

201 (CustomResourceDefinition): Created

401: Unauthorized

update 替换指定 CustomResourceDefinition 的状态

HTTP 请求

PUT /apis/apiextensions.k8s.io/v1/customresourcedefinitions/{name}/status

参数

响应

200 (CustomResourceDefinition): OK

201 (CustomResourceDefinition): Created

401: Unauthorized

patch 部分更新指定的 CustomResourceDefinition

HTTP 请求

PATCH /apis/apiextensions.k8s.io/v1/customresourcedefinitions/{name}

参数

响应

200 (CustomResourceDefinition): OK

201 (CustomResourceDefinition): Created

401: Unauthorized

patch 部分更新指定 CustomResourceDefinition 的状态

HTTP 请求

PATCH /apis/apiextensions.k8s.io/v1/customresourcedefinitions/{name}/status

参数

响应

200 (CustomResourceDefinition): OK

201 (CustomResourceDefinition): Created

401: Unauthorized

delete 删除一个 CustomResourceDefinition

HTTP 请求

DELETE /apis/apiextensions.k8s.io/v1/customresourcedefinitions/{name}

参数

响应

200 (Status): OK

202 (Status): Accepted

401: Unauthorized

deletecollection 删除 CustomResourceDefinition 的集合

HTTP 请求

DELETE /apis/apiextensions.k8s.io/v1/customresourcedefinitions

参数

响应

200 (Status): OK

401: Unauthorized

7.2 - DeviceClass

DeviceClass 是由供应商或管理员提供的资源,包含设备配置和选择算符。

apiVersion: resource.k8s.io/v1

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

DeviceClass

DeviceClass 是由供应商或管理员提供的资源,包含设备配置和选择算符。 它可以在申领的设备请求中被引用,以应用预设值。作用域为集群范围。

这是一个 Alpha 阶段的资源类别,需要启用 DynamicResourceAllocation 特性门控。


DeviceClassSpec

DeviceClassSpec 在 DeviceClass 中用于定义可被分配的资源以及如何配置这类资源。


DeviceClassList

DeviceClassList 是类的集合。


操作


get 读取指定的 DeviceClass

HTTP 请求

GET /apis/resource.k8s.io/v1/deviceclasses/{name}

参数

响应

200 (DeviceClass): OK

401: Unauthorized

list 列举或监视 DeviceClass 类别的对象

HTTP 请求

GET /apis/resource.k8s.io/v1/deviceclasses

参数

响应

200 (DeviceClassList): OK

401: Unauthorized

create 创建 DeviceClass

HTTP 请求

POST /apis/resource.k8s.io/v1/deviceclasses

参数

响应

200 (DeviceClass): OK

201 (DeviceClass): Created

202 (DeviceClass): Accepted

401: Unauthorized

update 替换指定的 DeviceClass

HTTP 请求

PUT /apis/resource.k8s.io/v1/deviceclasses/{name}

参数

响应

200 (DeviceClass): OK

201 (DeviceClass): Created

401: Unauthorized

patch 部分更新指定的 DeviceClass

HTTP 请求

PATCH /apis/resource.k8s.io/v1/deviceclasses/{name}

参数

响应

200 (DeviceClass): OK

201 (DeviceClass): Created

401: Unauthorized

delete 删除 DeviceClass

HTTP 请求

DELETE /apis/resource.k8s.io/v1/deviceclasses/{name}

参数

响应

200 (DeviceClass): OK

202 (DeviceClass): Accepted

401: Unauthorized

deletecollection 删除 DeviceClass 的集合

HTTP 请求

DELETE /apis/resource.k8s.io/v1/deviceclasses

参数

响应

200 (Status): OK

401: Unauthorized

7.3 - MutatingWebhookConfiguration

MutatingWebhookConfiguration 描述准入 Webhook 的配置,该 Webhook 可在更改对象的情况下接受或拒绝对象请求

apiVersion: admissionregistration.k8s.io/v1

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

MutatingWebhookConfiguration

MutatingWebhookConfiguration 描述准入 Webhook 的配置,该 Webhook 可接受或拒绝对象请求,并且可能变更对象。


MutatingWebhookConfigurationList

MutatingWebhookConfigurationList 是 MutatingWebhookConfiguration 的列表。


操作


get 读取指定的 MutatingWebhookConfiguration

HTTP 请求

GET /apis/admissionregistration.k8s.io/v1/mutatingwebhookconfigurations/{name}

参数

响应

200 (MutatingWebhookConfiguration): OK

401: Unauthorized

list 列出或观察 MutatingWebhookConfiguration 类型的对象

HTTP 请求

GET /apis/admissionregistration.k8s.io/v1/mutatingwebhookconfigurations

参数

响应

200 (MutatingWebhookConfigurationList): OK

401: Unauthorized

create 创建一个 MutatingWebhookConfiguration

HTTP 请求

POST /apis/admissionregistration.k8s.io/v1/mutatingwebhookconfigurations

参数

响应

200 (MutatingWebhookConfiguration): OK

201 (MutatingWebhookConfiguration): Created

202 (MutatingWebhookConfiguration): Accepted

401: Unauthorized

update 替换指定的 MutatingWebhookConfiguration

HTTP 请求

PUT /apis/admissionregistration.k8s.io/v1/mutatingwebhookconfigurations/{name}

参数

响应

200 (MutatingWebhookConfiguration): OK

201 (MutatingWebhookConfiguration): Created

401: Unauthorized

patch 部分更新指定的 MutatingWebhookConfiguration

HTTP 请求

PATCH /apis/admissionregistration.k8s.io/v1/mutatingwebhookconfigurations/{name}

参数

响应

200 (MutatingWebhookConfiguration): OK

201 (MutatingWebhookConfiguration): Created

401: Unauthorized

delete 删除 MutatingWebhookConfiguration

HTTP 请求

DELETE /apis/admissionregistration.k8s.io/v1/mutatingwebhookconfigurations/{name}

参数

响应

200 (Status): OK

202 (Status): Accepted

401: Unauthorized

deletecollection 删除 MutatingWebhookConfiguration 的集合

HTTP 请求

DELETE /apis/admissionregistration.k8s.io/v1/mutatingwebhookconfigurations

参数

响应

200 (Status): OK

401: Unauthorized

7.4 - ValidatingWebhookConfiguration

ValidatingWebhookConfiguration 描述准入 Webhook 的配置,该 Webhook 可在不更改对象的情况下接受或拒绝对象请求

apiVersion: admissionregistration.k8s.io/v1

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

ValidatingWebhookConfiguration

ValidatingWebhookConfiguration 描述准入 Webhook 的配置,此 Webhook 可在不更改对象的情况下接受或拒绝对象请求。


ValidatingWebhookConfigurationList

ValidatingWebhookConfigurationList 是 ValidatingWebhookConfiguration 的列表。


apiVersion 定义对象表示的版本化模式。服务器应将已识别的模式转换为最新的内部值, 并可能拒绝未识别的值。更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources

操作


get 读取指定的 ValidatingWebhookConfiguration

HTTP 请求

GET /apis/admissionregistration.k8s.io/v1/validatingwebhookconfigurations/{name}

参数

响应

200 (ValidatingWebhookConfiguration): OK

401: Unauthorized

list 列出或观察 ValidatingWebhookConfiguration 类型的对象

HTTP 请求

GET /apis/admissionregistration.k8s.io/v1/validatingwebhookconfigurations

参数

响应

200 (ValidatingWebhookConfigurationList): OK

401: Unauthorized

create 创建一个 ValidatingWebhookConfiguration

HTTP 请求

POST /apis/admissionregistration.k8s.io/v1/validatingwebhookconfigurations

参数

响应

200 (ValidatingWebhookConfiguration): OK

201 (ValidatingWebhookConfiguration): Created

202 (ValidatingWebhookConfiguration): Accepted

401: Unauthorized

update 替换指定的 ValidatingWebhookConfiguration

HTTP 请求

PUT /apis/admissionregistration.k8s.io/v1/validatingwebhookconfigurations/{name}

参数

响应

200 (ValidatingWebhookConfiguration): OK

201 (ValidatingWebhookConfiguration): Created

401: Unauthorized

patch 部分更新指定的 ValidatingWebhookConfiguration

HTTP 请求

PATCH /apis/admissionregistration.k8s.io/v1/validatingwebhookconfigurations/{name}

参数

响应

200 (ValidatingWebhookConfiguration): OK

201 (ValidatingWebhookConfiguration): Created

401: Unauthorized

delete 删除 ValidatingWebhookConfiguration

HTTP 请求

DELETE /apis/admissionregistration.k8s.io/v1/validatingwebhookconfigurations/{name}

参数

响应

200 (Status): OK

202 (Status): Accepted

401: Unauthorized

deletecollection 删除 ValidatingWebhookConfiguration 的集合

HTTP 请求

DELETE /apis/admissionregistration.k8s.io/v1/validatingwebhookconfigurations

参数

响应

200 (Status): OK

401: Unauthorized

8 - 集群资源

8.1 - 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 协议,但是你可以禁用证书验证。


APIServiceStatus

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


APIServiceList

APIServiceList 是 APIService 对象的列表。


Operations


get 读取指定的 APIService

HTTP 请求

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

参数

响应

200 (APIService): OK

401: Unauthorized

get 读取指定 APIService 的状态

HTTP 请求

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

参数

响应

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}

参数

响应

200 (APIService): OK

201 (APIService): Created

401: Unauthorized

update 替换指定 APIService 的 status

HTTP 请求

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

参数

响应

200 (APIService): OK

201 (APIService): Created

401: Unauthorized

patch 部分更新指定的 APIService

HTTP 请求

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

参数

响应

200 (APIService): OK

201 (APIService): Created

401: Unauthorized

patch 部分更新指定 APIService 的 status

HTTP 请求

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

参数

响应

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

8.2 - ComponentStatus

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

apiVersion: v1

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

ComponentStatus

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


ComponentStatusList

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


操作


get 读取指定的 ComponentStatus

HTTP 请求

GET /api/v1/componentstatuses/{name}

参数

响应

200 (ComponentStatus): OK

401: Unauthorized

list 列出 ComponentStatus 类别的对象

HTTP 请求

GET /api/v1/componentstatuses

参数

响应

200 (ComponentStatusList): OK

401: Unauthorized

8.3 - Event

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

apiVersion: events.k8s.io/v1

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

Event

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


EventList

EventList 是一个 Event 对象列表。


操作


get 读取特定 Event

HTTP 请求

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

参数

响应

200 (Event): OK

401: Unauthorized

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

HTTP 请求

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

参数

响应

200 (EventList): OK

401: Unauthorized

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

HTTP 请求

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

参数

响应

200 (EventList): OK

401: Unauthorized

create 创建一个 Event

HTTP 请求

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

参数

响应

200 (Event): OK

201 (Event): Created

202 (Event): Accepted

401: Unauthorized

update 替换指定 Event

HTTP 请求

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

参数

响应

200 (Event): OK

201 (Event): Created

401: Unauthorized

patch 部分更新指定的 Event

HTTP 请求

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

参数

响应

200 (Event): OK

201 (Event): Created

401: Unauthorized

delete 删除 Event

HTTP 请求

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

参数

响应

200 (Status): OK

202 (Status): Accepted

401: Unauthorized

deletecollection 删除 Event 集合

HTTP 请求

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

参数

响应

200 (Status): OK

401: Unauthorized

8.4 - IPAddress

IPAddress 表示单个 IP 族的单个 IP。

apiVersion: networking.k8s.io/v1

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

IPAddress

IPAddress 表示单个 IP 族的单个 IP。此对象旨在供操作 IP 地址的 API 使用。 此对象由 Service 核心 API 用于分配 IP 地址。 IP 地址可以用不同的格式表示,为了保证 IP 地址的唯一性,此对象的名称是格式规范的 IP 地址。 IPv4 地址由点分隔的四个十进制数字组成,前导零可省略;IPv6 地址按照 RFC 5952 的定义来表示。 有效值:192.168.1.5、2001:db8::1 或 2001:db8:aaaa:bbbb:cccc:dddd:eeee:1。 无效值:10.01.2.3 或 2001:db8:0:0:0::1。


IPAddressSpec

IPAddressSpec 描述 IP 地址中的属性。


IPAddressList

IPAddressList 包含 IPAddress 的列表。


操作


get 读取指定的 IPAddress

HTTP 请求

GET /apis/networking.k8s.io/v1/ipaddresses/{name}

参数

响应

200 (IPAddress): OK

401: Unauthorized

list 列举或监视类别为 IPAddress 的对象

HTTP 请求

GET /apis/networking.k8s.io/v1/ipaddresses

参数

响应

200 (IPAddressList): OK

401: Unauthorized

create 创建 IPAddress

HTTP 请求

POST /apis/networking.k8s.io/v1/ipaddresses

参数

响应

200 (IPAddress): OK

201 (IPAddress): Created

202 (IPAddress): Accepted

401: Unauthorized

update 替换指定的 IPAddress

HTTP 请求

PUT /apis/networking.k8s.io/v1/ipaddresses/{name}

参数

响应

200 (IPAddress): OK

201 (IPAddress): Created

401: Unauthorized

patch 部分更新指定的 IPAddress

HTTP 请求

PATCH /apis/networking.k8s.io/v1/ipaddresses/{name}

参数

响应

200 (IPAddress): OK

201 (IPAddress): Created

401: Unauthorized

delete 删除 IPAddress

HTTP 请求

DELETE /apis/networking.k8s.io/v1/ipaddresses/{name}

参数

响应

200 (Status): OK

202 (Status): Accepted

401: Unauthorized

deletecollection 删除 IPAddress 的集合

HTTP 请求

DELETE /apis/networking.k8s.io/v1/ipaddresses

参数

响应

200 (Status): OK

401: Unauthorized

8.5 - Lease

Lease 定义了租约的概念。

apiVersion: coordination.k8s.io/v1

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

Lease

Lease 定义了租约的概念。


LeaseSpec

LeaseSpec 是 Lease 的规约。


LeaseList

LeaseList 是 Lease 对象的列表。


操作


get 读取指定的 Lease

HTTP 请求

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

参数

响应

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}

参数

响应

200 (Lease): OK

201 (Lease): Created

401: Unauthorized

patch 部分更新指定的 Lease

HTTP 请求

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

参数

响应

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

8.6 - LeaseCandidate v1beta1

LeaseCandidate 定义 Lease 对象的候选者。

apiVersion: coordination.k8s.io/v1beta1

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

LeaseCandidate

LeaseCandidate 定义一个 Lease 对象的候选者。 通过创建候选者,协同式领导者选举能够从候选者列表中选出最佳的领导者。


LeaseCandidateSpec

LeaseCandidateSpec 是 Lease 的规约。


pingTime 是服务器最近一次请求 LeaseCandidate 续订的时间。 此操作仅在领导者选举期间进行,用以检查是否有 LeaseCandidates 变得不合格。 当 pingTime 更新时,LeaseCandidate 会通过更新 renewTime 来响应。

MicroTime 是微秒级精度的 Time 版本

LeaseCandidateList

LeaseCandidateList 是 Lease 对象的列表。


操作


get 读取指定的 LeaseCandidate

HTTP 请求

GET /apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leasecandidates/{name}

参数

响应

200 (LeaseCandidate): OK

401: Unauthorized

list 列举或监视类别为 LeaseCandidate 的对象

HTTP 请求

GET /apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leasecandidates

参数

响应

200 (LeaseCandidateList): OK

401: Unauthorized

list 列举或监视类别为 LeaseCandidate 的对象

HTTP 请求

GET /apis/coordination.k8s.io/v1beta1/leasecandidates

参数

响应

200 (LeaseCandidateList): OK

401: Unauthorized

create 创建 LeaseCandidate

HTTP 请求

POST /apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leasecandidates

参数

响应

200 (LeaseCandidate): OK

201 (LeaseCandidate): Created

202 (LeaseCandidate): Accepted

401: Unauthorized

update 替换指定的 LeaseCandidate

HTTP 请求

PUT /apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leasecandidates/{name}

参数

响应

200 (LeaseCandidate): OK

201 (LeaseCandidate): Created

401: Unauthorized

patch 部分更新指定的 LeaseCandidate

HTTP 请求

PATCH /apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leasecandidates/{name}

参数

响应

200 (LeaseCandidate): OK

201 (LeaseCandidate): Created

401: Unauthorized

delete 删除 LeaseCandidate

HTTP 请求

DELETE /apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leasecandidates/{name}

参数

响应

200 (Status): OK

202 (Status): Accepted

401: Unauthorized

deletecollection 删除 LeaseCandidate 的集合

HTTP 请求

DELETE /apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leasecandidates

参数

响应

200 (Status): OK

401: Unauthorized

8.7 - Namespace

Namespace 为名字提供作用域。

apiVersion: v1

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

Namespace

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


NamespaceSpec

NamespaceSpec 用于描述 Namespace 的属性。


NamespaceStatus

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


NamespaceList

NamespaceList 是一个命名空间列表。


操作


get 读取指定的 Namespace

HTTP 请求

GET /api/v1/namespaces/{name}

参数

响应

200 (Namespace):OK

401:Unauthorized

get 读取指定 Namespace 的状态

HTTP 请求

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

参数

响应

200 (Namespace):OK

401:Unauthorized

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

HTTP 请求

GET /api/v1/namespaces

参数

响应

200 (NamespaceList):OK

401:Unauthorized

create 创建一个 Namespace

HTTP 请求

POST /api/v1/namespaces

参数

响应

200 (Namespace):OK

201 (Namespace):Created

202 (Namespace):Accepted

401:Unauthorized

update 替换指定的 Namespace

HTTP 请求

PUT /api/v1/namespaces/{name}

参数

响应

200 (Namespace):OK

201 (Namespace):Created

401:Unauthorized

update 替换指定 Namespace 的终结器

HTTP 请求

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

参数

响应

200 (Namespace):OK

201 (Namespace):Created

401:Unauthorized

update 替换指定 Namespace 的状态

HTTP 请求

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

参数

响应

200 (Namespace):OK

201 (Namespace):Created

401: Unauthorized

patch 部分更新指定的 Namespace

HTTP 请求

PATCH /api/v1/namespaces/{name}

参数

响应

200 (Namespace):OK

201 (Namespace):Created

401: Unauthorized

patch 部分更新指定 Namespace 的状态

HTTP 请求

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

参数

响应

200 (Namespace):OK

201 (Namespace):Created

401:Unauthorized

delete 删除一个 Namespace

HTTP 请求

DELETE /api/v1/namespaces/{name}

参数

响应

200 (Status):OK

202 (Status):Accepted

401:Unauthorized

8.8 - Node

Node 是 Kubernetes 中的工作节点。

apiVersion: v1

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

Node

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


NodeSpec

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


NodeStatus

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


NodeList

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


操作


get 读取指定节点

HTTP 请求

GET /api/v1/nodes/{name}

参数

响应

200 (Node): OK

401: Unauthorized

get 读取指定节点的状态

HTTP 请求

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

参数

响应

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}

参数

响应

200 (Node): OK

201 (Node): Created

401: Unauthorized

update 替换指定节点的状态

HTTP 请求

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

参数

响应

200 (Node): OK

201 (Node): Created

401: Unauthorized

patch 部分更新指定节点

HTTP 请求

PATCH /api/v1/nodes/{name}

参数

响应

200 (Node): OK

201 (Node): Created

401: Unauthorized

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

HTTP 请求

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

参数

响应

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

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


RuntimeClassList

RuntimeClassList 是 RuntimeClass 对象的列表。


操作


get 读取指定的 RuntimeClass

HTTP 请求

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

参数

响应

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}

参数

响应

200 (RuntimeClass): OK

201 (RuntimeClass): Created

401: Unauthorized

patch 部分更新指定的 RuntimeClass

HTTP 请求

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

参数

响应

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

8.10 - ServiceCIDR

ServiceCIDR 使用 CIDR 格式定义 IP 地址的范围

apiVersion: networking.k8s.io/v1

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

ServiceCIDR

ServiceCIDR 使用 CIDR 格式定义 IP 地址的范围(例如 192.168.0.0/24 或 2001:db2::/64)。 此范围用于向 Service 对象分配 ClusterIP。


ServiceCIDRSpec

ServiceCIDRSpec 定义用户想要为 Service 分配 ClusterIP 所用的 CIDR。


ServiceCIDRStatus

ServiceCIDRStatus 描述 ServiceCIDR 的当前状态。


ServiceCIDRList

ServiceCIDRList 包含 ServiceCIDR 对象的列表。


操作


get 读取指定的 ServiceCIDR

HTTP

GET /apis/networking.k8s.io/v1/servicecidrs/{name}

参数

响应

200 (ServiceCIDR): OK

401: Unauthorized

get 读取指定的 ServiceCIDR 的状态

HTTP 请求

GET /apis/networking.k8s.io/v1/servicecidrs/{name}/status

参数

响应

200 (ServiceCIDR): OK

401: Unauthorized

list 列举或监视 ServiceCIDR 类别的对象

HTTP 请求

GET /apis/networking.k8s.io/v1/servicecidrs

参数

响应

200 (ServiceCIDRList): OK

401: Unauthorized

create 创建 ServiceCIDR

HTTP 请求

POST /apis/networking.k8s.io/v1/servicecidrs

参数

响应

200 (ServiceCIDR): OK

201 (ServiceCIDR): Created

202 (ServiceCIDR): Accepted

401: Unauthorized

update 替换指定的 ServiceCIDR

HTTP 请求

PUT /apis/networking.k8s.io/v1/servicecidrs/{name}

参数

响应

200 (ServiceCIDR): OK

201 (ServiceCIDR): Created

401: Unauthorized

update 替换指定的 ServiceCIDR 的状态

HTTP 请求

PUT /apis/networking.k8s.io/v1/servicecidrs/{name}/status

参数

响应

200 (ServiceCIDR): OK

201 (ServiceCIDR): Created

401: Unauthorized

patch 部分更新指定的 ServiceCIDR

HTTP 请求

PATCH /apis/networking.k8s.io/v1/servicecidrs/{name}

参数

响应

200 (ServiceCIDR): OK

201 (ServiceCIDR): Created

401: Unauthorized

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

HTTP 请求

PATCH /apis/networking.k8s.io/v1/servicecidrs/{name}/status

参数

响应

200 (ServiceCIDR): OK

201 (ServiceCIDR): Created

401: Unauthorized

delete 删除 ServiceCIDR

HTTP 请求

DELETE /apis/networking.k8s.io/v1/servicecidrs/{name}

参数

响应

200 (Status): OK

202 (Status): Accepted

401: Unauthorized

deletecollection 删除 ServiceCIDR 的集合

HTTP 请求

DELETE /apis/networking.k8s.io/v1/servicecidrs

参数

响应

200 (Status): OK

401: Unauthorized

9 - 公共定义

9.1 - DeleteOptions

删除 API 对象时可以提供 DeleteOptions。

import "k8s.io/apimachinery/pkg/apis/meta/v1"

删除 API 对象时可以提供 DeleteOptions。


9.2 - LabelSelector

标签选择算符是对一组资源的标签查询。

import "k8s.io/apimachinery/pkg/apis/meta/v1"

标签选择算符是对一组资源的标签查询。 matchLabelsmatchExpressions 的结果按逻辑与的关系组合。 一个 empty 标签选择算符匹配所有对象。一个 null 标签选择算符不匹配任何对象。


9.3 - ListMeta

ListMeta 描述了合成资源必须具有的元数据,包括列表和各种状态对象。

import "k8s.io/apimachinery/pkg/apis/meta/v1"

ListMeta 描述了合成资源必须具有的元数据,包括列表和各种状态对象。 一个资源仅能有 {ObjectMeta, ListMeta} 中的一个。


9.4 - LocalObjectReference

LocalObjectReference 包含足够的信息,可以让你在同一命名空间内找到引用的对象。

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

LocalObjectReference 包含足够的信息,可以让你在同一命名空间(namespace)内找到引用的对象。


9.5 - NodeSelectorRequirement

节点选择算符需求是一个选择算符,其中包含值集、主键以及一个将键和值集关联起来的操作符。

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

节点选择算符需求是一个选择算符,其中包含值集、主键以及一个将键和值集关联起来的操作符。


9.6 - ObjectFieldSelector

ObjectFieldSelector 选择对象的 APIVersioned 字段。

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

ObjectFieldSelector 选择对象的 APIVersioned 字段。


9.7 - ObjectMeta

ObjectMeta 是所有持久化资源必须具有的元数据,其中包括用户必须创建的所有对象。

import "k8s.io/apimachinery/pkg/apis/meta/v1"

ObjectMeta 是所有持久化资源必须具有的元数据,其中包括用户必须创建的所有对象。


系统字段

只读字段

9.8 - ObjectReference

ObjectReference 包含足够的信息,可以让你检查或修改引用的对象。

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

ObjectReference 包含足够的信息,允许你检查或修改引用的对象。


9.9 - Patch

提供 Patch 是为了给 Kubernetes PATCH 请求正文提供一个具体的名称和类型。

import "k8s.io/apimachinery/pkg/apis/meta/v1"

提供 Patch 是为了给 Kubernetes PATCH 请求正文提供一个具体的名称和类型。


9.10 - Quantity

数量(Quantity)是数字的定点表示。

import "k8s.io/apimachinery/pkg/api/resource"

数量(Quantity)是数字的定点表示。 除了 String() 和 AsInt64() 的访问接口之外, 它以 JSON 和 YAML 形式提供方便的打包和解包方法。

序列化格式如下:

<quantity>        ::= <signedNumber><suffix>

(注意 <suffix> 可能为空,例如 <decimalSI> 的 "" 情形。)

<digit>           ::= 0 | 1 | ... | 9
<digits>          ::= <digit> | <digit><digits>
<number>          ::= <digits> | <digits>.<digits> | <digits>. | .<digits>
<sign>            ::= "+" | "-"
<signedNumber>    ::= <number> | <sign><number>
<suffix>          ::= <binarySI> | <decimalExponent> | <decimalSI>
<binarySI>        ::= Ki | Mi | Gi | Ti | Pi | Ei

(国际单位制度;查阅: http://physics.nist.gov/cuu/Units/binary.html)

<decimalSI>       ::= m | "" | k | M | G | T | P | E

(注意,1024 = 1ki 但 1000 = 1k;我没有选择大写。)

<decimalExponent> ::= "e" <signedNumber> | "E" <signedNumber>

无论使用三种指数形式中哪一种,没有数量可以表示大于 263-1 的数,也不可能超过 3 个小数位。 更大或更精确的数字将被截断或向上取整(例如:0.1m 将向上取整为 1m)。 如果将来我们需要更大或更小的数量,可能会扩展。

当从字符串解析数量时,它将记住它具有的后缀类型,并且在序列化时将再次使用相同类型。

在序列化之前,数量将以“规范形式”放置。这意味着指数或者后缀将被向上或向下调整(尾数相应增加或减少),并确保:

除非数量是负数,否则将省略正负号。

例如:

请注意,数量永远不会在内部以浮点数表示。这是本设计的重中之重。

只要它们格式正确,非规范值仍将解析,但将以其规范形式重新输出(所以应该总是使用规范形式,否则不要执行 diff 比较)。

这种格式旨在使得很难在不撰写某种特殊处理代码的情况下使用这些数字,进而希望实现者也使用定点实现。


9.11 - ResourceFieldSelector

ResourceFieldSelector 表示容器资源(CPU,内存)及其输出格式。

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

ResourceFieldSelector 表示容器资源(CPU,内存)及其输出格式。


9.12 - Status

状态(Status)是不返回其他对象的调用的返回值。

import "k8s.io/apimachinery/pkg/apis/meta/v1"

状态(Status)是不返回其他对象的调用的返回值。


9.13 - TypedLocalObjectReference

TypedLocalObjectReference 包含足够的信息,可以让你在同一个名称空间中定位指定类型的引用对象。

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

TypedLocalObjectReference 包含足够的信息,可以让你在同一个名称空间中定位特定类型的引用对象。


10 - 常用参数

allowWatchBookmarks

allowWatchBookmarks 字段请求类型为 BOOKMARK 的监视事件。 没有实现书签的服务器可能会忽略这个标志,并根据服务器的判断发送书签。 客户端不应该假设书签会在任何特定的时间间隔返回,也不应该假设服务器会在会话期间发送任何书签事件。 如果当前请求不是 watch 请求,则忽略该字段。


continue

当需要从服务器检索更多结果时,应该设置 continue 选项。由于这个值是服务器定义的, 客户端只能使用先前查询结果中具有相同查询参数的 continue 值(continue 值除外), 服务器可能拒绝它识别不到的 continue 值。 如果指定的 continue 值不再有效,无论是由于过期(通常是 5 到 15 分钟) 还是服务器上的配置更改,服务器将响应 "410 ResourceExpired" 错误和一个 continue 令牌。 如果客户端需要一个一致的列表,它必须在没有 continue 字段的情况下重新发起 list 请求。 否则,客户端可能会发送另一个带有 410 错误令牌的 list 请求,服务器将响应从下一个键开始的列表, 但列表数据来自最新的快照,这与之前的列表结果不一致。 第一个列表请求之后被创建、修改或删除的对象将被包含在响应中,只要它们的键是在“下一个键”之后。

当 watch 字段为 true 时,不支持此字段。客户端可以从服务器返回的最后一个 resourceVersion 值开始监视,就不会错过任何修改。


dryRun

表示不应该持久化所请求的修改。无效或无法识别的 dryRun 指令将导致错误响应, 并且服务器不再对请求进行进一步处理。有效值为:


fieldManager

fieldManager 是与进行这些更改的参与者或实体相关联的名称。 长度小于或128个字符且仅包含可打印字符,如 https://golang.org/pkg/unicode/#IsPrint 所定义。


fieldSelector

限制所返回对象的字段的选择器。默认为返回所有字段。


fieldValidation

fieldValidation 指示服务器如何处理请求(POST/PUT/PATCH)中包含未知或重复字段的对象。 有效值为:

从服务器返回的错误将包含所有遇到的未知和重复的字段。


force

Force 将“强制”应用请求。这意味着用户将重新获得他人拥有的冲突领域。 对于非应用补丁请求,Force 标志必须不设置。


gracePeriodSeconds

删除对象前的持续时间(秒数)。值必须为非负整数。取值为 0 表示立即删除。 如果该值为 nil,将使用指定类型的默认宽限期。如果没有指定,默认为每个对象的设置值。 0 表示立即删除。


ignoreStoreReadErrorWithClusterBreakingPotential

如果设置为 true,在正常的删除流程因对象损坏错误而失败时, 将触发资源的不安全删除。当由于以下原因无法从底层存储成功检索资源时, 该资源被视为损坏:

  1. 其数据无法转换,例如解密失败;或
  2. 它无法解码为一个对象。

注意:不安全删除忽略终结器约束,跳过前提条件检查,并从存储中移除对象。

警告:如果与正在被不安全删除的资源相关联的工作负载依赖于正常删除流程, 这可能会破坏集群。仅在你真正知道自己在做什么的情况下使用。

默认值是 false,用户必须主动选择启用。


labelSelector

通过标签限制返回对象列表的选择器。默认为返回所有对象。


limit

limit 是一个列表调用返回的最大响应数。如果有更多的条目,服务器会将列表元数据上的 'continue' 字段设置为一个值,该值可以用于相同的初始查询来检索下一组结果。 设置 limit 可能会在所有请求的对象被过滤掉的情况下返回少于请求的条目数量(下限为零), 并且客户端应该只根据 continue 字段是否存在来确定是否有更多的结果可用。 服务器可能选择不支持 limit 参数,并将返回所有可用的结果。 如果指定了 limit 并且 continue 字段为空,客户端可能会认为没有更多的结果可用。 如果 watch 为 true,则不支持此字段。

服务器保证在使用 continue 时返回的对象将与不带 limit 的列表调用相同, 也就是说,在发出第一个请求后所创建、修改或删除的对象将不包含在任何后续的继续请求中。 这有时被称为一致性快照,确保使用 limit 的客户端在分块接收非常大的结果的客户端能够看到所有可能的对象。 如果对象在分块列表期间被更新,则返回计算第一个列表结果时存在的对象版本。


namespace

对象名称和身份验证范围,例如用于团队和项目。


pretty

如果设置为 'true',那么输出是规范的打印。 默认情况下为 'false',除非用户代理声明是浏览器或命令行 HTTP 工具 (如 curl 和 wget)。


propagationPolicy

该字段决定是否以及如何执行垃圾收集。可以设置此字段或 OrphanDependents,但不能同时设置。 默认策略由 metadata.finalizers 和特定资源的默认策略设置决定。可接受的值是:


resourceVersion

resourceVersion 对请求所针对的资源版本设置约束。 详情请参见 https://kubernetes.io/zh-cn/docs/reference/using-api/api-concepts/#resource-versions

默认不设置。


resourceVersionMatch

resourceVersionMatch 字段决定如何将 resourceVersion 应用于列表调用。 强烈建议对设置了 resourceVersion 的列表调用设置 resourceVersion 匹配, 具体请参见 https://kubernetes.io/zh-cn/docs/reference/using-api/api-concepts/#resource-versions

默认不设置。


sendInitialEvents

sendInitialEvents=true 可以和 watch=true 一起设置。 在这种情况下,监视通知流将从合成事件开始,以生成集合中对象的当前状态。 一旦发送了所有此类事件,将发送合成的 "Bookmark" 事件。"bookmark" 将报告对象集合对应的 ResourceVersion(RV),并标有 "k8s.io/initial-events-end": "true" 注解。 之后,监视通知流将照常进行,发送与所监视的对象的变更(在 RV 之后)对应的监视事件。

当设置了 sendInitialEvents 选项时,我们还需要设置 resourceVersionMatch 选项。watch 请求的语义如下:

如果 resourceVersion=""resourceVersion="0"(出于向后兼容性原因), 默认为 true,否则默认为 false。


timeoutSeconds

list/watch 调用的超时秒数。这选项限制调用的持续时间,无论是否有活动。


watch

监视对所述资源的更改,并将其这类变更以添加、更新和删除通知流的形式返回。指定 resourceVersion。