<p>I have set up a Rancher k8s environment on AWS. </p>

<p>Rancher server lies behind a classic ELB with ssl termination and is accessible via e.g <code>https://my.rancher.server</code>.</p>

<p>I have deployed a simple pod via the command line by running</p>

<pre><code>kubectl create -f &lt;podfilename.yml&gt;
</code></pre>

<p>I am then able to <code>get</code> and <code>describe</code> the pod.</p>

<p>However, the following command fails:</p>

<pre><code>$ kubectl exec my.pod.name -- ls /app
W1219 12:13:12.053543   16174 http.go:363] Error reading backend response: unexpected EOF
error: error sending request: Post https://my.rancher.server/r/projects/1a1043/kubernetes:6443/api/v1/namespaces/default/pods/my.pod.name/exec?command=ls&amp;command=%2Fapp&amp;container=k8s-demo&amp;container=k8s-demo&amp;stderr=true&amp;stdout=true: unexpected EOF
</code></pre>

<p><strong>edit</strong>: this is the json returned:</p>

<pre><code>{
  "kind": "Status",
  "apiVersion": "v1",
  "metadata": {

  },
  "status": "Failure",
  "message": "Upgrade request required",
  "reason": "BadRequest",
  "code": 400
}
</code></pre>

<p>I have configured my elb to use ssl listener, and also configured proxy protocol.</p>

<p><a href="https://i.stack.imgur.com/orDTA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/orDTA.png" alt="enter image description here"></a></p>

<p>ELB's HTTP does not support websockets; you need to use a SSL listener -> TCP backend and configure proxy protocol support. <a href="http://rancher.com/docs/rancher/v1.6/en/installing-rancher/installing-server/basic-ssl-config/#elb" rel="nofollow noreferrer">http://rancher.com/docs/rancher/v1.6/en/installing-rancher/installing-server/basic-ssl-config/#elb</a></p>
