> ## Documentation Index
> Fetch the complete documentation index at: https://notes.kodekloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Demo Telepresence Basics

> Demo showing how Telepresence lets your local machine act like it's inside a Kubernetes cluster to debug and interact with example services (products, inventory, auth) without port forwarding

This demo walks through a small example application and shows how Telepresence lets your local machine behave as if it is running inside a Kubernetes cluster. That makes debugging cluster-internal services — using your local editor, debugger, or network tools — fast and convenient without port-forwarding or building special images.

Overview

* Three application services:
  * auth service
  * product service (entry point)
  * inventory service
* Flow: client → products → inventory (products aggregates inventory data and returns it). The auth service runs independently.

Application layout

* auth/ — Node.js app (index.js, package.json, Dockerfile)
* inventory/ — Node.js app (same structure)
* products/ — Node.js app (same structure)
* k8s/ — Kubernetes manifests for Deployments and Services

Service responsibilities

| Service | Role | Notes |
| - | - | - |
| `products-service` | Entry point for user requests | Aggregates product data and calls `inventory-service` for stock counts |
| `inventory-service` | Provides inventory counts | Cluster-internal |
| `auth-service` | Authentication mock | Independent service used in examples |

Below are the key manifest excerpts and the sequence of steps used in the demo.

Deployment and Service manifests

Inventory Deployment + Service (example)

```yaml theme={null}
apiVersion: apps/v1
kind: Deployment
metadata:
  name: inventory-depl
spec:
  selector:
    matchLabels:
      app: inventory
  template:
    metadata:
      labels:
        app: inventory
    spec:
      containers:
      - name: inventory
        image: sanjeevkt720/telepresence-inventory
        ports:
        - containerPort: 3000
          name: web
---
apiVersion: v1
kind: Service
metadata:
  name: inventory-service
spec:
  selector:
    app: inventory
  ports:
  - port: 3000
    targetPort: 3000
```

Products Deployment (entry point)

```yaml theme={null}
apiVersion: apps/v1
kind: Deployment
metadata:
  name: products-depl
spec:
  selector:
    matchLabels:
      app: products
  template:
    metadata:
      labels:
        app: products
    spec:
      volumes:
      - name: db-config
        configMap:
          name: db-info
      containers:
      - name: products
        image: sanjeevkt720/telepresence-products
        volumeMounts:
        - name: db-config
          mountPath: /tmp
        ports:
        - containerPort: 3000
          name: web
        # env: (any environment variables would go here)
---
apiVersion: v1
kind: Service
metadata:
  name: products-service
spec:
  selector:
    app: products
  type: LoadBalancer
  ports:
  - port: 3000
    targetPort: 3000
```

Auth Service (Service manifest)

```yaml theme={null}
---
apiVersion: v1
kind: Service
metadata:
  name: auth-service
spec:
  selector:
    app: auth
  ports:
  - port: 3000
    targetPort: 3000
```

Verify cluster nodes

Ensure your kubeconfig context is correct and list nodes:

```bash theme={null}
kubectl get nodes
```

Example cluster output:

```text theme={null}
NAME                             STATUS   ROLES   AGE   VERSION
ip-192-168-24-32.ec2.internal    Ready    <none>  47h   v1.30.4-eks-a737599
ip-192-168-43-108.ec2.internal   Ready    <none>  47h   v1.30.4-eks-a737599
```

Install the Telepresence client on your local machine

Telepresence provides platform-detecting installers. The example below shows the PowerShell steps for Windows (run PowerShell as Administrator):

<Callout icon="warning" color="#FF6B6B">
  Run installer steps as an Administrator. The script will install components and adjust network routes on your machine.
</Callout>

PowerShell installer steps:

```powershell theme={null}
# 1. Download the latest windows zip containing telepresence.exe and its dependencies (~50 MB)
Invoke-WebRequest https://app.getambassador.io/download/tel2oss/releases/download/v2.20.0/telepresence-windows-amd64.zip -OutFile telepresence.zip

# 2. Unzip; then remove the zip file
Expand-Archive -Path telepresence.zip -DestinationPath telepresenceInstaller/telepresence
Remove-Item 'telepresence.zip'
cd telepresenceInstaller/telepresence

# 3. Run the installer script to install telepresence and its dependencies.
#    By default it installs to C:\telepresence (customizable via -Path).
powershell.exe -ExecutionPolicy bypass -c ". '.\install-telepresence.ps1';"

# 4. Cleanup unzipped installer files
cd ../..
Remove-Item telepresenceInstaller -Recurse -Confirm:$false -Force

# 5. Telepresence is now installed and you can use telepresence commands in PowerShell.
```

Verify Telepresence is available:

```bash theme={null}
telepresence --help
```

Install the Traffic Manager into your cluster

Telepresence requires a cluster-side component called the Traffic Manager. The Telepresence client includes Helm and can install the Traffic Manager for you:

Install with default values:

```bash theme={null}
telepresence helm install
```

Install with custom values:

```bash theme={null}
telepresence helm install --values values.yaml
```

<Callout icon="lightbulb" color="#1CB2FE">
  The Traffic Manager is installed into its own namespace (commonly `ambassador`). Check the namespace and pods after installation:

  * `kubectl get namespace`
  * `kubectl get pods -n ambassador`
</Callout>

Connect Telepresence to your cluster

Telepresence uses the active kubeconfig context. Connect:

```bash theme={null}
telepresence connect
```

Example successful connection output:

