Commit Graph

55 Commits

Author SHA1 Message Date
Shivanshu Raj Shrivastava
f4aad52885
migrated preemption.go, stateful.go, resource_allocation.go to structured logging 2021-11-08 22:52:47 +05:30
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
qingwave
8f2d913acd migrate kubelet/preemption and kubelet/logs to structured logging 2021-03-06 13:13:18 +08:00
Benjamin Elder
56e092e382 hack/update-bazel.sh 2021-02-28 15:17:29 -08: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
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
Wei Huang
3f8b202266
Move GeneralPredicates logic to kubelet. 2020-01-21 09:27:00 -08:00
Eric Ernst
cdd92d39b7 preemption: typo cleanup
Signed-off-by: Eric Ernst <eric.ernst@intel.com>
2020-01-15 10:55:40 -08:00
David Ashpole
fca84c02bb add dashpole as kubelet approver 2019-12-12 11:10:24 -08:00
Clayton Coleman
3c44e11cfa
kubelet: Record preemptions similarly to evictions
A preemption is a disruption event that should have a metric so that
the rate of preemption can be assessed. Nodes that are under heavy
preemption may have conflicting workloads or otherwise need attention.
A sudden burst of preemption on a cluster in steady state could
indicate pathological conditions within the scheduler or workload
controllers.
2019-10-19 19:07:37 -04:00
draveness
495faa22db feat: cleanup pod critical pod annotations feature 2019-08-09 08:41:23 +08:00
draveness
d83526d253 Revert "feat: cleanup pod critical pod annotations feature"
This reverts commit b6d41ee5cc.
2019-07-18 13:31:12 +08:00
Kubernetes Prow Robot
7c90f7d96c
Merge pull request #77686 from tedyu/preempt-qty
Break out of inner loop when newQuantity is negative in admissionRequirementList#subtract
2019-07-15 14:53:37 -07:00
Ted Yu
0ec1f85b47 Break out of inner loop when newQuantity is negative 2019-07-12 09:40:22 -07:00
draveness
b6d41ee5cc feat: cleanup pod critical pod annotations feature 2019-07-11 08:54:19 +08:00
Kubernetes Prow Robot
c64f81d082
Merge pull request #78653 from sjenning/add-sjenning-owners
kubelet: add sjenning to kubelet subdirectory owners files
2019-06-25 14:47:15 -07:00
Kubernetes Prow Robot
ec02afb46e
Merge pull request #78777 from tedyu/preempt-bench
Use no-priority best-effort pod as the preemptor in BenchmarkGetPodsToPreempt
2019-06-14 16:51:00 -07:00
Kubernetes Prow Robot
b2be0753dd
Merge pull request #78493 from tedyu/ignore-pod-kill-err
Continue admitting the pod regardless of return value from killPodFunc
2019-06-14 04:09:00 -07:00
Ted Yu
22556aed17 Use no-priority best-effort pod as the preemptor in BenchmarkGetPodsToPreempt 2019-06-06 14:51:53 -07:00
Seth Jennings
89dc2c65e4 kubelet: add sjenning to kubelet subdirectory owners files 2019-06-03 08:26:24 -05:00
Ted Yu
132556e13a Continue admitting the pod regardless of return value from killPodFunc 2019-05-30 11:36:34 -07:00
David Ashpole
a95cf017e1 add dashpole to kubelet owners files 2019-05-29 13:33:48 -07:00
Kubernetes Prow Robot
ace60e8acb
Merge pull request #77684 from tedyu/pre-empt
Correct CriticalPodAdmissionHandler in godoc
2019-05-12 02:24:09 -07:00
Ted Yu
0a9bf0d05e Correct CriticalPodAdmissionHandler in godoc 2019-05-09 10:51:46 -07:00
Andrew Kim
c919139245 update import of generic featuregate code from k8s.io/apiserver/pkg/util/feature -> k8s.io/component-base/featuregate 2019-05-08 10:01:50 -04:00
wangqingcan
b82a1d4600 Move predicate types from algorithm to predicates 2018-12-21 22:26:47 +08:00
Jordan Liggitt
2498ca7606 drop VerifyFeatureGatesUnchanged 2018-11-21 11:51:33 -05:00
Jordan Liggitt
733dd9dfd7 Add tests to ensure feature gate changes don't escape kubelet/scheduler packages 2018-11-16 10:52:53 -05:00
Jordan Liggitt
de8bf9b63d fix scheduler and kubelet unit tests leaking feature flag changes 2018-11-16 10:52:53 -05:00
Davanum Srinivas
954996e231
Move from glog to klog
- Move from the old github.com/golang/glog to k8s.io/klog
- klog as explicit InitFlags() so we add them as necessary
- we update the other repositories that we vendor that made a similar
change from glog to klog
  * github.com/kubernetes/repo-infra
  * k8s.io/gengo/
  * k8s.io/kube-openapi/
  * github.com/google/cadvisor
