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.club.tw/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)