Intercept a service to route its traffic to your workspace. Requests that would go to the service in the environment are redirected to your local code instead.
1. Start an intercept for a service (e.g., api)
2. All traffic to that service is redirected to your workspace
3. Debug with real requests, then stop the intercept to restore normal flow
Prerequisite
You must first connect to an environment with kl env connect before intercepting services.
Start intercepting a service. You'll be prompted to configure port mapping.
kl intercept start # Interactive service selection
kl intercept start api # Intercept specific service
Map the service port to your workspace port where your local server runs.
# Service port 8080 → Workspace port 3000
# Traffic to api:8080 now reaches localhost:3000
kl intercept list
Shows service name, phase (Active/Pending/Failed), and port mappings.
kl intercept status api
Detailed info including workspace pod, port mappings, and start time.
kl intercept stop # Interactive selection
kl intercept stop api # Stop specific service
Traffic routes back to the original service within seconds.