# HorizontalPodAutoscaler

HorizontalPodAutoscalerconfiguration of a horizontal pod autoscaler.apiVersion: autoscaling/v1import "k8s.io/api/autoscaling/v1"HorizontalPodAutoscalerconfiguration of a horizontal pod autoscaler.apiVersion: autoscaling/v1kind: HorizontalPodAutoscalermetadata (ObjectMeta)Standard object metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadataspec (HorizontalPodAutoscalerSpec)spec defines the behaviour of autoscaler. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status.status (HorizontalPodAutoscalerStatus)status is the current information about the autoscaler.HorizontalPodAutoscalerSpecspecification of a horizontal pod autoscaler.maxReplicas (int32), requiredmaxReplicas is the upper limit for the number of pods that can be set by the autoscaler; cannot be smaller than MinReplicas.scaleTargetRef (CrossVersionObjectReference), requiredreference 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), requiredkind is the kind of the referent; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kindsscaleTargetRef.name (string), requiredname is the name of the referent; More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#namesscaleTargetRef.apiVersion (string)apiVersion is the API version of the referentminReplicas (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)targetCPUUtilizationPercentage is the 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.HorizontalPodAutoscalerStatuscurrent status of a horizontal pod autoscalercurrentReplicas (int32), requiredcurrentReplicas is the current number of replicas of pods managed by this autoscaler.desiredReplicas (int32), requireddesiredReplicas is the desired number of replicas of pods managed by this autoscaler.currentCPUUtilizationPercentage (int32)currentCPUUtilizationPercentage is the 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% of its requested CPU.lastScaleTime (Time)lastScaleTime is the 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)observedGeneration is the most recent generation observed by this autoscaler.HorizontalPodAutoscalerListlist of horizontal pod autoscaler objects.apiVersion: autoscaling/v1kind: HorizontalPodAutoscalerListmetadata (ListMeta)Standard list metadata.items ([]HorizontalPodAutoscaler), requireditems is the list of horizontal pod autoscaler objects.Operationsget read the specified HorizontalPodAutoscalerHTTP RequestGET /apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}Parametersname (in path): string, requiredname of the HorizontalPodAutoscalernamespace (in path): string, requirednamespacepretty (in query): stringprettyResponse200 (HorizontalPodAutoscaler): OK401: Unauthorizedget read status of the specified HorizontalPodAutoscalerHTTP RequestGET /apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}/statusParametersname (in path): string, requiredname of the HorizontalPodAutoscalernamespace (in path): string, requirednamespacepretty (in query): stringprettyResponse200 (HorizontalPodAutoscaler): OK401: Unauthorizedlist list or watch objects of kind HorizontalPodAutoscalerHTTP RequestGET /apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalersParametersnamespace (in path): string, requirednamespaceallowWatchBookmarks (in query): booleanallowWatchBookmarkscontinue (in query): stringcontinuefieldSelector (in query): stringfieldSelectorlabelSelector (in query): stringlabelSelectorlimit (in query): integerlimitpretty (in query): stringprettyresourceVersion (in query): stringresourceVersionresourceVersionMatch (in query): stringresourceVersionMatchsendInitialEvents (in query): booleansendInitialEventstimeoutSeconds (in query): integertimeoutSecondswatch (in query): booleanwatchResponse200 (HorizontalPodAutoscalerList): OK401: Unauthorizedlist list or watch objects of kind HorizontalPodAutoscalerHTTP RequestGET /apis/autoscaling/v1/horizontalpodautoscalersParametersallowWatchBookmarks (in query): booleanallowWatchBookmarkscontinue (in query): stringcontinuefieldSelector (in query): stringfieldSelectorlabelSelector (in query): stringlabelSelectorlimit (in query): integerlimitpretty (in query): stringprettyresourceVersion (in query): stringresourceVersionresourceVersionMatch (in query): stringresourceVersionMatchsendInitialEvents (in query): booleansendInitialEventstimeoutSeconds (in query): integertimeoutSecondswatch (in query): booleanwatchResponse200 (HorizontalPodAutoscalerList): OK401: Unauthorizedcreate create a HorizontalPodAutoscalerHTTP RequestPOST /apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalersParametersnamespace (in path): string, requirednamespacebody: HorizontalPodAutoscaler, requireddryRun (in query): stringdryRunfieldManager (in query): stringfieldManagerfieldValidation (in query): stringfieldValidationpretty (in query): stringprettyResponse200 (HorizontalPodAutoscaler): OK201 (HorizontalPodAutoscaler): Created202 (HorizontalPodAutoscaler): Accepted401: Unauthorizedupdate replace the specified HorizontalPodAutoscalerHTTP RequestPUT /apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}Parametersname (in path): string, requiredname of the HorizontalPodAutoscalernamespace (in path): string, requirednamespacebody: HorizontalPodAutoscaler, requireddryRun (in query): stringdryRunfieldManager (in query): stringfieldManagerfieldValidation (in query): stringfieldValidationpretty (in query): stringprettyResponse200 (HorizontalPodAutoscaler): OK201 (HorizontalPodAutoscaler): Created401: Unauthorizedupdate replace status of the specified HorizontalPodAutoscalerHTTP RequestPUT /apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}/statusParametersname (in path): string, requiredname of the HorizontalPodAutoscalernamespace (in path): string, requirednamespacebody: HorizontalPodAutoscaler, requireddryRun (in query): stringdryRunfieldManager (in query): stringfieldManagerfieldValidation (in query): stringfieldValidationpretty (in query): stringprettyResponse200 (HorizontalPodAutoscaler): OK201 (HorizontalPodAutoscaler): Created401: Unauthorizedpatch partially update the specified HorizontalPodAutoscalerHTTP RequestPATCH /apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}Parametersname (in path): string, requiredname of the HorizontalPodAutoscalernamespace (in path): string, requirednamespacebody: Patch, requireddryRun (in query): stringdryRunfieldManager (in query): stringfieldManagerfieldValidation (in query): stringfieldValidationforce (in query): booleanforcepretty (in query): stringprettyResponse200 (HorizontalPodAutoscaler): OK201 (HorizontalPodAutoscaler): Created401: Unauthorizedpatch partially update status of the specified HorizontalPodAutoscalerHTTP RequestPATCH /apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}/statusParametersname (in path): string, requiredname of the HorizontalPodAutoscalernamespace (in path): string, requirednamespacebody: Patch, requireddryRun (in query): stringdryRunfieldManager (in query): stringfieldManagerfieldValidation (in query): stringfieldValidationforce (in query): booleanforcepretty (in query): stringprettyResponse200 (HorizontalPodAutoscaler): OK201 (HorizontalPodAutoscaler): Created401: Unauthorizeddelete delete a HorizontalPodAutoscalerHTTP RequestDELETE /apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}Parametersname (in path): string, requiredname of the HorizontalPodAutoscalernamespace (in path): string, requirednamespacebody: DeleteOptionsdryRun (in query): stringdryRungracePeriodSeconds (in query): integergracePeriodSecondsignoreStoreReadErrorWithClusterBreakingPotential (in query): booleanignoreStoreReadErrorWithClusterBreakingPotentialpretty (in query): stringprettypropagationPolicy (in query): stringpropagationPolicyResponse200 (Status): OK202 (Status): Accepted401: Unauthorizeddeletecollection delete collection of HorizontalPodAutoscalerHTTP RequestDELETE /apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalersParametersnamespace (in path): string, requirednamespacebody: DeleteOptionscontinue (in query): stringcontinuedryRun (in query): stringdryRunfieldSelector (in query): stringfieldSelectorgracePeriodSeconds (in query): integergracePeriodSecondsignoreStoreReadErrorWithClusterBreakingPotential (in query): booleanignoreStoreReadErrorWithClusterBreakingPotentiallabelSelector (in query): stringlabelSelectorlimit (in query): integerlimitpretty (in query): stringprettypropagationPolicy (in query): stringpropagationPolicyresourceVersion (in query): stringresourceVersionresourceVersionMatch (in query): stringresourceVersionMatchsendInitialEvents (in query): booleansendInitialEventstimeoutSeconds (in query): integertimeoutSecondsResponse200 (Status): OK401: UnauthorizedThis page is automatically generated.If you plan to report an issue with this page, mention that the page is auto-generated in your issue description. The fix may need to happen elsewhere in the Kubernetes project.