Commit Graph

72 Commits (0867e250c630e46a92e7d9fa8620ff45beb5d03d)

Author SHA1 Message Date
Tim St. Clair 7b6d843309 Move test-only files to test-only packages 2016-03-01 09:11:32 -08:00
Random-Liu 41b12a18d9 Remove GetAPIPodStatus usage 2016-02-02 23:41:55 +00:00
Fabio Yeon 7205a160ac Remove all instances of "/tmp" from unit tests and replace with a common
tmp directory creator. Exception is documented.
2016-01-27 16:11:22 -08:00
Yu-Ju Hong 712612c2dc Treat first-seen, non-pending pods as updates
Kubelet doesn't perform checkpointing and loses all its internal states after
restarts. It'd then mistaken pods from the api server as new pods and attempt
to go through the admission process. This may result in pods being rejected
even though they are running on the node (e.g., out of disk situation). This
change adds a condition to check whether the pod was seen before and categorize
such pods as updates. The change also removes freeze/unfreeze mechanism used to
work around such cases, since it is no longer needed and it stopped working
correctly ever since we switched to incremental updates.
2016-01-08 17:21:43 -08:00
jiangyaoguo f4c5d00b0c Implement a cachedNodeInfo in predicates 2015-11-27 21:49:14 +08:00
Vishnu kannan 4ad3d6f5fe Move container manager into a separate package.
Inject container manager into Kubelet. This lets us stub out container
manager during integration testing.
2015-11-11 15:00:37 -08:00
Tim St. Clair 858126b42a Clean up static/mirror pod status logic
- status.Manager always deals with the local (static) pod, but gets the
  mirror pod when syncing
  - This lets components like the probe workers ignore mirror pods
2015-11-04 11:42:25 -08:00
k8s-merge-robot c4779fbc4f Merge pull request #15475 from jijun2/fix-cni_test
Auto commit by PR queue bot
2015-10-20 01:30:24 -07:00
eulerzgy 31c09bdcb8 Del capatical local packagename for cadvisorApi 2015-10-16 11:03:50 +08:00
jijun2 bf6e8cbff7 test: using ioutil.TempDir in unit tests per #15176
update

update mode

delete /tmp

update

use ioutil.TempDir instead of static tmp dir

use ioutil.TempDir instead of static tmp dir
2015-10-16 09:21:46 +08:00
Yu-Ju Hong 2c76c55bb9 kubelet: move PodManager and MirrorClient to a subpackage
This change moves pod_manager.go and mirror_client.go to a separate package.
Also made necessary, minor changes to facilitate testing.
2015-10-12 16:34:18 -07:00
Tim St. Clair 52ece0c34e Refactor readiness probing
Each container with a readiness has an individual go-routine which
handles periodic probing for that container. The results are cached, and
written to the status.Manager in the pod sync path.
2015-10-02 15:37:10 -07:00
Vishnu kannan 77be271ed0 Linux container manager initialization will now fail if cpu and memory cgroups are not mounted. 2015-09-24 15:34:42 -07:00
Yu-Ju Hong 8319a5c822 Replace testDocker with container.fakeRuntime in runonce_test
runonce_test should not be testing docker-specific logic.
2015-09-23 09:24:51 -07:00
Yu-Ju Hong 7bdf9bfdfa Revert "Move and fix nodeManager related unit tests"
This reverts commit 865dc19957.
2015-09-21 10:58:54 -07:00
Yu-Ju Hong 865dc19957 Move and fix nodeManager related unit tests 2015-09-16 17:41:40 -07:00
k8s-merge-robot f6fb0a58b6 Merge pull request #13874 from timstclair/status-manager
Auto commit by PR queue bot
2015-09-16 00:46:01 -07:00
Mikaël Cluseau b76abf10cc hairpin: fix tests 2015-09-12 08:43:45 +11:00
Tim St. Clair 1f91fffb57 Move kubelet.statusManager to status.Manager
This refactor is in preparation for moving more state handling to the
status manager. It will become the canonical cache for the latest
information on running containers and probe status, as part of the
prober refactoring.
2015-09-11 12:22:01 -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
Yifan Gu d70a30c069 kubelet: refactor kubelet.Runtimehooks to container.ImagePuller. 2015-08-12 16:28:25 -07:00
Ananya Kumar 6ef3de1d5f Add QoS support on node 2015-08-07 11:18:16 -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
Dawn Chen ca95eb75e9 Configured resource-only container /docker-daemon with 70% of node memory
capacity. This is a workaround to docker memory leakage issue.
2015-06-17 11:40:30 -07:00
Victor Marmol 7283e662b5 Introduce SystemContainer to Kubelet ContainerManager.
This generalizes the handling of containers in the
ContainerManager.

Also introduces the ability to determine how much
resources are reserved for those system containers.
2015-05-29 17:32:34 -07:00
Yifan Gu 6a5681e0fe kubelet: Move HashContainer to kubelet/container package. 2015-05-20 12:08:32 -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
Victor Marmol 3b9eba2c1b Add SyncPod() to DockerManager and use in Kubelet.
This allows us to abstract away the logic of syncing a pod by the
runtime. It will allow other runtimes to perform their own sync as well.
2015-05-01 11:03:08 -07:00
Victor Marmol 2a01a2c7e9 Use RuntimeHooks in Kubelet.
Used in functionality that will be moved to the runtimes.
2015-04-29 17:06:49 -07:00
Victor Marmol fe4600ba17 Move ComputePodChanges to DockerManager.
This logic is specific to the Docker runtime. This move is the first
step towards making syncPod() runtime-agnostic.
2015-04-29 14:00:37 -07:00
Yu-Ju Hong 33b8f487f6 Merge pull request #7449 from vmarmol/runtime-network-plugins
Move network plugin TearDown to DockerManager
2015-04-29 10:09:58 -07:00
Yifan Gu c848fa447d kubelet: Refactor isPodRunning() in runonce.go
Replace InspectContainer() with generic GetPodStatus().
2015-04-28 17:44:13 -07:00
Victor Marmol 787d42d50b Move network plugin teardown to DockerManager.
This teardown is Docker-specific and will let us also do the setup in
the manager in future cleanups.
2015-04-28 16:58:54 -07:00
Victor Marmol 7404b7019c Move Docker-specific log handling to DockerManager.
Eases the separation of Docker-specific code into the Docker-specific
runtime.
2015-04-27 13:10:10 -07:00
Yifan Gu e8d485a3a1 kubelet/dockertools: Add readinessManage/containerRefManager to dockerManager.
This can enable us to move KillContainer() to container runtime.
2015-04-23 14:20:34 -07:00
Yifan Gu af1e9f737f kubelet: Introduce volume manager.
The volume manager book-keeps the information for the volume mounts
on the kubelet, so we can avoid passing the volumeMap around.
2015-04-23 10:37:02 -07:00
Satnam Singh 2444c1f943 Propagate pod and container name for log files 2015-04-22 15:08:51 -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 b868f421e0 kubelet: Move pod infra container image setting to dockertools. 2015-04-09 09:53:07 -07:00
Yifan Gu ddf323ee00 kubelet: Remove GetRecentDockerContainersWithNameAndUUID().
Always call GetPodStatus().
2015-04-08 09:44:23 -07:00
Yifan Gu 6103b144e0 kubelet: Remove GetRecentDockerContainersWithNameAndUUID().
Use the pod status to get the recent stopped containers in
shouldContainerBeRestarted().
2015-04-08 09:44:23 -07:00
Quinton Hoole c670071e87 Revert "kubelet: Remove GetRecentDockerContainersWithNameAndUUID." 2015-04-07 14:25:10 -07:00
Yifan Gu a8c02412b2 kubelet: Remove GetRecentDockerContainersWithNameAndUUID().
Use the pod status to get the recent stopped containers in
shouldContainerBeRestarted().
2015-04-06 12:43:49 -07:00
Yu-Ju Hong d01bc660b5 Kubelet: a step towards to better encapsulation of docker functions
We want to stop leaking more docker details into kubelet, and we also want to
consolidate some of the existing docker interfaces/structs. This change creates
DockerManager as the new home of some functions in dockertools/docker.go. It
also absorbs containerRunner. In addition, GetDockerPodStatus is renamed to
GetPodStatus with the entire pod passed to it so that it is simialr to the what
is defined in the container Runtime interface.

Eventually, DockerManager should implement the container Runtime interface, and
integrate DockerCache with a flag to turn on/off caching. Code in kubelet.go
should not be using docker client directly.
2015-04-02 13:26:39 -07:00
Paul Morie 7628b37d78 Add control over container entrypoint 2015-03-31 12:32:03 -04:00