Commit Graph

372 Commits (7b72d9539f08f78dc90f0f16e2ad782df3296f23)

Author SHA1 Message Date
Victor Marmol e187be9fe1 Merge pull request #5143 from vmarmol/cadvisor-pkg
Refactoring Kubelet's cAdvisor interface into a package.
2015-03-09 11:36:03 -07: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
Victor Marmol ca84aae454 Kubelet: wait up to 5m for Docker to come up.
The Kubelet assumes Docker is running during its execution and on
machine boot it is a race between Docker coming up and Kubelet calling
Docker. This PR waits for Docker to be up before the Kubelet begins
doing useful work. On timeout, Kubelet exits and expects to be
restarted.
2015-03-09 09:50:34 -07:00
Victor Marmol 1866adddd3 Merge pull request #5157 from yifan-gu/clean_prober
Adjust prober's logging verbose.
2015-03-06 18:04:12 -08:00
Yifan Gu da5d7c7814 Adjust prober's logging. 2015-03-06 17:30:29 -08:00
Victor Marmol 798513844c Merge pull request #5148 from yifan-gu/clean_prober
Refactor pkg/kubelet/kubelet.go: probeContainer().
2015-03-06 17:04:57 -08:00
Yifan Gu 09af0cd3b5 Refactor pkg/kubelet/kubelet.go: probeContainer().
Split the function into probeContainerLiveness() and probeContainerReadiness().
2015-03-06 16:37:58 -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
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
Deyuan Deng 50de1a80c2 kubelet should take a client interface 2015-03-06 15:01:55 -05:00
Dawn Chen 2d0743b143 Merge pull request #5019 from yujuhong/reject_pods
kubelet: reject pods on host port conflict
2015-03-06 11:42:04 -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
gmarek 4a01a4dbf5 Refactor Kubelets syncPod function by wrapping some functionalities into functions 2015-03-06 18:32:11 +01: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
Derek Carr cb1e044a60 Merge pull request #4923 from lavalamp/fix4
Allow reflector to do full resync periodically
2015-03-04 09:58:03 -05:00
Victor Marmol 71e545bf81 Merge pull request #4970 from dchen1107/podstatus
Hide POD container from end users
2015-03-02 17:15:24 -08:00
Dawn Chen dad365fb2b Hide POD container from end users 2015-03-02 17:03:28 -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
Daniel Smith 554b1c847c add occasional polling to reflector 2015-02-27 16:59:14 -08:00
Victor Marmol c7e7ecdf2c Handle crash in per-pod thread and container killer. 2015-02-27 16:33:46 -08:00
Victor Marmol cc3c4414f8 Merge pull request #4915 from yujuhong/hostport
kubelet: record an event with a clear reason on host port conflict
2015-02-27 16:04:04 -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 556acc792b Adding ContainersPerPodCount metric.
This will let us know the composition of pods in clusters.
2015-02-27 11:27:09 -08:00
Victor Marmol a9301b1996 Adding metric for latency of SyncPods (synching all pods). 2015-02-27 11:11:43 -08:00
Victor Marmol cbf93822ac Adding metrics to measure latency of Docker operations.
Part of #4604.
2015-02-27 10:26:06 -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
Sami Wagiaalla 9150cb9d95 Catch kubelet-master hostname mismatch during health check
During the kubelet's /healthz responce check to see if the
hostname used by the master matches the hostname the kubelet
knows itself by. If not fail the health check.

Signed-off-by: Sami Wagiaalla <swagiaal@redhat.com>
2015-02-26 10:22:03 -05:00
Vish Kannan e3af23e6e9 Merge pull request #4792 from vmarmol/mon-containers-per-pod
Add Kubelet metrics for pod and container counts.
2015-02-25 18:51:22 -08:00
Victor Marmol 95464349d5 Add Kubelet metrics for pod and container counts.
Part of #4604.
2015-02-25 12:18:59 -08:00
Daniel Smith ec8ecf3993 Merge pull request #4494 from brendandburns/race
Add protection for the pods member varaible.
2015-02-25 10:41:32 -08:00
Brendan Burns 801ad909ca Add protection for the pods member varaible.
Address comments.
2015-02-24 19:36:11 -08: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
Vish Kannan c561c8b0b1 Merge pull request #4753 from vmarmol/mon
First Kubelet metric and overall plumbing.
2015-02-24 12:51:34 -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 e77322a561 Merge pull request #4755 from yifan-gu/cleanup
pkg/kubelet: Fix logging.
2015-02-24 10:12:02 -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
Yifan Gu 1a5a842ac5 pkg/kubelet: Fix logging. 2015-02-24 09:47:10 -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
Victor Marmol c40a60e945 Adding image pull latency metric.
Also adding TODOs for other metrics.

Part of #4604.
2015-02-23 16:30:29 -08:00
Rohit Jnagal 50700419ea Merge pull request #4732 from yifan-gu/cleanup
Remove outdated const.
2015-02-23 16:06:32 -08:00
Victor Marmol a6d975c929 Remove pullLock from Kubelet.
The lock was only ever used to grab a read lock before container pulls.
2015-02-23 13:27:55 -08:00
Yifan Gu a631252abf Remove outdated const. 2015-02-23 11:00:38 -08:00
Victor Marmol da2f4b6d61 Check Docker init PID is valid before we use it.
This gives us an error if the PID is not returned as we expect.
2015-02-20 13:10:40 -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