- Entirely remove all references to glog
- Fix some tests by explicit InitFlags in their init() methods

Change-Id: I92db545ff36fcec83afe98f550c9e630098b3135
2018-11-10 07:50:31 -05:00
David Ashpole
90f58c1157 critical pod test should not rely on feature gate set in framework; non-critical pods are always preemptable 2018-09-07 17:43:42 -07:00
Da K. Ma
a75d625cc3 Compared preemption by priority.
Signed-off-by: Da K. Ma <klaus1982.cn@gmail.com>
2018-08-04 11:33:07 +08:00
Seth Jennings
f2a7654978 move feature gate checks inside IsCriticalPod 2018-07-11 16:10:05 -05:00
Jeff Grafton
23ceebac22 Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
Rohit Agarwal
87dda3375b Delete in-tree support for NVIDIA GPUs.
This removes the alpha Accelerators feature gate which was deprecated in 1.10.
The alternative feature DevicePlugins went beta in 1.10.
2018-04-02 20:17:01 -07:00
Jeff Grafton
ef56a8d6bb Autogenerated: hack/update-bazel.sh 2018-02-16 13:43:01 -08:00
Di Xu
48388fec7e fix all the typos across the project 2018-02-11 11:04:14 +08:00
Jonathan Basseri
85c5862552 Fix scheduler refs in BUILD files.
Update references to moved scheduler code.
2018-01-05 15:05:01 -08:00
Jonathan Basseri
30b89d830b Move scheduler code out of plugin directory.
This moves plugin/pkg/scheduler to pkg/scheduler and
plugin/cmd/kube-scheduler to cmd/kube-scheduler.

Bulk of the work was done with gomvpkg, except for kube-scheduler main
package.
2018-01-05 15:05:01 -08:00
Jeff Grafton
efee0704c6 Autogenerate BUILD files 2017-12-23 13:12:11 -08:00
Dr. Stefan Schimanski
bec617f3cc Update generated files 2017-11-09 12:14:08 +01:00
Dr. Stefan Schimanski
012b085ac8 pkg/apis/core: mechanical import fixes in dependencies 2017-11-09 12:14:08 +01:00
Jeff Grafton
aee5f457db update BUILD files 2017-10-15 18:18:13 -07:00
xiangpengzhao
1c4dbcf5ca Replace hard-code "cpu" and "memory" to consts 2017-08-16 16:37:50 +08:00
Jeff Grafton
a7f49c906d Use buildozer to delete licenses() rules except under third_party/ 2017-08-11 09:32:39 -07:00
Jeff Grafton
33276f06be Use buildozer to remove deprecated automanaged tags 2017-08-11 09:31:50 -07:00
zhangxiaoyu-zidif
e6c95e7a5c fix-review 2017-07-05 15:40:51 +08:00
Chao Xu
60604f8818 run hack/update-all 2017-06-22 11:31:03 -07:00