Table of Contents
- Prerequisites
- Node.js Service Example
- Kubernetes Deployment with ConfigMap Volume
- ConfigMap Definition
- Intercepting with Telepresence and Mounting Volumes
- Exploring the Mounted Volume
- Customizing the Local Mount Path
- References
Prerequisites
- Kubernetes cluster access with
kubectlconfigured - Telepresence installed
- A local
.envfile for environment variables
Ensure your
kubectl context is pointing to the intended cluster before starting the intercept.Node.js Service Example
The products service is an Express.js app that readsAPI_URL from environment variables:
Kubernetes Deployment with ConfigMap Volume
Deploy theproducts-depl Deployment and mount a ConfigMap called db-info at /tmp:
ConfigMap Definition
Define your database connection details in a ConfigMap:Intercepting with Telepresence and Mounting Volumes
- Check for existing intercepts:
- Create an intercept on port 8000, inject your
.env, and mount the pod’s volumes:
Redirecting service traffic through your local machine may impact production workloads. Proceed with caution.
Exploring the Mounted Volume
In a new terminal:Customizing the Local Mount Path
- End the current intercept:
- Start a new intercept with a custom mount location:
/tmp/example123/tmp: