Telepresence Architecture
Telepresence CLI
The Telepresence CLI orchestrates the moving parts on the workstation: it starts the Telepresence Daemons and then acts as a user-friendly interface to the Telepresence User Daemon.
Telepresence Daemons
Telepresence has Daemons that run on a developer's workstation and act as the main point of communication to the cluster's network in order to communicate with the cluster and handle intercepted traffic.
User-Daemon
The User-Daemon coordinates the creation and deletion of replacements, ingests and intercepts by communicating with the Traffic Manager. All requests from and to the cluster go through this Daemon.
Root-Daemon
The Root-Daemon manages the networking necessary to handle traffic between the local workstation and the cluster by setting up a Virtual Network Device (VIF).
Who may call the daemons
The CLI talks to the User-Daemon over gRPC on a local port. Every call except Version must carry a secret that the CLI
creates when it starts the daemon. The secret is stored in the daemon's info file, which only the user can read.
The User-Daemon talks to the Root-Daemon, which any local user may reach. The Root-Daemon serves one session at a time, and the session belongs to the connection that created it. Other connections can't read, change or end it, and it ends when that connection closes. The Root-Daemon acts only on inert input: a complete kubeconfig with inline credentials. It never starts a credential plugin or reads a file that a caller names. The User-Daemon runs any plugin as the user and passes the credentials to the Root-Daemon over the session's connection.
Traffic Manager
The Traffic Manager is the central point of communication between Traffic Agents in the cluster and Telepresence Daemons on developer workstations. It is responsible for injecting the Traffic Agent sidecar into attached pods (or, when the cluster is configured for it, creating a node-hosted agent instead), proxying all relevant inbound and outbound traffic, and tracking active attachments.
The Traffic-Manager is installed by a cluster administrator. It can either be installed using the Helm chart embedded
in the telepresence client binary (telepresence helm install) or by using a Helm Chart directly.
Traffic Agent
The Traffic Agent is the component that facilitates attachments. When a replace, ingest, intercept, or wiretap
is first started, it is normally injected into the workload's pod(s) as a sidecar container. A cluster administrator
can instead configure the Helm chart to run it as a node-hosted pod that attaches to the existing pod's namespaces
without modifying or restarting it — see
Choose between the sidecar and the node-agent. You can see the Traffic Agent's status by
running telepresence list or kubectl describe pod <pod-name>.
Depending on if an replace or intercept is active or not, the Traffic Agent will either route the incoming request
to your workstation, or it will pass it along to the container in the pod usually handling requests.
When a wiretap is active, the Traffic Agent will send a copy of the incoming requests to your workstation.
Please see Traffic Agent Sidecar and Node-hosted traffic-agent for details.