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.
- Deploy the IBM certified containers.
- Search for the deployments by running the following
oc get deploy -n <namespace>
Alternatively, you can use the Helm Command Line Tool and run the following command to retrieve the list of deployments.
All the deployments that are running in the current namespace are listed.
- Create an HPA policy for a deployment.
oc autoscale deployment <deployment name> --min=1 --max=2 --cpu-percent=80 -n <namespace>
<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>
<hpa name>refers to the HPA policy name and
<namespace>refers to the namespace in which the HPA is created.