0

I have written a simple reverse proxy which will proxy requests to a K8s cluster. The reverse proxy is deployed in a cluster which use gloo as api gateway.

I can perform kubectl get pods operations outside the cluster, using the reverse proxy to proxy kubectl requests to kube-apiserver: kubectl -> gloo -> simple reverse proxy -> kube-apiserver

But when I do kubectl portward I find that the request gets exception at POST /api/v1/namespaces/<namespace>/pods/<pod name>/portforward with exception info error: error upgrading connection: enter image description here

From the exception, it seems that gloo does not support the http to spdy protocol upgrade. How to solve this problem?

Any advice is greatly appreciated.

flyer
  • 9,280
  • 11
  • 46
  • 62
  • Try with kubectl v1.24 (there was some proxying / websocket related fixes, recently). If that doesn't help, then the issue is with your proxy: try something simpler first (apache/nginx/...) – SYN May 29 '22 at 19:49
  • @SYN I have tried `kubectl-1.22.2` and `kubectl-1.24.1` and got the same error `error upgrading connection`. This problem may be related to `gloo`, and it is still unclear how gloo's support for protocol upgrading (http->spdy) is configured... – flyer May 30 '22 at 01:34
  • 1
    It seems that `Envoy` doesn't support `spdy`. `gloo` is based on `Envoy` and so `gloo` doesn't support `spdy`: - https://www.envoyproxy.io/docs/envoy/latest/intro/arch_overview/http/http_connection_management - https://github.com/kubernetes/kubernetes/issues/89163 – flyer May 30 '22 at 02:36

0 Answers0