kubernetes: "kubectl exec" does not work through "kubectl proxy"
I use kubectl v1.3.5 and v1.2.0 in the k8s cluster. If I proxy to the cluster with
$ kubectl proxy --port=8888
I get the following error when trying to execute a command in a container:
$ kubectl --server=http://localhost:8888 exec -ti test-pod bash
error: unable to upgrade connection: <h3>Unauthorized</h3>
Other commands like get pods
work fine. The server is contacted by the poxy with https://kubmaster.****.de:443
and a bearer token.
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 22 (12 by maintainers)
Commits related to this issue
- [WIP] Unify proxy servers Before this change, kubernetes had two proxy server implementations and also used a proxy server from Go stdlib (which is not upgrade-aware). This commit aims to unify them.... — committed to nhlfr/kubernetes by nhlfr 8 years ago
- Merge pull request #49534 from smarterclayton/separate_proxy Automatic merge from submit-queue Support exec/attach/portforward in `kubectl proxy` Use the UpgradeAwareProxy shared code in kubectl pr... — committed to kubernetes/kubernetes by deleted user 7 years ago
Updated my comment. Also found the same in 1.8 changelog,
“kubectl proxy now correctly handles the exec, attach, and portforward commands. You must pass --disable-filter to the command to allow these commands.”
Thanks.
Well, the unification and needed re-implementation of proxies may be too big change to get it done in 1.5 release. I’m going to work on this soon (in the next week). Let’s assume that the worst case will be 1.6 release.