-
Notifications
You must be signed in to change notification settings - Fork 193
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
Using ...pods.exec.post() results in Error: Upgrade request required #319
Comments
kubernetes-client doesn't This issue discussing how to use |
Oh, this reminds me, I found a blog post and looked at the Kube server code to see how the Kube API wanted to talk over the websocket channel for the seemingly undocumented exec endpoint. It wants websocket frames where the first byte indicates the stream (stdout/stderr/....something else/out of band-errors) and then the rest of the frame is the command as binary. I'm happy to open a PR for it, but I don't know what kind of interface |
It would be rad to support this somehow because we get a bunch of questions about it. One incremental way to add support is to handle the upgrade response in That's probably the minimum amount of support in kubernetes-client to actually support |
Cool, that sounds like an entirely reasonable first step. I hope to take a look this weekend :) |
@silasbw hey, where would you expect this functionality to live? if i'm understanding the structure correctly, I'd guess it it belongs in fluent-openapi... as special logic in the post function? I don't think I can express it as part of a swagger spec - last I checked swagger didn't have built in support for websockets... |
What if we add code here-ish and handle it in a way similar to 401ing: https://github.com/godaddy/kubernetes-client/blob/master/lib/request.js#L94 If the response has an upgrade header, we upgrade the connection and retry. We might be able to handle that way without adding endpoint specific logic. |
Currently using this bit of code for the functionality, however while commands are instantly executed, it doesn't actually close the socket for ~30 seconds. Not sure why, but it works for now.
|
I am currently trying to use
client.api.v1.namespaces(ns).pods(pod).exec.post()
to run a command in a pod. Using it looks something like this:This results in the following error:
This error occurs with Kubernetes v1.9.0 as well as with v1.9.4 and v1.9.5. I used version 6.0.0 of your client.
If there is any more information I can provide you to help me solve this just tell me.
The text was updated successfully, but these errors were encountered: