<p>I have deployed Google cloud Kubernetes cluster. The cluster has internal IP only. </p>

<p>In order to access it, I created a virtual machine <code>bastion-1</code> which has external IP. </p>

<p>The structure: </p>

<pre><code>My Machine -&gt; bastion-1 -&gt; Kubernetes cluster
</code></pre>

<p>The connection to the proxy station:</p>

<pre><code>$ ssh bastion -D 1080
</code></pre>

<p>now using <code>kubectl</code> using proxy:</p>

<pre><code>$ HTTPS_PROXY=socks5://127.0.0.1:1080 kubectl get pods
No resources found.
</code></pre>

<p>The Kubernetes master server is responding, which is a good sign.</p>

<p>Now, trying to ssh a pod:</p>

<pre><code>$ HTTPS_PROXY=socks5://127.0.0.1:1080 kubectl exec -it "my-pod" -- /bin/bash
error: error sending request: Post https://xxx.xxx.xxx.xxx/api/v1/namespaces/xxx/pods/pod-xxx/exec?command=%2Fbin%2Fbash&amp;container=xxx&amp;container=xxx&amp;stdin=true&amp;stdout=true&amp;tty=true: EOF
</code></pre>

<p>Question: 
How to allow ssh connection to pod via bastion? What I'm doing wrong?</p>

<p>You can't do this right now.</p>

<p>The reason is because the connections used for commands like exec and proxy use SPDY2.</p>

<p>There's a bug report <a href="https://github.com/kubernetes/kubernetes/issues/58065" rel="nofollow noreferrer">here</a> with more information.</p>

<p>You'll have to switch to using a HTTP proxy</p>
