Skip to content

Metrics

Deciding which metrics to use is done by using MetricSpecs, which are a key part of HPAs, and look like this:

- type: Resource
  resource:
    name: cpu
    target:
      type: Utilization
      averageUtilization: 50

To send these specs to the Predictive HPA, add a config option called metrics to the PHPA, with a multiline string containing the metric list. For example:

netrics:
- type: Resource
  resource:
    name: cpu
    target:
      type: Utilization
      averageUtilization: 50

This allows porting over existing Kubernetes HPA metric configurations to the Predictive Horizontal Pod Autoscaler. Equivalent to K8s HPA metric specs; which are demonstrated in this HPA walkthrough. Can hold multiple values as it is an array.