Commit Graph

197 Commits (2cc86964258514ba06afc0eaa7de5f8b65c72845)

Author SHA1 Message Date
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
Filip Grzadkowski 18b728ff44 Revert "Periodically update pod status from kubelet." 2015-03-17 13:51:45 +01:00
Filip Grzadkowski 336525a27d Periodically update pod status from kubelet. 2015-03-16 23:03:03 +01: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
Dawn Chen 88e0b04916 Merge pull request #5287 from ncdc/master
Remove debugging log message from ExecInContainer
2015-03-11 09:45:37 -07:00
Wojciech Tyczynski 80576dfed3 Change PodWorkers to have desired cache. 2015-03-11 16:38:31 +01: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
Victor Marmol b314dc6025 Merge pull request #5032 from yifan-gu/clean_syncPod
Refactor pkg/kubelet/kubelet.go: syncPod().
2015-03-05 17:24:20 -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
Victor Marmol 33e6c3ebb3 DockerCache doesn't get containers at startup.
Fixes #5092.
2015-03-05 16:25:13 -08:00
Dawn Chen dad365fb2b Hide POD container from end users 2015-03-02 17:03:28 -08:00
Wojciech Tyczynski dcef5e2955 Introduce DockerCache in Kubelet. 2015-02-24 09:10:07 +01: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
Dawn Chen c843adbd8f Create docker.Container obj with Name. Integration test is using fake_docker_client
to create and start a fake container. When StartContainer, it pass a name as docker
ID for testing purpose, but leave Name uninitialized. This PR fixes such issue.

Fixed #4472.
2015-02-17 15:23:21 -08: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
Mike Danese 043794492e implement readiness. 2015-02-10 08:30:09 -08: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
Tim Hockin 7e6f3af937 Merge pull request #3817 from mrunalp/feature/shared_ipc
Shared IPC namespace for containers in a pod
2015-01-27 15:41:34 -08:00
Mrunal Patel b6a0ff1003 IP: Shared IPC. 2015-01-27 09:26:36 -08:00
Matt Moore 2d396797a9 Fix for issue 3797.
Docker's logic for resolving credentials from .dockercfg accepts two kinds of matches:
1. an exact match between the dockercfg entry and the image prefix
2. a hostname match between the dockercfg entry and the image prefix

This change implements the latter, which permits the docker client to take .dockercfg entries of the form:
   https://quay.io/v1/
and use them for images of the form:
   quay.io/foo/bar
even though they are not a prefix-match.
2015-01-26 14:06:12 -08:00
Dawn Chen 2299c04cea Remove image GC.
Fix #3617,#3611, and #3393.
2015-01-20 13:43:08 -08:00
Andrew Seidl 6dee1d7fa4 Fix typos in user-facing strings 2015-01-18 01:32:34 -06: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 7da0378f3c Track the sources that the kubelet has seen, and only delete pods
when every source has been seen at least once.
2014-12-17 13:08:43 -08:00
Brendan Burns bb28949291 Merge pull request #2831 from jdef/unit_test_for_2815
unit test for #2815, as requested by @brendandburns
2014-12-16 15:08:41 -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
James DeFelice 3afc9fffba fixed minor formatting 2014-12-12 20:43:07 -05: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 85b4b4677e unit test for #2815, as requested by @brendandburns 2014-12-10 15:33:38 -05: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
Eric Tune 4e0a72734e Handle and log errors when reading .dockercfg 2014-10-09 13:22:14 -07: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 8d0ed93aa1 Clean unittests 2014-10-06 13:37:22 -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
Clayton Coleman 6881db64a9 Allow configurable Kubelet net image for isolated networks
Public access to the DockerHub is not guaranteed in all environments,
add a flag to the kubelet that allows it to use a different image (like
one on a private registry) as well as only pull the first time the
image is needed.

Fixes #1545
2014-10-02 15:56:03 -04: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