-
Notifications
You must be signed in to change notification settings - Fork 192
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
pod-exec
Fails with 403
#346
Comments
The |
I have the same problem. Here is my version. I noticed when debugging that "parsedUrl.auth" is undefined. |
Hmm, I didn't really think about auth at all when I was setting that up, so it's very possible I missed something. Perhaps I can find some time to look into it... |
I also got bitten by this. After a fair bit of debugging, I realized that while client certificate authentication worked fine, token authentication failed. This is because "normal" http(s) requests are done using My quick&hacky workaround for now is to add options.headers = {
...options.headers,
authorization: `Bearer ${options.auth.bearer}`
} just before kubernetes-client/lib/backends/request.js Line 62 in 847623c
|
When this issue can be fixed? |
I would love to take a PR for this :) We're busy working on merging this client with the kubernetes-client/javascript one, so I apologize for being unresponsive on this issue. |
Thanks @silasbw . Looking forward to seeing the fix in the coming release. :-) |
Any chance we can get the fix merged? |
I managed to work around this issue with some user code (as if you can't manually edit the library's code).
I'm using Kubernetes 1.13. |
When using the following command:
api.v1.namespaces('kube-system').pods(albPod.name).exec.get({ qs: { command: ['nginx', '-t'], container: 'nginx-ingress', stdout: true, stderr: true } });
I get the following error:
This is the same failure for both
get
andpost
. I have tested usingconfig.fromKubeconfig(process.env.KUBECONFIG)
but have yet to try usingconfig.getInCluster()
but I do not think this is an auth issue. I am able to successfully usekubectl
to get thenginx -t
output like so:kubectl exec -in kube-system albPod.name -c nginx-ingress -- bash -c 'nginx -t'
My only guess is something to do with the websocket upgrade. I noticed the upgrade response that
kubectl
uses is the following:while the code included here uses for
pod-exec
is usingbase64.channel.k8s.io
.The text was updated successfully, but these errors were encountered: