Commit Graph

491 Commits (ca7c765f0a11d1d32c38a2b90fab4a299215505e)

Author SHA1 Message Date
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
Victor Marmol 35c644a45f Merge pull request #7870 from yifan-gu/rkt_volume
Add volumeGetter to rkt.
2015-05-07 08:58:00 -07:00
Wojciech Tyczynski e26da316dc Set NodeReady=False when docker is dead 2015-05-07 09:30:25 +02:00
Yifan Gu 8715c54bd3 kubelet/container: Move kubelet.volumeMap to container.VolumeMap.
This is a quick fix to solve circular dependency problem when
rkt references volume maps.
2015-05-06 16:50:57 -07:00
Paul Morie e949a623ff Change EnvVarSource.FieldPath -> FieldRef and add example 2015-05-04 18:41:09 -04: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
Yu-Ju Hong b37f23f1eb Add KillContainerInPod in DockerManager
This changes adds one of the functions that DockerManager needs to implement
the Runtime interface.
2015-04-30 16:23:39 -07:00
Yu-Ju Hong 2f7b951140 Remove more docker references in kubelet
This change also renames TrimRuntimePrefixFromImage to TrimRuntimePrefix to
better reflect that the usage is not limited to images (e.g. ID).
2015-04-30 13:16:11 -07:00
Victor Marmol 238b3c6f4e Move lifecycle handlers to its own sub package.
This will allow injecting it into the runtimes.
2015-04-30 08:47:23 -07:00
Yu-Ju Hong baaea11cd5 Merge pull request #7520 from vmarmol/runtime-pull
Add RuntimeHooks to abstract Kubelet logic
2015-04-30 08:33:19 -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
Yu-Ju Hong d81ecc58f8 Adapt pod killing and cleanup for generic container runtime
This change removes docker-specifc code in killUnwantedPods. It
also instructs the cleanup code to move away from interacting with
containers directly. They should always deal with the pod-level
abstraction if at all possible.
2015-04-29 16:08:09 -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
Victor Marmol f38c607285 Move Prober to its own subpackage.
This will allow it to be reused by the runtimes.
2015-04-29 10:11:28 -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
Dawn Chen aa487b7cab Merge pull request #7382 from vmarmol/rkt-deps
Move Docker-specific log handling to DockerManager.
2015-04-27 15:10:14 -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
Paul Morie 7d30f09ebf Add downward API for environment vars 2015-04-27 14:13:11 -04:00
Yu-Ju Hong b0e6926f67 kubelet: filter out terminated pods in SyncPods
Once a pod reaches a terminated state (whether failed or succeeded), it should
not transit out ever again. Currently, kubelet relies on examining the dead
containers to verify that the container has already been run. This is fine
in most cases, but if the dead containers were garbage collected, kubelet may
falsely concluded that the pod has never been run. It would then try to restart
all the containers.

