title: Kubectl port-forwarding not working for IPv6 binding with socat
body: <p>I'm trying to understand why this particular <code>socat</code> command isn't working in my case where I run it in a IPv6 only Kubernetes cluster.</p>
  <p>Cluster is build on top of AWS with Calico CNI &amp; containerd. Provisioned using <code>kubeadm</code> and Kubernetes 1.21.</p>
  <p>I have run the following <code>socat</code> command which binds to loopback interface <code>::1</code>,</p>
  <pre><code>kubectl --context=$CLUSTER1 run --image=alpine/socat socat -- tcp6-listen:15000,bind=\[::1\],fork,reuseaddr /dev/null
  </code></pre>
  <p>And then I try to <code>port-forward</code> and <code>curl</code> to <code>15000</code> port,</p>
  <pre><code>kubectl --context=$CLUSTER1 port-forward pod/socat 35000:15000 --address=::1
  curl -ivg http://localhost:35000
  </code></pre>
  <p>I get the error,</p>
  <pre><code>Forwarding from [::1]:35000 -&gt; 15000
  Handling connection for 35000
  E0830 17:09:59.604799   79802 portforward.go:400] an error occurred forwarding 35000 -&gt; 15000: error forwarding port 15000 to pod a8ba619774234e73f4c1b4fe4ff47193af835cffc56cb6ad1a8f91e745ac74e9, uid : failed to execute portforward in network namespace &quot;/var/run/netns/cni-8bade2c1-28c9-6776-5326-f10d55fd0ff9&quot;: failed to dial 15000: dial tcp4 127.0.0.1:15000: connect: connection refused
  </code></pre>
  <p>Its listening to <code>15000</code> as,</p>
  <pre><code>Active Internet connections (servers and established)
  Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
  tcp        0      0 ::1:15000               :::*                    LISTEN      1/socat
  </code></pre>
  <p>However if I run the following it works fine,</p>
  <pre><code>kubectl --context=$CLUSTER1 run --image=alpine/socat socat -- tcp6-listen:15000,bind=\[::\],fork,reuseaddr /dev/null
  </code></pre>
  <p>Not sure I understand why <code>port-forward</code> would fail for the loopback interface binding <code>::1</code> but not for catch all <code>::</code>. Can someone please shed some light on this ?</p>