命名空间

命名空间为名称提供范围。

apiVersion: v1

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

命名空间

命名空间为名称提供范围。使用多个命名空间是可选的。


NamespaceSpec

NamespaceSpec 描述了命名空间的属性。


NamespaceStatus

NamespaceStatus 是有关命名空间当前状态的信息。


  • conditions ([]NamespaceCondition)

    补丁策略:按键 type 合并

    表示命名空间当前状态的最新可用观察结果。

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

    • conditions.status (string), required

      条件的状态,True、False、Unknown 之一。

    • conditions.type (string), required

      命名空间控制器条件的类型。

    • conditions.lastTransitionTime (Time)

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

    • conditions.message (string)

    • conditions.reason (string)

  • phase (string)

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

NamespaceList

NamespaceList 是命名空间列表。


操作


get 读取指定的命名空间

HTTP 请求

GET /api/v1/namespaces/{name}

参数

  • name (在路径中): string, required

    命名空间的名称

  • pretty (在查询中): string

    pretty

响应

200 (Namespace): OK

401: Unauthorized

get 读取指定命名空间的状态

HTTP 请求

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

参数

  • name (在路径中): string, required

    命名空间的名称

  • pretty (在查询中): string

    pretty

响应

200 (Namespace): OK

401: Unauthorized

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

HTTP 请求

GET /api/v1/namespaces

参数

响应

200 (NamespaceList): OK

401: Unauthorized

create 创建一个命名空间

HTTP 请求

POST /api/v1/namespaces

参数

响应

200 (Namespace): OK

201 (Namespace): Created

202 (Namespace): Accepted

401: Unauthorized

update 替换指定的命名空间

HTTP 请求

PUT /api/v1/namespaces/{name}

参数

  • name (在路径中): string, required

    命名空间的名称

  • body: Namespace, required

  • dryRun (在查询中): string

    dryRun

  • fieldManager (在查询中): string

    fieldManager

  • fieldValidation (在查询中): string

    fieldValidation

  • pretty (在查询中): string

    pretty

响应

200 (Namespace): OK

201 (Namespace): Created

401: Unauthorized

update 替换指定命名空间的最终化

HTTP 请求

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

参数

  • name (在路径中): string, required

    命名空间的名称

  • body: Namespace, required

  • dryRun (在查询中): string

    dryRun

  • fieldManager (在查询中): string

    fieldManager

  • fieldValidation (在查询中): string

    fieldValidation

  • pretty (在查询中): string

    pretty

响应

200 (Namespace): OK

201 (Namespace): Created

401: Unauthorized

update 替换指定命名空间的状态

HTTP 请求

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

参数

  • name (在路径中): string, required

    命名空间的名称

  • body: Namespace, required

  • dryRun (在查询中): string

    dryRun

  • fieldManager (在查询中): string

    fieldManager

  • fieldValidation (在查询中): string

    fieldValidation

  • pretty (在查询中): string

    pretty

响应

200 (Namespace): OK

201 (Namespace): Created

401: Unauthorized

patch 部分更新指定的命名空间

HTTP 请求

PATCH /api/v1/namespaces/{name}

参数

  • name (在路径中): string, required

    命名空间的名称

  • body: Patch, required

  • dryRun (在查询中): string

    dryRun

  • fieldManager (在查询中): string

    fieldManager

  • fieldValidation (在查询中): string

    fieldValidation

  • force (在查询中): boolean

    force

  • pretty (在查询中): string

    pretty

响应

200 (Namespace): OK

201 (Namespace): Created

401: Unauthorized

patch 部分更新指定命名空间的状态

HTTP 请求

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

参数

  • name (在路径中): string, required

    命名空间的名称

  • body: Patch, required

  • dryRun (在查询中): string

    dryRun

  • fieldManager (在查询中): string

    fieldManager

  • fieldValidation (在查询中): string

    fieldValidation

  • force (在查询中): boolean

    force

  • pretty (在查询中): string

    pretty

响应

200 (Namespace): OK

201 (Namespace): Created

401: Unauthorized

delete 删除一个命名空间

HTTP 请求

DELETE /api/v1/namespaces/{name}

参数

响应

200 (Status): OK

202 (Status): Accepted

401: Unauthorized

此页面是自动生成的。

如果您打算报告此页面存在问题,请在您的问题描述中提及该页面是自动生成的。修复可能需要在 Kubernetes 项目的其他地方进行。

上次修改时间:2023 年 4 月 3 日上午 8:22 PST:API Ref 多页面 v1.27 (7b39e9a9ec)