This change eliminates most of such possibilities by pre-filtering out the pods
in the final states before sending updates to per-pod workers.
2015-04-24 15:28:03 -07:00
Yifan Gu b5a1b32aa4 kubelet/dockertools: Move RunContainer into container runtime.
Also removed ContainerRunner interface.
2015-04-23 16:40:37 -07:00
Yifan Gu 6ed27d06f7 kubelet: Move KillContainer to container runtime.
Rename KillContainerID(string) with KillContainer(string).
Delete the old KillContainer(*kubecontainer.Container).
2015-04-23 15:44:00 -07:00
Dawn Chen 6207c518b3 Merge pull request #7254 from yifan-gu/readiness
kubelet/dockertools: Add readinessManage/containerRefManager to dockerManager.
2015-04-23 14:34:43 -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
Dawn Chen f7831dcd93 Merge pull request #7229 from vmarmol/stats
Kubelet: Add /stats/container endpoint for raw containers
2015-04-23 13:43:23 -07:00
Victor Marmol c29d328c55 Kubelet: Add /stats/container endpoint.
This endpoint exposes container stats for all raw containers on the
machine. The addition is backwards compatible.
2015-04-23 10:38:29 -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
Yifan Gu f59013410a kubelet/container: Move Prober/HandlerRunner interface to container/helpers.go
This enables us to pass them to container runtime as parameters.
2015-04-22 11:56:15 -07:00
Victor Marmol 914a6febfb Merge pull request #7010 from yifan-gu/compute
kubelet: Refactor computePodContainerChanges().
2015-04-22 08:05:18 -07:00
Yifan Gu 611fb25926 kubelet: Refactor GetDockerVersion().
Remove GetDockerServerVersion() from DockerContainerCommandRunner interface,
replaced with runtime.Version(). Also added Version type in runtime for version
comparision.
2015-04-21 14:52:08 -07:00
Yifan Gu 5594981340 kubelet: Refactor computePodContainerChanges().
Pull generatePodStatus() and makePodDataDirs() out as they are the
common part for container runtimes.
2015-04-21 13:53:20 -07:00
Victor Marmol 4b9a64bcd8 Merge pull request #7098 from yifan-gu/handler
kubelet: Refactor runHandler().
2015-04-21 08:14:42 -07:00
Yifan Gu c23b83b0ca kubelet: Refactor runHandler().
Use new HandlerRunner type to replace runHandler()
2015-04-20 21:31:11 -07:00
Daniel Smith 462534ca5d Merge pull request #7068 from krousey/api_pod_pointer
Changing  a few more instances of api.Pod to *api.Pod
2015-04-20 17:09:28 -07:00
Kris Rousey 594f514843 Changing a few remaining instances of passing pods around by value. I
avoided changing api.PodList.Items to []*api.Pod.
2015-04-20 15:26:45 -07:00
Brendan Burns 01b891770f Merge pull request #7054 from ncdc/dockerclient-version
Use go-dockerclient's APIVersion
2015-04-20 14:20:57 -07:00
Andy Goldstein a0a80ea76e Use go-dockerclient's APIVersion
Use go-dockerclient's APIVersion to check the minimum required Docker
version, as it contains methods for parsing the ApiVersion response from
the Docker daemon and for comparing 2 APIVersion objects.
2015-04-20 13:48:18 -04:00
Yifan Gu 1d58992df7 kubelet: Refactor prober.
Decompose the health check prober from the kubelet.
2015-04-17 15:54:28 -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
Victor Marmol 54406a5b7c Merge pull request #6794 from yujuhong/restart_counts
Kubelet: persist restart count of a container
2015-04-14 16:01:49 -07:00
Yu-Ju Hong fd34441d2d Kubelet: persist restart count of a container
Currently, restart count are generated by examine dead docker containers, which
are subject to background garbage collection. Therefore, the restart count is
capped at 5 and can decrement if GC happens.

This change leverages the container statuses recorded in the pod status as a
reference point. If a container finished after the last observation, restart
count is incremented on top of the last observed count. If container is created
after last observation, but GC'd before the current observation time, kubelet
would not be aware of the existence of such a container, and would not increase
the restart count accordingly. However, the chance of this should be low, given
that pod statuses are reported frequently. Also, the restart cound would still
be increasing monotonically (with the exception of container insepct error).
2015-04-14 15:06:42 -07:00
Victor Marmol ca9e209ccb Merge pull request #6795 from yifan-gu/cache
kubelet/container: Replace DockerCache with RuntimeCache.
2015-04-14 09:37:34 -07:00
Yifan Gu e1feed9a8b kubelet/container: Replace DockerCache with RuntimeCache. 2015-04-13 18:16:05 -07:00
Yifan Gu 4cdb1bf9ce kubelet: Introduce PodInfraContainerChanged().
Update tests.
2015-04-13 16:18:52 -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 bb417e82d7 Kubelet: surface the container creation/start failure reason
Container creation/start failure cannot be reproduced by inspecting the
containers. This change caches such errors so that kubelet can retrieve it
later.

This change also extends FakeDockerClient to support setting error response
for a specific function.
2015-04-10 16:02:27 -07:00
Victor Marmol 1563a7636a Merge pull request #6652 from dchen1107/podstatus
Populate last terminated container information
2015-04-10 09:21:58 -07:00
Dawn Chen 563f2965ba Populate last terminated container information 2015-04-09 16:10:13 -07:00
Daniel Smith 629d94657e Merge pull request #6624 from gmarek/status_to_subresource
Update NodeStatus use subresources.
2015-04-09 16:00:15 -07:00
Victor Marmol 40acaef454 Merge pull request #6607 from yujuhong/mirror_update
Kubelet: recreate mirror pod if the static pod changes
2015-04-09 10:29:55 -07:00
Yifan Gu b868f421e0 kubelet: Move pod infra container image setting to dockertools. 2015-04-09 09:53:07 -07:00
gmarek ccc56d3c3c Update NodeStatus use subresources. 2015-04-09 14:07:40 +02:00
Yu-Ju Hong d7cf294c99 Kubelet: recreate mirror pod if the static pod changes
If a static pod changes, delete the corresponding mirror pod. When kubelet
could not see mirror pod from the API server update, it'd attemp to create a
new mirror pod with up-to-date specs.
2015-04-08 18:06:21 -07:00
Yifan Gu 4b945e7218 kubelet: Remove GetRecentDockerContainersWithNameAndUUID().
Add unit tests to test the restart behaviour under different
restart policy.
2015-04-08 09:44:23 -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
gmarek 72182735b9 Remove Node Controllers ability to pull status from Kubelet 2015-04-08 09:44:42 +02:00
Quinton Hoole c670071e87 Revert "kubelet: Remove GetRecentDockerContainersWithNameAndUUID." 2015-04-07 14:25:10 -07:00
Nikhil Jindal 842b9d8d3a Merge pull request #6493 from smarterclayton/make_client_pluggable
Make the client.Fake more powerful by standardizing how the fake loads data
2015-04-07 12:48:27 -07:00
Victor Marmol cb0850d7cf Merge pull request #6527 from yujuhong/remove_unused
Remove unused code in kubelet/server_test.go
2015-04-07 12:30:39 -07:00
Clayton Coleman 51db3bd654 Create a new testclient package that can be backed by disk files
Standardize how our fakes are used so that a test case can use a
simpler mechanism for providing large, complex data sets, as well
as represent queries over time.
2015-04-07 14:56:15 -04:00
Yu-Ju Hong d6b4633432 Remove unused code in kubelet/server_test.go
The code creates a channel and a go routine waiting for update, which is never
used by any test. Remove the unused code.
2015-04-07 11:55:19 -07:00
Yifan Gu ba1ad9fad2 kubelet: Refactor RunInContainer/ExecInContainer/PortForward.
Replace GetKubeletDockerContainers() with findContainer().
2015-04-06 17:14:46 -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
Dawn Chen 67c1678e7e Merge pull request #6378 from yujuhong/docker_manager
RFC: Kubelet: a step towards to better encapsulation of docker functions
2015-04-02 14:22:26 -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
Piotr Szczesniak 5c6439d449 Removed PodStatus.Host
Fixes #6165
2015-04-02 16:38:45 +02:00
Victor Marmol 2de37624e8 Merge pull request #6252 from krousey/string_format_cleanup
Fixing a lot of string formatting issues
2015-03-31 16:57:36 -07:00
Kris Rousey 6904c4d585 Fixing a lot of string formatting issues with regards to:
* Improper format specifier (e.g. %s for bools or %s for ints)
  * More or less parameters than format specifiers
  * Not calling a formatting function when it should have (e.g. Error() instead of Errorf())
