副本集
apiVersion: apps/v1
import "k8s.io/api/apps/v1"
副本集
ReplicaSet 确保在任何给定时间运行指定数量的 Pod 副本。
apiVersion: apps/v1
kind: ReplicaSet
metadata (ObjectMeta)
如果 ReplicaSet 的标签为空,则它们将默认为与 ReplicaSet 管理的 Pod 相同。标准对象的元数据。更多信息:https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
spec (ReplicaSetSpec)
Spec 定义了 ReplicaSet 的预期行为规范。更多信息:https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
status (ReplicaSetStatus)
Status 是 ReplicaSet 最近观察到的状态。此数据可能在一段时间内过时。由系统填充。只读。更多信息:https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
ReplicaSetSpec
ReplicaSetSpec 是 ReplicaSet 的规范。
selector (LabelSelector), 必需
Selector 是对应该匹配副本数量的 Pod 的标签查询。为了被此副本集控制,标签键和值必须匹配。它必须与 Pod 模板的标签匹配。更多信息:https://kubernetes.ac.cn/docs/concepts/overview/working-with-objects/labels/#label-selectors
template (PodTemplateSpec)
Template 是描述如果检测到副本不足将创建的 Pod 的对象。更多信息:https://kubernetes.ac.cn/docs/concepts/workloads/controllers/replicationcontroller#pod-template
replicas (int32)
Replicas 是所需副本的数量。这是一个指针,用于区分显式零和未指定。默认为 1。更多信息:https://kubernetes.ac.cn/docs/concepts/workloads/controllers/replicationcontroller/#what-is-a-replicationcontroller
minReadySeconds (int32)
新创建的 Pod 在其任何容器崩溃之前应处于就绪状态的最小秒数,以便将其视为可用。默认为 0(Pod 一旦就绪即被视为可用)。
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 的集合。
apiVersion: apps/v1
kind: ReplicaSetList
metadata (ListMeta)
标准列表元数据。更多信息:https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
items ([]ReplicaSet), 必需
ReplicaSet 列表。更多信息:https://kubernetes.ac.cn/docs/concepts/workloads/controllers/replicationcontroller
操作
get
读取指定的 ReplicaSet
HTTP 请求
GET /apis/apps/v1/namespaces/{namespace}/replicasets/{name}
参数
响应
200 (ReplicaSet): OK
401: 未经授权
get
读取指定 ReplicaSet 的状态
HTTP 请求
GET /apis/apps/v1/namespaces/{namespace}/replicasets/{name}/status
参数
响应
200 (ReplicaSet): OK
401: 未经授权
list
列出或观察 ReplicaSet 类型的对象
HTTP 请求
GET /apis/apps/v1/namespaces/{namespace}/replicasets
参数
namespace (在路径中): string, 必需
allowWatchBookmarks (在查询中): boolean
continue (在查询中): string
fieldSelector (在查询中): string
labelSelector (在查询中): string
limit (在查询中): integer
pretty (在查询中): string
resourceVersion (在查询中): string
resourceVersionMatch (在查询中): string
sendInitialEvents (在查询中): boolean
timeoutSeconds (在查询中): integer
watch (在查询中): boolean
响应
200 (ReplicaSetList): OK
401: 未经授权
list
列出或观察 ReplicaSet 类型的对象
HTTP 请求
GET /apis/apps/v1/replicasets
参数
allowWatchBookmarks (在查询中): boolean
continue (在查询中): string
fieldSelector (在查询中): string
labelSelector (在查询中): string
limit (在查询中): integer
pretty (在查询中): string
resourceVersion (在查询中): string
resourceVersionMatch (在查询中): string
sendInitialEvents (在查询中): boolean
timeoutSeconds (在查询中): integer
watch (在查询中): boolean
响应
200 (ReplicaSetList): OK
401: 未经授权
create
创建一个 ReplicaSet
HTTP 请求
POST /apis/apps/v1/namespaces/{namespace}/replicasets
参数
namespace (在路径中): string, 必需
body: ReplicaSet, 必需
dryRun (在查询中): string
fieldManager (在查询中): string
fieldValidation (在查询中): string
pretty (在查询中): string
响应
200 (ReplicaSet): OK
201 (ReplicaSet): 已创建
202 (ReplicaSet): 已接受
401: 未经授权
update
替换指定的 ReplicaSet
HTTP 请求
PUT /apis/apps/v1/namespaces/{namespace}/replicasets/{name}
参数
name (在路径中): string, 必需
ReplicaSet 的名称
namespace (在路径中): string, 必需
body: ReplicaSet, 必需
dryRun (在查询中): string
fieldManager (在查询中): string
fieldValidation (在查询中): string
pretty (在查询中): string
响应
200 (ReplicaSet): OK
201 (ReplicaSet): 已创建
401: 未经授权
update
替换指定 ReplicaSet 的状态
HTTP 请求
PUT /apis/apps/v1/namespaces/{namespace}/replicasets/{name}/status
参数
name (在路径中): string, 必需
ReplicaSet 的名称
namespace (在路径中): string, 必需
body: ReplicaSet, 必需
dryRun (在查询中): string
fieldManager (在查询中): string
fieldValidation (在查询中): string
pretty (在查询中): string
响应
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
fieldManager (在查询中): string
fieldValidation (在查询中): string
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
fieldManager (在查询中): string
fieldValidation (在查询中): string
force (在查询中): boolean
pretty (在查询中): string
响应
200 (ReplicaSet): OK
201 (ReplicaSet): 已创建
401: 未经授权
delete
删除一个 ReplicaSet
HTTP 请求
DELETE /apis/apps/v1/namespaces/{namespace}/replicasets/{name}
参数
name (在路径中): string, 必需
ReplicaSet 的名称
namespace (在路径中): string, 必需
body: DeleteOptions
dryRun (在查询中): string
gracePeriodSeconds (在查询中): integer
pretty (在查询中): string
propagationPolicy (在查询中): string
响应
200 (Status): OK
202 (Status): 已接受
401: 未经授权
deletecollection
删除 ReplicaSet 的集合
HTTP 请求
DELETE /apis/apps/v1/namespaces/{namespace}/replicasets
参数
namespace (在路径中): string, 必需
body: DeleteOptions
continue (在查询中): string
dryRun (在查询中): string
fieldSelector (在查询中): string
gracePeriodSeconds (在查询中): integer
labelSelector (在查询中): string
limit (在查询中): integer
pretty (在查询中): string
propagationPolicy (在查询中): string
resourceVersion (在查询中): string
resourceVersionMatch (在查询中): string
sendInitialEvents (在查询中): boolean
timeoutSeconds (在查询中): integer
响应
200 (Status): OK
401: 未经授权
此页面是自动生成的。
如果您打算报告此页面存在问题,请在问题描述中提及该页面是自动生成的。修复可能需要在 Kubernetes 项目中的其他地方进行。