kubernetes: kubectl exec not working behind c# reverse-proxy on version 1.18 and below.
What happened: We have a scenario where we have upgrade aware reverse proxy (https://github.com/microsoft/reverse-proxy) running in front of API server.
The normal kubectl commands over proxy seem to be working in all versions. Whereas the commands which require connection upgrade such as kubectl exec
we get the following error as below for k8s version 1.18 or below:
F1020 20:51:57.011101 20900 helpers.go:115] error: unable to upgrade connection: unable to upgrade: unable to negotiate protocol: client supports [v4.channel.k8s.io, v3.channel.k8s.io, v2.channel.k8s.io, channel.k8s.io], server accepts [v4.channel.k8s.io v3.channel.k8s.io v2.channel.k8s.io channel.k8s.io]
What you expected to happen: Upgrade aware commands should work similar to that of their working in 1.19.
How to reproduce it (as minimally and precisely as possible):
- Clone this repo: https://github.com/rapatchi/reverse-proxy
- Replace <API-SERVER-URL> and <CA-DATA> in the sample https://github.com/rapatchi/reverse-proxy/blob/master/samples/ReverseProxy.Code.Sample/Startup.cs with your k8s cluster details.
- Build the code accordingly by using the readme: https://github.com/rapatchi/reverse-proxy#build
- Run the sample preferably in visual studio.
- Update your kubeconfig to point to the proxy server and make
kubectl exec
call.
Anything else we need to know?:
Environment:
- Kubernetes version (use
kubectl version
):
Client Version: version.Info{Major:“1”, Minor:“18”, GitVersion:“v1.18.3”, GitCommit:“2e7996e3e2712684bc73f0dec0200d64eec7fe40”, GitTreeState:“clean”, BuildDate:“2020-05-20T12:52:00Z”, GoVersion:“go1.13.9”, Compiler:“gc”, Platform:“windows/amd64”} Server Version: version.Info{Major:“1”, Minor:“18”, GitVersion:“v1.18.10”, GitCommit:“62876fc6d93e891aa7fbe19771e6a6c03773b0f7”, GitTreeState:“clean”, BuildDate:“2020-10-15T01:43:56Z”, GoVersion:“go1.13.15”, Compiler:“gc”, Platform:“linux/amd64”}
- Cloud provider or hardware configuration: kubeadm
- OS (e.g:
cat /etc/os-release
): NAME=“Ubuntu” VERSION=“18.04.5 LTS (Bionic Beaver)” ID=ubuntu ID_LIKE=debian PRETTY_NAME=“Ubuntu 18.04.5 LTS” VERSION_ID=“18.04” HOME_URL=“https://www.ubuntu.com/” SUPPORT_URL=“https://help.ubuntu.com/” BUG_REPORT_URL=“https://bugs.launchpad.net/ubuntu/” PRIVACY_POLICY_URL=“https://www.ubuntu.com/legal/terms-and-policies/privacy-policy” VERSION_CODENAME=bionic UBUNTU_CODENAME=bionic - Kernel (e.g.
uname -a
): Linux kube-master 5.4.0-1031-azure #32~18.04.1-Ubuntu SMP Tue Oct 6 10:03:22 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux - Install tools:
- Network plugin and version (if this is a network-related bug):
- Others:
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 16 (11 by maintainers)
Thank you @victor-timofei !