Commit Graph

75 Commits

Author SHA1 Message Date
Jun Gong
454f9acc24 Remove unuseful error message about updating pod conditions not owned by kubelet 2020-07-24 09:56:03 +08: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
Mike Danese
76f8594378 more artisanal fixes
Most of these could have been refactored automatically but it wouldn't
have been uglier. The unsophisticated tooling left lots of unnecessary
struct -> pointer -> struct transitions.
2020-03-05 14:59:47 -08:00
Clayton Coleman
8bc5cb01a9
kubelet: Clear the podStatusChannel before invoking syncBatch
The status manager syncBatch() method processes the current state
of the cache, which should include all entries in the channel. Flush
the channel before we call a batch to avoid unnecessary work and
to unblock pod workers when the node is congested.

Discovered while investigating long shutdown intervals on the node
where the status channel stayed full for tens of seconds.

Add a for loop around the select statement to avoid unnecessary
invocations of the wait.Forever closure each time.
2020-03-04 13:34:25 -05:00
Clayton Coleman
ad3d8949f0
kubelet: Preserve existing container status when pod terminated
The kubelet must not allow a container that was reported failed in a
restartPolicy=Never pod to be reported to the apiserver as success.
If a client deletes a restartPolicy=Never pod, the dispatchWork and
status manager race to update the container status. When dispatchWork
(specifically podIsTerminated) returns true, it means all containers
are stopped, which means status in the container is accurate. However,
the TerminatePod method then clears this status. This results in a
pod that has been reported with status.phase=Failed getting reset to
status.phase.Succeeded, which is a violation of the guarantees around
terminal phase.

Ensure the Kubelet never reports that a container succeeded when it
hasn't run or been executed by guarding the terminate pod loop from
ever reporting 0 in the absence of container status.
2020-03-04 13:34:24 -05:00
Clayton Coleman
b252865479
kubelet: Avoid sending no-op patches
In an e2e run, out of 1857 pod status updates executed by the
Kubelet 453 (25%) were no-ops - they only contained the UID of
the pod and no status changes. If the patch is a no-op we can
avoid invoking the server and continue.
2020-02-26 23:06:38 -05:00
Kubernetes Prow Robot
dde6e8e746 Merge pull request #87858 from smarterclayton/different_type
kubelet: Debug pod status output diff is wrong
2020-02-08 06:44:06 -08:00
Mike Danese
3aa59f7f30 generated: run refactor 2020-02-07 18:16:47 -08:00
Clayton Coleman
aed4d639a5
kubelet: Debug pod status output diff is wrong
The types were different so the diff output is not useful, both
should be pointers:

