Creating horizontal pod autoscaler
The Sterling Configure, Price, Quote Helm chart in OpenShift® Container Platform supports horizontal pod autoscaling based on the observed CPU utilization that can be achieved by creating a Horizontal Pod Autoscaler (HPA) policy for a deployment.
Procedure
Example
oc autoscale deployment <deployment name> --min=1 --max=2
--cpu-percent=80 -n <namespace>
Here, <deployment name>
refers to
the name of the deployment and <namespace>
refers to the namespace in which the
deployment is running.
Results: An HPA policy with the same name as the deployment name is created with minimum replicas as 1, maximum replicas as 2, and a target CPU utilization threshold as 80%. Based on the CPU utilization by the deployment, the number of replicas are automatically scaled up or scaled down.
For more information about Pod Autoscaling, see Red Hat OpenShift documentation.
oc delete
hpa <hpa name> -n <namespace>
Here,
<hpa name>
refers
to the HPA policy name and <namespace>
refers to the namespace in which the HPA
is created.