Commit Graph

52 Commits (ee9cded79a8a5a597efcef7404bc32a003f8ea37)

Author SHA1 Message Date
Vishnu kannan ee9cded79a do not query the metadata server to find out if running on GCE. Retry docker registry fetches on GCP
Signed-off-by: Vishnu kannan <vishnuk@google.com>
2016-07-15 11:41:02 -07:00
k8s-merge-robot 7be82496eb Merge pull request #28428 from justinsb/aws_region_ap_south
Automatic merge from submit-queue

AWS: Add ap-south-1 to list of known AWS regions

Adding the new ap-south-1 region (Mumbai)
2016-07-14 20:28:53 -07:00
Justin Santa Barbara 60c37a0a87 AWS: Add ap-south-1 to list of known AWS regions
Adding the new ap-south-1 region (Mumbai)
2016-07-02 21:47:09 -04:00
David McMahon ef0c9f0c5b Remove "All rights reserved" from all the headers. 2016-06-29 17:47:36 -07:00
Rudi Chiarito 684517f74f Add ap-northeast-2 2016-05-10 12:03:41 -04:00
Rudi Chiarito 6e6ea46182 Include changes from feedback
Use constructor for ecrProvider
Rename package to "credentials" like golint requests
Don't wrap the lazy provider with a caching provider
Add immedita compile-time interface conformance checks for the interfaces
Added comments
2016-05-10 12:03:40 -04:00
Rudi Chiarito eea29e8851 Allow cross-region image pulling with AWS' ECR
This is step two. We now create long-lived, lazy ECR providers in all regions.
When first used, they will create the actual ECR providers doing the work
behind the scenes, namely talking to ECR in the region where the image lives,
rather than the one our instance is running in.

Also:

- moved the list of AWS regions out of the AWS cloudprovider and into the
credentialprovider, then exported it from there.
- improved logging

Behold, running in us-east-1:

```
aws_credentials.go:127] Creating ecrProvider for us-west-2
aws_credentials.go:63] AWS request: ecr:GetAuthorizationToken in us-west-2
aws_credentials.go:217] Adding credentials for user AWS in us-west-2
Successfully pulled image 123456789012.dkr.ecr.us-west-2.amazonaws.com/test:latest"
```

*"One small step for a pod, one giant leap for Kube-kind."*
2016-05-10 12:03:39 -04:00
zhouhaibing089 bf1a3f99c0 Uncomment the code that cause by #19254 2016-04-25 23:21:31 +08:00
Harry Zhang a3939473d3 Refactor PullImage RemoveImage methods
Refactor image remove
2016-04-23 10:33:47 -04:00
Rudi Chiarito ca6bdba014 Allow lazy binding in credential providers; don't use it in AWS yet
This is step one for cross-region ECR support and has no visible effects yet.
I'm not crazy about the name LazyProvide. Perhaps the interface method could
remain like that and the package method of the same name could become
LateBind(). I still don't understand why the credential provider has a
DockerConfigEntry that has the same fields but is distinct from
docker.AuthConfiguration. I had to write a converter now that we do that in
more than one place.

In step two, I'll add another intermediate, lazy provider for each AWS region,
whose empty LazyAuthConfiguration will have a refresh time of months or years.
Behind the scenes, it'll use an actual ecrProvider with the usual ~12 hour
credentials, that will get created (and later refreshed) only when kubelet is
attempting to pull an image. If we simply turned ecrProvider directly into a
lazy provider, we would bypass all the caching and get new credentials for
each image pulled.
2016-03-29 15:39:30 -04:00
goltermann 34d4eaea08 Fixing several (but not all) go vet errors. Most are around string formatting, or unreachable code. 2016-03-22 17:26:50 -07:00
deads2k ab03317d96 support CIDRs in NO_PROXY 2016-03-16 16:22:54 -04:00
Clayton Coleman 31e3265317 Credential providers are not newsworthy
Move the info to debugging level.
2016-03-07 21:50:39 -05:00
Yu-Ju Hong fd7e323cc6 Revert "Set timeout for accessing credential provider's URL"
This reverts commit 9d3806bceb.
2016-03-04 12:37:30 -08:00
Jeff Lowdermilk 9c20848af7 Merge pull request #22318 from yujuhong/read_url
Set timeout for accessing credential provider's URL
2016-03-03 15:21:01 -08:00
Eric Paris 5e5a823294 Move blunderbuss assignees into tree 2016-03-02 20:46:32 -05:00
Yu-Ju Hong 9d3806bceb Set timeout for accessing credential provider's URL
This changes sets the timeout and also adds the retry mechanism.
2016-03-01 15:41:16 -08:00
Clayton Coleman 8c27314915 Unqualified host:port pairs are valid Docker auth fields
The dockercfg and .docker/config.json files can contain host:path
combos, which are not correctly parsed by the keyring.
2016-02-18 13:18:34 -05:00
Rudi Chiarito 76e29ed455 Register ECR credential plugin only when an AWS cloud instance is created 2016-01-25 22:18:45 -05:00
Rudi Chiarito bc0dd97a70 ECR credential provider 2016-01-22 15:03:25 -05:00
David Oppenheimer 8ac484793d Comment out calls to httptest.Server.Close() to work around
https://github.com/golang/go/issues/12262 . See #19254 for
more details. This change should be reverted when we upgrade
to Go 1.6.
2016-01-11 23:02:11 -08:00
Tim Hockin 9698e957a6 Merge pull request #12717 from tamnd/fixdockercfg
Fix new docker config format for private registries
2015-09-18 14:43:38 -07:00
tummychow 78ce5da988 Move util.StringSet into its own package
A lot of packages use StringSet, but they don't use anything else from
the util package. Moving StringSet into another package will shrink
their dependency trees significantly.
2015-09-10 12:04:15 -07:00
Vanya Tarasov d6c43b0606 Recognize cloud-platform scope on GCP
GCP credential provider currently requires presence of 'devstorage.*' scope, however it fails to recognize 'cloud-platform' scope that implies it.
2015-09-01 16:04:53 -07:00
tamnd 906b279080 Support new docker config format for private registries 2015-08-22 15:37:25 +07:00
Kris Rousey 565189f5b8 Correcting all go vet errors 2015-08-11 13:55:37 -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
Quinton Hoole 988a413acf Merge pull request #9058 from deads2k/serialize-with-auth
serialize dockercfg with matching auth field
2015-06-05 11:26:14 -07:00
deads2k ac2c43fc87 serialize dockercfg with matching auth field 2015-06-05 11:14:10 -04:00
Eric Tune 760caea187 Merge pull request #8863 from mfojtik/fix-default-registry-matcher
Add 'docker.io' and 'index.docker.io' to default registry matcher
2015-06-01 10:28:34 -07:00
Michal Fojtik 9a94f7cc38 Add 'docker.io' and 'index.docker.io' to default registry matcher
Signed-off-by: Michal Fojtik <mfojtik@redhat.com>
2015-05-30 12:59:18 +02:00
Nghia Tran 8b57b6fea6 Support glob wildcards for gcr.io credentials 2015-05-29 10:44:59 -07:00
deads2k 72c0709f18 reduce scope of DockerConfigEntryWithAuth 2015-05-19 12:41:03 -04:00
deads2k 0c14e0cbdb add pull secret references to pods 2015-05-18 16:18:16 -04:00
deads2k be0f2d2930 add dockercfg secret types 2015-05-18 08:25:27 -04:00
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