k3s/pkg/controller
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
..
bootstrap Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
certificates UT case of certificate_controller 2018-07-14 16:40:08 +08:00
cloud Add Labels to various OWNERS files 2018-08-21 13:59:08 -04:00
clusterroleaggregation Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
cronjob Add Labels to various OWNERS files 2018-08-21 13:59:08 -04:00
daemon Add Labels to various OWNERS files 2018-08-21 13:59:08 -04:00
deployment Add Labels to various OWNERS files 2018-08-21 13:59:08 -04:00
disruption Add Labels to various OWNERS files 2018-08-21 13:59:08 -04:00
endpoint Allow headless svc without ports to have endpoints 2018-08-21 08:36:27 -07:00
garbagecollector Add sig/api-machinery label to apimachinery OWNERS files 2018-08-20 18:46:47 +05:30
history Merge pull request #67485 from linyouchong/pr-0816 2018-08-21 21:10:05 -07:00
job Add Labels to various OWNERS files 2018-08-21 13:59:08 -04:00
namespace Add sig/api-machinery label to apimachinery OWNERS files 2018-08-20 18:46:47 +05:30
nodeipam Update external k8s.io/metrics imports 2018-07-02 10:44:18 +02:00
nodelifecycle Fix out of bounds error on non-64-bit machines 2018-06-28 16:29:52 -04:00
podautoscaler Merge pull request #67252 from jbartosik/metric-sanitization 2018-08-24 15:25:07 -07:00
podgc add ns info for pod in log 2018-08-01 16:25:34 +08:00
replicaset Add Labels to various OWNERS files 2018-08-21 13:59:08 -04:00
replication Add Labels to various OWNERS files 2018-08-21 13:59:08 -04:00
resourcequota allow failed discovery on initial quota controller start 2018-08-17 11:42:54 -04:00
route Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
service Implement GetLoadBalancerName per provider and add DefaultLoadBalancerName. 2018-08-04 00:36:48 -04:00
serviceaccount Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
statefulset Add Labels to various OWNERS files 2018-08-21 13:59:08 -04:00
testutil Merge pull request #65052 from dbdd4us/master 2018-07-11 22:25:03 -07:00
ttl Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
util/node Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
volume Merge pull request #67062 from cofyc/fix66287 2018-08-17 11:58:06 -07:00
.import-restrictions
BUILD Update Bazel 2018-08-15 13:34:31 +02:00
OWNERS
client_builder.go Deprecate ListWatchUntil, fix it and call places 2018-08-15 13:34:31 +02:00
controller_ref_manager.go Use apps/v1 in Deployment controller. 2018-05-22 13:42:10 -07:00
controller_ref_manager_test.go Use apps/v1 in Deployment controller. 2018-05-22 13:42:10 -07:00
controller_utils.go Safe encode template hash value to make it consistent with resource name 2018-07-13 09:52:26 -07:00
controller_utils_test.go Use apps/v1 in Deployment controller. 2018-05-22 13:42:10 -07:00
doc.go
lookup_cache.go