k3s/pkg/apis/componentconfig
Kubernetes Submit Queue 663551bebd
Merge pull request #67252 from jbartosik/metric-sanitization
Automatic merge from submit-queue (batch tested with PRs 66916, 67252, 67794, 67619, 67328). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fix HPA sample sanitization

**What this PR does / why we need it**: @mwielgus pointed out a case when HPA fails as a result of my changes to HPA algorithm:
- Have pods that use a lot of CPU during initilization, become ready right after they initialize,
- Trigger a scale up,
- When new pods become ready will will count their usage (even though it's not related to any work that needs doing),
- This triggers another scale up, even though existing pods can handle work, no problem.

The fix is:
- Use all samples for non-cpu metrics.
- Only use CPU samples if:
  - Pod is ready and was started more than 2 minutes ago, or
  - Pod is unready and last readiness change happened more than 10s after it was started.

Reasoning behind this in: https://docs.google.com/document/d/1UdtYedhmCxjaJIQi6hwJMY0eHQQKxlVD8lSHZC1BPOA/edit

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:

**Special notes for your reviewer**:

**Release note**:
```release-note
Replace scale up forbidden window with disregarding CPU samples collected when pod was initializing.
```
2018-08-24 15:25:07 -07:00
..
fuzzer Remove references to 'pkg/apis/componentconfig/install' and fix inconsistencies 2018-08-09 18:45:27 +03:00
install autogenerated 2018-08-09 19:35:03 +03:00
v1alpha1 Merge pull request #67252 from jbartosik/metric-sanitization 2018-08-24 15:25:07 -07:00
BUILD auto-generated 2018-08-24 10:58:09 +08:00
OWNERS Remove references to 'pkg/apis/componentconfig/install' and fix inconsistencies 2018-08-09 18:45:27 +03:00
doc.go deepcopy: remove deepcopy register tags 2017-11-10 18:25:26 +01:00
helpers.go kube-proxy: Fix flag validation for healthz-bind-address and metrics-bind-address 2018-01-31 14:02:30 -08:00
helpers_test.go kube-proxy: Fix flag validation for healthz-bind-address and metrics-bind-address 2018-01-31 14:02:30 -08:00
register.go use external KubeSchedulerConfiguration 2018-08-24 10:58:09 +08:00
types.go Merge pull request #67252 from jbartosik/metric-sanitization 2018-08-24 15:25:07 -07:00
zz_generated.deepcopy.go Merge pull request #67252 from jbartosik/metric-sanitization 2018-08-24 15:25:07 -07:00