Google-cloud-python: Container: equivalent for `gcloud container clusters get-credentials`?

Created on 9 Mar 2018  路  3Comments  路  Source: googleapis/google-cloud-python

I did a quick search through the container api code and couldn't find anything similar. I'm working on an internal python library and currently have to shell out to gcloud in order to create kubeconfig files for cluster authentication, but it would be great to be able to do this from within the python API. Is this possible / on the roadmap?

question container

All 3 comments

According to the API if you just get the cluster it should return the master_auth property. Does that have what you need?

@jonparrott it does, and I'm sure I can use that to generate the kube config entry some other way, but I'm wondering if this API has this functionality built-in somewhere (just like how gcloud container clusters get-credentials adds a kube config entry).

Not built-in, but it seems that the cloud SDK just generates the kube config from that same endpoint, so it should be easily possible in your code.

Closing for now.

Was this page helpful?
0 / 5 - 0 ratings