use telepresence to debug remote service

Signed-off-by: runzexia <runzexia@yunify.com>
This commit is contained in:
runzexia
2019-11-26 17:51:36 +08:00
parent de2baa695b
commit 50bc00b004
2 changed files with 37 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
# 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.
We can use telepresence to help us run kubesphere apiserver locally.
## 1. Install telepresence
You can read the [official installation documentation](https://www.telepresence.io/reference/install.html) to install telepresence.
## 2. Run telepresence
Open your command line and run the command `telepresence`, telepresence will help you to enter a bash connected to a remote kubernetes cluster.
Test telepresence with KubeSphere apigateway:
```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).

View File

@@ -33,6 +33,10 @@ During the development of KubeSphere apiserver, you must configure at least the
Below is a sample configuration of Kubesphere apiserver: Below is a sample configuration of Kubesphere apiserver:
> Note: In the default configuration, we use kubernetes service name to access the service.
> In a remote cluster, you may need to use external network exposure to connect to the cluster's internal services.
> Or you can refer to the [documentation](How-to-connect-remote-service.md) to use `telepresence` to connect to remote services
```yaml ```yaml
kubernetes: kubernetes:
kubeconfig: "/Users/kubesphere/.kube/config" kubeconfig: "/Users/kubesphere/.kube/config"