Skip to content
This repository was archived by the owner on Jan 11, 2023. It is now read-only.

Kubernetes Horizontal Pod Autoscaler does not work for v1.8+ cluster #1936

Closed
karataliu opened this issue Dec 15, 2017 · 2 comments
Closed
Labels
cse-sync-week Triage for issues that would be good for CSE sync week, April 24-27th 2018

Comments

@karataliu
Copy link
Contributor

Is this a request for help?:
N/A

Is this an ISSUE or FEATURE REQUEST? (choose one):
ISSUE

What version of acs-engine?:
v0.10.0

Orchestrator and version (e.g. Kubernetes, DC/OS, Swarm)
Kubernetes

What happened:

Follow the steps to using HPA(Horizontal Pod Autoscaler):
https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale-walkthrough/

It does not work for acs-engine generated v1.8 cluster due to missing metric data. It works well with v1.7

Error is:

  26m		1m		51	horizontal-pod-autoscaler	Warning		FailedGetResourceMetric		unable to get metrics for resource cpu: unable to fetch metrics from API: the server could not find the requested resource (get pods.metrics.k8s.io)

Detailed log from controller-manager log:

E1215 05:27:31.069343       1 request.go:629] TESTINGLOG GET, https://10.255.255.5:443/apis/metrics.k8s.io/v1beta1/namespaces/e2e-tests-horizontal-pod-autoscaling-khm9m/pods?labelSelector=name%3Drc-light
E1215 05:27:31.070269       1 podmetrics.go:79] TESTINGLOG error is :"the server could not find the requested resource (get pods.metrics.k8s.io)"

This is due to 'metrics' changed to 'metrics.k8s.io' in v1.8:
kubernetes/kubernetes#51653

In v1.7, the cluster depends on heapster to provide such metric information, but it is no longer supported in v1.8:
kubernetes-retired/heapster#1840

What you expected to happen:
HPA functions correctly

How to reproduce it (as minimally and precisely as possible):
Try
https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale-walkthrough/

Anything else we need to know:

metrics-server is now the recommended way to provide the resource metrics API. 
@AceHack
Copy link

AceHack commented Feb 28, 2018

Any update?

@CecileRobertMichon CecileRobertMichon added the cse-sync-week Triage for issues that would be good for CSE sync week, April 24-27th 2018 label Apr 25, 2018
@karataliu
Copy link
Contributor Author

Follow-up issue: #2114
Fix PR: #2339

Verified from my side, with acs-engine v0.16.0 and k8s v1.10.1, it works well.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cse-sync-week Triage for issues that would be good for CSE sync week, April 24-27th 2018
Projects
None yet
Development

No branches or pull requests

3 participants