How-to-connect-remote-service.md 1.1 KB
Newer Older
1 2 3 4
# Connect to remote service with telepresence

Telepresence is an open source tool that lets you run a single service locally, while connecting that service to a remote Kubernetes cluster.

P
pengfei 已提交
5
We can use telepresence to help us running KubeSphere apiserver locally.
6 7 8 9 10 11 12 13


## 1. Install telepresence

You can read the [official installation documentation](https://www.telepresence.io/reference/install.html) to install telepresence.

## 2. Run telepresence

P
pengfei 已提交
14
Open your command line and run the command `telepresence`, telepresence will help you to enter a bash connected to a remote Kubernetes cluster.
15 16

Test telepresence with KubeSphere apigateway:
P
pengfei 已提交
17

18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
```bash

@kubernetes-admin@cluster.local|bash-3.2$ curl http://ks-apigateway.kubesphere-system

401 Unauthorized
```

## 3. Run your module in bash

Now your module can easily connect to remote services.

```bash
go run cmd/ks-apiserver/apiserver.go
```
## 4. Further more

You can use telepresence to replace services in the cluster for debugging. For more information, please refer to the [official documentation](https://www.telepresence.io/discussion/overview).