Skip to content

Commit

Permalink
docs: update debugging remote argocd environment (#10811)
Browse files Browse the repository at this point in the history
- launch.json now uses `main.go` and env var to determine which service is launched
- telepresence v2 uses new structure to initialice and intercept connections
- Add .envrc.remote to .gitignore

Signed-off-by: Nathanael Liechti <[email protected]>

Signed-off-by: Nathanael Liechti <[email protected]>
  • Loading branch information
the-technat committed Oct 7, 2022
1 parent 90760a5 commit 0a02a63
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ test-results
node_modules/
.kube/
./test/cmp/*.sock
.envrc.remote

# ignore built binaries
cmd/argocd/argocd
Expand Down
34 changes: 31 additions & 3 deletions docs/developer-guide/debugging-remote-environment.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,41 @@ curl -sSfL https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/i
## Connect
Connect to one of the services, for example, to debug the main ArgoCD server run:
```shell
telepresence helm install # Installs telepresence into your cluster
telepresence connect # Starts the connection to your cluster
telepresence intercept argocd-server --port 8083:8083 --port 8080:8080 --env-file .envrc.remote --namespace argocd # Starts the interception
```
* `--port` 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
* `--namespace` specifies that the `argocd-server` is located in the `argocd` namespace

List current status of Telepresence using:
```shell
telepresence status
```

Stop the intercept using:
```shell
telepresence leave argocd-server-argocd
```

And uninstall telepresence from your cluster:
```shell
telepresence helm uninstall
```

See [this quickstart](https://www.telepresence.io/docs/latest/howtos/intercepts/) for more information on how to intercept services using Telepresence.

### Connect (telepresence v1)
Use the following command instead:
```shell
telepresence --swap-deployment argocd-server --namespace argocd --env-file .envrc.remote --expose 8080:8080 --expose 8083:8083 --run bash
```
* `--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.

Expand All @@ -44,13 +71,14 @@ Update the configuration file to point to kubeconfig file: `KUBECONFIG=` (requir
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}/cmd/argocd-server",
"program": "${workspaceFolder}/cmd/main.go",
"envFile": [
"${workspaceFolder}/.envrc.remote",
],
"env": {
"ARGOCD_BINARY_NAME": "argocd-server",
"CGO_ENABLED": "0",
"KUBECONFIG": "/path/to/kube/config"
}
}
```
```

0 comments on commit 0a02a63

Please sign in to comment.