k3s/pkg/kubelet
Kubernetes Submit Queue 270ed995f4
Merge pull request #59841 from dashpole/metrics_after_reclaim
Automatic merge from submit-queue (batch tested with PRs 59683, 59964, 59841, 59936, 59686). 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>.

Reevaluate eviction thresholds after reclaim functions

**What this PR does / why we need it**:
When the node comes under `DiskPressure` due to inodes or disk space, the eviction manager runs garbage collection functions to clean up dead containers and unused images.
Currently, we use the strategy of trying to measure the disk space and inodes freed by garbage collection.  However, as #46789 and #56573 point out, there are gaps in the implementation that can cause extra evictions even when they are not required.  Furthermore, for nodes which frequently cycle through images, it results in a large number of evictions, as running out of inodes always causes an eviction.

This PR changes this strategy to call the garbage collection functions and ignore the results.  Then, it triggers another collection of node-level metrics, and sees if the node is still under DiskPressure.
This way, we can simply observe the decrease in disk or inode usage, rather than trying to measure how much is freed.

**Which issue(s) this PR fixes**:
Fixes #46789
Fixes #56573
Related PR #56575

**Special notes for your reviewer**:
This will look cleaner after #57802  removes arguments from [makeSignalObservations](https://github.com/kubernetes/kubernetes/pull/57802/files#diff-9e5246d8c78d50ce4ba440f98663f3e9R719).

**Release note**:
```release-note
NONE
```

/sig node
/kind bug
/priority important-soon
cc @kubernetes/sig-node-pr-reviews
2018-02-16 16:31:33 -08:00
..
apis Merge pull request #57885 from cimomo/kubelet-fixes 2018-02-16 13:38:49 -08:00
cadvisor Improve comments for kubelet 2018-02-14 12:03:46 -08:00
certificate Autogenerate BUILD files 2017-12-23 13:12:11 -08:00
checkpoint Autogenerate BUILD files 2017-12-23 13:12:11 -08:00
client Autogenerate BUILD files 2017-12-23 13:12:11 -08:00
cm collect ephemeral storage capacity on initialization 2018-02-15 17:33:22 -08:00
config Redesign and implement volume reconstruction work 2018-02-05 13:14:09 -08:00
configmap Autogenerate BUILD files 2017-12-23 13:12:11 -08:00
container reevaluate eviction thresholds after reclaim functions 2018-02-16 08:35:24 -08:00
custommetrics Autogenerate BUILD files 2017-12-23 13:12:11 -08:00
dockershim Fake docker-client assigns random IPs to containers 2018-02-14 14:28:52 +01:00
envvars Update generated files 2017-11-09 12:14:08 +01:00
events Improve messaging on resize 2018-01-29 15:07:51 -05:00
eviction Merge pull request #59841 from dashpole/metrics_after_reclaim 2018-02-16 16:31:33 -08:00
gpu Autogenerate BUILD files 2017-12-23 13:12:11 -08:00
images reevaluate eviction thresholds after reclaim functions 2018-02-16 08:35:24 -08:00
kubeletconfig Merge pull request #53833 from mtaufen/kubeletconfig-to-beta 2018-02-15 11:06:40 -08:00
kuberuntime fix all the typos across the project 2018-02-11 11:04:14 +08:00
leaky
lifecycle Fix scheduler refs in BUILD files. 2018-01-05 15:05:01 -08:00
metrics Fix kubelet PVC metrics using a volume stats collector. 2018-02-11 23:48:06 +08:00
mountpod Autogenerate BUILD files 2017-12-23 13:12:11 -08:00
network fix all the typos across the project 2018-02-11 11:04:14 +08:00
pleg Increment CRI version from v1alpha1 to v1alpha2 2018-02-07 09:06:26 +01:00
pod Autogenerate BUILD files 2017-12-23 13:12:11 -08:00
preemption fix all the typos across the project 2018-02-11 11:04:14 +08:00
prober fix all the typos across the project 2018-02-11 11:04:14 +08:00
qos Autogenerate BUILD files 2017-12-23 13:12:11 -08:00
remote Increment CRI version from v1alpha1 to v1alpha2 2018-02-07 09:06:26 +01:00
rkt Merge pull request #56960 from islinwb/remove_unused_code_ut_pkg 2018-01-18 02:41:29 -08:00
secret Autogenerate BUILD files 2017-12-23 13:12:11 -08:00
server Merge pull request #57136 from k82cn/k8s_54313 2018-02-16 10:35:33 -08:00
stats Merge pull request #57136 from k82cn/k8s_54313 2018-02-16 10:35:33 -08:00
status Autogenerate BUILD files 2017-12-23 13:12:11 -08:00
sysctl Autogenerate BUILD files 2017-12-23 13:12:11 -08:00
types Add 'none' option to EnforceNodeAllocatable 2018-02-08 10:24:39 -08:00
util fix all the typos across the project 2018-02-11 11:04:14 +08:00
volumemanager Merge pull request #59923 from jsafrane/volumemanager-logs 2018-02-15 20:16:38 -08:00
winstats fix all the typos across the project 2018-02-11 11:04:14 +08:00
BUILD Merge pull request #59170 from cofyc/fix_kubelet_volume_metrics 2018-02-15 18:44:08 -08:00
OWNERS
active_deadline.go
active_deadline_test.go
doc.go
kubelet.go Merge pull request #59769 from dashpole/capacity_ephemeral_storage 2018-02-16 11:17:02 -08:00
kubelet_getters.go kubelet: revert the get pod status 2018-02-15 22:24:35 +01:00
kubelet_getters_test.go
kubelet_network.go fix all the typos across the project 2018-02-11 11:04:14 +08:00
kubelet_network_test.go Move DNS related kubelet codes into its own package 2017-11-15 10:56:44 -08:00
kubelet_node_status.go Merge pull request #59769 from dashpole/capacity_ephemeral_storage 2018-02-16 11:17:02 -08:00
kubelet_node_status_test.go Merge pull request #59769 from dashpole/capacity_ephemeral_storage 2018-02-16 11:17:02 -08:00
kubelet_pods.go Fix pod scheduled. 2018-02-16 00:51:20 +00:00
kubelet_pods_test.go Increment CRI version from v1alpha1 to v1alpha2 2018-02-07 09:06:26 +01:00
kubelet_pods_windows_test.go
kubelet_resources.go
kubelet_resources_test.go
kubelet_test.go Merge pull request #57824 from thockin/gcr-vanity 2018-02-08 03:29:32 -08:00
kubelet_volumes.go
kubelet_volumes_test.go BlockVolumesSupport: CRI, VolumeManager and OperationExecutor changes 2017-11-20 14:10:26 -05:00
oom_watcher.go
oom_watcher_test.go
pod_container_deletor.go
pod_container_deletor_test.go
pod_workers.go
pod_workers_test.go
reason_cache.go
reason_cache_test.go
runonce.go
runonce_test.go
runtime.go Remove setInitError. 2018-01-29 21:44:54 -08:00
util.go
volume_host.go enable flexvolume on Windows 2017-12-07 06:24:20 +00:00