1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-05 12:46:18 +01:00
Files
openshift-docs/modules/nodes-pods-autoscaling-requests-and-limits-hpa.adoc

29 lines
1.2 KiB
Plaintext

// Module included in the following assemblies:
//
// * nodes/nodes-pods-autoscaling.adoc
:_mod-docs-content-type: CONCEPT
[id="nodes-pods-autoscaling-requests-and-limits-hpa_{context}"]
= About requests and limits
The scheduler uses the resource request that you specify for containers in a pod, to decide which node to place the pod on. The kubelet enforces the resource limit that you specify for a container to ensure that the container is not allowed to use more than the specified limit.
The kubelet also reserves the request amount of that system resource specifically for that container to use.
.How to use resource metrics?
In the pod specifications, you must specify the resource requests, such as CPU and memory. The HPA uses this specification to determine the resource utilization and then scales the target up or down.
For example, the HPA object uses the following metric source:
[source,yaml]
----
type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 60
----
In this example, the HPA keeps the average utilization of the pods in the scaling target at 60%. Utilization is the ratio between the current resource usage to the requested resource of the pod.