Namespace

Namespace 为 Names 提供了一个范围。

apiVersion: v1

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

Namespace

Namespace 为 Names 提供了一个范围。使用多个命名空间是可选的。


NamespaceSpec

NamespaceSpec 描述了 Namespace 的属性。


NamespaceStatus

NamespaceStatus 包含有关 Namespace 当前状态的信息。


  • conditions ([]NamespaceCondition)

    补丁策略:按键 type 合并

    映射:合并时将保留键类型上的唯一值

    表示 Namespace 当前状态的最新可用观察。

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

    • conditions.status (string),必需

      条件的 status,可以是 True、False、Unknown 之一。

    • conditions.type (string),必需

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

    • 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 读取指定的 Namespace

HTTP 请求

GET /api/v1/namespaces/{name}

参数

  • name (在路径中): string,必填

    Namespace 的名称

  • pretty (在查询中): string

    pretty

响应

200 (Namespace): OK

401: 未授权

get 读取指定的 Namespace 的状态

HTTP 请求

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

参数

  • name (在路径中): string,必填

    Namespace 的名称

  • pretty (在查询中): string

    pretty

响应

200 (Namespace): OK

401: 未授权

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

HTTP 请求

GET /api/v1/namespaces

参数

响应

200 (NamespaceList): OK

401: 未授权

create 创建一个 Namespace

HTTP 请求

POST /api/v1/namespaces

参数

响应

200 (Namespace): OK

201 (Namespace): Created

202 (Namespace): Accepted

401: 未授权

update 替换指定的 Namespace

HTTP 请求

PUT /api/v1/namespaces/{name}

参数

  • name (在路径中): string,必填

    Namespace 的名称

  • body: Namespace, required

  • dryRun (在查询中): string

    dryRun

  • fieldManager (在查询中): string

    fieldManager

  • fieldValidation (在查询中): string

    fieldValidation

  • pretty (在查询中): string

    pretty

响应

200 (Namespace): OK

201 (Namespace): Created

401: 未授权

update 替换指定的 Namespace 的 finalize

HTTP 请求

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

参数

  • name (在路径中): string,必填

    Namespace 的名称

  • body: Namespace, required

  • dryRun (在查询中): string

    dryRun

  • fieldManager (在查询中): string

    fieldManager

  • fieldValidation (在查询中): string

    fieldValidation

  • pretty (在查询中): string

    pretty

响应

200 (Namespace): OK

201 (Namespace): Created

401: 未授权

update 替换指定的 Namespace 的状态

HTTP 请求

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

参数

  • name (在路径中): string,必填

    Namespace 的名称

  • body: Namespace, required

  • dryRun (在查询中): string

    dryRun

  • fieldManager (在查询中): string

    fieldManager

  • fieldValidation (在查询中): string

    fieldValidation

  • pretty (在查询中): string

    pretty

响应

200 (Namespace): OK

201 (Namespace): Created

401: 未授权

patch 部分更新指定的 Namespace

HTTP 请求

PATCH /api/v1/namespaces/{name}

参数

  • name (在路径中): string,必填

    Namespace 的名称

  • body: Patch,必需

  • dryRun (在查询中): string

    dryRun

  • fieldManager (在查询中): string

    fieldManager

  • fieldValidation (在查询中): string

    fieldValidation

  • force (在查询中): boolean

    force

  • pretty (在查询中): string

    pretty

响应

200 (Namespace): OK

201 (Namespace): Created

401: 未授权

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

HTTP 请求

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

参数

  • name (在路径中): string,必填

    Namespace 的名称

  • body: Patch,必需

  • dryRun (在查询中): string

    dryRun

  • fieldManager (在查询中): string

    fieldManager

  • fieldValidation (在查询中): string

    fieldValidation

  • force (在查询中): boolean

    force

  • pretty (在查询中): string

    pretty

响应

200 (Namespace): OK

201 (Namespace): Created

401: 未授权

delete 删除一个 Namespace

HTTP 请求

DELETE /api/v1/namespaces/{name}

参数

响应

200 (Status): OK

202 (Status): 已接受

401: 未授权

本页面是自动生成的。

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

上次修改时间:2025 年 4 月 9 日太平洋标准时间下午 6:36:更新 v1.32 的 API 参考文档 (a3b579d035)