2015-03-31 16:47:10 -07:00
Brian Grant 3354cffbf0 Merge pull request #6182 from thockin/plural_services_20
Implement multi-port Services
2015-03-31 12:55:21 -07:00
Victor Marmol 9bbf0b1546 Merge pull request #6100 from pmorie/entrypoint
Add control over container entrypoint
2015-03-31 09:58:40 -07:00
Victor Marmol d6d370d8ae Merge pull request #6211 from dchen1107/docker
publish node components version information
2015-03-31 09:47:08 -07:00
Dawn Chen 5b9a6d47e8 publish node components version information 2015-03-31 09:32:29 -07:00
Paul Morie 7628b37d78 Add control over container entrypoint 2015-03-31 12:32:03 -04:00
Tim Hockin 186818d787 WIP: Implement multi-port Services 2015-03-30 19:28:11 -07:00
Yifan Gu 7b1ea6b41d kubelet_test: Fix copy bug.
Initialize the slice before copying in verifyUnorderedCalls()
and verifyStringArrayEqualsAnyOrder().
2015-03-30 17:17:42 -07:00
Yifan Gu 6fecda710c kubelet: Add container readiness manager.
Move the readiness managing logic into pkg/kubelet/container package
to facilitate the pluggable container runtime.
2015-03-26 18:45:23 -07:00
Victor Marmol 0fb131c4f9 Merge pull request #5975 from yifan-gu/refactor_runContainer
kubelet: Refactor kubelet.runContainer.
2015-03-26 15:50:37 -07:00
Yifan Gu e6820bd0ca kubelet_test: Fix verifyStringArrayEqualsAnyOrder().
Old implementation can not tell cases where strings are
repetitive. e.g. {"a", "b", "b"} and {"a", "a", "b"} will
be treated as correct.
2015-03-26 15:26:32 -07:00
Yifan Gu aa2e7fe688 kubelet_test: Add verifyUnorderedCalls().
This fixes TestSyncPodsDeletesWithNoPodInfraContainer.
Since we need to sync two pods in parallel, we should not verify
the docker calls in strict order.
2015-03-26 15:25:51 -07:00
Yifan Gu 5f08555f45 kubelet: Refactor kubelet.runContainer.
Push the run container logic into container runtime.
2015-03-26 13:43:45 -07:00
Victor Marmol 1cad0df268 Merge pull request #6004 from yifan-gu/ref_manager
kubelet: Move container reference manager to pkg/kubelet/container.
2015-03-26 13:04:34 -07:00
Brian Grant 3b0db99692 Merge pull request #5915 from piosz/api
Changed PodInfo to be a list
2015-03-26 12:46:50 -07:00
Yifan Gu 9f62b929b8 kubelet: Move container reference manager to pkg/kubelet/container.
This enables other package to use it, such as docktools.
2015-03-26 11:53:44 -07:00
Victor Marmol d2ea1a793b Merge pull request #5982 from yifan-gu/ref_manager
kubelet: Add container reference manager.
2015-03-26 10:20:13 -07:00
Yifan Gu a06bc96414 kubelet: Add container reference manager.
Move the reference managing logic into container reference manager.
This enables pluggable container runtime to manage the container references.
2015-03-26 09:50:54 -07:00
gmarek 5a11748018 Move Capacity from NodeSpec to NodeStatus 2015-03-26 15:28:48 +01:00
Piotr Szczesniak 31901ed9d0 Changed PodInfo to be a list
This change is to make API consistent with our convention.

