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

Most upvoted comments

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.