Commit Graph

42 Commits (56dc8f9a6ab09debeddf5349ee26730d3e9107f8)

Author SHA1 Message Date
Davanum Srinivas 0f5013b715 Better check for GCE VM
we should do what is being done in GoogleCloudPlatform/google-cloud-go:
https://github.com/GoogleCloudPlatform/google-cloud-go/blob/master/compute/metadata/metadata.go#L259-L267

Looks like folks are reusing appliances which end up with
```
$ cat /sys/class/dmi/id/product_name
Google Search Appliance
```
2018-01-17 18:35:51 -05:00
Michael Taufen 8ec1958667 All Kubelet flags should be explicitly registered
This explicitly registers Kubelet flags from libraries that were
registering flags globally, and stops parsing the global flag set.
In general, we should always be explicit about flags we register
and parse, so that we maintain control over our command-line API.
2018-01-09 17:37:34 -08:00
Jeff Grafton efee0704c6 Autogenerate BUILD files 2017-12-23 13:12:11 -08:00
Jeff Grafton aee5f457db update BUILD files 2017-10-15 18:18:13 -07:00
Jeff Grafton a7f49c906d Use buildozer to delete licenses() rules except under third_party/ 2017-08-11 09:32:39 -07:00
Jeff Grafton 33276f06be Use buildozer to remove deprecated automanaged tags 2017-08-11 09:31:50 -07:00
Eric Chiang 3f888f2edf GCP credential provider: add "type" field to fake JSON key in unit test 2017-04-28 16:16:53 -07:00
Mike Danese a05c3c0efd autogenerated 2017-04-14 10:40:57 -07:00
Kubernetes Submit Queue c3b897d930 Merge pull request #36516 from apelisse/owners-pkg-credentialprovider
Automatic merge from submit-queue

Curating Owners: pkg/credentialprovider

cc @liggitt @erictune

In an effort to expand the existing pool of reviewers and establish a
two-tiered review process (first someone lgtms and then someone
experienced in the project approves), we are adding new reviewers to
existing owners files.


If You Care About the Process:
------------------------------

We did this by algorithmically figuring out who’s contributed code to
the project and in what directories.  Unfortunately, that doesn’t work
well: people that have made mechanical code changes (e.g change the
copyright header across all directories) end up as reviewers in lots of
places.

Instead of using pure commit data, we generated an excessively large
list of reviewers and pruned based on all time commit data, recent
commit data and review data (number of PRs commented on).

At this point we have a decent list of reviewers, but it needs one last
pass for fine tuning.

Also, see https://github.com/kubernetes/contrib/issues/1389.

TLDR:
-----

As an owner of a sig/directory and a leader of the project, here’s what
we need from you:

1. Use PR https://github.com/kubernetes/kubernetes/pull/35715 as an example.

2. The pull-request is made editable, please edit the `OWNERS` file to
remove the names of people that shouldn't be reviewing code in the
future in the **reviewers** section. You probably do NOT need to modify
the **approvers** section. Names asre sorted by relevance, using some
secret statistics.

3. Notify me if you want some OWNERS file to be removed.  Being an
approver or reviewer of a parent directory makes you a reviewer/approver
of the subdirectories too, so not all OWNERS files may be necessary.

4. Please use ALIAS if you want to use the same list of people over and
over again (don't hesitate to ask me for help, or use the pull-request
above as an example)
2017-01-13 14:34:02 -08:00
deads2k 6a4d5cd7cc start the apimachinery repo 2017-01-11 09:09:48 -05:00
Jeff Grafton 20d221f75c Enable auto-generating sources rules 2017-01-05 14:14:13 -08:00
Mike Danese 161c391f44 autogenerated 2016-12-29 13:04:10 -08:00
Mike Danese c87de85347 autoupdate BUILD files 2016-12-12 13:30:07 -08:00
Antoine Pelisse 23b95d9f5e Update OWNERS approvers and reviewers: pkg/credentialprovider 2016-11-09 10:17:14 -08:00
Mike Danese 3b6a067afc autogenerated 2016-10-21 17:32:32 -07:00
guangxuli a68812d954 remove the tmp file 2016-09-22 23:37:27 +08:00
k8s-merge-robot 75689dd4d2 Merge pull request #28539 from derekwaynecarr/credential_provider_timeout
Automatic merge from submit-queue

Fix httpclient setup for gcp credential provider to have timeout

The default http client has no timeout.

This could cause problems when not on GCP environments.

This PR changes to use a 10s timeout, and ensures the transport has our normal defaults applied.

/cc @ncdc @liggitt
2016-07-22 18:01:41 -07:00
k8s-merge-robot 8eb0cf5039 Merge pull request #28871 from vishh/gce-cp
Automatic merge from submit-queue

Do not query the metadata server to find out if running on GCE.  Retry metadata server query for gcr if running on gce.

Retry the logic for determining is gcr is enabled to workaround metadata unavailability.

Note: This patch does not retry fetching registry credentials.
2016-07-18 14:32:04 -07:00
Davanum Srinivas 2b0ed014b7 Use Go canonical import paths
Add canonical imports only in existing doc.go files.
https://golang.org/doc/go1.4#canonicalimports

Fixes #29014
2016-07-16 13:48:21 -04:00
Vishnu kannan ea1a459a80 Check if service accounts exist in gcr credential provider
Signed-off-by: Vishnu kannan <vishnuk@google.com>
2016-07-15 11:41:02 -07:00
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
derekwaynecarr 5366bfe08d Fix httpclient setup for gcp credential provider to have timeout 2016-07-06 13:37:22 -04:00
David McMahon ef0c9f0c5b Remove "All rights reserved" from all the headers. 2016-06-29 17:47:36 -07:00
zhouhaibing089 bf1a3f99c0 Uncomment the code that cause by #19254 2016-04-25 23:21:31 +08: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
deads2k ab03317d96 support CIDRs in NO_PROXY 2016-03-16 16:22:54 -04: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
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
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
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
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
Nghia Tran 8b57b6fea6 Support glob wildcards for gcr.io credentials 2015-05-29 10:44:59 -07: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
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
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 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