Fixes #3622
2015-03-26 10:15:25 +01:00
Abhishek Shah cd5ed38250 Stop port forwarding from pause in net=host mode 2015-03-25 17:55:37 -07:00
Federico Simoncelli afbf401464 nodeinfo: add boot id system information
Signed-off-by: Federico Simoncelli <fsimonce@redhat.com>
2015-03-25 15:06:53 -04:00
Victor Marmol cf7e2756b5 Add HostNetworkSources capability to limit use of HostNetwork. 2015-03-25 11:23:06 -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 31bb11ac2a kubelet: Move pod name helpers to pkg/kubelet/container/runtime.go 2015-03-24 16:08:04 -07:00
Yifan Gu 13250c904f kubelet: Replace GetKubeletDockerContainers with GetPods in syncPod/SyncPods. 2015-03-24 16:01:38 -07:00
David Oppenheimer 30c3583900 Merge pull request #5806 from ddysher/condition-rename
Rename ConditionFull->ConditionTrue, ConditionNone->ConditionFalse
2015-03-24 15:50:11 -07:00
Victor Marmol 270c850b3b Merge pull request #5826 from yujuhong/pod_manager
Kubelet: refactor pod manager
2015-03-24 15:33:54 -07:00
Yu-Ju Hong 08e4a883b6 Kubelet: refactor pod manager
This change cleans up the pod manager extensively so that
 * Mirror pods are actually stored in the pod manager.
 * Both (non-mirror) pods and mirror pods are indexed by UID and full name for
   easy lookup and mapping. This is required for the next change to send
   full pod along with the pod status update.

This change also renames mirrorManager as mirrorClient since it is merely a
client to contact the API server and create/delete mirror pods.
2015-03-24 15:10:26 -07:00
Deyuan Deng ca68f4a9d1 Rename ConditionFull->ConditionTrue, ConditionNone->ConditionFalse 2015-03-24 17:28:59 -04:00
Deyuan Deng b51d491f05 Delete all pods based on condition transition time. 2015-03-24 14:23:48 -04:00
Filip Grzadkowski 632ca506ce * Update pod status only when it changes.
* Refactor syncing logic into a separate struct
2015-03-24 16:41:00 +01:00
Yu-Ju Hong f440989017 Kubelet: add podManager for managing internal pod storage
This change moves pod array and mirrorPods into podManager, along with all
methods accessing these internal pod storages. This is the first step of the
refactoring, and no function change is involved.
2015-03-23 15:11:10 -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
Yu-Ju Hong 15e9760bd4 Kubelet: support retrieving stats using UID of mirror pod
Kubelet supports retrieving stats for pods/containers with and without UID.
This does not always work for the static pods because users may get the UIDs of
the mirror pods from the API server, and use them to query Kubelet. In this
case, Kubelet would fail to locate the containers due to mismatched UIDs.

This change adds a intenral mirror to static pod UID mapping and teaches all
public-facing functions to perform UID lookup before proceeding. This allows
users to use either mirror or static pod's UID to retrieve stats.
2015-03-20 15:40:49 -07:00
Vish Kannan f118ca8fb4 Merge pull request #5642 from thockin/volume_multi_plugins
Prep for multiple kinds of volume plugins
2015-03-20 15:12:30 -07:00
Tim Hockin bfadae77e0 Promote volume plugins, prep for persistent vols
Move pkg/kubelet/volume/... to pkg/volume/...
Some renames to make the soon-to-come persistent volumes work clearer.
2015-03-20 13:49:40 -07:00
Abhishek Gupta b0c23c1046 Headless Services: Adding option to specify None for PortalIP 2015-03-20 12:10:03 -07:00
CJ Cullen 7ddcecfd1c Revert "Revert "[WIP] southbound networking hooks in kubelet"" 2015-03-19 16:14:13 -07:00
Zach Loafman b5d1e538df Revert "[WIP] southbound networking hooks in kubelet" 2015-03-19 16:08:08 -07:00
Rajat Chopra 7857aa7751 kubelet networking plugin 2015-03-19 14:15:52 -07:00
Jerzy Szczepkowski c0ff504ad3 Merge pull request #5501 from jszczepkowski/kubelet-spechost
Running resource predicate on kubelet.
2015-03-19 21:34:27 +01:00
Dawn Chen 4910be6dcb Remove PodIP from ContainerStatus 2015-03-19 10:42:01 -07: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
Filip Grzadkowski 1a352b74ba Periodically update pod status from kubelet. 2015-03-18 12:11:39 +01:00
Victor Marmol d1ed571e28 Use containerGC in the Kubelet.
New policy default is 100 containers max.

