Skip to content
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

Authenticate as Google Service Account #31

Open
itmecho opened this issue Nov 20, 2019 · 5 comments
Open

Authenticate as Google Service Account #31

itmecho opened this issue Nov 20, 2019 · 5 comments

Comments

@itmecho
Copy link

itmecho commented Nov 20, 2019

I've created a service account in the Google cloud console and am struggling to find out how to authenticate as that service account via kubectl. The idea is that our deployment server should be able to execute kubectl set image deployment ... against the cluster but to do that, it needs to authenticate. It makes more sense to use a service account as opposed to a normal IAM user account in this situation.

Is this possible using dexter? If not, does anyone know of an example I can look at for how to achieve this?

@dkerwin
Copy link
Contributor

dkerwin commented Nov 21, 2019

I think dexter will not help you in this situation as OIDC is not involved here. I'm not really an expert on GCP so I will need to do more research to help you. Are you trying to access the API (with kubectl) from a pod running in kubernetes or from a VM? If you run in k8s you could just use a k8s serviceaccount and it should work our of the box if RBAC is setup correctly.

@dkerwin
Copy link
Contributor

dkerwin commented Nov 25, 2019

Anything else I can help you with?

@itmecho
Copy link
Author

itmecho commented Nov 26, 2019

Thanks for getting back to me! I couldn't see anything in the docs about it so I assumed it wasn't supported. I was just wondering as when I run the following commands, I get an OpenID connect token so I wasn't sure if it was possible to implement somehow?

gcloud auth activate-service-account  --key-file /path/to/key.file
gcloud auth print-identity-token [email protected]

@dkerwin
Copy link
Contributor

dkerwin commented Nov 27, 2019

Thank you for the update. From the top of my head I don't think this is a use-case for dexter. The classic OpenID flow doesn't really match the GCP service account usecase. There's no login from a real user, no callback, ... Sorry

@itmecho
Copy link
Author

itmecho commented Nov 28, 2019

Cool, thanks for letting me know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants