Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port-forwarding not working in containerized hyperkube due to missing socat command #17157

Closed
2opremio opened this issue Nov 12, 2015 · 1 comment

Comments

@2opremio
Copy link

When trying to use kubectl port-forward against a containerized kubernetes cluster (i.e. deployed following https://github.com/kubernetes/kubernetes/blob/master/docs/getting-started-guides/docker.md ) I get the following errors:

$ kubectl port-forward fons-proxy-ksts5 8000:8000 8080:8080
I1112 12:23:59.888110   53302 portforward.go:213] Forwarding from 127.0.0.1:8000 -> 8000
I1112 12:23:59.888315   53302 portforward.go:213] Forwarding from [::1]:8000 -> 8000
I1112 12:23:59.888365   53302 portforward.go:213] Forwarding from 127.0.0.1:8080 -> 8080
I1112 12:23:59.888423   53302 portforward.go:213] Forwarding from [::1]:8080 -> 8080
I1112 12:24:13.166791   53302 portforward.go:247] Handling connection for 8000
I1112 12:24:13.168963   53302 portforward.go:247] Handling connection for 8000
I1112 12:24:13.171131   53302 portforward.go:247] Handling connection for 8000
I1112 12:24:13.171192   53302 portforward.go:247] Handling connection for 8000
I1112 12:24:13.171193   53302 portforward.go:247] Handling connection for 8000
I1112 12:24:13.171888   53302 portforward.go:247] Handling connection for 8000
E1112 12:24:13.233818   53302 portforward.go:318] an error occurred forwarding 8000 -> 8000: error forwarding port 8000 to pod fons-proxy-ksts5_default, uid : unable to do port forwarding: socat not found.
E1112 12:24:13.236034   53302 portforward.go:318] an error occurred forwarding 8000 -> 8000: error forwarding port 8000 to pod fons-proxy-ksts5_default, uid : unable to do port forwarding: socat not found.
E1112 12:24:13.236272   53302 portforward.go:318] an error occurred forwarding 8000 -> 8000: error forwarding port 8000 to pod fons-proxy-ksts5_default, uid : unable to do port forwarding: socat not found.
E1112 12:24:13.236404   53302 portforward.go:318] an error occurred forwarding 8000 -> 8000: error forwarding port 8000 to pod fons-proxy-ksts5_default, uid : unable to do port forwarding: socat not found.
E1112 12:24:13.236489   53302 portforward.go:318] an error occurred forwarding 8000 -> 8000: error forwarding port 8000 to pod fons-proxy-ksts5_default, uid : unable to do port forwarding: socat not found.
E1112 12:24:13.236528   53302 portforward.go:318] an error occurred forwarding 8000 -> 8000: error forwarding port 8000 to pod fons-proxy-ksts5_default, uid : unable to do port forwarding: socat not found.
I1112 12:24:13.321342   53302 portforward.go:247] Handling connection for 8000
E1112 12:24:43.322896   53302 portforward.go:258] error creating error stream for port 8000 -> 8000: Timeout occured

This is simply because the socat command is missing in the hyperkube container image. I will be creating a PR with a fix shortly.

2opremio pushed a commit to weaveworks/service that referenced this issue Nov 12, 2015
…es/#17157

Fixes kubernetes/kubernetes#17157 "Port-forwarding not
working in containerized hyperkube due to missing socat command"

In practice it's kubernetes 706d3a7 with
kubernetes/kubernetes#17159 on top but didn't want to
wait for it to get merged to kubernetes/master
@mayukh1
Copy link

mayukh1 commented May 31, 2020

mayukh@mayukh-Inspiron-3521:/istio-1.6.0$ istioctl manifest apply --set profile=demo
Detected that your cluster does not support third party JWT authentication. Falling back to less secure first party JWT. See https://istio.io/docs/ops/best-practices/security/#configure-third-party-service-account-tokens for details.
✔ Istio core installed
✔ Istiod installed
✔ Egress gateways installed
✔ Ingress gateways installed
✔ Addons installed
✔ Installation complete mayukh@mayukh-Inspiron-3521:
/istio-1.6.0$ istio version
istio: command not found
mayukh@mayukh-Inspiron-3521:/istio-1.6.0$ kubectl -n istio-system get svc prometheus
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
prometheus ClusterIP 10.101.216.106 9090/TCP 20m
mayukh@mayukh-Inspiron-3521:
/istio-1.6.0$ kubectl -n istio-system get svc grafana
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
grafana ClusterIP 10.97.41.187 3000/TCP 21m
mayukh@mayukh-Inspiron-3521:/istio-1.6.0$ kubectl -n istio-system port-forward $(kubectl -n istio-system get pod -l app=grafana -o jsonpath='{.items[0].metadata.name}') 3000:3000 &
[1] 12167
mayukh@mayukh-Inspiron-3521:
/istio-1.6.0$ Forwarding from 127.0.0.1:3000 -> 3000
Forwarding from [::1]:3000 -> 3000
Handling connection for 3000
Handling connection for 3000
E0601 00:12:20.831407 12167 portforward.go:400] an error occurred forwarding 3000 -> 3000: error forwarding port 3000 to pod 6277818d8d58b0b6d52d07c776f1e930860a60466790efbaf9460a380ea497ad, uid : unable to do port forwarding: socat not found
E0601 00:12:20.832330 12167 portforward.go:400] an error occurred forwarding 3000 -> 3000: error forwarding port 3000 to pod 6277818d8d58b0b6d52d07c776f1e930860a60466790efbaf9460a380ea497ad, uid : unable to do port forwarding: socat not found
Handling connection for 3000
E0601 00:12:20.836785 12167 portforward.go:400] an error occurred forwarding 3000 -> 3000: error forwarding port 3000 to pod 6277818d8d58b0b6d52d07c776f1e930860a60466790efbaf9460a380ea497ad, uid : unable to do port forwarding: socat not found
Handling connection for 3000
Handling connection for 3000

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants