You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm running a script that calls into kubernetes via the python client. However, it appears unable to get the correct credentials. I /can/ use the kubectl command-line interface, which I've noticed populates my .kube/config file with an access-token and an expiry whenever I make a command (e.g., kubectl get pods). As long as that token has not expired, my python script runs fine. However, once that token expires it doesn't seem to be able to refresh it, instead failing and telling me to set GOOGLE_APPLICATION_CREDENTIALS.
Of course, when I created a service-account with a keyfile and pointed GOOGLE_APPLICATION_CREDENTIALS to that keyfile, it gave me the following error:
RefreshError: ('invalid_scope: Empty or missing scope not allowed.', u'{\n "error" : "invalid_scope",\n "error_description" : "Empty or missing scope not allowed."\n}')
Although from the code it seems like you can provide scopes to credentials, I am trying to create a Kubernetes client via kubernetes.config.kube_config.new_client_from_config, which seems to create credentials without scopes.
Is there something wrong with my understanding of this client? Appreciate any help with this!
I am using the 3.0.0 release of the kubernetes python library. In case it is helpful, here is my .kube/config:
I'm running a script that calls into kubernetes via the python client. However, it appears unable to get the correct credentials. I /can/ use the
kubectl
command-line interface, which I've noticed populates my.kube/config
file with an access-token and an expiry whenever I make a command (e.g.,kubectl get pods
). As long as that token has not expired, my python script runs fine. However, once that token expires it doesn't seem to be able to refresh it, instead failing and telling me to setGOOGLE_APPLICATION_CREDENTIALS
.Of course, when I created a service-account with a keyfile and pointed
GOOGLE_APPLICATION_CREDENTIALS
to that keyfile, it gave me the following error:Although from the code it seems like you can provide scopes to credentials, I am trying to create a Kubernetes client via
kubernetes.config.kube_config.new_client_from_config
, which seems to create credentials without scopes.Is there something wrong with my understanding of this client? Appreciate any help with this!
I am using the 3.0.0 release of the kubernetes python library. In case it is helpful, here is my
.kube/config
:The text was updated successfully, but these errors were encountered: