Commit Graph

52 Commits (4103f40fc206cc43c792de1a9652e54961e13cb0)

Author SHA1 Message Date
Chao Xu f4989a45a5 run root-rewrite-v1-..., compile 2017-06-22 10:25:57 -07:00
Chao Xu 5e1adf91df cmd/kubelet 2016-11-23 15:53:09 -08:00
Harry Zhang 64c8d3ad3d Add e2e node test for log path
Update to use pod to check log file
2016-11-08 13:01:25 -05:00
Ke Zhang e48f995987 pods can not admitted should return directly 2016-07-30 11:47:50 +08:00
Kevin Wang 09344c1ffc Optimizing the processing flow of HandlePodAdditions and canAdmitPod methods.
Signed-off-by: Kevin Wang <wang.kanghua@zte.com.cn>

change the note for the canAdmitPod method.

Signed-off-by: Kevin Wang <wang.kanghua@zte.com.cn>

gofmt kubelet.go

Signed-off-by: Kevin Wang <wang.kanghua@zte.com.cn>
2016-07-11 10:34:51 +08:00
David McMahon ef0c9f0c5b Remove "All rights reserved" from all the headers. 2016-06-29 17:47:36 -07:00
Lucas Käldström 2022c44409 kubelet: Use MkdirAll instead of Mkdir 2016-05-22 00:23:18 +03:00
derekwaynecarr 6fefb428c1 Add killPodNow to kubelet 2016-05-12 19:17:08 -04:00
Random-Liu 41b12a18d9 Remove GetAPIPodStatus usage 2016-02-02 23:41:55 +00: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
Random-Liu b2a72ca384 Change my TODO to be the same with others 2015-12-31 00:41:05 -08:00
Random-Liu 6e92ddf9e1 Cleanup pod print in dockertools/manager.go, prober/prober.go and
runonce.go
2015-12-28 14:07:37 -08:00
k8s-merge-robot cb42bd47bb Merge pull request #18027 from roboll/runonce-datadirs
Auto commit by PR queue bot
2015-12-19 19:14:29 -08:00
Yu-Ju Hong c646255579 Replace podFullName with format.Pod() in logging messages 2015-12-07 13:41:52 -08:00
Random-Liu 3cbdf79f8c Change original PodStatus to APIPodStatus, and start using kubelet internal PodStatus in dockertools 2015-12-04 17:37:39 -08:00
rob boll 81b9097a80 kubelet runonce: create data dirs 2015-12-01 14:03:02 -05:00
Abhi Shah 8c7c5ec117 Merge pull request #17307 from zhengguoyong/set_no_public_runonce
Use small letter var definition
2015-11-18 14:50:04 -08:00
zhengguoyong b18a9baacc Use small letter var definition 2015-11-16 12:12:21 +08:00
Alexander Hersh 0584f9ba7a Create mirrorPod in runOnce to update API before syncPod
+ Fix #14992
+ "When deploying a pod using an on-disk kubelet manifest (a la /etc/kubernetes/manifests), it appears that the network plugin setUpPod is notified of the new pod before the apiserver."
2015-11-12 15:35:45 -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 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
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 1ad4dd7803 Kubelet: replace DockerManager with the Runtime interface
This change instructs kubelet to switch to using the Runtime interface. In order
to do it, the change moves the Prober instantiation to DockerManager.

Note that most of the tests in kubelet_test.go needs to be migrated to
dockertools. For now, we use type assertion to convert the Runtime interface to
DockerManager in most tests.
2015-05-04 10:19:46 -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 c848fa447d kubelet: Refactor isPodRunning() in runonce.go
Replace InspectContainer() with generic GetPodStatus().
2015-04-28 17:44:13 -07:00
Kris Rousey 81497f3ed2 Changing the scheduler package to use *api.Pod instead of api.Pod to
avoid unnecessary shallow copies. The change rippled through a lot of
code.
2015-04-17 13:34:31 -07:00
Yifan Gu dda600e45c kubelet/dockertools: Add puller interfaces in the containerManager. 2015-04-13 15:34:22 -07:00
Yifan Gu a3675e08f2 kubelet/dockertool: Move Getpods() to DockerManager. 2015-04-13 14:05:22 -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
Jerzy Szczepkowski 34a8a3a844 Running node selector predicate on kubelet.
Added checking on kubelet if scheduled pods have matching node selector. This is the last step to fix #5207.
2015-03-23 08:21:58 +01:00
Jerzy Szczepkowski 5845f6ad48 Running resource predicate on kubelet.
Added checking on kubelet if scheduled pods do not exceed resources. Related to #5207.
2015-03-19 10:40:10 +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
Wojciech Tyczynski 5d95e9e671 Remove BoundPods from Kubelet 2015-03-16 19:17:21 +01:00
Victor Marmol 2939abb6cb Merge pull request #5383 from wojtek-t/kubelet_test
Speedup pkg/kubelet/runonce_test.go
2015-03-12 10:22:03 -07:00
Victor Marmol f9d2ab6e48 Use time.Sleep() instead of <-time.After(). 2015-03-12 09:25:09 -07:00
Wojciech Tyczynski dca3db0a50 Speedup pkg/kubelet/runonce_test.go 2015-03-12 17:12:04 +01:00
Yu-Ju Hong 3ccdb8db98 kubelet: reject pods on host port conflict
When a host port conflict is detected, kubelet should set the pod status to
fail. The failed status will then be polled by other components at a later time,
which allows replication controller to create a new pod if necessary.

To achieve this, this change stores the pod status information in a status map
upon the detecton of port conflict. GetPodStatus() consults this status map
before attempting to query docker. The entries in the status map will be removed
when the pod is no longer associated with the node.
2015-03-06 10:46:49 -08:00
Paul Morie 02b18edac6 Allow multiple sources to be used with record package 2015-03-05 13:54:29 -05:00
Clayton Coleman bb77a5d15f Rename ID -> Name 2014-10-22 15:00:26 -04:00
Johan Euphrosine 14c3b9d900 runonce: handle inspect error 2014-10-21 13:38:11 -07:00
Johan Euphrosine 6cd0c261b3 runonce: better container state detection 2014-10-21 12:00:51 -07:00
Clayton Coleman 892942af8f Read BoundPods from etcd instead of ContainerManifestList
There are three values that uniquely identify a pod on a host -
the configuration source (etcd, file, http), the pod name, and the
pod namespace. This change ensures that configuration properly
makes those names unique by changing podFullName to contain both
name (currently ID in v1beta1, Name in v1beta3) and namespace.

The Kubelet does not properly handle information requests for
pods not in the default namespace at this time.
2014-10-16 19:29:08 -04:00
Johan Euphrosine 0fc5e68207 runonce: isPodRunning returns no error 2014-10-08 22:34:40 -07:00
Johan Euphrosine dbb2342688 runonce: list kubelet container between each iteration 2014-10-08 22:28:41 -07:00
Johan Euphrosine 14c5fd405d kubelet: only check for container listed in the manifest
also wait 1 retryDelay before polling state after syncing.
2014-10-08 17:49:21 -07:00
Daniel Smith 2d048bc0f2 fix captured loop variable 2014-10-07 13:57:30 -07:00