Configuring Horizontal Pod Autoscaling

Horizontal Pod Autoscaloing (HPA) governs the spinning up and deletion of additional pods when the existing resources (CPU and Memory) of the microservice are exhausted. In Adeptia Connect, Autoscaling is by default disabled. You can enable HPA in Adeptia Connect by setting the required parameters in the global values.yaml file. 

To enable HPA, you need to set the parameters as described below for each of the microservices individually.

The following screenshot illustrates the autoscaling parameters for webrunner microservice.

ParameterDescription
enabledParameter to enable HPA by setting its value to true.
minReplicasMinimum number of pods for a microservice.
maxReplicasThe maximum number of pods a microservice can scale up to.
targetCPUUtilizationPercentageThe percentage value of CPU utilization at which the autoscaler spins up a new pod.
targetmemoryUtilizationPercentageThe percentage value of memory utilization at which the autoscaler spins up a new pod.

Configuring HPA for runtime microservice

The HPA configuration for the runtime microservice differs from that of the rest of the microservices. An additional runtime pod spins up or gets deleted based on the number of Process Flows you have in the queued state. As the number of Process Flows in the queue gets beyond the threshold value, a new runtime pod is created. 

The configuration steps for HPA depend upon whether the Process Flows are running on ashared or dedicated queue. The sections given below describe how the runtime HPA is configured in the following scenarios.

When the Process Flows to run on the shared queue 

If you are configuring the HPA before deployment of the application, set the parameters in the global values.yaml file as instructed below:

  1. In the global values.yaml file, go to autoscaler: >env: 
  2. Set the values for MIN_POD, MAX_POD, and MAX_QUEUE parameters.


    ParameterDescription
    MIN_PODMinimum number of pods for runtime microservice.
    MAX_PODThe maximum number of pods the runtime microservice can scale up to.
    MAX_QUEUEThe number of Process Flows in the shared queue beyond which the autoscaler spins up a new runtime pod.

If you want to configure the HPA after deployment of the application, follow the steps given below.

  1. Go to /shared folder in the PVC.
  2. Open AUTOSCALING file in edit mode.
  3. Update the file as shown in the example below.

    2|3|7|My_Namespace|shared_queue|deployment_1

    Where,

    2 - Minimum number of pods for runtime microservice.

    3 - The maximum number of pods the runtime microservice can scale up to.

    7 - The number of Process Flows in the shared queue beyond which the autoscaler spins up a new runtime pod.

    My_Namespace - Namespace

    shared_queue - Name of the shared queue

    deployment_1 - Name of the deployment

  4. Save the file.
  5. Restart the runtime microservice.
Changes are reflected within 30 secs.

When the Process Flows to run on a dedicated queue

If your Process flows are running on a dedicated queue, you can configure the HPA by following the steps given on the page "Creating a queue".

Important

Only an Admin user can configure the HPA in this case.