HorizontalPodAutoscaler
apiVersion: autoscaling/v1
import "k8s.io/api/autoscaling/v1"
HorizontalPodAutoscaler
configuration of a horizontal pod autoscaler.
-
apiVersion: autoscaling/v1
-
kind: HorizontalPodAutoscaler
-
metadata (ObjectMeta)
Standard object metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata -
spec (HorizontalPodAutoscalerSpec)
behaviour of autoscaler. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status. -
status (HorizontalPodAutoscalerStatus)
current information about the autoscaler.
HorizontalPodAutoscalerSpec
specification of a horizontal pod autoscaler.
- maxReplicas (int32), required
upper limit for the number of pods that can be set by the autoscaler; cannot be smaller than MinReplicas. - scaleTargetRef (CrossVersionObjectReference), required
reference to scaled resource; horizontal pod autoscaler will learn the current resource consumption and will set the desired number of pods by using its Scale subresource.
CrossVersionObjectReference contains enough information to let you identify the referred resource.- scaleTargetRef.kind (string), required
Kind of the referent; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" - scaleTargetRef.name (string), required
Name of the referent; More info: http://kubernetes.io/docs/user-guide/identifiers#names - scaleTargetRef.apiVersion (string)
API version of the referent
- scaleTargetRef.kind (string), required
- minReplicas (int32)
minReplicas is the lower limit for the number of replicas to which the autoscaler can scale down. It defaults to 1 pod. minReplicas is allowed to be 0 if the alpha feature gate HPAScaleToZero is enabled and at least one Object or External metric is configured. Scaling is active as long as at least one metric value is available. - targetCPUUtilizationPercentage (int32)
target average CPU utilization (represented as a percentage of requested CPU) over all the pods; if not specified the default autoscaling policy will be used.
HorizontalPodAutoscalerStatus
current status of a horizontal pod autoscaler
- currentReplicas (int32), required
current number of replicas of pods managed by this autoscaler. - desiredReplicas (int32), required
desired number of replicas of pods managed by this autoscaler. - currentCPUUtilizationPercentage (int32)
current average CPU utilization over all pods, represented as a percentage of requested CPU, e.g. 70 means that an average pod is using now 70%!o(MISSING)f its requested CPU. - lastScaleTime (Time)
last time the HorizontalPodAutoscaler scaled the number of pods; used by the autoscaler to control how often the number of pods is changed.
Time is a wrapper around time.Time which supports correct marshaling to YAML and JSON. Wrappers are provided for many of the factory methods that the time package offers. - observedGeneration (int64)
most recent generation observed by this autoscaler.
HorizontalPodAutoscalerList
list of horizontal pod autoscaler objects.
-
apiVersion: autoscaling/v1
-
kind: HorizontalPodAutoscalerList
-
metadata (ListMeta)
Standard list metadata. -
items ([]HorizontalPodAutoscaler), required
list of horizontal pod autoscaler objects.
Operations
get
read the specified HorizontalPodAutoscaler
HTTP Request
GET /apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}
Parameters
- {name} (string), required
name of the HorizontalPodAutoscaler - {namespace} (string), required
namespace - ?pretty (string)
pretty
Response
200 (HorizontalPodAutoscaler): OK
401: Unauthorized
get
read status of the specified HorizontalPodAutoscaler
HTTP Request
GET /apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}/status
Parameters
- {name} (string), required
name of the HorizontalPodAutoscaler - {namespace} (string), required
namespace - ?pretty (string)
pretty
Response
200 (HorizontalPodAutoscaler): OK
401: Unauthorized
list
list or watch objects of kind HorizontalPodAutoscaler
HTTP Request
GET /apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers
Parameters
- {namespace} (string), required
namespace - ?allowWatchBookmarks (boolean)
allowWatchBookmarks - ?continue (string)
continue - ?fieldSelector (string)
fieldSelector - ?labelSelector (string)
labelSelector - ?limit (integer)
limit - ?pretty (string)
pretty - ?resourceVersion (string)
resourceVersion - ?resourceVersionMatch (string)
resourceVersionMatch - ?timeoutSeconds (integer)
timeoutSeconds - ?watch (boolean)
watch
Response
200 (HorizontalPodAutoscalerList): OK
401: Unauthorized
list
list or watch objects of kind HorizontalPodAutoscaler
HTTP Request
GET /apis/autoscaling/v1/horizontalpodautoscalers
Parameters
- ?allowWatchBookmarks (boolean)
allowWatchBookmarks - ?continue (string)
continue - ?fieldSelector (string)
fieldSelector - ?labelSelector (string)
labelSelector - ?limit (integer)
limit - ?pretty (string)
pretty - ?resourceVersion (string)
resourceVersion - ?resourceVersionMatch (string)
resourceVersionMatch - ?timeoutSeconds (integer)
timeoutSeconds - ?watch (boolean)
watch
Response
200 (HorizontalPodAutoscalerList): OK
401: Unauthorized
create
create a HorizontalPodAutoscaler
HTTP Request
POST /apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers
Parameters
-
{namespace} (string), required
namespace -
body (HorizontalPodAutoscaler), required
-
?dryRun (string)
dryRun -
?fieldManager (string)
fieldManager -
?pretty (string)
pretty
Response
200 (HorizontalPodAutoscaler): OK
201 (HorizontalPodAutoscaler): Created
202 (HorizontalPodAutoscaler): Accepted
401: Unauthorized
update
replace the specified HorizontalPodAutoscaler
HTTP Request
PUT /apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}
Parameters
-
{name} (string), required
name of the HorizontalPodAutoscaler -
{namespace} (string), required
namespace -
body (HorizontalPodAutoscaler), required
-
?dryRun (string)
dryRun -
?fieldManager (string)
fieldManager -
?pretty (string)
pretty
Response
200 (HorizontalPodAutoscaler): OK
201 (HorizontalPodAutoscaler): Created
401: Unauthorized
update
replace status of the specified HorizontalPodAutoscaler
HTTP Request
PUT /apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}/status
Parameters
-
{name} (string), required
name of the HorizontalPodAutoscaler -
{namespace} (string), required
namespace -
body (HorizontalPodAutoscaler), required
-
?dryRun (string)
dryRun -
?fieldManager (string)
fieldManager -
?pretty (string)
pretty
Response
200 (HorizontalPodAutoscaler): OK
201 (HorizontalPodAutoscaler): Created
401: Unauthorized
patch
partially update the specified HorizontalPodAutoscaler
HTTP Request
PATCH /apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}
Parameters
-
{name} (string), required
name of the HorizontalPodAutoscaler -
{namespace} (string), required
namespace -
body (Patch), required
-
?dryRun (string)
dryRun -
?fieldManager (string)
fieldManager -
?force (boolean)
force -
?pretty (string)
pretty
Response
200 (HorizontalPodAutoscaler): OK
401: Unauthorized
patch
partially update status of the specified HorizontalPodAutoscaler
HTTP Request
PATCH /apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}/status
Parameters
-
{name} (string), required
name of the HorizontalPodAutoscaler -
{namespace} (string), required
namespace -
body (Patch), required
-
?dryRun (string)
dryRun -
?fieldManager (string)
fieldManager -
?force (boolean)
force -
?pretty (string)
pretty
Response
200 (HorizontalPodAutoscaler): OK
401: Unauthorized
delete
delete a HorizontalPodAutoscaler
HTTP Request
DELETE /apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}
Parameters
-
{name} (string), required
name of the HorizontalPodAutoscaler -
{namespace} (string), required
namespace -
body (DeleteOptions)
-
?dryRun (string)
dryRun -
?gracePeriodSeconds (integer)
gracePeriodSeconds -
?pretty (string)
pretty -
?propagationPolicy (string)
propagationPolicy
Response
200 (Status): OK
202 (Status): Accepted
401: Unauthorized
deletecollection
delete collection of HorizontalPodAutoscaler
HTTP Request
DELETE /apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers
Parameters
-
{namespace} (string), required
namespace -
body (DeleteOptions)
-
?continue (string)
continue -
?dryRun (string)
dryRun -
?fieldSelector (string)
fieldSelector -
?gracePeriodSeconds (integer)
gracePeriodSeconds -
?labelSelector (string)
labelSelector -
?limit (integer)
limit -
?pretty (string)
pretty -
?propagationPolicy (string)
propagationPolicy -
?resourceVersion (string)
resourceVersion -
?resourceVersionMatch (string)
resourceVersionMatch -
?timeoutSeconds (integer)
timeoutSeconds
Response
200 (Status): OK
401: Unauthorized