Commit Graph

61 Commits (a0932c33347aae7d5d9e0a87b652a11df5cce911)

Author SHA1 Message Date
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
Krzysztof Jastrzebski ad330f7dbe Start synchronizing pods after network is ready. 2018-09-21 10:12:49 +02:00
Lantao Liu 0f4c739b2c Fix pod worker deadlock.
Signed-off-by: Lantao Liu <lantaol@google.com>
2018-07-09 11:45:26 -07:00
yue9944882 9ecc0b2bd2 fixes document grammar 2018-02-20 10:38:41 -05:00
Derek Carr 54224600ec kubelet syncPod throws specific events 2017-10-13 10:24:09 -04: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
Derek Carr a02f10fa3a Strip containerID from events to reduce spam 2017-06-13 23:31:56 -04:00
David Ashpole 6daa2f2ef3 increase timeout 2017-02-27 10:59:24 -08:00
deads2k 8a12000402 move client/record 2017-01-31 19:14:13 -05:00
Michal Fojtik 34db84efe2
Report the Pod name and namespace when kubelet fails to sync the container 2017-01-16 16:44:56 +01:00
deads2k 6a4d5cd7cc start the apimachinery repo 2017-01-11 09:09:48 -05:00
Kubernetes Submit Queue fe391d7bb0 Merge pull request #37350 from chentao1596/delete-meaningless-judgments
Automatic merge from submit-queue (batch tested with PRs 39280, 37350, 39389, 39390, 39313)

delete meaningless judgments

What this PR does / why we need it:
      Whether "err" is nil or not, "err" can be return, so the judgment "err !=nil " is unnecessary
2017-01-03 18:25:10 -08:00
Chao Xu 5e1adf91df cmd/kubelet 2016-11-23 15:53:09 -08:00
chentao1596 6d4341b3ff delete meaningless judgments 2016-11-23 15:20:11 +08:00
derekwaynecarr ff017839c7 Log an event when container runtime exceeds grace-period during eviction 2016-09-07 13:28:08 -04:00
Andrey Kurilin 9f1c3a4c56 Fix various typos in kubelet 2016-08-03 01:14:44 +03:00
Ron Lai e6b745122d Moving event.go from kubelet/container to kubelet/events 2016-07-12 17:42:29 -07:00
David McMahon ef0c9f0c5b Remove "All rights reserved" from all the headers. 2016-06-29 17:47:36 -07:00
derekwaynecarr 6fefb428c1 Add killPodNow to kubelet 2016-05-12 19:17:08 -04:00
Jan Chaloupka 392fc6668f Jittering periods of some kubelet's sync loops:
- pod_workers: pod syncing
- prober workers: container syncing

In order to synchronize the current state of Kubernetes's objects (e.g. pods, containers, etc.),
periodic synch loops are run. When there is a lot of objects to synchronize with,
loops increase communication traffic. At some point when all the traffic interfere cpu usage curve
hits the roof causing 100% cpu utilization.

To distribute the traffic in time, some sync loops can jitter their period in each loop
and help to flatten the curve.
2016-02-09 15:22:22 +01:00
Yu-Ju Hong ff04de4fc0 Remove RuntimeCache from sync path
This change removes RuntimeCache in the pod workers and the syncPod() function.
Note that it doesn't deprecate RuntimeCache completely as other components
still rely on the cache.
2016-02-01 21:32:41 -08:00
harry 1032067ff9 Replace runtime reference by pkg 2016-02-01 21:06:44 +08:00
Yu-Ju Hong cfb5442b2d Turn on kubecontainer.Cache in kubelet 2016-01-19 18:15:10 -08:00
Piotr Szczesniak 9659057986 Revert "Enable kubecontainer.Cache in kubelet" 2016-01-18 13:35:41 +01:00
Yu-Ju Hong 07cf5cff48 Enable kubecontainer.Cache in kubelet 2016-01-14 09:31:24 -08:00
Avesh Agarwal 3d5207fd73 This commit adds type information to events.
This addresses issue #15624.
2015-11-24 09:59:54 -05:00
jiangyaoguo b0f0c294d9 make reasons constants with clarity 2015-11-09 23:42:14 +08:00
Yu-Ju Hong 2eb17df46b kubelet: independent pod syncs and backoff on error
Currently kubelet syncs all pods every 10s. This is not preferred because
 * Some pods may have been sync'd recently.
 * This may cause all the pods to be sync'd at once, causing undesirable
   CPU spikes.

This PR replaces the global syncs with independent, periodic pod syncs. At the
end of syncing, each pod worker will enqueue itslef with a future timestamp (
current time + sync interval), when it will be due for another sync.
 * If the pod worker encoutners an sync error, it may requeue with a different
   timestamp to retry sooner.
 * If a sync is triggered by the update channel (events or spec changes), the
   pod worker would enqueue a new sync time.

This change is necessary for moving to long or no periodic sync period once pod
lifecycle event generator is completed. We will still rely on the mechanism to
requeue the pod on sync error.

