Remote debugging using Telepresence
Telepresence is a tool that lets you access services in a Kubernetes cluster, debug them, make and test changes as if the services were running on your computer locally.
The Kubernetes plugin provides integration with Telepresence allowing you to:
Connect to Telepresence to access a service in the cluster by its DNS name.
Intercept a service to route traffic from the cluster to your local environment.
Connect to Telepresence
Open the Services tool window: select or press Alt+8.
Right-click your Kubernetes cluster and select Connect Telepresence. Alternatively, click in the toolbar. When prompted, enter your administrator account password required to start the Telepresence daemon.
If Telepresence is not installed on your computer, a notification will appear, providing you with the option to install it. Telepresence will be installed in /usr/local/bin (on macOS and Linux) or <home>\.jetbrains (on Windows).
Similarly, if Traffic Manager is not installed in the cluster, IntelliJ IDEA will prompt you to install it.
After installing Telepresence and Traffic Manager, click Connect Telepresence again.
You can now access services in the Kubernetes cluster by their DNS names as if the cluster were running on your workstation. For example, if you have an application that accepts requests to hello-node:9001
, you can access it by its name.
Intercept traffic from cluster
Intercepts allow you to take traffic going to a service in the Kubernetes cluster and route it to the local service.
On the toolbar, click (Create New Interception) and then click Create new interception.
In the window that opens, in the Service list, select a workload to intercept. This can be a Deployment, a ReplicaSet, or a StatefulSet.
In the Ports field, specify the port, on which the local instance of your service is running.
If the service is intercepted successfully, you can access it locally and use the IDE features to try, debug, and profile your application running in the cluster.
Quit Telepresence
Telepresence interacts with one cluster at a time, so you may need to stop it before connecting to another cluster. Quitting Telepresence will stop all active intercepts.
Open the Services tool window: select or press Alt+8.
Right-click your Kubernetes cluster and select Quit Telepresence. Alternatively, click in the toolbar.