Configuring HorizontalPodAutoscaler Target Average Utilization Limits
You can configure the HorizontalPodAutoscaler (HPA) target average utilization limits in the FTM custom resource (CR). This field is optional. If you do not configure it, the default utilization limits are used.
The following table shows the parameters used to configure the HPA average utilization limits for
the FTM pods.
| Property name | Description |
|---|---|
| hpa.averageUtilizationCPU | Indicates the HPA’s target average CPU utilization. |
| hpa.averageUtilizationMemory | Indicates the HPA’s target average memory utilization. |
Finding HPA average utilization
You can check the average CPU and memory utilization settings of an HPA by using the following steps:
- To view the current HPA values, run the following command. Replace
<hpa_name> with the actual HPA resource
name.
oc get hpa <hpa_name> -o yaml - Locate the CPU and memory target values in the spec.metrics.resource
list.
spec: maxReplicas: 5 metrics: - resource: name: cpu target: averageUtilization: 50 type: Utilization type: Resource - resource: name: memory target: averageUtilization: 60 type: Utilization type: Resource
The following sections show examples of how to set the HPA average CPU and memory utilization values for the FTM pods.
Example YAML 1 - Setting HPA for a specific pod
In this example, the
business-rules-manager pod’s HPA average CPU utilization is
set to 50%, and average memory utilization is set to 60%.spec:
resources:
- name: business-rules-manager
maxReplicas: 5
hpa:
averageUtilizationCPU: 50
averageUtilizationMemory: 60Example YAML 2 - Setting default HPA for all scalable pods
In this example, every horizontally scaling pod’s HPA average CPU utilization is set to 50%, and
average memory utilization is set to 60% by using the resource name
default
spec:
resources:
- name: business-rules-manager
maxReplicas: 5
- name: default
hpa:
averageUtilizationCPU: 50
averageUtilizationMemory: 60