With the Telepresence for Docker extension, you can create personal intercepts. These intercepts route the cluster traffic through a proxy UTL to your local Docker container. Follow the instructions below to create an intercept with Docker Desktop.
Before you begin, you need:
This guide assumes you have a Kubernetes deployment with a running service, and that you can run a copy of that service in a docker container on your laptop.
Once you have the Telepresence extension installed and connected the Telepresence extension, you need to copy the service. To do this, use the
docker run command with the following flags:
The Telepresence extension requires the target service to be on the host network. This allows Telepresence to share a network with your container. The mounted network device redirects cluster-related traffic back into the cluster.
In Docker Desktop, the Telepresence extension shows all the services in the namespace.
Choose a service to intercept and click the Intercept button.
Select the service port for the intercept from the dropdown.
Enter the target port of the service you previously copied in the Docker container.
Click Submit to create the intercept.
The intercept now shows up in the Docker Telepresence extension.
Now you can make your code changes in your preferred IDE. When you're finished, build a new container with your code changes and run your container on Docker's host network. All the traffic previously routed to and from your Kubernetes service is now routed to and from your local container.
Click the globe icon next to your intercept to get the preview URL. From here, you can view the intercept details in Ambassador Cloud, open the preview URL in your browser to see the changes you've made in realtime, or you can share the preview URL with teammates so they can review your work.