Skip to main content
Learn how to intercept Kubernetes Service traffic and handle requests locally using Telepresence. This guide covers setup, command syntax, traffic flow, and best practices for collaborative development.

Prerequisites

  • A running Kubernetes cluster with the Telepresence Traffic Manager installed.
  • An active Telepresence session:
    This establishes a secure tunnel between your local environment and the cluster.

Creating an Intercept

To redirect Service traffic for local debugging, you create an intercept on a Deployment. In this example, a products-depl Deployment is exposed on port 3000 in the cluster:

Command Syntax

Run the intercept:
If the target Service exposes only one port, you can omit :REMOTE.
For example:
Once the intercept is established, Telepresence injects a traffic-agent sidecar into the products-depl Pod. All calls from other Pods (for example, an inventory Service) to port 3000 are proxied through the cluster to your local process on port 8000.

Intercept Details

After running the command, Telepresence prints status information:

Listing and Managing Active Intercepts

View all active intercepts:
You can intercept multiple Services in parallel. Just ensure each local port is unique:
Each intercept binds a unique local port. Reusing a port will cause the command to fail.

Traffic Flow with Multiple Intercepts

When one intercepted Service calls another, traffic may loop through the cluster multiple times:
  1. Client in cluster → local products-depl (port 8000)
  2. Local products-depl → cluster → local inventory-depl (port 9000)
  3. Local inventory-depl → cluster → local products-depl → original caller
This indirect routing can impact performance. While you can manually adjust /etc/hosts or use a local proxy to shortcut these hops, Telepresence does not automate intra-local traffic resolution.

Collaboration Best Practices

Active intercepts route all cluster traffic for a Service to your machine. If multiple developers intercept the same Service in a shared namespace, requests will collide.
  • Deploy each developer’s version into a dedicated namespace.
  • Instruct teammates to intercept only their namespace’s resources.
The image illustrates a Kubernetes setup with two namespaces, "test1" and "test2," showing a "products" deployment with a traffic agent and inventory components, connected via a tunnel to a laptop.

Watch Video