Commit Graph

90 Commits (10917084df0df9b45796c129eca4bb149932d93a)

Author SHA1 Message Date
Yu-Ju Hong a3e60cc32e Rename imported package local name kubeletTypes to kubetypes
According to the naming guidelines, package name should not include mixedCaps.
2015-10-09 10:24:31 -07:00
Jordan Liggitt 9d6b52881d Add authentication/authorization interfaces to kubelet, always include /metrics with /stats 2015-10-09 03:10:00 -04:00
Yu-Ju Hong 098ab05997 kubelet: move common types to kubelet/types
This would faciliate tasks such as moving code in pkg/kubelet to sub packages.
2015-10-08 14:38:01 -07:00
Andy Goldstein ed021fed4c Port forwarding fixes
Correct port-forward data copying logic so that the server closes its
half of the data stream when socat exits, and the client closes its half
of the data stream when it finishes writing.

Modify the client to wait for both copies (client->server,
server->client) to finish before it unblocks.

Fix race condition in the Kubelet's handling of incoming port forward
streams. Have the client generate a connectionID header to be used to
associate the error and data streams for a single connection, instead of
assuming that streams n and n+1 go together. Attempt to generate a
pseudo connectionID in the server in the event the connectionID header
isn't present (older clients); this is a best-effort approach that only
really works with 1 connection at a time, whereas multiple concurrent
connections will only work reliably with a newer client that is
generating connectionID.
2015-09-30 20:03:49 -04:00
Dawn Chen a010e91913 Merge pull request #14292 from yujuhong/revert_node
Revert node status manager
2015-09-21 23:13:18 -07:00
Clayton Coleman c2e90cd154 Support extended pod logging options
Increase the supported controls on pod logging. Add validaiton to pod
log options. Ensure the Kubelet is using a consistent, structured way to
process pod log arguments.

Add ?sinceSeconds=<durationInSeconds>, &sinceTime=<RFC3339>, ?timestamps=<bool>,
?tailLines=<number>, and ?limitBytes=<number>
2015-09-21 15:39:32 -04:00
Yu-Ju Hong 7bdf9bfdfa Revert "Move and fix nodeManager related unit tests"
This reverts commit 865dc19957.
2015-09-21 10:58:54 -07:00
Yu-Ju Hong 865dc19957 Move and fix nodeManager related unit tests 2015-09-16 17:41:40 -07:00
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