An external metric is a monitoring measurement produced outside a Kubernetes cluster and made available to a Horizontal Pod Autoscaler (HPA). It lets workloads scale on signals Kubernetes does not provide directly, such as requests per second (RPS) or undelivered messages. section 6.2.1 section 6.2
RPS is useful when CPU utilization does not represent demand, especially for services that spend time waiting on external systems. If tested replica capacity is known, a simple planning rule is replica count = RPS ÷ replica capacity. section 6.2.1 section 6.2
Using an external metric for HTTP workload autoscaling requires:
- Expose the workload through an Ingress so HTTP requests can be observed and measured. section 6.2.1
Scaling an HTTP service on RPS
A timeserver is exposed through an Ingress and monitored using Google Cloud’s request-count metric. An HPA sets one to six replicas and targets the selected forwarding rule. After a load test, kubectl reports 94% against a 30% target and four replicas, showing the HPA responding to external demand.
