telepresenceio / telepresence

Local development against a remote Kubernetes or OpenShift cluster

Home Page:https://www.telepresence.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

intercept a service

wafaboussada opened this issue · comments

Hello
before in version 1, I used this command in service to run it locally:
telepresence --swap-deployment frontend --run-shell
which command I use in version 2 ?
also when the service is intercepted it is no longer opened it always 502 error.
Thanks

The corresponding command for version 2 is:

telepresence intercept frontend -- /bin/bash

If you get a 502 error when the intercept is active, then that's likely caused by the fact that you don't have an intercept handler running on your local workstation that can receive the intercepted traffic.

telepresence intercept frontend -- /bin/bash This command doesn't open a run shell in the service. i just got the message that the service is intercepted.
for the 502 error, how can I solve it? how do have an intercept handler running on your local workstation that can receive the intercepted traffic?
thanks

An intercept handler can be something like a Docker container running locally. There are more examples you can reference here. When running the intercept command what do you get? Which port is Telepresence routing to on your local machine?

When i intecept the service, i got that the service is intercepted and when i do telepresence list the service is intercepted but in navigator i got 502 error (when i intercept the Frontend service and opened it in navigator)

We suspect you haven’t launched your app locally, which is where Telepresence would send the intercepted traffic. This does work a bit differently from swap-deployment which you're more used to.

Can you share the output of your intercept command - what do you get? The shell does open for us. If we can check that output we can confirm if you’re running anything on that destination port.

before when i use telepresence --swap-deployment frontend --run-shell, it open the shell in the service so i can run the command to run the service locally. now it doesn't open a shell

Closing this, because a telepresence intercept xxx -- /bin/bash will perform the requested task (and the provided image suggest that it still does).
The reason you get a 502 is because the intercepted traffic is now routed to you shell, and you haven't yet started a service locally that can handle that traffic.