Closed indrasvat closed 3 years ago
Any insights on this?
Per the suggestion from @cindy, I tried the --mapped-namespaces
flag. Now, it seems the SSH command works, and I'm able to list pods etc, but I'm still not able to hit the hello
service via curl
.
The only difference from the tutorial is that the hello
service is deployed in the hello
namespace, not default
.
$ telepresence connect --mapped-namespaces default,hello
Launching Telepresence Daemon v2.2.0 (api v3)
Need root privileges to run "/usr/local/bin/telepresence daemon-foreground ~/Library/Logs/telepresence '' ''"
Password:
Connecting to traffic manager...
Connected to context minikube (https://192.168.99.103:8443)
$ kubectl get ns
NAME STATUS AGE
ambassador Active 14d
argo Active 3d16h
default Active 14d
hello Active 14d
kube-node-lease Active 14d
kube-public Active 14d
kube-system Active 14d
$ kubectl get po -nhello
NAME READY STATUS RESTARTS AGE
hello-78745876ff-8xw78 1/1 Running 2 14d
$ kubectl get svc -nhello
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
hello ClusterIP 10.97.229.172 <none> 80/TCP 14d
$ curl -v --connect-timeout 10 --max-time 10 'http://hello.hello'
* Rebuilt URL to: http://hello.hello/
* Trying 10.97.229.172...
* TCP_NODELAY set
* Connected to hello.hello (10.97.229.172) port 80 (#0)
> GET / HTTP/1.1
> Host: hello.hello
> User-Agent: curl/7.54.0
> Accept: */*
>
* Operation timed out after 10001 milliseconds with 0 bytes received
* stopped the pause stream!
* Closing connection 0
curl: (28) Operation timed out after 10001 milliseconds with 0 bytes received
connector.log
so far:
$ tail -f ~/Library/Logs/telepresence/connector.log
2021/05/04 16:02:32 Patching synced Namespace f3cf8c46-f6e1-4aaa-9b59-e076c353a7a9
2021/05/04 16:02:32 connector/background-k8swatch/namespaces posting search paths to default hello
2021/05/04 16:02:32 connector/background-manager/intercept-port-forward posting search paths to default hello
2021/05/04 16:02:32 connector/background-k8swatch/namespaces Watching namespace "hello"
2021/05/04 16:02:32 connector/background-k8swatch/namespaces Watching namespace "default"
2021/05/04 16:02:32 Patching add Service 1f23fdd7-0f6e-43f1-8d13-1f3c01c412af
2021/05/04 16:02:32 Patching add Service 1f23fdd7-0f6e-43f1-8d13-1f3c01c412af
2021/05/04 16:02:32 connector/server-socks [pid:69231] started command []string{"ssh", "-D", "127.0.0.1:49975", "-F", "none", "-C", "-oConnectTimeout=10", "-oStrictHostKeyChecking=no", "-oUserKnownHostsFile=/dev/null", "-N", "-oExitOnForwardFailure=yes", "-p", "49972", "telepresence@localhost"}
2021/05/04 16:02:32 connector/server-socks [pid:69231] stdin < EOF
2021/05/04 16:02:32 connector/server-socks [pid:69231] stdout+stderr > "Warning: Permanently added '[localhost]:49972' (ECDSA) to the list of known host"… (4 runes truncated)
2021/05/04 16:07:32 Patching synced Namespace f3cf8c46-f6e1-4aaa-9b59-e076c353a7a9
2021/05/04 16:07:32 Patching synced Service 1f23fdd7-0f6e-43f1-8d13-1f3c01c412af
Just to confirm, the hello
service is running:
$ kubectl port-forward hello-78745876ff-8xw78 8082:8080 -nhello
Forwarding from 127.0.0.1:8082 -> 8080
Forwarding from [::1]:8082 -> 8080
Handling connection for 8082
...
$ curl -v --connect-timeout 10 --max-time 10 'http://localhost:8082'
* Trying ::1...
* TCP_NODELAY set
* Connected to localhost (::1) port 8082 (#0)
> GET /hello HTTP/1.1
> Host: localhost:8082
> User-Agent: curl/7.54.0
> Accept: */*
>
< HTTP/1.1 200 OK
< Server: nginx/1.10.0
< Date: Tue, 04 May 2021 23:35:20 GMT
< Content-Type: text/plain
< Transfer-Encoding: chunked
< Connection: keep-alive
<
CLIENT VALUES:
client_address=127.0.0.1
command=GET
real path=/hello
query=nil
request_version=1.1
request_uri=http://localhost:8080/hello
SERVER VALUES:
server_version=nginx: 1.10.0 - lua: 10001
HEADERS RECEIVED:
accept=*/*
host=localhost:8082
user-agent=curl/7.54.0
BODY:
* Connection #0 to host localhost left intact
-no body in request-
It's really odd that curl reports * Connected to hello.hello (10.97.229.172) port 80 (#0)
and then times out. A log from the hello pod's traffic-agent container would be interesting to look at.
@thallgren, I only see the echoserver
container 🤷🏼♂️
apiVersion: v1
kind: Pod
metadata:
labels:
app: hello
pod-template-hash: 78745876ff
name: hello-78745876ff-8xw78
namespace: hello
spec:
containers:
- image: k8s.gcr.io/echoserver:1.4
name: echoserver
priority: 0
serviceAccountName: default
tolerations:
- effect: NoExecute
key: node.kubernetes.io/not-ready
operator: Exists
tolerationSeconds: 300
- effect: NoExecute
key: node.kubernetes.io/unreachable
operator: Exists
tolerationSeconds: 300
UPDATE:
I'm not at the intercept stage yet. Not able to get past https://github.com/telepresenceio/telepresence/tree/release/v2#establish-a-connection-to--the-cluster-outbound-traffic.
@thallgren, updated minikube
to latest. Still the same issue.
🚩 minikube version
minikube version: v1.20.0
commit: c61663e942ec43b20e8e70839dcca52e44cd85ae
🚩 k get ns
NAME STATUS AGE
ambassador Active 23d
argo Active 12d
default Active 23d
hello Active 23d
ingress-nginx Active 14m
kube-node-lease Active 23d
kube-public Active 23d
kube-system Active 23d
🚩 k get po -nhello
NAME READY STATUS RESTARTS AGE
hello-78745876ff-8xw78 1/1 Running 5 23d
🚩 telepresence connect --mapped-namespaces=hello
🚩 curl -v 'http://hello.hello'
* Rebuilt URL to: http://hello.hello/
* Trying 10.97.229.172...
* TCP_NODELAY set
* Connected to hello.hello (10.97.229.172) port 80 (#0)
> GET / HTTP/1.1
> Host: hello.hello
> User-Agent: curl/7.54.0
> Accept: */*
>
^C
I ran into the same problem. please help!!!!
I use kubectl run -it --rm --restart=Never busybox1 --image=busybox sh
in the master ;
telepresence2 work suddenly!!
This issue is made obsolete by the fact that Telepresence no longer use ssh.
@thallgren, interesting. Should I update telepresence
to latest and try the setup again?
Yes, please do.
Gave telepresence2 a spin. Can't get it to work with my local minikube (with the
virtualbox
driver).Steps followed: https://github.com/telepresenceio/telepresence/tree/release/v2#walkthrough
Telepresence Logs:
connector.log daemon.log
After running
telepresence connect
, I'm no longer able tokubectl ...
to minikube. I have totelepresence quit
for things to start working again.I manually ran the actual
ssh
command (picked fromconnector.log
) with verbose mode, and got this:Not sure how to debug this further.