Commit Graph

372 Commits (55f7b9b9b16c6c607584a6533bfc71779bd37768)

Author SHA1 Message Date
Yu-Ju Hong 55f7b9b9b1 Adapt most CommandRunner tests to use FakeRuntime 2015-06-02 15:03:38 -07:00
Yu-Ju Hong b3197bb49b Switch more tests from newTestKubelet to newTestKubeletWithFakeRuntime 2015-06-02 15:03:38 -07:00
Yu-Ju Hong d4034f9c43 Move more docker-specific tests to dockertools/manager_test.go 2015-06-02 15:03:33 -07:00
Filip Grzadkowski 98115facfd Revert "Gracefully delete pods from the Kubelet" 2015-06-02 23:40:05 +02:00
Brian Grant 0a28edf6e7 Merge pull request #8698 from vmarmol/with-limits
Reserve node resources for node services
2015-06-02 13:05:29 -07:00
Clayton Coleman 72ee028cab Gracefully delete pods from the Kubelet
This commit wires together the graceful delete option for pods
on the Kubelet.  When a pod is deleted on the API server, a
grace period is calculated that is based on the
Pod.Spec.TerminationGracePeriodInSeconds, the user's provided grace
period, or a default.  The grace period can only shrink once set.
The value provided by the user (or the default) is set onto metadata
as DeletionGracePeriod.

When the Kubelet sees a pod with DeletionTimestamp set, it uses the
value of ObjectMeta.GracePeriodSeconds as the grace period
sent to Docker.  When updating status, if the pod has DeletionTimestamp
set and all containers are terminated, the Kubelet will update the
status one last time and then invoke Delete(pod, grace: 0) to
clean up the pod immediately.
2015-06-01 19:23:59 -04: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
Chao Xu 2f6e5e2e08 Update ContainerState.Termination to ContainerState.Terminated in pkg/api/types.go and pkg/api/v1/types.go 2015-05-28 17:18:24 -07:00
Tim Hockin 4318ca5a8b Rename 'portal IP' to 'cluster IP' most everywhere
This covers obvious transforms, but not --portal_net, $PORTAL_NET and
similar.
2015-05-28 16:10:44 -07:00
Tim Hockin 081ab3abac Merge pull request #8853 from caesarxuchao/HostToNodeName
update PodSpec.Host to PodSpec.NodeName
2015-05-28 15:50:12 -07:00
Tim Hockin 3830c068b9 Merge pull request #8883 from yujuhong/kubelet_unittest2
Kubelet: clean up more unit tests
2015-05-28 15:00:02 -07:00
Chao Xu 9c1153322e update PodSpec.Host to PodSpec.NodeName in /pkg/api/types.go and /pkg/api/v1beta3/types.go 2015-05-28 14:10:06 -07:00
Daniel Smith ddcd2c89de remove RO port from kubelet test 2015-05-27 13:46:32 -07:00
Yu-Ju Hong d9339fedbe Modify more tests to use FakeRuntime in kubelet_test.go 2015-05-27 13:01:45 -07:00
Yu-Ju Hong 697312bcd7 Migrate more docker-specific tests to dockertools/manager_test.go 2015-05-27 12:42:59 -07:00
Yu-Ju Hong 044894665d Delete TestSyncPodsDeletes in kubelet_test.go
This test verifies that kubelet doesn't kill non-kubelet-managed containers.
This is obsolete now since container runtime provides only the KillPod
function, and has no support for killing a container.
2015-05-27 10:02:52 -07:00
Yu-Ju Hong ef5bef914f Kubelet: switch cadvisor-related unit tests to use FakeRuntime 2015-05-27 09:58:50 -07:00
Paul Morie 8b338860aa Make kubelet expand var refs in cmd, args, env 2015-05-27 00:13:57 -04:00
Yu-Ju Hong 9a71fb9373 Kubelet: clean up kubelet_test.go
* Start using FakeRuntime to replace FakeDockerClient in unit tests.
 * Move and adapt docker-specific tests (e.g. creating/deleting infra
   containers) to manager_test.go in dockertools.
2015-05-26 17:11:24 -07:00
Robert Bailey 3302628db3 Fix kubelet tests for systems without functional dns to look up localhost. 2015-05-22 14:32:51 -07:00
Dawn Chen 677a4aa1a7 Merge pull request #8164 from cjcullen/cloudprovider
Route creation reconciler loop.
2015-05-22 12:27:50 -07:00
Dawn Chen 017fb6a818 Merge pull request #8575 from yifan-gu/kube_refactor
Minor kubelet/rkt refactors
2015-05-21 09:37:31 -07:00
CJ Cullen bf646abf8d Revert "Revert "Modify nodes to register directly with the master.""
This reverts commit c53786ab31.
2015-05-20 14:21:03 -07:00
Quinton Hoole c53786ab31 Revert "Modify nodes to register directly with the master." 2015-05-20 13:47:51 -07:00
Yifan Gu 6a5681e0fe kubelet: Move HashContainer to kubelet/container package. 2015-05-20 12:08:32 -07:00
Robert Bailey 01467e0bb8 Modify nodes to register directly with the master.
- Delete nodes when they are no longer ready and don't exist in the
cloud provider.
 - Label each node with it's hostname.
 - Add flag to skip node registration.
 - Add a test for registering an existing node.
