Service Intercepts
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.
How it worksRedirect service traffic to your workspace for real-time debugging with production requests.
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.
Starting Intercepts
kl intercept startStart intercepting a service. You'll be prompted to configure port mapping.
kl intercept start # Interactive service selection
kl intercept start api # Intercept specific service
Port mapping
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
Managing Intercepts
List active interceptsShows service name, phase (Active/Pending/Failed), and port mappings.
kl intercept list
Check statusDetailed info including workspace pod, port mappings, and start time.
kl intercept status api
Stop interceptTraffic routes back to the original service within seconds.
kl intercept stop # Interactive selection
kl intercept stop api # Stop specific service