Commit Graph

82 Commits (e83bf49f863017840ad91cca8bec0303fea3009f)

Author SHA1 Message Date
Daniel Martí 7862ed3656 kubelet: Switch to restful for the REST api endpoints 2015-08-18 11:28:34 -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
Brendan Burns 64be76c14d Add support for Attach to the kubelet.
This is a pre-cursor to supporting 'kubectl attach ...' and 'kubectl run -it ...'
2015-07-27 21:48:55 -07:00
Yu-Ju Hong de75a42cb2 Add a kubelet /runningpods endpoint
/runningpods returns a list of pods currently running on the kubelet. The list
is composed by examining the container runtime, and may be different from the
desired pods to run known by kubelet.

This is useful for tests to verify that pods are indeed deleted on nodes.
2015-06-29 11:29:23 -07:00
Abhishek Shah 3556993179 Augmented kubelet healthz with syncLoop check.
Monit uses read-only port for health monitoring.
2015-06-19 18:14:01 -07: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
Dawn Chen 86479cc56c Add support to pull log for last terminated container 2015-05-11 12:54:04 -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 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 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
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
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
Andy Goldstein 00e24603cb Fix TestServeExecInContainerIdleTimeout flake
Remove creation of stream from TestServeExecInContainerIdleTimeout as
it's not necessary to very idle timeout.

Increase stream creation and ack timeouts to 30 seconds.

Fixes #5628
2015-04-09 16:44:56 -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
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
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
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
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 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
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
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
Wojciech Tyczynski 5d95e9e671 Remove BoundPods from Kubelet 2015-03-16 19:17:21 +01:00
Brendan Burns b53b2e1de0 Add and extend timeouts. 2015-03-11 14:12:46 -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
Dawn Chen 43b4f41202 Allow /healthz check from localhost 2015-03-05 17:27:56 -08:00
Justin Santa Barbara 7725cd23ec Fix typo in test 2015-03-04 10:10:08 -05: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
Andy Goldstein bd2eb2fa8f Fix flaky exec/portforward tests
Fixes #4676
2015-02-20 16:29:57 -05: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
Dawn Chen 8022c74b55 Merge pull request #4473 from xiang90/server
pkg/kubelet/server.go: minor fixes
2015-02-18 14:50:51 -08:00
Xiang Li 6b91901bd3 pkg/kubelet: minor fixes in server.go 2015-02-18 13:18:45 -08:00
Prashanth Balasubramanian 9427f75788 Cadvisor returns richer errors to the kubelet server. 2015-02-18 09:31:28 -08:00
Vishnu Kannan 922881fcd2 Improve error handling for '/containerLogs' API in kubelet. 2015-02-12 02:22:26 +00:00
Wojciech Tyczynski ead67108ce Use existing method to get Docker version. 2015-02-04 20:50:21 +01:00
Wojciech Tyczynski 78f66a6ce9 Check Docker version in Kubelet /healthz handler 2015-02-04 18:31:24 +01:00
Dawn Chen 15e9fa8a9d Introduce PodStatusResult, and deprecate PodContainerInfo. 2015-01-16 09:10:40 -08:00
Tim Hockin 1be3de895c Move util.UID to pkg/types 2015-01-14 15:22:21 -08:00
Tim Hockin e86d4cd3c6 Use a strong type for UID fields 2015-01-14 13:53:43 -08:00
Clayton Coleman ba53d723d3 Clean up how client is passed to Kubelet in preparation for reading pods
Also fixes how Kubelet server looks up pods by name when there are multiple
sources.
2015-01-07 14:40:37 -05:00
Vishnu Kannan 3ef9e404c1 Update "/stats" endpoint on kubelet to take namespace as an argument as part of the API. 2015-01-03 02:17:25 +00:00
Brendan Burns 928f52056e Remove HTTP Server support for pushing pods onto the kubelet. 2014-12-17 17:15:36 -08:00
Clayton Coleman 6d31c2bf8a util.EncodeJSON proven harmful, remove it everywhere
People were misusing EncodeJSON in tests when they should be using
runtime.EncodeOrDie(testapi.Codec(), obj).  Removing the potential
for cutting self on sharp objects.
2014-11-13 10:38:13 -05:00
Dawn Chen a1e79048a6 Add /podSpecs to Kubelet 2014-10-30 16:38:08 -07:00
Clayton Coleman 644eb70085 Refactor tests to split ObjectMeta from TypeMeta 2014-10-24 11:22:21 -04:00