DEV Community

Alex Spinov
Alex Spinov

Posted on

Telepresence Has a Free API: Develop Kubernetes Services Locally with Cluster Access

Why Telepresence

Telepresence connects your local development machine to a remote Kubernetes cluster. Your local service can access cluster resources (databases, services, configs) as if running inside the cluster.

Install

brew install datawire/blackbird/telepresence
telepresence helm install
telepresence connect
Enter fullscreen mode Exit fullscreen mode

Access Cluster Services Locally

# Connect to cluster
telepresence connect

# Now you can curl cluster services by name
curl http://my-api-service:8080/health
curl http://postgres-service:5432
Enter fullscreen mode Exit fullscreen mode

Intercept Traffic

# Route traffic from cluster service to your local machine
telepresence intercept my-service --port 8080:8080

# Now cluster traffic to my-service goes to localhost:8080
nodemon server.js  # Your local dev server receives cluster traffic
Enter fullscreen mode Exit fullscreen mode

Personal Intercepts (Team-Friendly)

# Only intercept requests with specific header
telepresence intercept my-service \
  --port 8080 \
  --http-header x-telepresence-id=alex
Enter fullscreen mode Exit fullscreen mode

Team members traffic flows normally. Only your requests go to your local machine.

Environment Variables

# Import env vars from the target pod
telepresence intercept my-service --port 8080 --env-file .env

# Then run with those vars
env $(cat .env | xargs) node server.js
Enter fullscreen mode Exit fullscreen mode

Key Features

  • Cluster access — DNS, services, secrets from local machine
  • Traffic interception — route cluster traffic to localhost
  • Personal intercepts — header-based routing for teams
  • Volume mounts — access pod volumes locally
  • Env vars — import pod environment

Telepresence vs mirrord

Feature Telepresence mirrord
Approach VPN + intercept LD_PRELOAD/hook
Install Cluster agent No agent
IDE integration Limited VS Code, JetBrains
Traffic modes Intercept Mirror + steal
Setup telepresence connect mirrord exec

Resources


Need to extract cluster data, service configs, or dev environment metrics? Check out my Apify tools or email spinov001@gmail.com for custom solutions.

Top comments (0)