-
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
Python Kubernetes Client - 500 Internal Server Error when running exec command #15484
Comments
Just realized there's a lot of issues that got opened today regarding the same problem. Closing. |
Actually not sure that this is 100% related yet, so reopening to track. |
Any recommendations then on a client that uses SPDY? Or is using a Python client just not possible right now with Teleport and Kubernetes? @tigrato |
For now, I think that only Go's client uses SPDY |
Expected behavior:
I expect that with the right authentication and access that I can run
exec
commands from a Python Kubernetes client without error.Current behavior:
This could be user error, but it's hard for me to tell without having the real error message appear. I have an API object in Python which we will call
api
from this point forward. I've tested a few scenarios.Docker Desktop Cluster:
I can run exec commands, and any other command that I choose. No teleport enabled for local cluster. This is my baseline to determine that my Python syntax and commands are correct. All commands are working as expected, including the Websocket-based
exec
call.Teleport Cluster:
I can run all commands except for exec. This returns the error with traceback:
just a generic handshake error with a 500 code.
kubectl:
To confirm that I actually have permissions to do this, I also ran commands from
tsh
on my shell. I have access to any resource that I need, and along with that,exec
commands are working fine when usingtsh
.I have also checked through kube apiserver logs as well as kube authenticator logs and it looks like the commands are not making it to Kubernetes which is why I suspect teleport in this case.
I believe that the variable here that isn't a control between the cases is SPDY vs Websockets for the exec call. It seemed strange to me that
kubectl
can exec but Python can't even with the exact same login process andkubeconfig
and I believe thatkubectl
still uses SPDY for theexec
, while Python uses Websockets. I was trying to find a way to call the exec function with SPDY from Python but the python-kubernetes doesn't support this (based on my own research, would like confirmation here). The one thing that I can see that changes between kubectl and python api call is SPDY vs Websockets. That's my best guess right now.Bug details:
exec
,namespace
, andpods
tsh login --proxy=<my proxy>
tsh kube login <cluster id>
api.read_namespaced_pod("<pod name>", "<ns>")
- should work fineThe text was updated successfully, but these errors were encountered: