副本集

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

    补丁策略:按键 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)