3

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?

feco
  • 4,384
  • 5
  • 27
  • 44
  • That looks like the Kubernetes API server didn't like something about your request. Do you have any more details on the HTTP 400 error? – CJ Cullen May 20 '16 at 17:09

1 Answers1

3

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}

feco
  • 4,384
  • 5
  • 27
  • 44
  • Hi, I'm not having any luck with these headers , `curl -H "Connection: upgrade" -H "Upgrade: SPDY/3.1" http://172.10.2.4:8080/api/v1/namespaces/mailho/pods/webmail-2495503454-zufoc/exec?container=webmail&command=ls [2] 28991 ` . The response I get `[2] 28991` – Jonathan Sep 01 '16 at 10:53
  • Your shell is backgrounding the process when it sees `&`. You need to wrap the whole URL in quotes to avoid evaluating special characters - `curl -H "Connection: upgrade" -H "Upgrade: SPDY/3.1" "http://172.10.2.4:8080/api/v1/namespaces/mailho/pods/webmail‌​-2495503454-zufoc/ex‌​ec?container=webmail‌​&command=ls"` – hexedpackets Oct 05 '16 at 21:58