Commit Graph

32 Commits

Author SHA1 Message Date
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
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
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
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
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
0d0fb5f07b Kubelet: per-pod workers should avoid grabbing the pod array lock
Per-pod worker syncs the pod and container status, and write the pod status in
the pod status cache. Given that it already owns a copy of the pod, it can
bypass the additional pod lookup step completely. This change adds a new
generatePodStatusByPod() method to achieve this. In general, per-pod worker
should avoid accessing the internal pod array completely, as this would may
lead to high contention.

This change also changes the return type of GetPodByFullName to reflect the
name, and consolidates GetPodByFullName() and GetPodByName().
2015-03-19 18:25:41 -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
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
Wojciech Tyczynski
5d95e9e671 Remove BoundPods from Kubelet 2015-03-16 19:17:21 +01:00
Wojciech Tyczynski
dca3db0a50 Speedup pkg/kubelet/runonce_test.go 2015-03-12 17:12:04 +01: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
Paul Morie
02b18edac6 Allow multiple sources to be used with record package 2015-03-05 13:54:29 -05: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
Tim Hockin
ca89aa6528 Make data dirs for all pods when syncing 2015-01-13 17:18:21 -08:00
Tim Hockin
0d92da6b15 Remove logic to handle if UID is blank
This should only have been triggered by tests, and those should now be fixed.
I tested by calling panic() if UID was blank in BuildDockerName() or if number
of fields was < 5 in ParseDockerName().  All errors were fixed.
2015-01-12 14:27:34 -08:00
Clayton Coleman
644eb70085 Refactor tests to split ObjectMeta from TypeMeta 2014-10-24 11:22:21 -04:00
Clayton Coleman
bb77a5d15f Rename ID -> Name 2014-10-22 15:00:26 -04: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
dbb2342688 runonce: list kubelet container between each iteration 2014-10-08 22:28:41 -07:00
Dawn Chen
4fdfeaa30e Addressed comments. 2014-10-06 14:41:20 -07:00
Johan Euphrosine
fa1dcd0a8b kubelet: add basic test for runonce 2014-10-03 18:02:30 -07:00