Commit Graph

288 Commits

Author SHA1 Message Date
yuzhiquanlong
be9e1fda5e remove format pods func, instead with klog.Kobjs 2021-10-15 18:26:02 +08:00
Kubernetes Prow Robot
cab54856f1
Merge pull request #104933 from vikramcse/automate_mockery
conversion of tests from mockery to mockgen
2021-09-30 18:33:21 -07:00
vikram Jadhav
0de4397490 mockery to mockgen conversion 2021-09-25 16:15:08 +00:00
wojtekt
53ce79a18a Migrate to k8s.io/utils/clock in pkg/kubelet 2021-09-10 12:20:09 +02:00
Stephen Augustus
481cf6fbe7
generated: Run hack/update-gofmt.sh
Signed-off-by: Stephen Augustus <foo@auggie.dev>
2021-08-24 15:47:49 -04:00
Clayton Coleman
3eadd1a9ea
Keep pod worker running until pod is truly complete
A number of race conditions exist when pods are terminated early in
their lifecycle because components in the kubelet need to know "no
running containers" or "containers can't be started from now on" but
were relying on outdated state.

Only the pod worker knows whether containers are being started for
a given pod, which is required to know when a pod is "terminated"
(no running containers, none coming). Move that responsibility and
podKiller function into the pod workers, and have everything that
was killing the pod go into the UpdatePod loop. Split syncPod into
three phases - setup, terminate containers, and cleanup pod - and
have transitions between those methods be visible to other
components. After this change, to kill a pod you tell the pod worker
to UpdatePod({UpdateType: SyncPodKill, Pod: pod}).

Several places in the kubelet were incorrect about whether they
were handling terminating (should stop running, might have
containers) or terminated (no running containers) pods. The pod worker
exposes methods that allow other loops to know when to set up or tear
down resources based on the state of the pod - these methods remove
the possibility of race conditions by ensuring a single component is
responsible for knowing each pod's allowed state and other components
simply delegate to checking whether they are in the window by UID.

Removing containers now no longer blocks final pod deletion in the
API server and are handled as background cleanup. Node shutdown
no longer marks pods as failed as they can be restarted in the
next step.

