HorizontalPodAutoscaling on Amazon EKS
Solution 1:
EDITED
The AWS has released the support to horizontal pod autoscaling with custom metric: https://aws.amazon.com/pt/about-aws/whats-new/2018/08/amazon-eks-supports-horizontal-pod-autoscaling-with-custom-metric/
PREVIOUS ANSWER
This is a known issue currently with EKS. Here is my response from support (Partially omitted):
Unfortunately, the EKS control plane currently has issues with the metrics-server aggregator. The EKS service team are working to these issues to bring metric-server support to the Control Plane.
As soon as this feature gets released, it should be publicly announced in either one of the following links:
- AWS blogs: https://blogs.amazon.com/
- What's New: https://aws.amazon.com/new/
- AWS Release Notes: https://aws.amazon.com/releasenotes/
I have indicated your interest in this issue and I will advocate for a solution on your behalf.
Hopefully they sort it out soon.
Solution 2:
I know this is an older topic, but I wanted to add something, since we had issues setting it up recently.
While HPA is supported in Kubernetes 1.10 from eks version eks.2, in Kubernetes 1.11 it's supported from version eks.1 already.
But it doesn't work "out of the box" and the issue is the same as described in the question (current CPU is not set).
You need to know that the metrics-server is not installed on EKS by default. The metrics-server can be found here: https://github.com/kubernetes-incubator/metrics-server.
After the metrics-server is running, the HPA is working on EKS as expected.
Hope that helps someone!