-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
RefreshError with config.load_kube_config() #339
Comments
Can you provide these information: If kubeconfig succeeded, most probably we need to change our code to run the command line code gcloud provides instead of using google credentials api. |
1- with
2- removed current ~/.kube/config (since I had already shut down all clusters from GCP console anyways), then ran
And indeed 3- ran
Note that the 4- python client worked. 5- the only difference in the two config files are indeed those two fields Thanks! |
It is strange that I did the same steps, even created a new python environment and installed latest version of kubernetes package but couldn't reproduce this. first run of the client adds
if you get different results, please also include all pypi package versions so we can compare. |
When creating a new virtualenv to follow your steps I remembered that I had previously installed python 2.7.13 with homebrew to resolve an issue with OpenSSL causing the kubernetes client not being able to deploy containers to clusters with macOS's stock python 2.7.10. Looking in
So I added it to my .zshrc, and everything works now ( Anyways now I can continue with my project. Thanks! |
Nice. You are welcome. |
Running into the same issue again even with the setup that used to work (as far as I remember). Below is the print out from
|
I hit the same issue when using a service account (by setting environment variable GOOGLE_APPLICATION_CREDENTIALS). I suspect this is an issue with google-auth-library-python and not the Kubernetes Python Client library |
I opened up googleapis/google-auth-library-python#217 |
The response to googleapis/google-auth-library-python#217 was that this is working as intended.
I actually need cloud-platform scope otherwise requests to K8s master returned unauthorized. I was able to work around this by piping in my own credential refresher so I could set the scopes see here. Some options for better supporting this would be
|
Hm I seem to be running in to this same issue in #386. I agree that the google auth side is working as expected; isn't this a bug with the kubernetes python client? |
does running the command line tool in |
I'm running into what looks like the same bug, and it's reproducible here. Starting with no kubeconfig, I run I can help debug this. Let me know if you prefer to reopen this, or if I should file another bug report. Thanks! |
I also faced with a problem with refreshing token. Python client reads token from |
gcloud container clusters get-credentials my-cluster
Confirmed with
gcloud container clusters get-credentials my-cluster
, and./kube/config
was created.Then in python:
returns:
What did I miss?
stack trace:
The text was updated successfully, but these errors were encountered: