mirror of
https://github.com/kubesphere/website.git
synced 2025-12-26 00:12:48 +00:00
Merge pull request #6 from rayzhou2017/master
Update dev workflow guide
This commit is contained in:
commit
7cfec2dfcb
|
|
@ -1,24 +1,26 @@
|
|||
# Development Workflow
|
||||
|
||||

|
||||
The following graph shows the workflow how to develop KubeSphere backend. For the frontend part please refer to [KubeSphere console](https://github.com/kubesphere/console)
|
||||
|
||||
## 1 Fork in the cloud
|
||||

|
||||
|
||||
## Step 1. Fork
|
||||
|
||||
1. Visit https://github.com/kubesphere/kubesphere
|
||||
2. Click `Fork` button to establish a cloud-based fork.
|
||||
2. Click `Fork` button to create a fork of the project to your GitHub account.
|
||||
|
||||
## 2 Clone fork to local storage
|
||||
## Step 2. Clone fork to local storage
|
||||
|
||||
Per Go's [workspace instructions](https://golang.org/doc/code.html#Workspaces), place KubeSphere' code on your `GOPATH` using the following cloning procedure.
|
||||
Per Go's [workspace instructions](https://golang.org/doc/code.html#Workspaces), place KubeSphere code on your `GOPATH` using the following cloning procedure.
|
||||
|
||||
1. Define a local working directory:
|
||||
Define a local working directory:
|
||||
|
||||
```bash
|
||||
$ export working_dir=$GOPATH/src/kubesphere.io
|
||||
$ export user={your github profile name}
|
||||
export working_dir=$GOPATH/src/kubesphere.io
|
||||
export user={your github profile name}
|
||||
```
|
||||
|
||||
2. Create your clone locally:
|
||||
Create your clone locally:
|
||||
|
||||
```bash
|
||||
$ mkdir -p $working_dir
|
||||
|
|
@ -30,11 +32,11 @@ $ git remote add upstream https://github.com/kubesphere/kubesphere.git
|
|||
# Never push to upstream master
|
||||
$ git remote set-url --push upstream no_push
|
||||
|
||||
# Confirm that your remotes make sense:
|
||||
# Confirm your remotes make sense:
|
||||
$ git remote -v
|
||||
```
|
||||
|
||||
## 3 Keep your branch in sync
|
||||
## Step 3. Keep your branch in sync
|
||||
|
||||
```bash
|
||||
git fetch upstream
|
||||
|
|
@ -42,27 +44,27 @@ git checkout master
|
|||
git rebase upstream/master
|
||||
```
|
||||
|
||||
## 4 Add new features or fix issues
|
||||
## Step 4. Add new features or fix issues
|
||||
|
||||
Branch from it:
|
||||
Create a branch from master:
|
||||
|
||||
```bash
|
||||
$ git checkout -b myfeature
|
||||
git checkout -b myfeature
|
||||
```
|
||||
|
||||
Then edit code on the myfeature branch.
|
||||
Then edit code on the `myfeature` branch.
|
||||
|
||||
**Test and build**
|
||||
### Test and build
|
||||
|
||||
Currently, make rules only contain simple checks such as vet, unit test, will add e2e tests soon.
|
||||
Currently, the make rules only contain simple checks such as vet, unit test, will add e2e tests soon.
|
||||
|
||||
**Using KubeBuilder**
|
||||
### Using KubeBuilder
|
||||
|
||||
- For Linux OS, you can download and execute this [KubeBuilder script](https://raw.githubusercontent.com/kubesphere/kubesphere/master/hack/install_kubebuilder.sh).
|
||||
|
||||
- For MacOS, you can install KubeBuilder by following this [guide](https://book.kubebuilder.io/quick-start.html).
|
||||
|
||||
**Run and test**
|
||||
### Run and test
|
||||
|
||||
```bash
|
||||
$ make all
|
||||
|
|
@ -72,14 +74,14 @@ $ make test
|
|||
|
||||
Run `make help` for additional information on these make targets.
|
||||
|
||||
### 5 Development in new branch
|
||||
## Step 5. Development in new branch
|
||||
|
||||
**Sync with upstream**
|
||||
### Sync with upstream
|
||||
|
||||
After the test is completed, suggest you to keep your local in sync with upstream which can avoid conflicts.
|
||||
After the test is completed, it is a good practice to keep your local in sync with upstream to avoid conflicts.
|
||||
|
||||
```
|
||||
# Rebase your the master branch of your local repo.
|
||||
```bash
|
||||
# Rebase your master branch of your local repo.
|
||||
$ git checkout master
|
||||
$ git rebase upstream/master
|
||||
|
||||
|
|
@ -87,22 +89,23 @@ $ git rebase upstream/master
|
|||
git checkout new_feature
|
||||
git rebase -i master
|
||||
```
|
||||
**Commit local changes**
|
||||
|
||||
### Commit local changes
|
||||
|
||||
```bash
|
||||
$ git add <file>
|
||||
$ git commit -s -m "add your description"
|
||||
git add <file>
|
||||
git commit -s -m "add your description"
|
||||
```
|
||||
|
||||
### 6 Push to your folk
|
||||
## Step 6. Push to your folk
|
||||
|
||||
When ready to review (or just to establish an offsite backup or your work), push your branch to your fork on github.com:
|
||||
When ready to review (or just to establish an offsite backup of your work), push your branch to your fork on GitHub:
|
||||
|
||||
```
|
||||
$ git push -f ${your_remote_name} myfeature
|
||||
```bash
|
||||
git push -f ${your_remote_name} myfeature
|
||||
```
|
||||
|
||||
### 7 Create a PR
|
||||
## Step 7. Create a PR
|
||||
|
||||
- Visit your fork at https://github.com/$user/kubesphere
|
||||
- Click the` Compare & Pull Request` button next to your myfeature branch.
|
||||
|
|
|
|||
|
|
@ -1,23 +1,21 @@
|
|||
# Connect to remote service with telepresence
|
||||
# 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.
|
||||
[Telepresence](https://www.telepresence.io/) is an open source tool that lets you run a single service locally, while connecting the service to a remote Kubernetes cluster.
|
||||
|
||||
We can use telepresence to help us running KubeSphere apiserver locally.
|
||||
We can use Telepresence to help us running KubeSphere apiserver locally.
|
||||
|
||||
## 1. Install Telepresence
|
||||
|
||||
## 1. Install telepresence
|
||||
You can read the [official installation documentation](https://www.telepresence.io/reference/install.html) to install Telepresence.
|
||||
|
||||
You can read the [official installation documentation](https://www.telepresence.io/reference/install.html) to install telepresence.
|
||||
## 2. Run 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.
|
||||
|
||||
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:
|
||||
Test Telepresence with KubeSphere apigateway:
|
||||
|
||||
```bash
|
||||
|
||||
@kubernetes-admin@cluster.local|bash-3.2$ curl http://ks-apigateway.kubesphere-system
|
||||
$ curl http://ks-apigateway.kubesphere-system
|
||||
|
||||
401 Unauthorized
|
||||
```
|
||||
|
|
@ -29,6 +27,7 @@ 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).
|
||||
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).
|
||||
|
|
|
|||
Loading…
Reference in New Issue