2015-05-19 09:55:07 -07:00
Brian Grant 2c81050e6f Merge pull request #8457 from davidopp/master
Fix stylistic isues with #5547. Closes #4910.
2015-05-19 07:43:21 -07:00
David Oppenheimer 44b1e1ca0c Fix stylistic isues with #5547. Closes #4910. 2015-05-18 23:32:06 -07:00
Victor Marmol c5da035d51 Merge pull request #8421 from yujuhong/active_deadline
Kubelet: move active deadline check to per pod worker
2015-05-18 17:42:21 -07:00
Yu-Ju Hong 2bf0646c76 Kubelet: do not remove directories of terminated pods
We recently changed `SyncPods` to filter out terminated pods at the beginning
for two reasons:

 * performance: kubelet no longer keeps goroutines to checks containers for
   terminated pods.
 * correctness: kubelet relies on inspecting dead containers to generate
   pod status. Because dead containers may get garbage collected and
   kubelet does not have checkpoints yet, syncing terminated pod could
   lead to modifying the status of a terminated pod.

However, even though kubelet should not *sync* the terminated pods, it
should not attempt to remove the directories and volumes for such
pods as long as they have not been deleted. This change fixes aggresive
directory removal by passing all pods (including terminated pods) to the
cleanup functions.
2015-05-18 13:23:49 -07:00
Victor Marmol 45874d5f76 Merge pull request #5547 from gmarek/client3
Add a resource specifying number of Pods that are allowed to run on Kubelet.
2015-05-18 11:11:43 -07:00
Yu-Ju Hong 050b8ba60b Kubelet: move active deadline check to per pod worker
Per-pod workers have sufficient knowledge to determine whether a pod has
exceeded the active deadline, and they set the status at the end of each sync.
Move the active deadline check to generatePodStatus so that per pod workers
can update the pod status directly. This eliminates the possibility of a race
condition where both SyncPods and the pod worker are updating the status, which
could lead to temporary erratic pod status behavior (pod phase: failed ->
running -> failed).
2015-05-18 10:52:41 -07:00
Yu-Ju Hong 25668ccc11 Kubelet: remove the getPodstatus method
Pod statuses are periodically writtien to the status manager, and status
manager sets the start time of the pod. All non-status-modifying code should
perform cache lookup and should not attempt to generate pod status on its own.
2015-05-18 10:52:36 -07:00
derekwaynecarr 8216332611 Kubelet kills a pod that exceeds ActiveDeadlineSeconds 2015-05-15 16:33:37 -04:00
gmarek 27d660d0ac Add a resource specifying number of Pods that are allowed to run on Kubelet. 2015-05-15 10:57:46 +02:00
Yu-Ju Hong 4b40db3367 Remove /podInfo endpoint on kubelet
Kubelet sends pod status updates to the API server now. This endpoint is no
longer needed.
2015-05-14 17:51:26 -07:00
Victor Marmol 67eab52b9e Merge pull request #8146 from yifan-gu/runtime_opt
kubelet/container: Refactor RunContainerOptions.
2015-05-13 11:09:56 -07:00
Yifan Gu 2617cb26b8 kubelet/container: Add tests for kubelet.makePortMappings(). 2015-05-13 10:01:01 -07:00
Yifan Gu d164ac0ba0 kubelet/container: Refactor RunContainerOptions.
Make Envs, Mounts, PortMappings more generic.
Also add default name for PortMapping if it's not specified.
2015-05-13 10:01:00 -07:00
Brendan Burns 3f49c556e6 Second try at implementing prestop. 2015-05-12 17:17:03 -07:00
Victor Marmol 40ec627cd4 Merge pull request #8108 from rjnagal/kubelet
Handle out of disk situation on kubelet.
2015-05-12 15:49:31 -07:00
Paul Morie 6ac55002d8 Improve kubelet test for env vars 2015-05-12 17:14:32 -04:00
Rohit Jnagal 2cf0dfb79d Handle out of disk situation on kubelets.
Kubelet will stop accepting new pods if it detects low disk space on root fs or fs holding docker images.
Running pods are not affected. low-diskspace-threshold-mb is used to configure the low diskspace threshold.
2015-05-12 18:23:09 +00:00
Victor Marmol 43029345f9 Merge pull request #7973 from dchen1107/podstatus
Add kubectl log --previous support to view last terminated container log
2015-05-11 17:08:45 -07:00
Victor Marmol 1465475401 Merge pull request #8079 from yifan-gu/rm_command_runner
kubelet/container: Move prober.ContainerCommandRunner to container.
2015-05-11 16:05:25 -07:00
Yifan Gu 7831b7da72 kubelet/container: Move prober.ContainerCommandRunner to container.
Also include the ContainerCommandRunner in Runtime interface, but
still keep the ContainerCommandRunner interface for testability.
2015-05-11 15:32:51 -07:00
Dawn Chen 86479cc56c Add support to pull log for last terminated container 2015-05-11 12:54:04 -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
Deyuan Deng 2f7183cba5 Check Pod privileged container 2015-05-09 17:30:35 -04:00
Yu-Ju Hong d185bfd56a Record failure reason for image pulling 2015-05-08 17:37:11 -07:00