Having trouble running example
See original GitHub issueI get 403 Forbidden when running Example.java. I tried setting KUBECONFIG to the absolute path of my ~/.kube/config file. I’m able to run kubectl get pods --all-namespaces
. Is there something I’m missing?
null for gcp
Exception in thread "main" io.kubernetes.client.ApiException: Forbidden
at io.kubernetes.client.ApiClient.handleResponse(ApiClient.java:882)
at io.kubernetes.client.ApiClient.execute(ApiClient.java:798)
at io.kubernetes.client.apis.CoreV1Api.listPodForAllNamespacesWithHttpInfo(CoreV1Api.java:18462)
at io.kubernetes.client.apis.CoreV1Api.listPodForAllNamespaces(CoreV1Api.java:18440)
at io.kubernetes.client.examples.Example.main(Example.java:40)
Issue Analytics
- State:
- Created 6 years ago
- Comments:19 (10 by maintainers)
Top Results From Across the Web
11 Common Running Mistakes to Avoid - Verywell Fit
11 Common Running Mistakes to Avoid · Wearing the Wrong Shoes · Doing Too Much, Too Soon · Overstriding · Having Bad Upper...
Read more >Why some runs feel harder and 3 useful tips you need to know
If you've poured your mental energy into work, you'll have less for running. And this can be a big reason why some runs...
Read more >How to Run Properly (4 Steps for Beginners to Start Running)
Learn how to run in our step-by-step guide. We'll show you proper running technique so when the zombies come, you don't get eaten....
Read more >HAVING TROUBLE RUNNING TESTS AND EXAMPLES
I am a new user of pysph, I have followed the procedure given in pysph for the installation of the packages. However, when...
Read more >The Big Problem With Road Running (5 Solutions) - YouTube
Road running is a staple for most of us but how good is it actually for us and our running ? Because it...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Ok I figured it out 😃 So I noticed that my
kubectl
uses basic auth to connect to the clusterYet after digging around in the master branch It seems to have been corrected but not in the 1.0.0-beta1 release. However the correction is not complete. Since my defaultConfig uses basic auth over https, it has a username, password and client certificate but no access token. My workaround was to create one without the factory method.
And it works 😃
A more deeper question would be why create many
Authentication
methods (ApiKeyAuth
,HttpBasicAuth
,OAuth
) if all API calls hardcode theBearerToken
key requiring API only?Anyhow hope this helps anyone else struggling with GKE 😃
Thanks - I don’t think the client fully supports the gcp authenticator (at the very minimum token refresh isn’t implemented). It looks like you’re running on GKE, so you could try
To get a credential format the client accepts in the meantime.