Commit Graph

197 Commits (27d096d27d60d32c1978e08db82f28da17333405)

Author SHA1 Message Date
Yifan Gu 7fedb14c27 kubelet: Remove unused docker functions.
Remove kubelet.getPodInfraContainer().
Remove dockertools.RemoveContainerWithID().
Remove dockertools.FindContainersByPod().

Also replace the useless test with a test for GetPods().
2015-04-13 16:32:18 -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
Clayton Coleman fce3e5a2bb Merge pull request #6574 from ncdc/exec-portforward-no-command-pipes
Don't use command pipes for exec/port forward
2015-04-10 12:07:21 -04:00
Yifan Gu b868f421e0 kubelet: Move pod infra container image setting to dockertools. 2015-04-09 09:53:07 -07:00
Andy Goldstein 4c1cba5312 Don't use command pipes for exec/port forward
Switch to passing the streams for Stdin/Stdout/Stderr instead of using
StdinPipe() etc because the pipes are incompatible with Run()/Wait().
2015-04-08 13:42:42 -04:00
Yifan Gu ba1ad9fad2 kubelet: Refactor RunInContainer/ExecInContainer/PortForward.
Replace GetKubeletDockerContainers() with findContainer().
2015-04-06 17:14:46 -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
Yu-Ju Hong 3ad0e22cdd Kubelet: allow docker to examine terminated container
Removing the if statement so that docker can continue returning the status of
terminated containers.
2015-03-27 18:04:50 -07:00
Vishnu Kannan 14a48ad026 Update pod ip using active container only. 2015-03-27 00:38:43 +00:00
Yifan Gu 5f08555f45 kubelet: Refactor kubelet.runContainer.
Push the run container logic into container runtime.
2015-03-26 13:43:45 -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
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
Yifan Gu f4c3ccf639 dockertools: Introduce GetPods() for docker runtime. 2015-03-24 16:01:37 -07:00
Nataliia Uvarova 73c2338320 Refactor build/parse dockername. #3511
Functions Build/ParseDockerName now work with struct instead of the long
list of arguments. This new struct also was reused in the kubelet.go
instead of auxilary podContainer struct.
2015-03-21 09:09:03 +01:00
Dawn Chen 4910be6dcb Remove PodIP from ContainerStatus 2015-03-19 10:42:01 -07:00
Andy Goldstein 7b07960758 Use docker's ParseRepositoryTag when pulling 2015-03-17 20:15:13 -04:00
Victor Marmol 0c664a343c Adding errors to Kubelet events.
This will help while debugging issues that generate events.

Also removed unecessary log line.
2015-03-17 15:55:25 -07:00
Zach Loafman 5496686f33 Revert "Use docker's ParseRepositoryTag when pulling" 2015-03-17 15:16:33 -07:00
Andy Goldstein c08f41c18b Use docker's ParseRepositoryTag when pulling 2015-03-17 13:23:17 -04: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
Victor Marmol 4675fcc57d Make ParseDockerName() return an error.
This forces callers to handle cases where the container name could not
be parsed.
2015-03-12 16:33:16 -07:00
Andy Goldstein 0c798bbe52 Remove debugging log message from ExecInContainer 2015-03-11 10:07:14 -04: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
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
Dawn Chen dad365fb2b Hide POD container from end users 2015-03-02 17:03:28 -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
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
Clayton Coleman 09f18031fe Merge pull request #4285 from brendandburns/auth
Add a more detailed error message for potential auth fails in docker pull.
2015-02-13 12:08:48 -05:00
Brendan Burns 0532c46217 Add a more detailed error message for potential auth fails in docker pull. 2015-02-12 17:00:59 -08:00
Vishnu Kannan 922881fcd2 Improve error handling for '/containerLogs' API in kubelet. 2015-02-12 02:22:26 +00:00
Federico Simoncelli e01df69565 api: add image's id to ContainerStatus
Sometimes for external applications it is important to identify
exactly what images are running. Since tags can be moved to point
to newer builds this information can be used to identify old images
running.

Signed-off-by: Federico Simoncelli <fsimonce@redhat.com>
2015-02-06 09:01:14 -05: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 524cdba101 Fix hack/test-cmd.sh test. 2015-02-05 01:58:26 +01:00
Wojciech Tyczynski ead67108ce Use existing method to get Docker version. 2015-02-04 20:50:21 +01:00
Tim Hockin 70ab406751 Use a constant for the pod infra container name
This is an implementation detail that has leaked out of kubelet.  Use a
constant to prevent divergence, for now.  Plan to get rid of it.

@dchen1107
2015-01-28 10:13:02 -08:00
Mrunal Patel b6a0ff1003 IP: Shared IPC. 2015-01-27 09:26:36 -08:00
Dawn Chen 2299c04cea Remove image GC.
Fix #3617,#3611, and #3393.
2015-01-20 13:43:08 -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
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
Tim Hockin 905514a12b Ensure Namespace and UID are set in kubelet
Make all kubelet config sources ensure that UID and Namespace are defaulted, if
need be.

We can *almost* disable the "if blank" logic for UID, except for tests that
call APIs that do not run through SyncPods.  We really ought to be enforcing
invariants better.
2015-01-12 14:27:34 -08:00
saadali f92f830e1f Modify hash to be computed using spew library so that nested object values are used instead of pointer 2015-01-05 15:48:06 -08:00
Brendan Burns b8781c04bb Add support for garbage collecting images. 2014-12-22 16:56:58 -08:00
Dawn Chen f073ecf4cc Understand OOMKilled reason 2014-12-18 15:59:44 -08:00
Dawn Chen 608c3d5046 Update kubelet package on latest go-dockerclient package. 2014-12-18 13:49:13 -08:00
Brendan Burns 3a0d16ff35 Add an e2e test for exec liveness probes. Fix the docker exec integration. 2014-12-16 13:53:32 -08:00
Vishnu Kannan f4ef05bc20 Updated docker version that supports exec to '1.3.0'. 2014-12-15 20:44:58 +00:00
Jordan Liggitt 51bfb50698 Use util.Time consistently in types.go 2014-12-11 11:14:25 -05:00
Federico Simoncelli 4af64b8911 api: add container's id to ContainerStatus
Sometimes for external applications it is useful to correlate the pod
containers to the real docker instances.

This patch adds a new entry in the container status (containerID) which
is used to identify the instance.

Signed-off-by: Federico Simoncelli <fsimonce@redhat.com>
2014-12-10 20:38:41 +00:00
James DeFelice ca2840a8e8 inspect the full repo/image:tag name 2014-12-09 15:41:08 -05:00
James DeFelice 76ef747927 avoid panics when docker CT has no name 2014-12-05 15:48:25 -05:00
Eric Tune 54859cf1ea Remove format specifiers with no options. 2014-11-26 12:05:00 -08:00
Brendan Burns a5bc6301a4 Revert "Using util.Time for ContainerStatus" 2014-11-24 21:32:31 -08:00
Daniel Smith 610ab9a0db Merge pull request #2586 from dchen1107/cleanup
Using util.Time for ContainerStatus
2014-11-24 15:35:07 -08:00
Dawn Chen acb0f1198b Using util.Time for ContainerStatus 2014-11-24 15:15:33 -08:00
bgrant0607 9f5ebef3d8 Merge pull request #2513 from lavalamp/verifyNetwork
Fix crash (loop?) in kubelet
2014-11-21 10:10:32 -08:00
Daniel Smith 9116c27040 Fix crash (loop?) in kubelet 2014-11-20 18:28:23 -08:00
Tim Hockin ea960711ff Clean up error logs.
Use %v for errors, tidy some messages, make error messages start lowe-case
(as per go guidelines).  Just accumulated nits.
2014-11-21 09:45:26 +08:00
Matt Moore 0c5d9ed0d2 Implements a credentialprovider library for use by DockerPuller.
This change refactors the way Kubelet's DockerPuller handles the docker config credentials to utilize a new credentialprovider library.

The credentialprovider library is based on several of the files from the Kubelet's dockertools directory, but supports a new pluggable model for retrieving a .dockercfg-compatible JSON blob with credentials.

With this change, the Kubelet will lazily ask for the docker config from a set of DockerConfigProvider extensions each time it needs a credential.

This change provides common implementations of DockerConfigProvider for:
 - "Default": load .dockercfg from disk
 - "Caching": wraps another provider in a cache that expires after a pre-specified lifetime.

GCP-only:
 - "google-dockercfg": reads a .dockercfg from a GCE instance's metadata
 - "google-dockercfg-url": reads a .dockercfg from a URL specified in a GCE instance's metadata.
 - "google-container-registry": reads an access token from GCE metadata into a password field.
2014-11-17 21:46:54 -08:00
Dawn Chen f729d748ac If the image with :latest tag specified in Spec, kubelet should try
to pull the latest one even the policy is PullIfNotPresent.
2014-11-14 16:09:53 -08:00
jhadvig f2f1708687 Setting RawTerminal attribute in LogOptions to false 2014-11-12 17:47:52 +01:00
bgrant0607 3cf17c0094 Merge pull request #2225 from dchen1107/deathrattle
Capture application termination messages/output
2014-11-10 11:25:14 -08:00
Dawn Chen 57454cce81 Add support to capture application termination message and propagate
the message to the upper layer through ContainerStatus.
2014-11-10 10:56:23 -08:00
Dawn Chen b4ab6e6ecc Remove dead code. 2014-11-07 11:05:35 -08:00
Mike Danese 1d76452bc2 added support for authentication against the default docker registry when provided in the .dockercfg
a
2014-11-06 11:52:25 -08:00
Daniel Smith 4b16e979e6 Fix nil docker client (how did this ever work???) 2014-11-04 16:58:37 -08:00
Brendan Burns 4ae3e99177 Change a spammy log to V(3) 2014-11-03 08:38:02 -08:00
Brendan Burns 51bf451932 Add container garbage collection. 2014-10-28 12:52:06 -07:00
Brendan Burns b47486abe7 Merge pull request #1771 from vishh/native_exec
Use native exec support in docker instead of exec'ing nsinit in kubelet.
2014-10-21 07:32:07 -07:00
Michal Fojtik 0bccce4520 Move error about connecting to healthz server to V(1) 2014-10-20 15:31:01 +02:00
Vishnu Kannan 7b3db4d41b Use native exec support in docker instead of execing nsinit in kubelet. 2014-10-17 10:04:46 +00: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 8f010c3ec0 dockertools: add todo for container lookup 2014-10-08 22:31:59 -07:00
Dawn Chen 4fdfeaa30e Addressed comments. 2014-10-06 14:41:20 -07:00
Dawn Chen a86d496f9a Fix e2e tests. 2014-10-06 13:37:24 -07:00
Dawn Chen 39f648bda2 Fix rebase issues. 2014-10-06 13:37:23 -07:00
Dawn Chen 9861eb7c8e Initial support of propogating the termination reasons and image failure
to apiserver. Deprecated docker.Container from API completely.

Conflicts:
	pkg/api/types.go
	pkg/kubelet/kubelet.go
2014-10-06 13:37:22 -07:00
Tim Hockin db49dc0012 Merge pull request #1458 from brendandburns/dontpull
Add the ability to turn off image pulling.
2014-10-01 12:40:47 -07:00
Brendan Burns 4c456015b6 Add the ability to turn off image pulling. 2014-10-01 12:34:22 -07:00
jhadvig 9b21053188 ListContainer filter 2014-09-30 23:30:32 +02:00
Tim Hockin badeaef95f Merge pull request #1457 from brendandburns/pull
Add a rate limiter, use it to rate limit docker pulls.
2014-09-26 12:39:25 -07:00
Brendan Burns 3ac706a32e Add a rate limiter, use it to rate limit docker pulls. 2014-09-26 11:55:21 -07:00
Dawn Chen 01c9015ed3 use _ as the separator for docker container name. 2014-09-26 09:21:21 -07:00
Clayton Coleman 4e56dafecc Introduce some default log verbosity control
Move a lot of common error logging into better buckets:

glog.Errorf() - Always an error
glog.Warningf() - Something unexpected, but probably not an error
glog.V(0) - Generally useful for this to ALWAYS be visible
            to an operator
            * Programmer errors
            * Logging extra info about a panic
            * CLI argument handling
glog.V(1) - A reasonable default log level if you don't want
            verbosity
            * Information about config (listening on X, watching Y)
            * Errors that repeat frequently that relate to conditions
              that can be corrected (pod detected as unhealthy)
glog.V(2) - Useful steady state information about the service
            * Logging HTTP requests and their exit code
            * System state changing (killing pod)
            * Controller state change events (starting pods)
            * Scheduler log messages
glog.V(3) - Extended information about changes
            * More info about system state changes
glog.V(4) - Debug level verbosity (for now)
            * Logging in particularly thorny parts of code where
              you may want to come back later and check it
2014-09-25 16:30:14 -04:00
Brendan Burns 431caa93df Merge pull request #1335 from dchen1107/exit1
Convert existing kubernetes system to use ContainerStatus, instead of
2014-09-24 21:37:24 -07:00
Daniel Smith bb0cd95a83 fix non-gofmt'd things 2014-09-24 14:27:10 -07:00
Dawn Chen 0e6ec3cbfc Convert existing kubernetes system to use ContainerStatus, instead of
docker.Container directly.

Conflicts:
	pkg/kubelet/dockertools/docker.go
	pkg/registry/pod/rest.go
2014-09-24 11:16:46 -07:00
jhadvig d2709ab9c1 Typo fix 2014-09-24 01:33:39 +02:00
jhadvig 9ba71528e4 stdout/stderr container log stream 2014-09-23 00:15:36 +02:00
jhadvig 6da2653b4a Update according to review 2014-09-16 15:40:12 +02:00
jhadvig f351691493 Adding endpoint for log retrieval on the minion 2014-09-15 17:02:56 +02:00
Brian Waldon 2f87857b0f kubelet: generate keyring from .dockercfg 2014-09-11 21:01:39 -07:00
Brian Waldon 0bf4fabc19 kubelet: move docker-related code into sub-package 2014-09-11 13:12:28 -07:00