命名空间
apiVersion: v1
import "k8s.io/api/core/v1"
命名空间
命名空间提供了一个作用域供名称使用。使用多个命名空间是可选的。
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.ac.cn/docs/tasks/administer-cluster/namespaces/
NamespaceStatus
NamespaceStatus 是关于 Namespace 当前状态的信息。
conditions ([]NamespaceCondition)
Patch 策略:按键
type
进行合并Map:合并期间将保留键类型上的唯一值
表示命名空间当前状态的最新可用观察结果。
NamespaceCondition 包含关于命名空间状态的详细信息。
conditions.status (string),必需
条件的 Status,为 True、False、Unknown 之一。
conditions.type (string),必需
命名空间控制器条件的 Type。
conditions.lastTransitionTime (Time)
条件上次从一个状态迁移到另一个状态的时间。
Time 是 time.Time 的一个包装器,支持正确地编组(Marshaling)为 YAML 和 JSON。提供了许多 time 包工厂方法的包装器。
conditions.message (string)
人类可读的消息,指示关于上次迁移的详细信息。
conditions.reason (string)
条件的上次迁移的唯一、单个单词、CamelCase 格式的原因。
phase (string)
Phase 是命名空间当前的生命周期阶段。更多信息请参阅:https://kubernetes.ac.cn/docs/tasks/administer-cluster/namespaces/
NamespaceList
NamespaceList 是 Namespace 的列表。
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.ac.cn/docs/concepts/overview/working-with-objects/namespaces/
操作
get
读取指定的 Namespace
HTTP 请求
GET /api/v1/namespaces/{name}
参数
name (in path): string,必需
Namespace 的名称
pretty (in query): string
响应
200 (Namespace): OK
401: 未经授权
get
读取指定的 Namespace 的 status
HTTP 请求
GET /api/v1/namespaces/{name}/status
参数
name (in path): string,必需
Namespace 的名称
pretty (in query): string
响应
200 (Namespace): OK
401: 未经授权
list
列出或监视 kind 为 Namespace 的对象
HTTP 请求
GET /api/v1/namespaces
参数
allowWatchBookmarks (in query): boolean
continue (in query): string
fieldSelector (in query): string
labelSelector (in query): string
limit (in query): integer
pretty (in query): string
resourceVersion (in query): string
resourceVersionMatch (in query): string
sendInitialEvents (in query): boolean
timeoutSeconds (in query): integer
watch (in query): boolean
响应
200 (NamespaceList): OK
401: 未经授权
create
创建一个 Namespace
HTTP 请求
POST /api/v1/namespaces
参数
body: Namespace,必需
dryRun (in query): string
fieldManager (in query): string
fieldValidation (in query): string
pretty (in query): string
响应
200 (Namespace): OK
201 (Namespace): 已创建
202 (Namespace): 已接受
401: 未经授权
update
替换指定的 Namespace
HTTP 请求
PUT /api/v1/namespaces/{name}
参数
name (in path): string,必需
Namespace 的名称
body: Namespace,必需
dryRun (in query): string
fieldManager (in query): string
fieldValidation (in query): string
pretty (in query): string
响应
200 (Namespace): OK
201 (Namespace): 已创建
401: 未经授权
update
替换指定的 Namespace 的 finalize
HTTP 请求
PUT /api/v1/namespaces/{name}/finalize
参数
name (in path): string,必需
Namespace 的名称
body: Namespace,必需
dryRun (in query): string
fieldManager (in query): string
fieldValidation (in query): string
pretty (in query): string
响应
200 (Namespace): OK
201 (Namespace): 已创建
401: 未经授权
update
替换指定的 Namespace 的 status
HTTP 请求
PUT /api/v1/namespaces/{name}/status
参数
name (in path): string,必需
Namespace 的名称
body: Namespace,必需
dryRun (in query): string
fieldManager (in query): string
fieldValidation (in query): string
pretty (in query): string
响应
200 (Namespace): OK
201 (Namespace): 已创建
401: 未经授权
patch
部分更新指定的 Namespace
HTTP 请求
PATCH /api/v1/namespaces/{name}
参数
name (in path): string,必需
Namespace 的名称
body: Patch,必需
dryRun (in query): string
fieldManager (in query): string
fieldValidation (in query): string
force (in query): boolean
pretty (in query): string
响应
200 (Namespace): OK
201 (Namespace): 已创建
401: 未经授权
patch
部分更新指定的 Namespace 的 status
HTTP 请求
PATCH /api/v1/namespaces/{name}/status
参数
name (in path): string,必需
Namespace 的名称
body: Patch,必需
dryRun (in query): string
fieldManager (in query): string
fieldValidation (in query): string
force (in query): boolean
pretty (in query): string
响应
200 (Namespace): OK
201 (Namespace): 已创建
401: 未经授权
delete
删除一个 Namespace
HTTP 请求
DELETE /api/v1/namespaces/{name}
参数
name (in path): string,必需
Namespace 的名称
body: DeleteOptions
dryRun (in query): string
gracePeriodSeconds (in query): integer
ignoreStoreReadErrorWithClusterBreakingPotential (in query): boolean
pretty (in query): string
propagationPolicy (in query): string
响应
200 (Status): OK
202 (Status): 已接受
401: 未经授权
本页是自动生成的。
如果您计划报告本页的问题,请在您的问题描述中提及本页是自动生成的。修复可能需要在 Kubernetes 项目的其他地方进行。