See https://docs.google.com/document/d/1Pic5TPntdJnYfIpBeZndDelM-AbS4FN9H2GTLFhoJ04/edit# for details
2021-07-06 15:55:22 -04:00
刁浩 10284789
be48f1d272 Add test cases to the addAllocatableThresholds function in pkg/kubelet/eviction/helpers.go
Signed-off-by: 刁浩 10284789 <diao.hao@zte.com.cn>
2021-06-15 11:32:44 +00:00
Kubernetes Prow Robot
8b057cdfa4
Merge pull request #99095 from maxlaverse/fix_kubelet_stuck_in_diskpressure
Prevent Kubelet from getting stuck in DiskPressure when imagefs minReclaim is set
2021-04-23 18:23:14 -07:00
Maxime Lagresle
63cba062eb
more sensible comment 2021-04-12 21:20:20 +02:00
Niekvdplas
fec272a7b2 Fixed several spelling mistakes 2021-03-30 23:02:09 +02:00
Kubernetes Prow Robot
a91fdfbeb3
Merge pull request #97493 from Pingan2017/allocatemem-1224
add operator for allocateMemory.available signal
2021-03-07 20:09:44 -08:00
Shintaro Murakami
fe7a862c2d Unify determination of whether a volume is ephemeral 2021-03-05 14:49:09 +09:00
Kubernetes Prow Robot
14abaa23c3
Merge pull request #99032 from yangjunmyfm192085/run-test18
Structured Logging migration: modify eviction  part logs of kubelet.
2021-03-04 13:38:57 -08:00
Benjamin Elder
56e092e382 hack/update-bazel.sh 2021-02-28 15:17:29 -08:00
Maxime Lagresle
848dc9e65f
Check that minReclaim is taken into account in reclaimNodeLevelResources() 2021-02-22 11:58:36 +01:00
JunYang
af0b4c9031 Structured Logging migration: modify eviction part logs of kubelet.
Signed-off-by: JunYang <yang.jun22@zte.com.cn>
2021-02-21 08:36:14 +08:00
Maxime Lagresle
7e97601023
Prevent Kubelet stuck in DiskPressure when imagefs minReclaim is set
Fixes https://github.com/kubernetes/kubernetes/issues/99094
2021-02-15 14:31:06 +01:00
Kubernetes Prow Robot
3ad19200ba
Merge pull request #97321 from shawnhanx/master
Change the upper limit of evictionthreshold from 10000% to 100%
2021-02-09 10:25:13 -08:00
shawnhanx
fa8d07d3e1
Apply suggestions from code review
Co-authored-by: bl-ue <54780737+bl-ue@users.noreply.github.com>
2021-02-07 09:23:07 +08:00
shawnhanx
0bee739a2f Change the upper limit of threshold from 10000% to 100% 2021-02-03 21:55:49 +08:00
Mike Dame
578ff3ec34 Move Taint/Toleration helpers to component-helpers repo
This is part of the goal for scheduling to remove dependencies on internal
packages for the scheduling framework. It also provides these functions in an
external location for other components and projects to import.
2021-02-01 11:06:03 -05:00
wzshiming
29808eaf24 Fix panic 2021-01-21 19:47:28 +08:00
Pingan2017
2f76666ff4 add operator for allocateMemory.available signal 2020-12-24 10:04:09 +08:00
Joel Smith
29ff2fe528 Remove now-unused eviction helpers, fix unit test TestCRIListPodStats 2020-12-03 13:04:25 -07:00
Derek Carr
acb43c7c4a Rework hostfs metrics
Ephemeral storage usage should be calculated by the metrics code,
not the eviction code.
2020-12-03 13:04:25 -07:00
Joel Smith
39a11744ce Partially revert "Include pod /etc/hosts in ephemeral storage calculation for eviction"
This reverts (most of) commit f34b586d01.
2020-12-03 04:47:16 -07:00
Masashi Honma
4c12900643 kube-eviction: Fix SI of process quantity
Use DecimalSI instead of BinarySI because process count is decimal.

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
2020-10-13 18:24:43 +09:00
Jan Chaloupka
274c536da3 Removing GetPodPriority from pkg/api and importing PodPriority from k8s.io/component-helpers 2020-10-11 21:40:11 +02:00
Marek Siarkowicz
7d309e0104 Move Kubelet Summary API to staging repo 2020-09-22 18:23:28 +02:00
Seth Jennings
a4f043a980 kubelet: eviction: remove noise from TestGetReclaimableThreshold test output 2020-07-27 13:53:55 -05:00
Joel Smith
f34b586d01 Include pod /etc/hosts in ephemeral storage calculation for eviction 2020-07-08 12:58:11 -06:00
Kubernetes Prow Robot
86ad0df820
Merge pull request #92203 from sjenning/add-sjenning-node-approver
Add sjenning as kubelet approver
2020-06-19 21:52:02 -07:00
Kubernetes Prow Robot
86ab25f038
Merge pull request #91716 from kadisi/append_mutations_kubelet
fix unexpected append mutations about pkg/kubelet package
2020-06-19 21:51:08 -07:00
Seth Jennings
45d2b98aa8 add sjenning as kubelet approver 2020-06-19 13:00:55 -05:00
Kubernetes Prow Robot
677e8d6871
Merge pull request #86223 from dashpole/owners_changes
Add dashpole as kubelet approver
2020-06-18 22:59:58 -07:00
kadisi
a75323c76b fix unexpected append mutations about pkg/kubelet package
Signed-off-by: kadisi <iamkadisi@163.com>
Co-authored-by: Dr. Stefan Schimanski <stefan.schimanski@gmail.com>
2020-06-03 13:36:57 +08:00
Davanum Srinivas
07d88617e5
Run hack/update-vendor.sh
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2020-05-16 07:54:33 -04:00
Davanum Srinivas
442a69c3bd
switch over k/k to use klog v2
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2020-05-16 07:54:27 -04:00
Kubernetes Prow Robot
89dfebb214
Merge pull request #89359 from gongguan/process
eviction by process number
2020-03-24 15:27:25 -07:00
louisgong
0efb70c0a2 eviction by process number 2020-03-24 09:25:04 +08:00
Wei Fu
a809aaf03d eviction: use previous statsFunc
No need to use summary to create statsFunc for localStorageEviction.
Just use vals from makeSignalObservations.

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2020-03-23 19:11:17 +08:00
Clayton Coleman
af9e0be163
kubelet: Record kubelet_evictions when limits are hit
The pod, container, and emptyDir volumes can all trigger evictions
when their limits are breached. To ensure that administrators can
alert on these type of evictions, update kubelet_evictions to include
the following signal types:

* ephemeralcontainerfs.limit - container ephemeral storage breaches its limit
* ephemeralpodfs.limit - pod ephemeral storage breaches its limit
* emptydirfs.limit - pod emptyDir storage breaches its limit
2020-02-18 15:08:30 -05:00
danielqsj
1a9b121764 remove deprecated metrics of kubelet 2020-01-10 16:46:52 +08:00
ianlang
c9418412d1 fix misspelling in comment 2019-12-16 17:27:08 +08:00
David Ashpole
fca84c02bb add dashpole as kubelet approver 2019-12-12 11:10:24 -08:00
Jordan Liggitt
297570e06a hack/update-vendor.sh 2019-11-06 17:42:34 -05:00
Kubernetes Prow Robot
46472773cb
Merge pull request #84836 from yuxiaobo96/k8s-checks
Correct spelling mistakes
2019-11-06 12:21:11 -08:00
yuxiaobo
81e9f21f83 Correct spelling mistakes
Signed-off-by: yuxiaobo <yuxiaobogo@163.com>
2019-11-06 20:25:19 +08:00
Wei Huang
019d7497a5
bazel files 2019-11-05 20:57:21 -08:00
Wei Huang
dd74205bcf
Move out const strings in pkg/scheduler/api/well_known_labels.go 2019-11-05 20:56:21 -08:00