-
Notifications
You must be signed in to change notification settings - Fork 40k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
auth/gcp: configurable scopes for gcp default credentials #58141
auth/gcp: configurable scopes for gcp default credentials #58141
Conversation
I think |
38a287b
to
7e24f9c
Compare
/hold cancel |
- add config.scopes field comma-separated scope URLs, to be used with Google Application Default Credentials (i.e. GOOGLE_APPLICATION_CREDENTIALS env) - default scopes now include userinfo.email scope so the headless app with gserviceaccount keys can have RoleBindings with email instead of account ID. Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
7e24f9c
to
e19dc6a
Compare
FYI @ericchiang |
Can you add a unittest that checks that:
|
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
@cjcullen Methods in Please take a look at ad4fdc7.
See
I'm having trouble inspecting the google.TokenSource, as the method returns
See |
I like the refactor. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ahmetb, cjcullen The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
/test pull-kubernetes-e2e-kops-aws |
/test all [submit-queue is verifying that this PR is safe to merge] |
/retest Review the full test history for this PR. Silence the bot with an |
Automatic merge from submit-queue (batch tested with PRs 58903, 58141, 58900). If you want to cherry-pick this change to another branch, please follow the instructions here. |
For anyone else who finds this in the future and is confused like me as to how some gserviceaccount's can successfully be referred to in a if you use If instead the active service account in |
also - @ahmetb thanks for making the behavior consistent going forward 😄 |
@mattnworb thanks for the clarification! Yes, if your [Cluster]RoleBinding object previously used a subject name like This is a breaking change, if it interrupts you, you can go back to using kubectl 1.9 or better: you can edit The numeric account name behavior was never documented and meant to be used that way, so hopefully addressing this early on before this use case gets popular will prevent us from dealing with this down the road! |
What this PR does / why we need it:
config.scopes
field comma-separated scope URLs, to be used with GoogleApplication Default Credentials (i.e. GOOGLE_APPLICATION_CREDENTIALS env)
env, craft a kubeconfig file with GKE master IP+CA cert and should be able to authenticate
to GKE in headless mode without requiring gcloud CLI, and they can now use the
email address of the gserviceaccount in RBAC role bindings and not use Google Cloud IAM at all.
using gserviceaccount keys can now be done without gcloud as well.
that use numeric uniqueID of the gserviceaccount will be broken (this behavior was
never documented/guaranteed). from now on email address of the service account
should be used as the subject in RBAC Role Bindings.
Release note:
/assign @cjcullen
/sig gcp