Fixes #5457.
2015-03-17 10:50:32 -07: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
Victor Marmol bdc1981eb5 Merge pull request #5433 from wojtek-t/remove_bound_pods
Remove BoundPods from Kubelet
2015-03-16 13:38:24 -07:00
Wojciech Tyczynski 5d95e9e671 Remove BoundPods from Kubelet 2015-03-16 19:17:21 +01:00
Jeff Lowdermilk e37fd2a84d Merge pull request #5477 from dchen1107/clean
Convert RestartPolicy to string for v1beta3.
2015-03-16 10:23:52 -07:00
Dawn Chen 34e9c82c70 Convert RestartPolicy to string for v1beta3.
Fixed #3607 and spiritually support #5475
2015-03-13 18:38:07 -07:00
Victor Marmol b00e82ed93 Merge pull request #5466 from dchen1107/docker
Fix a regression introduced lately: When any given PodInfraContainer on ...
2015-03-13 16:04:01 -07:00
Dawn Chen 732d4cb2b9 Fix a regression introduced lately: When any given PodInfraContainer on a node
is killed, kubelet kills all remaining containers no matter which pod that
container belongs to.

Fixed #5373
2015-03-13 15:46:30 -07:00
Dawn Chen 0cc2b62b4a Merge pull request #5265 from ddysher/kubelet-post-status
kubelet post node status to master
2015-03-13 15:29:22 -07:00
gmarek 3489d1ae01 Refactor kubelet syncPod method 2015-03-13 18:22:42 +01:00
Victor Marmol 51122998e3 Garbage collect unidentified Kubernetes containers.
These containers may be caused by a change in the Kubernetes naming
convention. The old containers are killed, the new ones started, but the
old ones are never GC'd. This change makes Kubelet GC all Kubernetes
containers, old and new.

