Commit Graph

187 Commits (be11540775e36b1f1acdd6cb43500c1717af0ad4)

Author SHA1 Message Date
Kubernetes Submit Queue f9ccee7714 Merge pull request #42435 from dashpole/timestamps_for_fsstats
Automatic merge from submit-queue (batch tested with PRs 42369, 42375, 42397, 42435, 42455)

[Bug Fix]: Avoid evicting more pods than necessary by adding Timestamps for fsstats and ignoring stale stats

Continuation of #33121.  Credit for most of this goes to @sjenning.  I added volume fs timestamps.

**why is this a bug** 
This PR attempts to fix part of https://github.com/kubernetes/kubernetes/issues/31362 which results in multiple pods getting evicted unnecessarily whenever the node runs into resource pressure. This PR reduces the chances of such disruptions by avoiding reacting to old/stale metrics.
Without this PR, kubernetes nodes under resource pressure will cause unnecessary disruptions to user workloads. 
This PR will also help deflake a node e2e test suite.

The eviction manager currently avoids evicting pods if metrics are old.  However, timestamp data is not available for filesystem data, and this causes lots of extra evictions.
See the [inode eviction test flakes](https://k8s-testgrid.appspot.com/google-node#kubelet-flaky-gce-e2e) for examples.
This should probably be treated as a bugfix, as it should help mitigate extra evictions.

cc: @kubernetes/sig-storage-pr-reviews  @kubernetes/sig-node-pr-reviews @vishh @derekwaynecarr @sjenning
2017-03-03 23:21:48 -08:00
Seth Jennings c5faf1c156 kubelet: eviction: add timestamp to FsStats 2017-03-02 11:20:24 -08:00
David Ashpole ac612eab8e eviction manager changes for allocatable 2017-03-02 07:36:24 -08:00
Vishnu kannan 9b4a8f7464 fix eviction helper function description
Signed-off-by: Vishnu kannan <vishnuk@google.com>
2017-02-27 21:24:45 -08:00
Vishnu Kannan cc5f5474d5 add support for node allocatable phase 2 to kubelet
Signed-off-by: Vishnu Kannan <vishnuk@google.com>
2017-02-27 21:24:44 -08:00
Vishnu kannan 26f9598279 admit critical pods under resource pressure\n evict critical pods that are not static
Signed-off-by: Vishnu kannan <vishnuk@google.com>
2017-02-19 19:19:09 -08:00
Kubernetes Submit Queue 76b39431d3 Merge pull request #41147 from derekwaynecarr/improve-eviction-logs
Automatic merge from submit-queue (batch tested with PRs 41074, 41147, 40854, 41167, 40045)

Add debug logging to eviction manager

**What this PR does / why we need it**:
This PR adds debug logging to eviction manager.

We need it to help users understand when/why eviction manager is/is not making decisions to support information gathering during support.
2017-02-09 17:41:41 -08:00
Derek Carr 0171121486 Add debug logging to eviction manager 2017-02-08 15:01:12 -05:00
Vishnu Kannan c967ab7b99 Avoid evicting critical pods in Kubelet if a special feature gate is enabled
Signed-off-by: Vishnu Kannan <vishnuk@google.com>
2017-02-02 11:32:20 -08:00
Vishnu Kannan ffd7dda234 Revert "Kubelet admits critical pods even under memory pressure"
This reverts commit afd676d94c.
2017-02-02 10:41:24 -08:00
Vishnu Kannan b8a63537dd Revert "Don't evict static pods"
This reverts commit 1743c6b6ab.
2017-02-02 10:29:12 -08:00
deads2k a106d9f848 switch kubelet to use external (client-go) object references for events 2017-01-31 19:15:33 -05:00
deads2k 8a12000402 move client/record 2017-01-31 19:14:13 -05:00
Dr. Stefan Schimanski 44ea6b3f30 Update generated files 2017-01-29 21:41:45 +01:00
Dr. Stefan Schimanski bc6fdd925d pkg/api/resource: move to apimachinery 2017-01-29 21:41:44 +01:00
deads2k 5a8f075197 move authoritative client-go utils out of pkg 2017-01-24 08:59:18 -05:00
deads2k c47717134b move utils used in restclient to client-go 2017-01-19 07:55:14 -05:00
Antoine Pelisse 3d82265340 Update OWNERS approvers and reviewers: pkg/kubelet 2017-01-18 10:27:11 -08:00
Clayton Coleman 9a2a50cda7
refactor: use metav1.ObjectMeta in other types 2017-01-17 16:17:19 -05:00
Kubernetes Submit Queue 5b629d83a2 Merge pull request #39303 from NickrenREN/eviction-manager
Automatic merge from submit-queue (batch tested with PRs 37505, 39844, 39525, 39109, 39303)

remove NewManager() return err
2017-01-13 14:33:35 -08:00
deads2k 6a4d5cd7cc start the apimachinery repo 2017-01-11 09:09:48 -05:00
Seth Jennings 4c30459e49 switch from local qos types to api types 2017-01-10 10:54:30 -06:00
Kubernetes Submit Queue aa7509989b Merge pull request #39318 from NickrenREN/eviction-manager-start
Automatic merge from submit-queue

remove eviction-manager start return err
2017-01-06 11:55:41 -08:00
NickrenREN 85e6076fab remove eviction-manager start return err
Start() function will never return err,we do not need the return value
2017-01-06 09:32:16 +08:00
Jeff Grafton 20d221f75c Enable auto-generating sources rules 2017-01-05 14:14:13 -08:00
NickrenREN 0f35ce1af3 drop NewManager() return err
NewManager will never return err,drop it
2017-01-03 11:24:12 +08:00
Mike Danese 161c391f44 autogenerated 2016-12-29 13:04:10 -08:00
bprashanth 1743c6b6ab Don't evict static pods 2016-12-22 16:22:14 -08:00
Dawn Chen b03fca9783 Fixed an import cycle issue:
import cycle not allowed in test
package k8s.io/kubernetes/pkg/client/restclient (test)
	imports k8s.io/kubernetes/pkg/api/testapi
	imports k8s.io/kubernetes/pkg/apis/componentconfig/install
	imports k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1
	imports k8s.io/kubernetes/pkg/kubelet/qos
	imports k8s.io/kubernetes/pkg/kubelet/pod
	imports k8s.io/kubernetes/pkg/client/clientset_generated/clientset
	imports k8s.io/kubernetes/pkg/client/clientset_generated/clientset/typed/apps/v1beta1
	imports k8s.io/kubernetes/pkg/client/restclient
2016-12-21 16:34:24 -08:00
bprashanth afd676d94c Kubelet admits critical pods even under memory pressure 2016-12-15 18:58:09 -08:00
Mike Danese c87de85347 autoupdate BUILD files 2016-12-12 13:30:07 -08:00
Andy Goldstein 89ea5ac9c1 Fix threshold notifier build tags
Fix threshold notifier build tags so the linux version is only built if cgo is
enabled, and the unsupported version is built if it's either not linux or not
cgo.
2016-12-12 11:56:07 -05:00
Derek Carr 459a7a05f1 Ability to quota storage by storage class 2016-12-09 13:26:59 -05:00
Derek Carr 5b2d1c2c25 Enable kernel memcg notification via additional flag 2016-12-07 10:09:41 -05:00
Clayton Coleman 3454a8d52c
refactor: update bazel, codec, and gofmt 2016-12-03 19:10:53 -05:00
Clayton Coleman 5df8cc39c9
refactor: generated 2016-12-03 19:10:46 -05:00
Chao Xu bcc783c594 run hack/update-all.sh 2016-11-23 15:53:09 -08:00
Chao Xu 5e1adf91df cmd/kubelet 2016-11-23 15:53:09 -08:00
Derek Carr 1ec69f658c Fix cross-build for memcg notification 2016-11-23 12:36:04 -05:00
Kubernetes Submit Queue f8d8831c71 Merge pull request #32577 from sjenning/memcg-notification-wip
Automatic merge from submit-queue

kubelet: eviction: add memcg threshold notifier to improve eviction responsiveness

This PR adds the ability for the eviction code to get immediate notification from the kernel when the available memory in the root cgroup falls below a user defined threshold, controlled by setting the `memory.available` siginal with the `--eviction-hard` flag.

This PR by itself, doesn't change anything as the frequency at which new stats can be obtained is currently controlled by the cadvisor housekeeping interval.  That being the case, the call to `synchronize()` by the notification loop will very likely get stale stats and not act any more quickly than it does now.

However, whenever cadvisor does get on-demand stat gathering ability, this will improve eviction responsiveness by getting async notification of the root cgroup memory state rather than relying on polling cadvisor.

@vishh @derekwaynecarr @kubernetes/rh-cluster-infra
2016-11-22 19:05:54 -08:00
Kubernetes Submit Queue 6515e3573e Merge pull request #34818 from nebril/eviction-test-cleanup
Automatic merge from submit-queue

Cleanup kubelet eviction manager tests

It cleans up kubelet eviction manager tests

Extracted parts of tests that were similar to each other to functions
2016-11-09 02:36:46 -08:00
Seth Jennings 2583116f1a kubelet: eviction: add memcg threshold notifier to improve eviction responsiveness 2016-11-06 20:47:49 -06:00
David Ashpole d68572e581 eviction message now includes resource that was exhausted 2016-11-04 09:30:02 -07:00
David Ashpole 9aca40dee6 revert #33218. dont need #36180. We only use diskpressure 2016-11-04 08:29:27 -07:00
Maciej Kwiek 3b5064740e Cleanup kubelect eviction manager tests
Extracted parts of tests that were similar to each other to functions
2016-11-02 10:31:59 +01:00
David Ashpole b8fc546d60 eviction manager ecivts pod using the most inodes. 2016-10-31 11:32:49 -07:00
Mike Danese 3b6a067afc autogenerated 2016-10-21 17:32:32 -07:00
Kubernetes Submit Queue 6a9d56b35a Merge pull request #32724 from sjenning/eviction-timestamp
Automatic merge from submit-queue

kubelet: eviction: avoid duplicate action on stale stats

Currently, the eviction code can be overly aggressive when synchronize() is called two (or more) times before a particular stat has been recollected by cadvisor.  The eviction manager will take additional  action based on information for which it has already taken actions.

This PR provides a method for the eviction manager to track the timestamp of the last obversation and not take action if the stat has not been updated since the last time synchronize() was run.

@derekwaynecarr @vishh @kubernetes/rh-cluster-infra
2016-10-06 11:05:34 -07:00
Seth Jennings 98e97a475a kubelet: eviction: avoid duplicate action on stale stats 2016-10-06 11:39:05 -05:00
Kubernetes Submit Queue 07eba4c6ef Merge pull request #33392 from sjenning/min-reclaim-percent
Automatic merge from submit-queue

kubelet: eviction: allow minimum reclaim as percentage

Fixes #33354 

xref #32537

**Release note**:
```release-note
The kubelet --eviction-minimum-reclaim option can now take precentages as well as absolute values for resources quantities
```
@derekwaynecarr @vishh @mtaufen
2016-10-06 09:25:46 -07:00
David Ashpole 0c8a664e50 addressed comments 2016-10-03 11:42:56 -07:00
David Ashpole fed3f37eef Split NodeDiskPressure into NodeInodePressure and NodeDiskPressure 2016-10-03 11:42:56 -07:00
Seth Jennings f52dce9319 kubelet: eviction: allow minreclaim as percentage 2016-09-30 11:12:36 -05:00
Angus Salkeld f785f3d3ef Clean up IPTables caps i.e.: sed -i "s/Iptables/IPTables/g" 2016-08-29 10:34:42 +10:00
Kubernetes Submit Queue cdbc3b56eb Merge pull request #31523 from derekwaynecarr/imagefs-observations
Automatic merge from submit-queue

Set imagefs rank and reclaim functions when nodefs+imagefs share comm…

Fixes #31192 

I decided that the behavior should match the current output of the kubelet summary API.  With no dedicated imagefs, the ranking and reclaim functions will match the nodefs ranking and reclaim functions.

/cc @ronnielai @vishh
2016-08-27 02:58:42 -07:00
derekwaynecarr 6a7eb7b420 Set imagefs rank and reclaim functions when nodefs+imagefs share common device 2016-08-26 11:08:43 -04:00
Yu-Ju Hong a072bda6fd Print out resource name when evicting pods 2016-08-25 14:11:21 -07:00
derekwaynecarr a65a24a850 kubelet eviction on inode exhaustion 2016-08-17 16:57:44 -04:00
bindata-mockuser d2dd03aecc Support percentage representation for eviction thresholds 2016-08-11 14:10:25 -07:00
derekwaynecarr 68bc47ecc6 Add support to invoke image gc in response to disk eviction thresholds 2016-08-04 17:13:08 -04:00
derekwaynecarr 611c127f0d kubelet eviction manager support for min-reclaim 2016-08-04 11:17:44 -04:00
Kubernetes Submit Queue 1933462c7b Merge pull request #29925 from ronnielai/container-gc
Automatic merge from submit-queue

Delete containers when pod is evicted

#29803
2016-08-04 04:20:02 -07:00
Ron Lai 8bc4444f16 Delete containers when pod is deleted 2016-08-03 15:56:04 -07:00
Andrey Kurilin 9f1c3a4c56 Fix various typos in kubelet 2016-08-03 01:14:44 +03:00
derekwaynecarr d37710f87b Allow cAdvisor to collect fs stats before building resource ranking funcs 2016-07-28 16:20:09 -04:00
derekwaynecarr 0de1e62b30 modify fsStats to fsStatsType to avoid confusion with cadvisor types 2016-07-28 16:01:38 -04:00
derekwaynecarr c3324b88a0 Eviction manager observes and acts on disk pressure 2016-07-28 16:01:38 -04:00
k8s-merge-robot eae90a3631 Merge pull request #26332 from resouer/util-debt
Automatic merge from submit-queue

Refactor util clock into it's own pkg

Continue my work ref #15634
2016-07-28 11:37:06 -07:00
Harry Zhang cb14b35bde Refactor util clock into it's own pkg 2016-07-28 02:29:04 -04:00
Avesh Agarwal cb7766de19 Fix kubelet to not accept negative eviction (hard, soft) thresholds
and add unit tests
2016-07-27 10:56:31 -04:00
k8s-merge-robot 1e7c513824 Merge pull request #29404 from derekwaynecarr/eviction-manager-runtime-dependent
Automatic merge from submit-queue

Eviction manager needs to start as runtime dependent module

To support disk eviction, the eviction manager needs to know if there is a dedicated device for the imagefs.  In order to know that information, we need to start the eviction manager after cadvisor.  This refactors the location eviction manager is started.

/cc @kubernetes/sig-node @kubernetes/rh-cluster-infra @vishh @ronnielai
2016-07-23 00:20:05 -07:00
derekwaynecarr 3e75f2effb Eviction manager needs to start as runtime dependent module 2016-07-22 10:19:40 -04:00
derekwaynecarr 2f4a4ea4cf Kubelet parses and validates eviction-minimum-reclaim flag 2016-07-21 16:46:12 -04:00
Davanum Srinivas 2b0ed014b7 Use Go canonical import paths
Add canonical imports only in existing doc.go files.
https://golang.org/doc/go1.4#canonicalimports

Fixes #29014
2016-07-16 13:48:21 -04:00
David McMahon ef0c9f0c5b Remove "All rights reserved" from all the headers. 2016-06-29 17:47:36 -07:00
Buddha Prakash 4acb64f8bd Make Qos naming consistent across the codebase 2016-06-26 16:19:47 -07:00
Buddha Prakash c3551ae6cd Refactor qos package
Signed-off-by: Buddha Prakash <buddhap@google.com>
2016-06-24 15:36:04 -07:00
Tim St. Clair f2f3caf744 Rename **/manager.go 2016-06-21 15:11:31 -07:00
derekwaynecarr 8ea7998c7d Add owners file for kubelet eviction 2016-06-14 13:30:23 -04:00
derekwaynecarr 2a1d3faf08 kubelet support for max grace period during soft eviction 2016-05-20 11:30:08 -04:00
Clayton Coleman e3c8c4c22b
Handle resource.Quantity changes in eviction thresholds 2016-05-19 08:41:43 -04:00
Clayton Coleman 5e4308f91d
Update use of Quantity in other classes 2016-05-19 08:41:43 -04:00
derekwaynecarr edc76f6d4f out of resource killing (memory) 2016-05-14 11:34:45 -04:00
k8s-merge-robot 17345bf857 Merge pull request #25372 from derekwaynecarr/more-eviction-flags
Automatic merge from submit-queue

Add eviction-pressure-transitition-period flag to kubelet

This PR does the following:
* add the new flag to control how often a node will go out of memory pressure or disk pressure conditions see: https://github.com/kubernetes/kubernetes/pull/25282
* pass an `eviction.Config` into `kubelet` so we can group config

/cc @vishh
2016-05-13 05:46:15 -07:00
derekwaynecarr 6fefb428c1 Add killPodNow to kubelet 2016-05-12 19:17:08 -04:00
derekwaynecarr 2c01edf9ea Add eviction-pressure-transition-period flag to kubelet 2016-05-12 17:33:00 -04:00
derekwaynecarr 725af223aa Add parsers for eviction thresholds 2016-05-06 12:06:03 -04:00