```
Feb 05 19:44:40 ci-ln-6k7l4-w-c-w9wbb.c.openshift-gce-devel-ci.internal hyperkube[2737]: I0205 19:44:40.222259    2737 status_manager.go:642] Pod status is inconsistent with cached status for pod "prometheus-k8s-1_openshift-monitoring(0e9137b8-3bd2-4353-b7f5-672749106dc1)", a reconciliation should be triggered:
Feb 05 19:44:40 ci-ln-6k7l4-w-c-w9wbb.c.openshift-gce-devel-ci.internal hyperkube[2737]:    interface{}(
Feb 05 19:44:40 ci-ln-6k7l4-w-c-w9wbb.c.openshift-gce-devel-ci.internal hyperkube[2737]: -         s"&PodStatus{Phase:Running,Conditions:[]PodCondition{PodCondition{Type:Initialized,Status:True,LastProbeTime:0001-01-01 00:00:00 +0000 UTC,LastTransitionTime:2020-02-05 19:13:30 +0000 UTC,Reason:,Message:,},PodCondit>
Feb 05 19:44:40 ci-ln-6k7l4-w-c-w9wbb.c.openshift-gce-devel-ci.internal hyperkube[2737]: +         v1.PodStatus{
Feb 05 19:44:40 ci-ln-6k7l4-w-c-w9wbb.c.openshift-gce-devel-ci.internal hyperkube[2737]: +                 Phase: "Running",
Feb 05 19:44:40 ci-ln-6k7l4-w-c-w9wbb.c.openshift-gce-devel-ci.internal hyperkube[2737]: +                 Conditions: []v1.PodCondition{
```
2020-02-05 14:52:46 -05:00
Jordan Liggitt
a65d8aeb76 Add UID precondition to kubelet pod status patch updates 2019-12-16 14:27:32 -05:00
Kubernetes Prow Robot
72cd1c14ef
Merge pull request #83325 from yutedz/static-mirror-pod
Check whether mirror pod is ciritical in managerImpl#evictPod
2019-10-07 22:15:40 -07:00
Ted Yu
0939f90103 Check whether mirror pod is ciritical in managerImpl#evictPod 2019-10-01 11:12:18 -07:00
Uzuku
5a2e6bd000 Fix golint failures of pkg/kubelet/status/... 2019-09-21 23:43:37 +08:00
Kubernetes Prow Robot
3f4e30a80e
Merge pull request #82113 from kebe7jun/fix/log-format-and-typo
Fix sync pod log format
2019-09-11 10:39:14 -07:00
Matthias Bertschy
323f99ea8c startupProbe: Kubelet changes 2019-08-30 00:40:26 +02:00
KEBE
8dc401d141 Fix sync pod log format and a func typo. 2019-08-29 14:39:43 +08:00
Tim Allclair
6510d26b6a Fix misc static check issues 2019-08-21 10:40:21 -07:00
Himanshu Pandey
c05d506019 changed IsCriticalPod to return true in case of static pods 2019-08-07 15:47:43 -07:00
Mike Brown
7b6bb58f3a update code docs around old todo that is not going to happen
Signed-off-by: Mike Brown <brownwm@us.ibm.com>
2019-07-08 09:24:50 -05:00
Minhan Xia
47bc948fe3 reconcile pod ready condition when message is not expected 2019-03-20 14:05:40 -07:00
Pingan2017
fddaf257af correct the type in status_manager.go 2019-01-25 14:34:11 +08:00
Pingan2017
1148ecfaf6 correctly update pod ready condition 2018-12-25 09:36:37 +08: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
Di Xu
8285a26589 add missing LastTransitionTime of ContainerReady condition 2018-06-07 14:51:14 +08:00
Minhan Xia
370268f123 Inject ContainersReady 2018-06-05 11:10:38 -07:00
Minhan Xia
ac4e015e12 trigger kubelet sync pod on reconciliation 2018-06-04 12:17:04 -07:00
Minhan Xia
35777c31ea change kubelet status manager to use patch instead of put to update pod status 2018-05-30 11:15:47 -07:00
Lantao Liu
19a1bd8b99 Fix PodScheduled bug for static pod.
Signed-off-by: Lantao Liu <lantaol@google.com>
2018-03-22 01:04:08 +00:00
Joel Smith
5f6c022737 Prevent successful containers from restarting with OnFailure restart policy 2017-10-27 10:08:09 -06:00
Kevin
4c8539cece use core client with explicit version globally 2017-10-27 15:48:32 +08:00
Seth Jennings
449fc027d9 check for illegal container state transition 2017-10-25 23:06:35 -05:00
Dr. Stefan Schimanski
ed586da147 apimachinery: remove Scheme.DeepCopy 2017-10-06 14:59:17 +02:00
xiangpengzhao
8719b4a8ea Remove deprecated init-container in annotations 2017-08-25 13:39:29 +08:00
Ebbe Elsborg
a286f25ff4 Typed static/mirror pod UID translation 2017-08-14 14:51:26 +02:00
Jacob Simpson
a765b8cfca Migrate api.Scheme to scheme.Scheme 2017-07-17 15:05:38 -07:00
Jacob Simpson
29c1b81d4c Scripted migration from clientset_generated to client-go. 2017-07-17 15:05:37 -07:00
Chao Xu
60604f8818 run hack/update-all 2017-06-22 11:31:03 -07:00
Chao Xu
f4989a45a5 run root-rewrite-v1-..., compile 2017-06-22 10:25:57 -07:00
Yu-Ju Hong
ccfecb1ebd kubelet status manager: short-circut the evaluation if possible
This avoids redundant checks in the `PodResourcesAreReclaimed`, which
also logs misleading "Pod is terminated" messages on every check.
2017-05-30 15:58:40 -07:00
David Ashpole
21fb487245 wait for previous evicted pod to be cleaned up 2017-05-16 14:23:42 -07:00
Andrew Pilloud
b8dca4dd9d Refactor syncPod to fix panics on error 2017-05-04 10:18:24 -07:00
Chao Xu
4f9591b1de move pkg/api/v1/ref.go and pkg/api/v1/resource.go to subpackages. move some functions in resource.go to pkg/api/v1/node and pkg/api/v1/pod 2017-04-17 11:38:11 -07:00
Kubernetes Submit Queue
61f5f842e2 Merge pull request #42662 from wongma7/status
Automatic merge from submit-queue

Print dereferenced pod status fields when logging status update

Before: "Terminated:0xc421932af0"
After:"Terminated:&ContainerStateTerminated{ExitCode:0,Signal:0,Reason:Completed,Message:,StartedAt:0001-01-01 00:00:00 +0000 UTC,FinishedAt:2017-03-07 14:50:48 -0500 EST,ContainerID:docker://bd453bb969264b3ace2b3934a568af7679a0d51fee543a5f8a82429ff654970e,}"

"Ignoring same status for pod" messages already print status fully, these "Status for pod updated" messages should too IMO

```release-note
NONE
```
2017-03-30 10:33:41 -07:00
Kubernetes Submit Queue
6eaa8610a1 Merge pull request #42226 from timchenxiaoyu/reconciletypo
Automatic merge from submit-queue

fix reconcile typo
2017-03-24 10:25:27 -07:00
David Ashpole
e3e0bc6ce0 do not skip pods that can be deleted 2017-03-09 09:35:50 -08:00
Matthew Wong
1dabce9815 Print dereferenced pod status fields when logging status update 2017-03-07 15:00:54 -05:00
timchenxiaoyu
4772931e63 fix reconcile typo 2017-02-28 13:50:25 +08:00
David Ashpole
1d38818326 Revert "Merge pull request #41202 from dashpole/revert-41095-deletion_pod_lifecycle"
This reverts commit ff87d13b2c, reversing
changes made to 46becf2c81.
2017-02-15 08:44:03 -08:00
David Ashpole
c612e09acd use the status we modify, not original 2017-02-14 13:36:20 -08:00
David Ashpole
b224f83c37 Revert "[Kubelet] Delay deletion of pod from the API server until volumes are deleted" 2017-02-09 08:45:18 -08:00