Autoscaling Prerequisites for Istio Services¶
For an Istio-enabled service to successfully autoscale using the Kubernetes Horizontal Pod Autoscaler (HPA), specific resource configurations must be met. The HPA relies on metrics to determine scaling behavior, and omitting these configurations will prevent the feature from functioning^[400-devops__07-Monitoring-and-Observability__k8s-istio__samples__helloworld__README.md].
Container CPU Requests¶
The fundamental requirement for autoscaling to work is that all containers within the pod must have a CPU request defined^[400-devops__07-Monitoring-and-Observability__k8s-istio__samples__helloworld__README.md]. The HPA calculates the percentage of resource usage based on the requested value versus the current usage; without a request, the system cannot determine utilization, and autoscaling will not trigger^[400-devops__07-Monitoring-and-Observability__k8s-istio__samples__helloworld__README.md].
Application and Sidecar Configuration¶
Because Istio services utilize an injected [[istio-proxy|istio-proxy]] sidecar container within the same pod, both the application container and the sidecar container must adhere to the CPU request requirement^[400-devops__07-Monitoring-and-Observability__k8s-istio__samples__helloworld__README.md].
To prepare an Istio service for autoscaling, you must ensure that:
1. The application container (defined in the Deployment YAML) specifies a resources.request.cpu value^[400-devops__07-Monitoring-and-Observability__k8s-istio__samples__helloworld__README.md].
2. The injected istio-proxy container also includes a CPU request^[400-devops__07-Monitoring-and-Observability__k8s-istio__samples__helloworld__README.md].