Commit Graph

116 Commits (0fc2c4844454be18961ad1b4446ef3c9540d20e6)

Author SHA1 Message Date
deads2k 2ecb0ebd73 make the dockerkeyring handle mutiple matching credentials 2015-05-11 09:54:03 -04: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
Paul Morie b3a613c6c3 Fix typo in provider.go 2015-04-27 21:42:45 -04:00
Tim Hockin a3d45fada8 Change flags to use dashes in help 2015-04-27 15:11:03 -07:00
Matt Moore d5e0054eb0 Enable usage of a "json key" for authenticating with gcr.io.
With this change, you can add --google_json_key=/path/to/key.json to the DAEMON_ARGS of the kubelet, e.g.
   nano /etc/default/kubelet
   ... # Add the flag
   service kubelet restart

With this setting, minions will be able to authenticate with gcr.io repositories nearly as smoothly as if K8s were running on GCE.

NOTE: This private key can be used to access most project resources, consider dropping the service account created through this flow to a project READER, or restricting its access to just the GCS bucket containing the container images.
2015-03-15 09:24:33 -07: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
Mike Danese 33f158073b Check other dirs for .dockercfg 2015-01-27 15:54:20 -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 0962b86ce3 Remove useless and duplicate call. 2015-01-22 15:00:21 -08:00
Daniel Smith ffcbe2fa10 Merge pull request #2674 from mattmoor/quiet-credentialprovider
Make credentialprovider less verbose about benign errors.
2014-12-02 18:25:03 -08:00
Matt Moore 65c246d45a Make credentialprovider less verbose about benign errors.
In particular, a few of the utilities used within the credentialprovider had the pattern:
   glog.Errorf("while blah %s: %v", s, err)
   return nil, err

This change propagates those error message and puts the burden of logging on the caller.

In particular, this allows us to squelch all output during kubelet startup when we are detecting whether certain credentialprovider plugins should even be enabled.

Fixes: https://github.com/GoogleCloudPlatform/kubernetes/issues/2673
2014-12-01 11:54:50 -08:00
Matt Moore 5c35af5810 add another registry URL 2014-11-29 15:56:25 -08:00
Tim Hockin 95a9098311 fix 'go vet' warnings 2014-11-21 09:45:28 +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
Clayton Coleman 2afa12073c Do not log an error when file does not exist 2014-11-19 22:04:36 -05: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