You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ kubectl port-forward $ALPACA_POD 48858:8080
Forwarding from 127.0.0.1:48858 -> 8080
Forwarding from [::1]:48858 -> 8080
Terminal 2:
curl http://localhost:48858/
Back to Terminal 1:
Handling connection for 48858
E0114 14:08:58.698803 17224 portforward.go:406] an error occurred forwarding 48858 -> 8080: error forwarding port 8080 to pod c5993e2de9902e4bb3fe8c579d8c41613fa34af5b67b6ecdbeaab5f4521c8574, uid : unable to do port forwarding: socat not found
E0114 14:08:58.699114 17224 portforward.go:234] lost connection to pod
Fix is to run sudo apk add socat on the VM
Steps to Reproduce
Ensure you're using the moby container engine. No problem with containerd
Do the following in terminal 1:
Install the sample app:
kubectl run alpaca-prod --image=gcr.io/kuar-demo/kuard-amd64:blue --port=8080 --labels="ver=1,app=alpaca,env=prod"
Background on kubectl:
$ which kubectl
/usr/local/bin/kubectl
$ ls -l /usr/local/bin/kubectl
lrwxr-xr-x 1 OWNER GROUP 67 12 Jan 15:09 /usr/local/bin/kubectl -> .../workspace/rancher/desktop/resources/darwin/bin/kubectl
$ kubectl version
Client Version: version.Info{Major:"1", Minor:"23", GitVersion:"v1.23.1", GitCommit:"86ec240af8cbd1b60bcc4c03c20da9b98005b92e", GitTreeState:"clean", BuildDate:"2021-12-16T11:41:01Z", GoVersion:"go1.17.5", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"23", GitVersion:"v1.23.1+k3s2", GitCommit:"a0cadcd3436745396c82821b4a0803ee460401e1", GitTreeState:"clean", BuildDate:"2022-01-14T08:22:21Z", GoVersion:"go1.17.5", Compiler:"gc", Platform:"linux/amd64"}
Now expose the app and port-forward to it:
$ kubectl expose pod alpaca-prod
$ kubectl port-forward alpaca-prod 48858:8080
Now switch to terminal 2 and hit the app through the port-forwarded tunnel:
curl http://localhost:48858/
Back to Terminal 1:
Handling connection for 48858
E0114 14:08:58.698803 17224 portforward.go:406] an error occurred forwarding 48858 -> 8080: error forwarding port 8080 to pod c5993e2de9902e4bb3fe8c579d8c41613fa34af5b67b6ecdbeaab5f4521c8574, uid : unable to do port forwarding: socat not found
E0114 14:08:58.699114 17224 portforward.go:234] lost connection to pod
Result
See above
Expected Behavior
Curl should dump a bunch of html output
Additional Information
No response
The text was updated successfully, but these errors were encountered:
ericpromislow
changed the title
kubectl port-forwarding fails during use: socat missing on VM
kubectl port-forwarding fails during use with moby: socat missing on VM
Jan 14, 2022
Rancher Desktop Version
dev->1.0.0-beta1
Rancher Desktop K8s Version
1.21.6
What operating system are you using?
macOS
Operating System / Build Version
macOS Monterey 12.0.1
What CPU architecture are you using?
x64
Windows User Only
No response
Actual Behavior
Terminal 1:
Terminal 2:
Back to Terminal 1:
Fix is to run
sudo apk add socat
on the VMSteps to Reproduce
Ensure you're using the
moby
container engine. No problem withcontainerd
Do the following in terminal 1:
Install the sample app:
Background on kubectl:
Now expose the app and port-forward to it:
Now switch to terminal 2 and hit the app through the port-forwarded tunnel:
Back to Terminal 1:
Result
See above
Expected Behavior
Curl should dump a bunch of html output
Additional Information
No response
The text was updated successfully, but these errors were encountered: