ReplicaSet

ReplicaSet 确保指定数量的 Pod 副本在任何时间都正在运行。

apiVersion: apps/v1

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

ReplicaSet

ReplicaSet 确保指定数量的 Pod 副本在任何时间都正在运行。


ReplicaSetSpec

ReplicaSetSpec 是 ReplicaSet 的规范。


ReplicaSetStatus

ReplicaSetStatus 表示 ReplicaSet 的当前状态。


  • replicas (int32),必需

    Replicas 是最近观察到的非终止状态 Pod 的数量。更多信息:https://kubernetes.ac.cn/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)

    Patch 策略:按键 type 合并

    Map:合并时将保留键 type 上的唯一值

    表示副本集当前状态的最新可用观察结果。

    ReplicaSetCondition 描述了副本集在某个时间点的状态。

    • conditions.status (string),必需

      状况状态,可以是 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 是 ReplicaSet 的集合。


操作


get 读取指定的 ReplicaSet

HTTP 请求

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

参数

  • name (in path): string,必需

    ReplicaSet 的名称

  • namespace (in path): string,必需

    命名空间

  • pretty (in query): string

    美化输出

响应

200 (ReplicaSet): OK

401: 未授权

get 读取指定的 ReplicaSet 的状态

HTTP 请求

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

参数

  • name (in path): string,必需

    ReplicaSet 的名称

  • namespace (in path): string,必需

    命名空间

  • pretty (in query): string

    美化输出

响应

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}

参数

响应

200 (ReplicaSet): OK

201 (ReplicaSet): 已创建

401: 未授权

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

HTTP 请求

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

参数

响应

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) (b84ec30bbb)