```text theme={null}
Connected to context arn:aws:eks:us-east-1:195275640053:cluster/telepresence, namespace default (https://C22C5458C5800FD626C361045762447E.gr7.us-east-1.eks.amazonaws.com)
```

Check Telepresence status

```bash theme={null}
telepresence status
```

Trimmed example status:

```text theme={null}
OSS User Daemon: Running
  Version        : 2.20.0
  Executable     : /usr/local/bin/telepresence
  Status         : Connected
  Kubernetes server : https://C22C5458C5800FD626C361045762447E.gr7.us-east-1.eks.amazonaws.com
  Kubernetes context: arn:aws:eks:us-east-1:195275640053:cluster/telepresence
  Namespace      : default
  Manager namespace : ambassador
  Intercepts     : 0 total

OSS Root Daemon: Running
  Version        : v2.20.0
  Remote IP      : 127.0.0.1
  Timeout        : 8s
  Subnets        : (2 subnets)
    - 10.100.0.0/16
    - 192.168.0.0/18

OSS Traffic Manager: Connected
  Version        : v2.20.0
  Traffic Agent  : ghcr.io/telepresenceio/tel2:2.20.0
```

What Telepresence configures on your machine

When connected, Telepresence creates routes for the cluster pod and service CIDRs so local processes can reach cluster IPs and service DNS names directly. Verify these routes with:

```bash theme={null}
ip route
```

You should see routes pointing cluster subnets to the Telepresence tunnel interface (often `tel0` on Linux — interface names vary by OS).

List services in the cluster

```bash theme={null}
kubectl get svc
```

Example services output:

```text theme={null}
NAME                 TYPE           CLUSTER-IP      EXTERNAL-IP                                                                 PORT(S)           AGE
auth-service         ClusterIP      10.100.10.52    <none>                                                                      3000/TCP          9m39s
inventory-service    ClusterIP      10.100.246.69   <none>                                                                      3000/TCP          46m
kubernetes           ClusterIP      10.100.0.1      <none>                                                                      443/TCP           48m
products-service     LoadBalancer   10.100.169.75   a4519082e1ab846e38b03d9760c9e3b9-515600148.us-east-1.elb.amazonaws.com    3000:30782/TCP    2m7s
```

Because Telepresence makes your laptop appear to be inside the cluster:

* ClusterIP services (e.g., `auth-service`, `inventory-service`) are reachable directly by service name or cluster IP.
* LoadBalancer services (e.g., `products-service`) remain externally reachable through your cloud provider’s external IP/DNS.

DNS lookups resolve cluster service names as if you were inside the cluster:

```bash theme={null}
nslookup auth-service
```

Example:

```text theme={null}
Server: 127.0.0.53
Address: 127.0.0.53#53

Non-authoritative answer:
Name: auth-service
Address: 10.100.10.52
```

Make HTTP requests directly to cluster services

Curl the auth service by service name and port:

```bash theme={null}
curl http://auth-service:3000
```

Example JSON response:

```json theme={null}
{"message":"this is the auth service"}
```

Call the products (entry point) service with query parameters:

```bash theme={null}
curl "http://products-service:3000/?product_ids=1,2,3"
```

Example aggregated response (inventory counts included):

```json theme={null}
{
  "data": [
    {"id":1,"name":"iphone 14","price":900,"category":"electronics","onSale":false,"inventoryCount":893},
    {"id":2,"name":"Samsung 40in TV","price":500,"category":"electronics","onSale":true,"inventoryCount":902},
    {"id":3,"name":"Apple MacbookPro","price":2500,"category":"electronics","onSale":false,"inventoryCount":444}
  ]
}
```

Access individual pods by pod IP

Telepresence also routes pod IPs. First get pod details:

```bash theme={null}
kubectl get pods -o wide
```

Example:

```text theme={null}
NAME                                READY   STATUS    RESTARTS   AGE     IP              NODE
auth-depl-69bf897bb9-t9hgg          1/1     Running   0          13m     192.168.32.69   ip-192-168-43-108.ec2.internal
inventory-depl-5f8657c56c-1p5r4     1/1     Running   0          50m     192.168.34.172  ip-192-168-43-108.ec2.internal
products-depl-547767bccd-8zcz9      1/1     Running   0          5m54s   192.168.6.186   ip-192-168-24-32.ec2.internal
```

Curl a pod IP directly:

```bash theme={null}
curl http://192.168.32.69:3000
```

Example response:

```json theme={null}
{"message":"this is the auth service"}
```

Disconnect Telepresence

When finished, quit Telepresence to stop local daemons and remove routes:

```bash theme={null}
telepresence quit
telepresence status
```

After quitting, `telepresence status` will show the client is no longer connected.

Closing notes

Telepresence enables using local development tooling (debuggers, profilers, packet capture, etc.) while interacting with cluster services as if your workstation were inside the cluster network. This simplifies troubleshooting DNS, networking, and service interactions without port-forwarding or building debug images.

Links and references

* Telepresence documentation: [https://www.telepresence.io/](https://www.telepresence.io/)
* Kubernetes documentation: [https://kubernetes.io/docs/](https://kubernetes.io/docs/)

<CardGroup>
  <Card title="Watch Video" icon="video" cta="Learn more" href="https://learn.kodekloud.com/user/courses/telepresence-for-kubernetes/module/0eb5dcb6-2e2a-40d9-9caa-bd3149741aeb/lesson/d76ac3de-46c7-464e-8da6-43d4e332c65d" />
</CardGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.