Commit Graph

29 Commits (763cb708d1bc917d7d88a744560950ad6d0be41b)

Author SHA1 Message Date
k8s-ci-robot 99f319567a
Merge pull request #68015 from damemi/hpa-metrics-specificity
Support backwards compatibility for v1beta1 custom metrics client
2018-09-10 16:12:23 -07:00
Mike Dame 364afe4042 Support multiple versions in custom metrics client
This changes the custom metrics client logic over to support multiple versions
of the custom metrics API by checking discovery to find the appropriate versions.

Fixes #68011

Co-authored-by: Solly Ross <sross@redhat.com>
2018-09-06 15:20:00 -04:00
Krzysztof Jastrzebski 985ba931b1 Use informer cache instead of active pod gets in HPA controller. 2018-09-05 11:31:27 +02:00
Krzysztof Jastrzebski 958cba1c82 Replace scale down forbidden window
Replacement is scale down stabilization window. HPA will scale down only
    to max of recommendations it made during that window. More details in

    https://docs.google.com/document/d/1IdG3sqgCEaRV3urPLA29IDudCufD89RYCohfBPNeWIM
2018-08-31 20:24:38 +02:00
Krzysztof Jastrzebski 5357bf9eac Change CPU sample sanitization in HPA.
Ignore samples if:
- Pod is beeing initalized - 5 minutes from start defined by flag
    - pod is unready
    - pod is ready but full window of metric hasn't been colected since
    transition
- Pod is initialized - 5 minutes from start defined by flag:
    - Pod has never been ready after initial readiness period.
2018-08-30 23:13:14 +02:00
Joachim Bartosik 4fd6a1684d Make HPA more configurable
Duration of initialization taint on CPU and window of initial readiness
setting controlled by flags.

Adding API violation exceptions following example of e50340ee23
2018-08-24 13:13:02 +02:00
Joachim Bartosik 7681c284f5 Remove UpscaleForbiddenWindow
Instead discard metric values for pods that are unready and have never
been ready (they may report misleading values, the original reason for
introducing scale up forbidden window).

Use per pod metric when pod is:
- Ready, or
- Not ready but creation timestamp and last readiness change are more
  than 10s apart.

In the latter case we asume the pod was ready but later became unready.
We want to use metrics for such pods because sometimes such pods are
unready because they were getting too much load.
2018-08-01 17:47:23 +02:00
David Eads fb7d137ea2 add debug handler capability for individual controllers 2018-07-26 13:24:36 -04:00
Mike Danese efb8827215 pkg/controller: remove old clientbuilder methods
everything has moved to client-go now so these are the same as the
original Client* methods.
2018-07-17 09:06:59 -07:00
Dr. Stefan Schimanski d79cf25497 Update external k8s.io/metrics imports 2018-07-02 10:44:18 +02:00
hzxuzhonghu 7f93d11f9e Add RESTMapper to ControllerContext and make it generic for controllers 2018-04-28 09:58:43 +08:00
David Eads e2fc5cf259 remove versioning interface 2018-04-27 07:56:42 -04:00
stewart-yu ec6399be53 split up the component config into smaller config 2018-04-13 08:40:54 +08:00
Maciej Pytel 66f4f9080d Add external metrics client to HPA rest client 2018-02-27 14:10:29 +01:00
Nikhita Raghunath 6fbe8157e3 add subresources for custom resources 2018-02-22 23:26:09 +05:30
stewart-yu 0cbe0a6034 controller-manager: switch to config/option struct pattern 2018-02-13 11:16:17 +01:00
supereagle b694d51842 use versiond group clients from client-go 2017-11-07 14:47:22 +08:00
Kevin 4c8539cece use core client with explicit version globally 2017-10-27 15:48:32 +08:00
Solly Ross d2b41120ea Make HPA controller use polymorphic scale client
This updates the HPA controller to use the polymorphic scale client from
client-go.  This should enable HPAs to work with arbitrary scalable
resources, instead of just those in the extensions API group (meaning we
can deprecate the copy of ReplicationController in extensions/v1beta1).
It also means that the HPA controller now pays attention to the
APIVersion field in `scaleTargetRef` (more specifically, the group part
of it).

Note that currently, discovery information on which resources are
available where is only fetched once (the first time that it's
requested).  In the future, we may want a refreshing discovery REST
mapper.
2017-10-19 13:21:02 -04:00
mattjmcnaughton abd46684d4 Make HPA tolerance a flag
Fix #18155

Make HPA tolerance configurable as a flag. This change allows us to use
different tolerance values in production/testing.

Signed-off-by: mattjmcnaughton <mattjmcnaughton@gmail.com>
2017-09-28 22:01:51 -04:00
Solly Ross 86f24eaf7a Update HPA REST metrics client to metrics/v1beta1
This commit updates the REST metrics client to use metrics/v1beta1.
The legacy client still uses metrics/v1alpha1.
2017-09-05 16:11:55 -04:00
Chao Xu b5a41e770a remove unnecessary call to metrics install package
remove init and reference to client-go/api from metrcis install package
2017-05-09 18:05:22 -07:00
Dmitry1987 965dab366b make hpa upscale and downscale delay window configurable 2017-03-24 18:01:04 +00:00
Solly Ross d6fe1e8764 HPA Controller: Use Custom Metrics API
This commit switches over the HPA controller to use the custom metrics
API.  It also converts the HPA controller to use the generated client
in k8s.io/metrics for the resource metrics API.

In order to enable support, you must enable
`--horizontal-pod-autoscaler-use-rest-clients` on the
controller-manager, which will switch the HPA controller's MetricsClient
implementation over to use the standard rest clients for both custom
metrics and resource metrics.  This requires that at the least resource
metrics API is registered with kube-aggregator, and that the controller
manager is pointed at kube-aggregator.  For this to work, Heapster
must be serving the new-style API server (`--api-server=true`).
2017-03-01 10:21:50 -05:00
Andy Goldstein 4cd38b863f Remove references to pkg/controller/informers 2017-02-27 06:47:59 -05:00
Andy Goldstein d11aa98c29 Switch hpa controller to shared informer 2017-02-10 09:53:41 -05:00
deads2k 8a12000402 move client/record 2017-01-31 19:14:13 -05:00
deads2k 6a4d5cd7cc start the apimachinery repo 2017-01-11 09:09:48 -05:00
deads2k f36a5ae9a1 separate controller initialization for easy controllers 2016-12-07 09:00:53 -05:00