Merge pull request #36012 from jlowdermilk/cmd-auth-provider

Automatic merge from submit-queue

Add cmd support to gcp auth provider plugin

**What this PR does / why we need it**:

Adds ability for gcp auth provider plugin to get access token by shelling out to an external command. We need this because for GKE, kubectl should be using gcloud credentials. It currently uses google application default credentials, which causes confusion if user has configured both with different permissions (previously the two were almost always identical).

**Which issue this PR fixes**:
Addresses #35530 with gcp-only solution, as generic cmd plugin was deemed not useful for other providers.

**Special notes for your reviewer**:

Configuration options are to support whatever future command gcloud provides for printing access token of active user. Also works with existing command (`gcloud auth print-access-token`)

```release-note
```
This commit is contained in:
Kubernetes Submit Queue
2016-11-06 01:45:48 -08:00
committed by GitHub
5 changed files with 274 additions and 11 deletions

View File

@@ -875,6 +875,7 @@ k8s.io/kubernetes/plugin/pkg/auth/authenticator/token/webhook,ghodss,1
k8s.io/kubernetes/plugin/pkg/auth/authorizer/rbac,hurf,1
k8s.io/kubernetes/plugin/pkg/auth/authorizer/rbac/bootstrappolicy,mml,1
k8s.io/kubernetes/plugin/pkg/auth/authorizer/webhook,hurf,1
k8s.io/kubernetes/plugin/pkg/client/auth/gcp,jlowdermilk,0
k8s.io/kubernetes/plugin/pkg/client/auth/oidc,cjcullen,1
k8s.io/kubernetes/plugin/pkg/scheduler,fgrzadkowski,0
k8s.io/kubernetes/plugin/pkg/scheduler/algorithm/predicates,fgrzadkowski,0
1 name owner auto-assigned
875 k8s.io/kubernetes/plugin/pkg/auth/authorizer/rbac hurf 1
876 k8s.io/kubernetes/plugin/pkg/auth/authorizer/rbac/bootstrappolicy mml 1
877 k8s.io/kubernetes/plugin/pkg/auth/authorizer/webhook hurf 1
878 k8s.io/kubernetes/plugin/pkg/client/auth/gcp jlowdermilk 0
879 k8s.io/kubernetes/plugin/pkg/client/auth/oidc cjcullen 1
880 k8s.io/kubernetes/plugin/pkg/scheduler fgrzadkowski 0
881 k8s.io/kubernetes/plugin/pkg/scheduler/algorithm/predicates fgrzadkowski 0