As of 12/19/2024 All newly created Rancher Folio environments have telepresence installed by default, thus every development team can remotely connect via IDE and debug all things.
...
Modules deployed in Eureka environment require more env vars to be present on module startup in Intellij IntelliJ when compared to the Okapi setup. When starting your module in Intellij IntelliJ make sure to extract the required environment variables (e.g. eureka-common, db-credentials and kafka-credentials) from your cluster into some .env file or individual env vars attached to Intellij IntelliJ run config.
...
Find and include additional env vars from the Rancher UI, these can be found under Storage > Secrets tab:
...
SIDECAR_FORWARD_UNKNOWN_REQUESTS_DESTINATION=http://kong-{{namespace}}:8000
Environment variable extraction for an Okapi-based environment will follow the same pattern but may require changing the cluster from folio-edev to folio-dev on your Rancher UI.
Sidecar port-proxy:
In order for cross-module requests to perform correctly in your Eureka environment there must be a port proxy added to route all traffic from your local module instance deployed in IntellijIntelliJ, to localhost:8082 and then finally to the remote cluster itself. This rerouting is necessary to simulate a fully functional pod environment, where we have our module of interest and its companion sidecar accessible on localhost:8082 in the pod.
...
sudo lsof -i :8002
sudo kill -9 <PID>
Module interception
To start intercepting a module, configure the environment variables, and in case of Eureka, setup necessary port proxies, start the module instance in IntelliJ, and then finally run the following command:
telepresence intercept -p {{local_instance_port}}:http {{module_name}}
...
Your {{local_instance_port}} will correspond to the port number used to start the module instance in the IntelliJ as shown below:
...
A successful interception will have traffic-agent-init terminated as Completed, traffic-agent left in Running status, and the module in question returning “OK” from its /admin/health endpoint:
...
After that you are all set test a feature or debug some issue with your local module instance now communicating directly with the modules deployed on Rancher.
Clean-up
Once your task is complete and interception no longer needed, please execute:
telepresence leave {{InterceptedSvcName}}
telepresence quit -s
If telepresence is failing to connect, please find all telepresence active\running process(es) on your system and stop them, then try to connect.
How to find active\running process(es) and terminate them:
...