12

When trying to setup a HorizontalPodAutoscaler on Amazon EKS, the TARGETS column always displays <unknown>/50% and when describing the HPA, I see

Warning FailedGetResourceMetric 17s (x50 over 1h) horizontal-pod-autoscaler unable to get metrics for resource cpu: unable to fetch metrics from resource metrics API: the server could not find the requested resource (get pods.metrics.k8s.io)

I've found multiple posts on other sites about similar issues mentioning to use --horizontal-pod-autoscaler-use-rest-clients on the kube-controller-manager, but I cannot find a way to change settings on the kube-controller-manager for an EKS cluster since it appears you can't SSH into the master nodes for management and kube-controller-manager is not listed as a resource anywhere in the system.

I have tried setting up the metrics-server manually following instructions on https://github.com/kubernetes-incubator/metrics-server but in that case, I'm shown that EKS doesn't provide the config map necessary for authenticating API extensions Could not create the API server: configmaps "extension-apiserver-authentication" not found

James Mills
  • 223
  • 2
  • 6
  • Here is an eks hpa workaround https://medium.com/eks-hpa-workaround/k8s-hpa-controller-6ac2dfb4c028 that we're using – James Smith Aug 17 '18 at 17:07
  • better the original kubernete, there are many tools to bootstrap the cluster and managing the addons is so easy using helm – c4f4t0r Dec 12 '18 at 01:50

3 Answers3

12

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:

I have indicated your interest in this issue and I will advocate for a solution on your behalf.

Hopefully they sort it out soon.

sprut
  • 136
  • 1
  • 4
  • Thank you. I absolutely needed this feature and got a similar response from them. I went ahead and spun up a cluster with kops that I can actually work on when issues arise. Hopefully amazon will give some more configuration to this platform in the future. – James Mills Jun 28 '18 at 16:31
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!

Pampy
  • 121
  • 2
1

It is supported now, it is a little late and requires a new cluster, you cannot trigger the update manually, yet.

https://aws.amazon.com/blogs/opensource/horizontal-pod-autoscaling-eks/

Mustafa
  • 195
  • 2
  • 9