HorizontalPodAutoscaler
apiVersion: autoscaling/v1
import "k8s.io/api/autoscaling/v1"
HorizontalPodAutoscaler
Horizontal Pod Autoscaler 的配置。
apiVersion: autoscaling/v1
kind: HorizontalPodAutoscaler
metadata (ObjectMeta)
标准对象元数据。更多信息:https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
spec (HorizontalPodAutoscalerSpec)
spec 定义了 autoscaler 的行为。更多信息:https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status。
status (HorizontalPodAutoscalerStatus)
status 是关于 autoscaler 的当前信息。
HorizontalPodAutoscalerSpec
horizontal pod autoscaler 的规范。
maxReplicas (int32), 必需
maxReplicas 是 autoscaler 可以设置的 Pod 数量上限;不能小于 MinReplicas。
scaleTargetRef (CrossVersionObjectReference), 必需
对被缩放资源的引用;Horizontal Pod Autoscaler 将学习当前的资源消耗,并通过其 Scale 子资源设置期望的 Pod 数量。
CrossVersionObjectReference 包含足够的信息来让你标识被引用的资源。
scaleTargetRef.kind (string), 必需
kind 是被引用对象的类别;更多信息:https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
scaleTargetRef.name (string), 必需
name 是被引用对象的名称;更多信息:https://kubernetes.ac.cn/docs/concepts/overview/working-with-objects/names/#names
scaleTargetRef.apiVersion (string)
apiVersion 是被引用对象的 API 版本
minReplicas (int32)
minReplicas 是 autoscaler 可以缩减到的副本数量下限。默认为 1 个 Pod。如果启用了 HPAScaleToZero alpha 功能开关并配置了至少一个 Object 或 External 指标,则 minReplicas 允许为 0。只要至少有一个指标值可用,扩缩容就处于活动状态。
targetCPUUtilizationPercentage (int32)
targetCPUUtilizationPercentage 是所有 Pod 的目标平均 CPU 利用率(表示为请求 CPU 的百分比);如果未指定,将使用默认的 autoscaling 策略。
HorizontalPodAutoscalerStatus
horizontal pod autoscaler 的当前状态
currentReplicas (int32), 必需
currentReplicas 是此 autoscaler 管理的 Pod 的当前副本数量。
desiredReplicas (int32), 必需
desiredReplicas 是此 autoscaler 管理的 Pod 的期望副本数量。
currentCPUUtilizationPercentage (int32)
currentCPUUtilizationPercentage 是所有 Pod 的当前平均 CPU 利用率,表示为请求 CPU 的百分比,例如 70 表示平均每个 Pod 当前正在使用其请求 CPU 的 70%。
lastScaleTime (Time)
lastScaleTime 是 HorizontalPodAutoscaler 上次扩缩 Pod 数量的时间;由 autoscaler 用于控制调整 Pod 数量的频率。
Time 是 time.Time 的一个包装器,支持正确地编组为 YAML 和 JSON。提供了许多 time 包提供的工厂方法的包装器。
observedGeneration (int64)
observedGeneration 是此 autoscaler 观察到的最新 Generation。
HorizontalPodAutoscalerList
horizontal pod autoscaler 对象列表。
apiVersion: autoscaling/v1
kind: HorizontalPodAutoscalerList
metadata (ListMeta)
标准列表元数据。
items ([]HorizontalPodAutoscaler), 必需
items 是 horizontal pod autoscaler 对象列表。
操作
get
读取指定的 HorizontalPodAutoscaler
HTTP 请求
GET /apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}
参数
name (在路径中): string, 必需
HorizontalPodAutoscaler 的名称
namespace (在路径中): string, 必需
pretty (在查询参数中): string
响应
200 (HorizontalPodAutoscaler): 成功
401: 未授权
get
读取指定的 HorizontalPodAutoscaler 的状态
HTTP 请求
GET /apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}/status
参数
name (在路径中): string, 必需
HorizontalPodAutoscaler 的名称
namespace (在路径中): string, 必需
pretty (在查询参数中): string
响应
200 (HorizontalPodAutoscaler): 成功
401: 未授权
list
列出或监听 HorizontalPodAutoscaler 类型的对象
HTTP 请求
GET /apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers
参数
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 (HorizontalPodAutoscalerList): 成功
401: 未授权
list
列出或监听 HorizontalPodAutoscaler 类型的对象
HTTP 请求
GET /apis/autoscaling/v1/horizontalpodautoscalers
参数
allowWatchBookmarks (在查询参数中): boolean
continue (在查询参数中): string
fieldSelector (在查询参数中): string
labelSelector (在查询参数中): string
limit (在查询参数中): integer
pretty (在查询参数中): string
resourceVersion (在查询参数中): string
resourceVersionMatch (在查询参数中): string
sendInitialEvents (在查询参数中): boolean
timeoutSeconds (在查询参数中): integer
watch (在查询参数中): boolean
响应
200 (HorizontalPodAutoscalerList): 成功
401: 未授权
create
创建一个 HorizontalPodAutoscaler
HTTP 请求
POST /apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers
参数
namespace (在路径中): string, 必需
body: HorizontalPodAutoscaler, 必需
dryRun (在查询参数中): string
fieldManager (在查询参数中): string
fieldValidation (在查询参数中): string
pretty (在查询参数中): string
响应
200 (HorizontalPodAutoscaler): 成功
201 (HorizontalPodAutoscaler): 已创建
202 (HorizontalPodAutoscaler): 已接受
401: 未授权
update
替换指定的 HorizontalPodAutoscaler
HTTP 请求
PUT /apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}
参数
name (在路径中): string, 必需
HorizontalPodAutoscaler 的名称
namespace (在路径中): string, 必需
body: HorizontalPodAutoscaler, 必需
dryRun (在查询参数中): string
fieldManager (在查询参数中): string
fieldValidation (在查询参数中): string
pretty (在查询参数中): string
响应
200 (HorizontalPodAutoscaler): 成功
201 (HorizontalPodAutoscaler): 已创建
401: 未授权
update
替换指定的 HorizontalPodAutoscaler 的状态
HTTP 请求
PUT /apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}/status
参数
name (在路径中): string, 必需
HorizontalPodAutoscaler 的名称
namespace (在路径中): string, 必需
body: HorizontalPodAutoscaler, 必需
dryRun (在查询参数中): string
fieldManager (在查询参数中): string
fieldValidation (在查询参数中): string
pretty (在查询参数中): string
响应
200 (HorizontalPodAutoscaler): 成功
201 (HorizontalPodAutoscaler): 已创建
401: 未授权
patch
部分更新指定的 HorizontalPodAutoscaler
HTTP 请求
PATCH /apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}
参数
name (在路径中): string, 必需
HorizontalPodAutoscaler 的名称
namespace (在路径中): string, 必需
body: Patch, 必需
dryRun (在查询参数中): string
fieldManager (在查询参数中): string
fieldValidation (在查询参数中): string
force (在查询参数中): boolean
pretty (在查询参数中): string
响应
200 (HorizontalPodAutoscaler): 成功
201 (HorizontalPodAutoscaler): 已创建
401: 未授权
patch
部分更新指定的 HorizontalPodAutoscaler 的状态
HTTP 请求
PATCH /apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}/status
参数
name (在路径中): string, 必需
HorizontalPodAutoscaler 的名称
namespace (在路径中): string, 必需
body: Patch, 必需
dryRun (在查询参数中): string
fieldManager (在查询参数中): string
fieldValidation (在查询参数中): string
force (在查询参数中): boolean
pretty (在查询参数中): string
响应
200 (HorizontalPodAutoscaler): 成功
201 (HorizontalPodAutoscaler): 已创建
401: 未授权
delete
删除一个 HorizontalPodAutoscaler
HTTP 请求
DELETE /apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}
参数
name (在路径中): string, 必需
HorizontalPodAutoscaler 的名称
namespace (在路径中): string, 必需
body: DeleteOptions
dryRun (在查询参数中): string
gracePeriodSeconds (在查询参数中): integer
ignoreStoreReadErrorWithClusterBreakingPotential (在查询参数中): boolean
pretty (在查询参数中): string
propagationPolicy (在查询参数中): string
响应
200 (Status): 成功
202 (Status): 已接受
401: 未授权
deletecollection
删除 HorizontalPodAutoscaler 集合
HTTP 请求
DELETE /apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers
参数
namespace (在路径中): string, 必需
body: DeleteOptions
continue (在查询参数中): string
dryRun (在查询参数中): string
fieldSelector (在查询参数中): string
gracePeriodSeconds (在查询参数中): integer
ignoreStoreReadErrorWithClusterBreakingPotential (在查询参数中): boolean
labelSelector (在查询参数中): string
limit (在查询参数中): integer
pretty (在查询参数中): string
propagationPolicy (在查询参数中): string
resourceVersion (在查询参数中): string
resourceVersionMatch (在查询参数中): string
sendInitialEvents (在查询参数中): boolean
timeoutSeconds (在查询参数中): integer
响应
200 (Status): 成功
401: 未授权
此页面是自动生成的。
如果您计划报告此页面的问题,请在您的问题描述中说明该页面是自动生成的。修复可能需要在 Kubernetes 项目的其他地方进行。