-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Unauthorized error when creating a job #163
Comments
Can you print The error body should have more details about what is going wrong. Thanks! |
Here is the Response body:
Cheers |
@OberstHorst Thanks, sadly there's no real information in there after all... I will try to reproduce this on my local machine and debug from there. |
@brendandburns I forgot to mention that i am using v1.0.0beta1 from the maven repository. I was able to dig a bit deeper. If you need some debug output, just let me know. I am currently stepping a bit through the call structure, maybe i find something. Cheers and happy new year. |
I was able to identify the problem: The BatchV1API class only adds BearerToken authentications to the HTTP header for authentication. I fixed it by replacing |
Thanks for digging into this. Ultimatley, I think this is because the kubernetes openapi spec doesn't define an @mbohlool should we have a security section in our open api spec? |
At the time that OpenAPI spec generator developed, there were not enough information to add a security section. We can revisit that. |
I have the same problem :
but creating a job returns However doing the same thing like this |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Stale issues rot after 30d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Rotten issues close after 30d of inactivity. Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
@fejta-bot: Closing this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Hey,
i want to create Job using the Java Kubernetes API. My tool runs fine when using a minikube cluster, but fails if i try to execute it against a (testing) Kubernetes cluster that was deployed using ubuntu conjure-up. The cluster has been modified to deny anonymous access and uses RBAC and Node authorization and basic auth authentication. i can use kubectl create -f foo.yaml to create a job, when i try to create a job using the Java API it returns:
I tried this with a custom user and the default admin user with the same result. Both were able to create jobs using kubectl. The config is read correctly when i force parsing by using
KubeConfig.loadDefaultKubeConfig()
.This is how a build my client:
Cheers and thanks in advance
The text was updated successfully, but these errors were encountered: