In this guide, we will describe how to debug a remote ArgoCD environment with [Telepresence](https://telepresence.io/).
Telepresence allows you to connect & debug a service deployed in a remote environment and to "cherry-pick" one service to run locally, staying connected to the remote cluster. This will:
* Reduce resource footprint on the local machine
* Decrease the feedback loop time
* Result in more confidence about the delivered code.
To read more about it, refer to the official documentation at [telepresence.io](https://telepresence.io/) or [Medium](https://medium.com/containers-101/development-environment-using-telepresence-634bd7210c26).
*`--env-file` writes all the environment variables of the remote pod into a local file, the variables are also set on the subprocess of the `--run` command
With this, any traffic that hits your argocd-server service in the cluster (e.g. through a LB / ingress) will be forwarded to your laptop on port 8080. So that you can now start argocd-server locally to debug or test new code. If you launch argocd-server using the environment variables in `.envrc.remote`, it is able to fetch all the configmaps, secrets and so on from the cluster and transparently connect to the other microservices so that no further configuration should be necessary, and it behaves exactly the same as in the cluster.
*`--swap-deployment` changes the argocd-server deployment
*`--expose` forwards traffic of remote ports 8080 and 8083 to the same ports locally
*`--env-file` writes all the environment variables of the remote pod into a local file, the variables are also set on the subprocess of the `--run` command
*`--run` defines which command to run once a connection is established, use `bash`, `zsh` or others
## Debug
Once a connection is established, use your favorite tools to start the server locally.