命名空間
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 定義命名空間的行為。 更多資訊:https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
status (NamespaceStatus)
Status 描述命名空間的目前狀態。 更多資訊:https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
NamespaceSpec
NamespaceSpec 描述命名空間上的屬性。
finalizers ([]string)
Atomic: 將在合併期間被取代
Finalizers 是值的非透明清單,必須為空才能從儲存體中永久移除物件。 更多資訊:https://kubernetes.dev.org.tw/docs/tasks/administer-cluster/namespaces/
NamespaceStatus
NamespaceStatus 是關於命名空間目前狀態的資訊。
conditions ([]NamespaceCondition)
Patch 策略:以鍵值
type
進行合併Map:在合併期間,鍵值 type 上的唯一值將被保留
代表命名空間目前狀態的最新可用觀察結果。
phase (string)
Phase 是命名空間目前的生命週期階段。更多資訊:https://kubernetes.dev.org.tw/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.dev.org.tw/docs/concepts/overview/working-with-objects/namespaces/
操作
get
讀取指定的命名空間
HTTP 請求
GET /api/v1/namespaces/{name}
參數
name (在路徑中):string,必填
命名空間的名稱
pretty (在查詢中):string
回應
200 (Namespace):OK
401:未經授權
get
讀取指定命名空間的狀態
HTTP 請求
GET /api/v1/namespaces/{name}/status
參數
name (在路徑中):string,必填
命名空間的名稱
pretty (在查詢中):string
回應
200 (Namespace):OK
401:未經授權
list
列出或監看 Namespace 類型的物件
HTTP 請求
GET /api/v1/namespaces
參數
allowWatchBookmarks (在查詢中):boolean
continue (在查詢中):string
fieldSelector (在查詢中):string
labelSelector (在查詢中):string
limit (在查詢中):integer
pretty (在查詢中):string
resourceVersion (在查詢中):string
resourceVersionMatch (在查詢中):string
sendInitialEvents (在查詢中):boolean
timeoutSeconds (在查詢中):integer
watch (在查詢中):boolean
回應
200 (NamespaceList):OK
401:未經授權
create
建立命名空間
HTTP 請求
POST /api/v1/namespaces
參數
body:Namespace,必填
dryRun (在查詢中):string
fieldManager (在查詢中):string
fieldValidation (在查詢中):string
pretty (在查詢中):string
回應
200 (Namespace):OK
201 (Namespace):已建立
202 (Namespace):已接受
401:未經授權
update
取代指定的命名空間
HTTP 請求
PUT /api/v1/namespaces/{name}
參數
name (在路徑中):string,必填
命名空間的名稱
body:Namespace,必填
dryRun (在查詢中):string
fieldManager (在查詢中):string
fieldValidation (在查詢中):string
pretty (在查詢中):string
回應
200 (Namespace):OK
201 (Namespace):已建立
401:未經授權
update
取代指定命名空間的最終化程序
HTTP 請求
PUT /api/v1/namespaces/{name}/finalize
參數
name (在路徑中):string,必填
命名空間的名稱
body:Namespace,必填
dryRun (在查詢中):string
fieldManager (在查詢中):string
fieldValidation (在查詢中):string
pretty (在查詢中):string
回應
200 (Namespace):OK
201 (Namespace):已建立
401:未經授權
update
取代指定命名空間的狀態
HTTP 請求
PUT /api/v1/namespaces/{name}/status
參數
name (在路徑中):string,必填
命名空間的名稱
body:Namespace,必填
dryRun (在查詢中):string
fieldManager (在查詢中):string
fieldValidation (在查詢中):string
pretty (在查詢中):string
回應
200 (Namespace):OK
201 (Namespace):已建立
401:未經授權
patch
部分更新指定的命名空間
HTTP 請求
PATCH /api/v1/namespaces/{name}
參數
name (在路徑中):string,必填
命名空間的名稱
body:Patch,必填
dryRun (在查詢中):string
fieldManager (在查詢中):string
fieldValidation (在查詢中):string
force (在查詢中):boolean
pretty (在查詢中):string
回應
200 (Namespace):OK
201 (Namespace):已建立
401:未經授權
patch
部分更新指定命名空間的狀態
HTTP 請求
PATCH /api/v1/namespaces/{name}/status
參數
name (在路徑中):string,必填
命名空間的名稱
body:Patch,必填
dryRun (在查詢中):string
fieldManager (在查詢中):string
fieldValidation (在查詢中):string
force (在查詢中):boolean
pretty (在查詢中):string
回應
200 (Namespace):OK
201 (Namespace):已建立
401:未經授權
delete
刪除命名空間
HTTP 請求
DELETE /api/v1/namespaces/{name}
參數
name (在路徑中):string,必填
命名空間的名稱
body:DeleteOptions
dryRun (在查詢中):string
gracePeriodSeconds (在查詢中):integer
pretty (在查詢中):string
propagationPolicy (在查詢中):string
回應
200 (Status):OK
202 (Status):已接受
401:未經授權
此頁面為自動產生。
如果您計劃回報此頁面的問題,請在您的問題描述中提及此頁面為自動產生。此修復可能需要在 Kubernetes 專案的其他地方進行。