在 Kubernetes 中执行 运行 时需要升级请求

Upgrade Request Required when running exec in Kubernetes

我正在使用 fabric8 Kubernetes Java 客户端并且我通过 HTTP 访问 Kubernetes,我遵循了来自 fabric8 但出现以下错误:

Expected HTTP 100 but received 400 instead, Bad Request.

我需要做什么才能将我的连接升级到 http/2?

我发现这与 http2 有关,因为 Kubernetes exec 使用 SPDY,当我升级到 curl 版本 > 7.36 并在服务器上安装 nghttp2 时,问题就消失了。

安装 curl 后,我可以通过添加一些 headers

来获得响应

curl -H "Connection: upgrade" -H "Upgrade: SPDY/3.1" {master url:port/pod/exec}