DocsTelepresenceProxy outbound traffic to my cluster
Proxy outbound traffic to my cluster
While preview URLs are a powerful feature, Telepresence offers other options for proxying traffic between your laptop and the cluster. This section discribes how to proxy outbound traffic and control outbound connectivity to your cluster.
Proxying outbound traffic
Connecting to the cluster instead of running an intercept allows you to access cluster workloads as if your laptop was another pod in the cluster. This enables you to access other Kubernetes services using <service name>
in the connected namespace and also to use <service name>.<namespace>
to reach services in other namespaces. A service running on your laptop can interact with other services on the cluster by name.
Run
telepresence connect
and enter your password to run the daemon.Run
telepresence status
to confirm connection to your cluster and that it is proxying traffic.Access your service by name with
curl web-app:80
. Telepresence routes the request to the cluster, as if your laptop is actually running in the cluster.
If you terminate the client with telepresence quit
and try to access the service again, it will fail because traffic is no longer proxied from your laptop.
Controlling outbound connectivity
Connected Namespace
The telepresence connect
command will connect to the default namespace, i.e. the namespace that your
current kubernetes context is configured to use, or a namespace named "default". When connected, you can
access all services in this namespace by just using a single label name of the service.
You can specify which namespace to connect to by using a --namespace <name>
to the connect command.
Mapped Namespaces
By default, Telepresence provides access to all Services found in all namespaces in the connected cluster. This can lead to problems if the user does not have RBAC access permissions to all namespaces. You can use the --mapped-namespaces <comma separated list of namespaces>
flag to control which namespaces are accessible.
When you use the --mapped-namespaces
flag, you need to include all namespaces containing services you want to access, as well as all namespaces that contain services related to the intercept.
Proxy outcound connectivity for laptops
To specify additional hosts or subnets that should be resolved inside the cluster, see AlsoProxy for more details.