ReplicaSet

副本集确保在任何给定时间运行指定数量的 Pod 副本。

apiVersion: apps/v1

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

ReplicaSet

副本集确保在任何给定时间运行指定数量的 Pod 副本。


ReplicaSetSpec

ReplicaSetSpec 是副本集的规范。


ReplicaSetStatus

ReplicaSetStatus 表示副本集的当前状态。


  • replicas (int32), required

    Replicas 是最近观察到的非终止 Pod 的数量。更多信息:https://kubernetes.ac.cn/docs/concepts/workloads/controllers/replicaset

  • availableReplicas (int32)

    此副本集的可用非终止 Pod(准备就绪至少 minReadySeconds)的数量。

  • readyReplicas (int32)

    具有就绪条件的此副本集的目标非终止 Pod 的数量。

  • terminatingReplicas (int32)

    此副本集的终止 Pod 的数量。终止 Pod 具有非空 .metadata.deletionTimestamp,并且尚未达到失败或成功 .status.phase。

    这是一个 beta 字段,需要启用 DeploymentReplicaSetTerminatingReplicas 特性(默认启用)。

  • fullyLabeledReplicas (int32)

    具有与副本集 Pod 模板的标签匹配标签的非终止 Pod 的数量。

  • conditions ([]ReplicaSetCondition)

    Patch 策略:在键 type 上合并

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

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

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

    • conditions.status (string), required

      条件的状态,为 True、False 或 Unknown 之一。

    • conditions.type (string), required

      副本集条件类型。

    • conditions.lastTransitionTime (Time)

      条件从一个状态过渡到另一个状态的最后时间。

      Time 是 time.Time 的包装器,支持正确地编组到 YAML 和 JSON。为时间包提供的许多工厂方法提供包装器。

    • conditions.message (string)

      指示过渡细节的人类可读消息。

    • conditions.reason (string)

      条件最后一次过渡的原因。

  • observedGeneration (int64)

    ObservedGeneration 反映了最近观察到的副本集的生成代数。

ReplicaSetList

ReplicaSetList 是副本集的集合。


操作


get 读取指定的副本集

HTTP 请求

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

Parameters

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

    副本集的名称

  • namespace (在路径中): string, 必需

    命名空间

  • pretty (在查询中): string

    pretty

响应

200 (ReplicaSet): 成功

401: 未授权

get 读取指定副本集的状态

HTTP 请求

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

Parameters

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

    副本集的名称

  • namespace (在路径中): string, 必需

    命名空间

  • pretty (在查询中): string

    pretty

响应

200 (ReplicaSet): 成功

401: 未授权

list 列出或监视副本集对象

HTTP 请求

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

Parameters

响应

200 (ReplicaSetList): 成功

401: 未授权

list 列出或监视副本集对象

HTTP 请求

GET /apis/apps/v1/replicasets

Parameters

响应

200 (ReplicaSetList): 成功

401: 未授权

create 创建一个副本集

HTTP 请求

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

Parameters

响应

200 (ReplicaSet): 成功

201 (ReplicaSet): 已创建

202 (ReplicaSet): 已接受

401: 未授权

update 替换指定的副本集

HTTP 请求

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

Parameters

响应

200 (ReplicaSet): 成功

201 (ReplicaSet): 已创建

401: 未授权

update 替换指定副本集的状态

HTTP 请求

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

Parameters

响应

200 (ReplicaSet): 成功

201 (ReplicaSet): 已创建

401: 未授权

patch 部分更新指定的副本集

HTTP 请求

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

Parameters

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

    副本集的名称

  • namespace (在路径中): string, 必需

    命名空间

  • body: Patch, 必需

  • dryRun (在查询中): string

    dryRun

  • fieldManager (在查询中): string

    fieldManager

  • fieldValidation (在查询中): string

    fieldValidation

  • force (in query): boolean

    force

  • pretty (在查询中): string

    pretty

响应

200 (ReplicaSet): 成功

201 (ReplicaSet): 已创建

401: 未授权

patch 部分更新指定副本集的状态

HTTP 请求

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

Parameters

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

    副本集的名称

  • namespace (在路径中): string, 必需

    命名空间

  • body: Patch, 必需

  • dryRun (在查询中): string

    dryRun

  • fieldManager (在查询中): string

    fieldManager

  • fieldValidation (在查询中): string

    fieldValidation

  • force (in query): boolean

    force

  • pretty (在查询中): string

    pretty

响应

200 (ReplicaSet): 成功

201 (ReplicaSet): 已创建

401: 未授权

delete 删除一个副本集

HTTP 请求

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

Parameters

响应

200 (Status): 确定

202 (Status): 已接受

401: 未授权

deletecollection 删除副本集集合

HTTP 请求

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

Parameters

响应

200 (Status): 确定

401: 未授权

本页面是自动生成的。

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

上次修改时间为 2025 年 12 月 21 日下午 5:37 PST:更新 v1.35 资源文档 (85b57273c5)