副本集

ReplicaSet 確保在任何給定時間都有指定數量的 Pod 副本正在執行。

apiVersion: apps/v1

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

副本集

ReplicaSet 確保在任何給定時間都有指定數量的 Pod 副本正在執行。


ReplicaSetSpec

ReplicaSetSpec 是 ReplicaSet 的規範。


ReplicaSetStatus

ReplicaSetStatus 表示 ReplicaSet 的當前狀態。


  • replicas (int32),必填

    Replicas 是最近觀察到的非終止 Pod 的數量。更多資訊: https://kubernetes.club.tw/docs/concepts/workloads/controllers/replicaset

  • availableReplicas (int32)

    此副本集中可用的非終止 Pod 數量(至少就緒 minReadySeconds)。

  • readyReplicas (int32)

    此 ReplicaSet 所針對的具有 Ready Condition 的非終止 Pod 數量。

  • terminatingReplicas (int32)

    此副本集中正在終止的 Pod 數量。正在終止的 Pod 具有非空的 .metadata.deletionTimestamp 並且尚未達到 Failed 或 Succeeded .status.phase。

    這是一個 Alpha 欄位。啟用 DeploymentReplicaSetTerminatingReplicas 才能使用此欄位。

  • fullyLabeledReplicas (int32)

    具有與副本集 Pod 模板標籤匹配的標籤的非終止 Pod 數量。

  • conditions ([]ReplicaSetCondition)

    補丁策略:按鍵 type 合併

    對映:合併時將保留鍵型別上的唯一值

    表示副本集當前狀態的最新可用觀察結果。

    ReplicaSetCondition 描述了副本集在某個時刻的狀態。

    • 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)

      條件上次轉換的原因。

  • observedGeneration (int64)

    ObservedGeneration 反映了最近觀察到的 ReplicaSet 的生成。

ReplicaSetList

ReplicaSetList 是 ReplicaSets 的集合。


操作


get 讀取指定的 ReplicaSet

HTTP 請求

GET /apis/apps/v1/namespaces/{namespace}/replicasets/{name}

引數

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

    ReplicaSet 的名稱

  • namespace (在路徑中): string,必填

    名稱空間

  • pretty (在查詢中): string

    pretty

響應

200 (ReplicaSet): OK

401: 未授權

get 讀取指定 ReplicaSet 的狀態

HTTP 請求

GET /apis/apps/v1/namespaces/{namespace}/replicasets/{name}/status

引數

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

    ReplicaSet 的名稱

  • namespace (在路徑中): string,必填

    名稱空間

  • pretty (在查詢中): string

    pretty

響應

200 (ReplicaSet): OK

401: 未授權

list 列出或監視 ReplicaSet 型別的物件

HTTP 請求

GET /apis/apps/v1/namespaces/{namespace}/replicasets

引數

響應

200 (ReplicaSetList): OK

401: 未授權

list 列出或監視 ReplicaSet 型別的物件

HTTP 請求

GET /apis/apps/v1/replicasets

引數

響應

200 (ReplicaSetList): OK

401: 未授權

create 建立一個 ReplicaSet

HTTP 請求

POST /apis/apps/v1/namespaces/{namespace}/replicasets

引數

響應

200 (ReplicaSet): OK

201 (ReplicaSet): 建立成功

202 (ReplicaSet): 已接受

401: 未授權

update 替換指定的 ReplicaSet

HTTP 請求

PUT /apis/apps/v1/namespaces/{namespace}/replicasets/{name}

引數

響應

200 (ReplicaSet): OK

201 (ReplicaSet): 建立成功

401: 未授權

update 替換指定 ReplicaSet 的狀態

HTTP 請求

PUT /apis/apps/v1/namespaces/{namespace}/replicasets/{name}/status

引數

響應

200 (ReplicaSet): OK

201 (ReplicaSet): 建立成功

401: 未授權

patch 部分更新指定的 ReplicaSet

HTTP 請求

PATCH /apis/apps/v1/namespaces/{namespace}/replicasets/{name}

引數

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

    ReplicaSet 的名稱

  • namespace (在路徑中): string,必填

    名稱空間

  • body: Patch,必填

  • dryRun (在查詢中): string

    dryRun

  • fieldManager (在查詢中): string

    fieldManager

  • fieldValidation (在查詢中): string

    fieldValidation

  • force (查詢引數): boolean

    force

  • pretty (在查詢中): string

    pretty

響應

200 (ReplicaSet): OK

201 (ReplicaSet): 建立成功

401: 未授權

patch 部分更新指定 ReplicaSet 的狀態

HTTP 請求

PATCH /apis/apps/v1/namespaces/{namespace}/replicasets/{name}/status

引數

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

    ReplicaSet 的名稱

  • namespace (在路徑中): string,必填

    名稱空間

  • body: Patch,必填

  • dryRun (在查詢中): string

    dryRun

  • fieldManager (在查詢中): string

    fieldManager

  • fieldValidation (在查詢中): string

    fieldValidation

  • force (查詢引數): boolean

    force

  • pretty (在查詢中): string

    pretty

響應

200 (ReplicaSet): OK

201 (ReplicaSet): 建立成功

401: 未授權

delete 刪除一個 ReplicaSet

HTTP 請求

DELETE /apis/apps/v1/namespaces/{namespace}/replicasets/{name}

引數

響應

200 (Status): OK

202 (Status): 已接受

401: 未授權

deletecollection 刪除 ReplicaSet 集合

HTTP 請求

DELETE /apis/apps/v1/namespaces/{namespace}/replicasets

引數

響應

200 (Status): OK

401: 未授權

本頁面是自動生成的。

如果你打算報告此頁面存在的問題,請在問題描述中提及此頁面是自動生成的。修復可能需要在 Kubernetes 專案的其他地方進行。

最後修改於 2025 年 4 月 24 日上午 9:14 PST:v1.33 的 Markdown API 參考 (b84ec30bbb)