Search code examples
javakubernetesfabric8

Upgrade Request Required when running exec in Kubernetes


Im using fabric8 Kubernetes Java Client and Im accessing Kubernetes through HTTP, I followed the example from fabric8 but I get the following error:

Expected HTTP 100 but received 400 instead, Bad Request.

What do I need to do to upgrade my connection to http/2?


Solution

  • I found out that this has to do with http2, because Kubernetes exec uses SPDY, the problem went away when I upgraded to curl version > 7.36 and installed nghttp2 on the server.

    After installing curl I was able to get the response by adding some headers

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