副本集

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

apiVersion: apps/v1

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

副本集

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


ReplicaSetSpec

ReplicaSetSpec 是 ReplicaSet 的规范。


ReplicaSetStatus

ReplicaSetStatus 表示 ReplicaSet 的当前状态。


  • replicas (int32), 必需

    Replicas 是最近观察到的副本数量。更多信息:https://kubernetes.ac.cn/docs/concepts/workloads/controllers/replicationcontroller/#what-is-a-replicationcontroller

  • availableReplicas (int32)

    此副本集的可用副本数量(至少准备了 minReadySeconds)。

  • readyReplicas (int32)

    readyReplicas 是此 ReplicaSet 目标的具有就绪条件的 Pod 数量。

  • fullyLabeledReplicas (int32)

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

  • conditions ([]ReplicaSetCondition)

    补丁策略:按键 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 (在路径中): string, 必需

    ReplicaSet 的名称

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

    命名空间

  • pretty (在查询中): string

    漂亮

响应

200 (ReplicaSet): OK

401: 未经授权

get 读取指定 ReplicaSet 的状态

HTTP 请求

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

参数

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

    ReplicaSet 的名称

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

    命名空间

  • pretty (在查询中): 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}

参数

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

    ReplicaSet 的名称

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

    命名空间

  • body: Patch, 必需

  • dryRun (在查询中): string

    dryRun

  • fieldManager (在查询中): string

    fieldManager

  • fieldValidation (在查询中): string

    fieldValidation

  • force (在查询中): boolean

    强制

  • pretty (在查询中): string

    漂亮

响应

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

    强制

  • pretty (在查询中): string

    漂亮

响应

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 项目中的其他地方进行。

最后修改时间:2023 年 4 月 3 日 上午 8:22 PST: API 参考多页 v1.27 (7b39e9a9ec)