1 - Namespace
apiVersion: v1
import "k8s.io/api/core/v1"
Namespace
Namespace 为名字提供作用域。使用多个命名空间是可选的。
-
apiVersion: v1
-
kind: Namespace
-
metadata (ObjectMeta)
标准的对象元数据。更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
-
spec (NamespaceSpec)
spec 定义了 Namespace 的行为。更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
-
status (NamespaceStatus)
status 描述了当前 Namespace 的状态。更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
NamespaceSpec
NamespaceSpec 用于描述 Namespace 的属性。
- finalizers ([]string) finalizers 是一个不透明的值列表,只有此列表为空时才能从存储中永久删除对象。 更多信息: https://kubernetes.io/docs/tasks/administer-cluster/namespaces/
NamespaceStatus
NamespaceStatus 表示 Namespace 的当前状态信息。
-
conditions ([]NamespaceCondition)
补丁策略:基于
type
健合并表示命名空间当前状态的最新可用状况。
NamespaceCondition 包含命名空间状态的详细信息。
-
conditions.status (string),必需
状况(condition)的状态,取值为 True、False 或 Unknown 之一。
- conditions.type (string), 必需
命名空间控制器状况的类型。
-
-
phase (string)
phase 是命名空间的当前生命周期阶段。更多信息: https://kubernetes.io/docs/tasks/administer-cluster/namespaces/
NamespaceList
NamespaceList 是一个命名空间列表。
-
apiVersion: v1
-
kind: NamespaceList
-
metadata (ListMeta)
标准的列表元数据。更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
-
items ([]Namespace),必需
items 是列表中的 Namespace 对象列表。更多信息: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/
操作
get
读取指定的 Namespace
HTTP 请求
GET /api/v1/namespaces/{name}
参数
-
name (路径参数):string,必需
Namespace 的名称
-
pretty (查询参数):string
响应
200 (Namespace):OK
401:Unauthorized
get
读取指定 Namespace 的状态
HTTP 请求
GET /api/v1/namespaces/{name}/status
参数
-
name (路径参数):string,必需
Namespace 的名称
-
pretty (查询参数):string
响应
200 (Namespace):OK
401:Unauthorized
list
列出或者检查类别为 Namespace 的对象
HTTP 请求
GET /api/v1/namespaces
参数
-
allowWatchBookmarks (查询参数):boolean
-
continue (查询参数):string
-
fieldSelector (查询参数):string
-
labelSelector (查询参数):string
-
limit (查询参数):integer
-
pretty (查询参数):string
-
resourceVersion (查询参数):string
-
resourceVersionMatch (查询参数):string
-
timeoutSeconds (查询参数):integer
-
watch (查询参数):boolean
响应
200 (NamespaceList):OK
401:Unauthorized
create
创建一个 Namespace
HTTP 请求
POST /api/v1/namespaces
参数
- body: Namespace,必需
-
dryRun (查询参数):string
-
fieldManager (查询参数):string
-
fieldValidation (查询参数):string
-
pretty (查询参数):string
响应
200 (Namespace):OK
201 (Namespace):Created
202 (Namespace):Accepted
401:Unauthorized
update
替换指定的 Namespace
HTTP 请求
PUT /api/v1/namespaces/{name}
参数
-
name (路径参数):string,必需
Namespace 的名称
-
body: Namespace, 必需
-
dryRun (查询参数):string
-
fieldManager (查询参数):string
-
fieldValidation (查询参数):string
-
pretty (查询参数):string
响应
200 (Namespace):OK
201 (Namespace):Created
401:Unauthorized
update
替换指定 Namespace 的终结器
HTTP 请求
PUT /api/v1/namespaces/{name}/finalize
参数
-
name (路径参数):string,必需
Namespace 的名称
-
body: Namespace,必需
-
dryRun (查询参数):string
-
fieldManager (查询参数):string
-
fieldValidation (查询参数):string
-
pretty (查询参数):string
响应
200 (Namespace):OK
201 (Namespace):Created
401:Unauthorized
update
替换指定 Namespace 的状态
HTTP 请求
PUT /api/v1/namespaces/{name}/status
参数
-
name (路径阐述):string,必需
Namespace 的名称
-
body: Namespace,必需
-
dryRun (查询参数):string
-
fieldManager (查询参数):string
-
fieldValidation (查询参数):string
-
pretty (查询参数):string
响应
200 (Namespace):OK
201 (Namespace):Created
401: Unauthorized
patch
部分更新指定的 Namespace
HTTP 请求
PATCH /api/v1/namespaces/{name}
参数
-
name (路径参数):string,必需
Namespace 的名称
- body: Patch,必需
-
dryRun (查询参数):string
-
fieldManager (查询参数):string
-
fieldValidation (查询参数):string
-
force (查询参数):boolean
-
pretty (查询参数): string
响应
200 (Namespace):OK
201 (Namespace):Created
401: Unauthorized
patch
部分更新指定 Namespace 的状态
HTTP 请求
PATCH /api/v1/namespaces/{name}/status
参数
-
name (路径参数):string,必需
Namespace 的名称
- body: Patch,必需
-
dryRun (查询参数):string
-
fieldManager (查询参数):string
-
fieldValidation (查询参数):string
-
force (查询参数): boolean
-
pretty (查询参数):string
响应
200 (Namespace):OK
201 (Namespace):Created
401:Unauthorized
delete
删除一个 Namespace
HTTP 请求
DELETE /api/v1/namespaces/{name}
参数
-
name (路径参数):string,必需
Namespace 的名称
-
body: DeleteOptions
-
dryRun (查询参数):string
-
gracePeriodSeconds (查询参数):integer
-
pretty (查询参数):string
-
propagationPolicy (查询参数):string
响应
200 (Status):OK
202 (Status):Accepted
401:Unauthorized
2 - Lease
apiVersion: coordination.k8s.io/v1
import "k8s.io/api/coordination/v1"
Lease
Lease 定义了租约的概念。
-
apiVersion: coordination.k8s.io/v1
-
kind: Lease
-
metadata (ObjectMeta)
更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
- spec (LeaseSpec)
Lease 规范。更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
LeaseSpec
LeaseSpec 是一个 Lease 的规范。
-
acquireTime (MicroTime)
acquireTime 是当前租约被获取的时间。
-
holderIdentity (string)
holderIdentity 包含当前租约持有人的身份。
-
leaseDurationSeconds (int32)
leaseDurationSeconds 是租约候选人需要等待强制获取租约的持续时间。这是相对于上次观察到的更新时间的度量。
-
leaseTransitions (int32)
LeasetTransitions 是租约持有人之间的转换次数。
-
renewTime (MicroTime)
renewTime 是当前租约持有人上次更新租约的时间。
LeaseList
LeaseList 是 Lease 对象的列表。
-
apiVersion: coordination.k8s.io/v1
-
kind: LeaseList
-
metadata (ListMeta)
标准列表元数据。更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
- items ([]Lease), required
Items 是架构对象的列表。
操作
get
读取指定的租赁
HTTP 请求
GET /apis/coordination.k8s.io/v1/namespaces/{namespace}/leases/{name}
参数
-
name (路径参数): string, 必需
Lease 名称
-
namespace (路径参数): string, 必需
-
pretty (查询参数): string
响应
200 (Lease): OK
401: Unauthorized
list
列出或监视 Lease 类对象
HTTP 请求
GET /apis/coordination.k8s.io/v1/namespaces/{namespace}/leases
参数
-
namespace (路径参数): string, 必需
-
allowWatchBookmarks (查询参数): boolean
-
continue (查询参数): string
-
fieldSelector (查询参数): string
-
labelSelector (查询参数): string
-
limit (查询参数): integer
-
pretty (查询参数): string
-
resourceVersion (查询参数): string
-
resourceVersionMatch (查询参数): string
-
timeoutSeconds (查询参数): integer
-
watch (查询参数): boolean
响应
200 (LeaseList): OK
401: Unauthorized
list
列出或监视 Lease 类对象
HTTP 请求
GET /apis/coordination.k8s.io/v1/leases
参数
-
allowWatchBookmarks (查询参数): boolean
-
continue (查询参数): string
-
fieldSelector (查询参数): string
-
labelSelector (查询参数): string
-
limit (查询参数): integer
-
pretty (查询参数): string
-
resourceVersion (查询参数): string
-
resourceVersionMatch (查询参数): string
-
timeoutSeconds (查询参数): integer
-
watch (查询参数): boolean
响应
200 (LeaseList): OK
401: Unauthorized
create
创建 Lease
HTTP 请求
POST /apis/coordination.k8s.io/v1/namespaces/{namespace}/leases
参数
-
namespace (路径参数): string, 必需
-
body: Lease, 必需
-
dryRun (查询参数): string
-
fieldManager (查询参数): string
-
fieldValidation (查询参数): string
-
pretty (查询参数): string
响应
200 (Lease): OK
201 (Lease): Created
202 (Lease): Accepted
401: Unauthorized
update
替换指定的 Lease
HTTP 请求
PUT /apis/coordination.k8s.io/v1/namespaces/{namespace}/leases/{name}
参数
-
name (路径参数): string, 必需
租贷名称
-
namespace (路径参数): string, 必需
-
body: Lease, 必需
-
dryRun (查询参数): string
-
fieldManager (查询参数): string
-
fieldValidation (查询参数): string
-
pretty (查询参数): string
响应
200 (Lease): OK
201 (Lease): Created
401: Unauthorized
patch
部分更新指定的 Lease
HTTP 请求
PATCH /apis/coordination.k8s.io/v1/namespaces/{namespace}/leases/{name}
参数
-
name (路径参数): string, 必需
租贷名称
-
namespace (路径参数): string, 必需
-
body: Patch, 必需
-
dryRun (查询参数): string
-
fieldManager (查询参数): string
-
fieldValidation (查询参数): string
-
force (查询参数): boolean
-
pretty (查询参数): string
响应
200 (Lease): OK
201 (Lease): Created
401: Unauthorized
delete
删除一个 Lease
HTTP 请求
DELETE /apis/coordination.k8s.io/v1/namespaces/{namespace}/leases/{name}
参数
-
name (路径参数): string, 必需
租贷的名称
-
namespace (路径参数): string, 必需
-
body: DeleteOptions
-
dryRun (查询参数): string
-
gracePeriodSeconds (查询参数): integer
-
pretty (查询参数): string
-
propagationPolicy (查询参数): string
响应
200 (Status): OK
202 (Status): Accepted
401: Unauthorized
deletecollection
删除 Lease 收款
HTTP 请求
DELETE /apis/coordination.k8s.io/v1/namespaces/{namespace}/leases
参数
-
namespace (路径参数): string, 必需
-
body: DeleteOptions
-
continue (查询参数): string
-
dryRun (查询参数): string
-
fieldSelector (查询参数): string
-
gracePeriodSeconds (查询参数): integer
-
labelSelector (查询参数): string
-
limit (查询参数): integer
-
pretty (查询参数): string
-
propagationPolicy (查询参数): string
-
resourceVersion (查询参数): string
-
resourceVersionMatch (查询参数): string
-
timeoutSeconds (查询参数): integer
响应
200 (Status): OK
401: Unauthorized
3 - Binding
apiVersion: v1
import "k8s.io/api/core/v1"
Binding
Binding 将一个对象与另一个对象联系起来; 例如,一个 Pod 被调度程序绑定到一个节点。 已在 1.7 版本弃用,请使用 Pod 的 binding 子资源。
-
apiVersion: v1
-
kind: Binding
-
metadata (ObjectMeta)
标准对象的元数据, 更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
-
target (ObjectReference), 必需
要绑定到标准对象的目标对象。
操作
create
创建一个 Binding
HTTP 请求
POST /api/v1/namespaces/{namespace}/bindings
参数
-
dryRun (查询参数): string
-
fieldManager (查询参数): string
-
fieldValidation (查询参数): string
-
pretty (查询参数): string
响应
200 (Binding): OK
201 (Binding): Created
202 (Binding): Accepted
401: Unauthorized
create
创建 Pod 的绑定
HTTP 请求
POST /api/v1/namespaces/{namespace}/pods/{name}/binding
参数
-
dryRun (查询参数): string
-
fieldManager (查询参数): string
-
fieldValidation (查询参数): string
-
pretty (查询参数): string
响应
200 (Binding): OK
201 (Binding): Created
202 (Binding): Accepted
401: Unauthorized