Fixes #5372.
2015-03-12 11:40:35 -07:00
Eric Tune ae9bc28f8b Remove mentions of etcd in kubelet. 2015-03-11 16:40:20 -07:00
Deyuan Deng 9982aaa960 kubelet post node status to master 2015-03-10 23:17:36 -04:00
Victor Marmol ab3c9de34b Refactoring cAdvisor interface into a package.
This will make it easier to start running the real cAdvisor alongside
Kubelet. This change is primarily no-op refactoring. The main behavioral
change is that we always create a cAdvisor interface and expect it to
always be available. When we make a request, if cAdvisor is not
connected the request fails with a connection error. This failure is
handled today as well.
2015-03-09 11:19:05 -07:00
Vish Kannan 53ec66caf4 Merge pull request #5152 from vmarmol/cadvisor-dep
Rename cAdvisor info API to cadvisorApi
2015-03-06 18:09:28 -08:00
Victor Marmol 43b469bd9f Rename cAdvisor info API to cadvisorApi 2015-03-06 16:06:38 -08:00
Dawn Chen 9439c0f3bd Merge pull request #5103 from yujuhong/naming
kubelet: revamp the pod/container naming scheme
2015-03-06 15:58:58 -08:00
Victor Marmol a35f4374c5 Update cAdvisor ContainerInfo references to v1 API.
The cAdvisor data structures were versioned recently. We use the v1
versions so this commit makes that explicit.
2015-03-06 15:42:06 -08:00
Yu-Ju Hong fe70be9261 kubelet: revamp the pod/container naming scheme
There are two main goals for this change.

 1. Fix the naming scheme in kubelet so that it accepts DNS subdomain
    name/namespaces correctly (#4920). The design is discussed in #3453.

 2. Prepare for syncing the static pods back to the apiserver(#4090). This
    includes

  - Eliminate the source component in the internal full pod name (#4922). Pods
    no longer need sources as they will all be sync'd via apiserver.

  - Changing the naming scheme for the static (file-, http-, and etcd-based)
    pods such that they are distinguishable when syncing back to the apiserver.

The changes includes:
  *	name = <pod.Name>-<hostname>
  * namespace = <cluster_namespace> (i.e. "default" for now).
  * container_name = k8s_<contianer_name>.<hash_of_container>_<pod_name>_<namespace>_<uid>_<random>

Note that this is not backward-compatible, meaning the kubelet won't recognize
existing running containers using the old naming scheme.
2015-03-06 13:14:45 -08:00
Yu-Ju Hong 32fd331e73 Revert "Split up kubelet "source seen" logic"
We want to sync pods from file/http/etcd sources to the apiserver, hence
differentiating sources is no longer desired.

This reverts commit 110ab6f1bd.
2015-03-06 12:57:48 -08: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
Dawn Chen 54b2b47caa Merge pull request #4756 from vishh/kubelet
Relax constraints on container status while fetching container logs
2015-03-05 21:49:48 -08:00
Yifan Gu ed1823e276 Refactor pkg/kubelet/kubelet.go: syncPod().
Makes the syncPod() takes only the containers that belongs to the pod.
2015-03-05 16:40:50 -08:00
Vishnu Kannan f6910803a9 Relax constraints on container status while fetching container logs 2015-03-06 00:19:52 +00:00
Paul Morie 02b18edac6 Allow multiple sources to be used with record package 2015-03-05 13:54:29 -05:00
Brendan Burns fb90b56bf6 Embed VolumeSource in v1beta3 and internal. 2015-03-04 02:25:40 -08:00
Tim Hockin ea548b8260 Rename type Port to ContainerPort
Sadly I had to do this by hand - I just could not get gorename to fix up
users of it.
2015-02-27 21:05:59 -08:00
Yu-Ju Hong 241df2d3be kubelet: record an event with a clear reason on host port conflict
Currently, kubelet silently ignores pods that caused host port conflict. This
commit surfaces the error by recording an event.

It also makes sure that kubelet iterates through the pods in the order of the
creation timestamp, which ensures that pods created later are ignored on
conflict.
2015-02-27 15:51:53 -08:00
Victor Marmol ed0f5885b5 Adding sync pod latency metric (again).
Latency is broken down by create, update, and sync pods.

Part of #4604.
2015-02-27 09:35:20 -08:00
Wojciech Tyczynski a973f57d6b Thread per pod 2015-02-27 13:27:29 +01:00
Jeff Grafton c2e7e2d029 Revert "Adding sync pod latency metric." and "Thread-per-pod model in Kubelet."
This reverts commits 744f33d886 and
7191c5c7fd.
2015-02-26 12:15:28 -08:00
Victor Marmol 744f33d886 Adding sync pod latency metric.
Latency is broken down by create, update, and sync pods.

Part of #4604.
2015-02-26 11:13:04 -08:00
Wojciech Tyczynski 7191c5c7fd Thread-per-pod model in Kubelet. 2015-02-26 17:58:57 +01:00
Vish Kannan 0b15f2ff65 Merge pull request #4784 from vmarmol/pod-restart
Kill infra pod when a container is restarted.
2015-02-24 13:37:08 -08:00
Victor Marmol aadbf221d2 Kill infra pod when a container is restarted.
Revert 0e20f7d736.
Fixes #4759.
2015-02-24 11:52:05 -08:00
Rohit Jnagal 590a62ffe5 Merge pull request #4767 from mikedanese/kind-to-type
Rename {Node,Pod}ConditionKind -> {Node,Pod}ConditionType
2015-02-24 10:10:57 -08:00
Wojciech Tyczynski dcef5e2955 Introduce DockerCache in Kubelet. 2015-02-24 09:10:07 +01:00
Mike Danese 5267127af1 api: rename conditionkind -> conditiontype 2015-02-23 22:13:21 -08:00
Daniel Smith 650f6cb826 Revert "Multi-port Endpoints" 2015-02-23 13:53:21 -08:00
Tim Hockin e0fd83096c Rename type Port to ContainerPort
Sadly I had to do this by hand - I just could not get gorename to fix up
users of it.
2015-02-21 22:26:38 -08:00
Andy Goldstein 5bd0e9ab05 Add streaming command execution & port forwarding
Add streaming command execution & port forwarding via HTTP connection
upgrades (currently using SPDY).
2015-02-20 09:57:02 -05:00
rsokolowski e81ef667c2 Fix broken kubelet_test.go. 2015-02-20 11:20:12 +01:00
Dawn Chen efac150039 Merge pull request #4563 from xiang90/syncpod
pkg/kubelet: recreate infra pod if the pod is changed
2015-02-20 00:29:26 -08:00
Victor Marmol 8649628c6c Make POD container last OOM victim.
Setting the oom_score_adj of the PID of the POD container to -100 which is less
than the default of 0. This ensures that this PID is the last OOM victim
chosen by the kernel.

Fixes #3067.
2015-02-19 19:24:01 -08:00
Xiang Li 0e20f7d736 pkg/kubelet: recreate infra pod if the pod is changed 2015-02-18 15:05:16 -08:00
Prashanth Balasubramanian 9427f75788 Cadvisor returns richer errors to the kubelet server. 2015-02-18 09:31:28 -08:00
Dawn Chen 20dc1c2481 Merge pull request #4410 from brendandburns/fixer
Don't delete the pod infrastructure container on health check failures.
2015-02-13 15:18:27 -08:00
Victor Marmol 5d6ad845cc Use Docker name (not ID) to parse Kubernetes components.
Since the parsing function doesn't return an error all the components
returned empty strings. This caused us to enforce the MaxContainerLimit
as a global limit instead of a per-container limit.

Fixes #4413.
2015-02-13 13:08:15 -08:00
Brendan Burns 4dbf98e98f Don't delete the pod infrastructure container on health check failures. 2015-02-12 21:28:32 -08:00
Dawn Chen f5f2b6f773 Check if kubelet does know such Pod before querying status. 2015-02-11 10:16:04 -08:00
Mike Danese c72c2a0d1e added tests 2015-02-10 08:30:13 -08:00
Mike Danese 043794492e implement readiness. 2015-02-10 08:30:09 -08:00
Dawn Chen f762e062f2 Kubelet decides podStatus 2015-02-05 15:49:41 -08:00
Brendan Burns 8b25b43039 Merge pull request #4117 from wojtek-t/validate_docker_version
Check Docker version in Kubelet /healthz handler
2015-02-05 10:06:33 -08:00
Brendan Burns cfe5b14114 Wait until containers actually finish running before trying to clean up
volumes or pods.
2015-02-04 17:28:41 -08:00
Wojciech Tyczynski ead67108ce Use existing method to get Docker version. 2015-02-04 20:50:21 +01:00
Mrunal Patel 19e0605f5b Replace "net" by "pod infra" in docs and format strings. 2015-01-28 15:03:06 -08:00
Mike Danese 78f33e950a rename api.LivenessProbe to api.Probe and break out Actions 2015-01-28 11:20:44 -08:00
Tim Hockin c8f61885df Merge pull request #3695 from mikedanese/ready
refactor pkg/health into more reusable pkg/probe
2015-01-28 11:00:32 -08:00
Mike Danese a298402bd4 remove pkg/health and move everything over to pkg/probe 2015-01-27 11:20:30 -08:00
Mrunal Patel b6a0ff1003 IP: Shared IPC. 2015-01-27 09:26:36 -08:00
Tim Hockin 30219f8dfa Merge pull request #3664 from thockin/pull-if
Pull if
2015-01-21 13:05:28 -08:00
Tim Hockin 81343aac63 Change PullPolicy constants to match 2015-01-21 12:48:56 -08:00
Tim Hockin 819803b79f Make VolumeSource not be a pointer
There's no reason for it to be a pointer.
2015-01-20 17:54:04 -08:00