ReplicaSet
apiVersion: apps/v1
import "k8s.io/api/apps/v1"
ReplicaSet
ReplicaSet 确保指定数量的 Pod 副本在任何时间都正在运行。
apiVersion: apps/v1
kind: ReplicaSet
metadata (ObjectMeta)
如果 ReplicaSet 的 Labels 为空,它们会默认为与 ReplicaSet 管理的 Pod(s) 相同。标准对象的元数据。更多信息: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 是对 Pods 的标签查询,应与副本数量匹配。必须匹配的标签键和值才能由该副本集控制。它必须与 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/replicaset/#pod-template
replicas (int32)
Replicas 是期望的 Pod 数量。这是一个指针,用于区分显式指定为零和未指定。默认为 1。更多信息:https://kubernetes.ac.cn/docs/concepts/workloads/controllers/replicaset
minReadySeconds (int32)
新创建的 Pod 在其任何容器没有崩溃的情况下,应保持就绪状态的最少秒数,以便被认为是可用的。默认为 0(Pod 在就绪后立即被认为是可用的)。
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 上的唯一值
表示副本集当前状态的最新可用观察结果。
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/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
参数
namespace (in path): string,必需
allowWatchBookmarks (in query): boolean
continue (in query): string
fieldSelector (in query): string
labelSelector (in query): string
limit (in query): integer
pretty (in query): string
resourceVersion (in query): string
resourceVersionMatch (in query): string
sendInitialEvents (in query): boolean
timeoutSeconds (in query): integer
watch (in query): boolean
响应
200 (ReplicaSetList): OK
401: 未授权
list
列出或监视 ReplicaSet 类型的对象
HTTP 请求
GET /apis/apps/v1/replicasets
参数
allowWatchBookmarks (in query): boolean
continue (in query): string
fieldSelector (in query): string
labelSelector (in query): string
limit (in query): integer
pretty (in query): string
resourceVersion (in query): string
resourceVersionMatch (in query): string
sendInitialEvents (in query): boolean
timeoutSeconds (in query): integer
watch (in query): boolean
响应
200 (ReplicaSetList): OK
401: 未授权
create
创建一个 ReplicaSet
HTTP 请求
POST /apis/apps/v1/namespaces/{namespace}/replicasets
参数
namespace (in path): string,必需
body: ReplicaSet,必需
dryRun (in query): string
fieldManager (in query): string
fieldValidation (in query): string
pretty (in query): string
响应
200 (ReplicaSet): OK
201 (ReplicaSet): 已创建
202 (ReplicaSet): 已接受
401: 未授权
update
替换指定的 ReplicaSet
HTTP 请求
PUT /apis/apps/v1/namespaces/{namespace}/replicasets/{name}
参数
name (in path): string,必需
ReplicaSet 的名称
namespace (in path): string,必需
body: ReplicaSet,必需
dryRun (in query): string
fieldManager (in query): string
fieldValidation (in query): string
pretty (in query): string
响应
200 (ReplicaSet): OK
201 (ReplicaSet): 已创建
401: 未授权
update
替换指定的 ReplicaSet 的状态
HTTP 请求
PUT /apis/apps/v1/namespaces/{namespace}/replicasets/{name}/status
参数
name (in path): string,必需
ReplicaSet 的名称
namespace (in path): string,必需
body: ReplicaSet,必需
dryRun (in query): string
fieldManager (in query): string
fieldValidation (in query): string
pretty (in query): string
响应
200 (ReplicaSet): OK
201 (ReplicaSet): 已创建
401: 未授权
patch
部分更新指定的 ReplicaSet
HTTP 请求
PATCH /apis/apps/v1/namespaces/{namespace}/replicasets/{name}
参数
name (in path): string,必需
ReplicaSet 的名称
namespace (in path): string,必需
body: Patch,必需
dryRun (in query): string
fieldManager (in query): string
fieldValidation (in query): string
force (in query): boolean
pretty (in query): string
响应
200 (ReplicaSet): OK
201 (ReplicaSet): 已创建
401: 未授权
patch
部分更新指定的 ReplicaSet 的状态
HTTP 请求
PATCH /apis/apps/v1/namespaces/{namespace}/replicasets/{name}/status
参数
name (in path): string,必需
ReplicaSet 的名称
namespace (in path): string,必需
body: Patch,必需
dryRun (in query): string
fieldManager (in query): string
fieldValidation (in query): string
force (in query): boolean
pretty (in query): string
响应
200 (ReplicaSet): OK
201 (ReplicaSet): 已创建
401: 未授权
delete
删除一个 ReplicaSet
HTTP 请求
DELETE /apis/apps/v1/namespaces/{namespace}/replicasets/{name}
参数
name (in path): string,必需
ReplicaSet 的名称
namespace (in path): string,必需
body: DeleteOptions
dryRun (in query): string
gracePeriodSeconds (in query): integer
ignoreStoreReadErrorWithClusterBreakingPotential (in query): boolean
pretty (in query): string
propagationPolicy (in query): string
响应
200 (Status): OK
202 (Status): 已接受
401: 未授权
deletecollection
删除 ReplicaSet 的集合
HTTP 请求
DELETE /apis/apps/v1/namespaces/{namespace}/replicasets
参数
namespace (in path): string,必需
body: DeleteOptions
continue (in query): string
dryRun (in query): string
fieldSelector (in query): string
gracePeriodSeconds (in query): integer
ignoreStoreReadErrorWithClusterBreakingPotential (in query): boolean
labelSelector (in query): string
limit (in query): integer
pretty (in query): string
propagationPolicy (in query): string
resourceVersion (in query): string
resourceVersionMatch (in query): string
sendInitialEvents (in query): boolean
timeoutSeconds (in query): integer
响应
200 (Status): OK
401: 未授权
此页面是自动生成的。
如果你打算报告此页面问题,请在问题描述中提及此页面是自动生成的。修复可能需要在 Kubernetes 项目中的其他地方进行。