This change also makes sure that if a sync does not succeed (either due to
real error or the per-container backoff mechanism), an error would be propagated
back to the pod worker, which is responsible for requeuing.
2015-11-03 13:29:08 -08:00
Yu-Ju Hong a3e60cc32e Rename imported package local name kubeletTypes to kubetypes
According to the naming guidelines, package name should not include mixedCaps.
2015-10-09 10:24:31 -07:00
Yu-Ju Hong 098ab05997 kubelet: move common types to kubelet/types
This would faciliate tasks such as moving code in pkg/kubelet to sub packages.
2015-10-08 14:38:01 -07:00
Yu-Ju Hong 889e798ddb kubelet: pipe SyncPodType to pod workers
Now that kubelet has switched to incremental updates, it has complete
information of the pod update type (create, update, sync). This change pipes
this information to pod workers so that they don't have to derive the type
again.
2015-10-01 16:29:46 -07:00
Daniel Smith 15b30b8b09 Move version agnostic parts of client
pkg/client/unversioned/cache -> pkg/client/cache
pkg/client/unversioned/record -> pkg/client/record
2015-09-10 17:17:59 -07:00
Yu-Ju Hong b906e34576 kubelet: trigger pod workers independently
Currently, whenever there is any update, kubelet would force all pod workers to
sync again, causing resource contention and hence performance degradation.

This commit flips kubelet to use incremental updates (as opposed to snapshots).
This allows us to know what pods have changed and send updates to those pod
workers only. The `SyncPods` function has been replaced with individual
handlers, each handling an operation (ADD, REMOVE, UPDATE). Pod workers are
still triggered periodically, and kubelet performs periodic cleanup as well.

This commit also spawns a new goroutine solely responsible for killing pods.
This is necessary because pod killing could hold up the sync loop for
indefinitely long amount of time now user can define the graceful termination
period in the container spec.
2015-08-25 17:52:01 -07:00
Kris Rousey ae6c64d9bb Moving everyone to unversioned client 2015-08-18 10:23:03 -07:00
jiangyaoguo 9ab4a46b9d Keep event reason in kubelet consistent with others 2015-08-12 19:00:09 +08:00
Mike Danese 17defc7383 run gofmt on everything we touched 2015-08-05 17:52:56 -07:00
Mike Danese 8e33cbfa28 rewrite go imports 2015-08-05 17:30:03 -07:00
Prashanth Balasubramanian b5ed0e9b13 Dont generatePodStatus twice for new pods 2015-06-11 17:18:16 -07:00
Yu-Ju Hong 8b3130b112 Merge pull request #7980 from yifan-gu/fix_kubelet_tests
kubelet: Fix racy kubelet tests.
2015-05-11 14:09:44 -07:00
Yifan Gu 52af792852 kubelet: Fix racy kubelet tests.
Add fakePodWorkders to run syncPod() in serial for testing.
2015-05-11 12:50:33 -07:00
Yu-Ju Hong 3599d81ef1 Remove some docker references 2015-05-11 11:03:47 -07:00
Eric Paris 6b3a6e6b98 Make copyright ownership statement generic
Instead of saying "Google Inc." (which is not always correct) say "The
Kubernetes Authors", which is generic.
2015-05-01 17:49:56 -04:00
Yifan Gu e1feed9a8b kubelet/container: Replace DockerCache with RuntimeCache. 2015-04-13 18:16:05 -07:00
Yu-Ju Hong b4b0bc75c4 Kubelet: pass the acutal pod for status update
Pod status update should include the ObjectMeta of the pod. This change is
required for #5738 to merge.
2015-03-25 09:58:46 -07:00
Yifan Gu 13250c904f kubelet: Replace GetKubeletDockerContainers with GetPods in syncPod/SyncPods. 2015-03-24 16:01:38 -07:00
Filip Grzadkowski 1a352b74ba Periodically update pod status from kubelet. 2015-03-18 12:11:39 +01:00
Yu-Ju Hong 929fb63b33 Sync static pods from Kubelet to the API server
Currently, API server is not aware of the static pods (manifests from
sources other than the API server, e.g. file and http) at all. This is
inconvenient since users cannot check the static pods through kubectl.
It is also sub-optimal because scheduler is unaware of the resource
consumption by these static pods on the node.

This change syncs the information back to the API server by creating a
mirror pod via API server for each static pod.

 - Kubelet creates containers for the static pod, as it would do
   normally.

 - If a mirror pod gets deleted, Kubelet will re-create one. The
   containers are sync'd to the static pods, so they will not be
   affected.

 - If a static pod gets removed from the source (e.g. manifest file
   removed from the directory), the orphaned mirror pod will be deleted.

Note that because events are associated with UID, and the mirror pod has
a different UID than the original static pod, the events will not be
shown for the mirror pod when running `kubectl describe pod
<mirror_pod>`.
2015-03-17 08:45:56 -07:00
Filip Grzadkowski 18b728ff44 Revert "Periodically update pod status from kubelet." 2015-03-17 13:51:45 +01:00
Filip Grzadkowski 336525a27d Periodically update pod status from kubelet. 2015-03-16 23:03:03 +01:00