Unable to do port forwarding: socat not found. Kubernetes on Docker

11/4/2015

I'm running a dev kubernetes cluster on Docker Machine with GCE as provider. Cluster was setup using this tutorial: https://github.com/kubernetes/kubernetes/blob/master/docs/getting-started-guides/docker.md. Everything's working fine except when I try to do port-forward. I get:

E1104 00:58:23.210982   18552 portforward.go:310] An error occurred forwarding 650 -> 650: Error forwarding port 650 to pod pfsd-rc-7xrq1_default, uid : Unable to do port forwarding: socat not found.
I1104 00:58:23.220147   18552 portforward.go:251] Handling connection for 650
E1104 00:58:23.480593   18552 portforward.go:310] An error occurred forwarding 650 -> 650: Error forwarding port 650 to pod pfsd-rc-7xrq1_default, uid : Unable to do port forwarding: socat not found.
I1104 00:58:23.481531   18552 portforward.go:251] Handling connection for 650
E1104 00:58:23.851200   18552 portforward.go:310] An error occurred forwarding 650 -> 650: Error forwarding port 650 to pod pfsd-rc-7xrq1_default, uid : Unable to do port forwarding: socat not found.
I1104 00:58:23.852122   18552 portforward.go:251] Handling connection for 650

I've tried installing locally, on the GCE machine and inside the container and nothing did the trick. Anyone else hit this?

-- Joe Doliner
docker
kubernetes

4 Answers

9/12/2019

The error clearly says "socat not found". So we need to install it(SOcket CAT), here I'm using a Ubuntu. So it can be install with apt install socat.

-- Milen John Thomas
Source: StackOverflow

11/4/2015

What image did you use for the virtual machine? If you use the container VM image, it already has socat installed.

-- Robert Bailey
Source: StackOverflow

8/3/2019

It's a bit late but still, I think it will be helpful for other people.

It says socat isn't installed. Running apt-get -y install socat on the host machine resolves the problem. It worked for me.

-- Rewanth Cool
Source: StackOverflow

11/25/2015

This was a bug with socat not being include in the kubelet container. It's now fixed.

Release 1.1.2 is the first one to include the fix.

-- Joe Doliner
Source: StackOverflow