Skip to content

Latest commit

 

History

History
156 lines (109 loc) · 3.52 KB

CONTRIBUTING.md

File metadata and controls

156 lines (109 loc) · 3.52 KB

CONTRIBUTING

About KubeVela

KubeVela project is initialized and maintained by the cloud native community since day 0 with bootstrapping contributors from 8+ different organizations. We intend for KubeVela to have a open governance since the very beginning and donate the project to neutral foundation as soon as it's released.

This doc explains how to set up a development environment, so you can get started contributing to kubevela or build a PoC (Proof of Concept).

Prerequisites

  1. Golang version 1.13+
  2. Kubernetes version v1.16+ with ~/.kube/config configured.
  3. ginkgo 1.14.0+ (just for E2E test)
  4. golangci-lint 1.31.0+, it will install automatically if you run make, you can install it manually if the installation is too slow.

Build

  • Clone this project
git clone git@github.com:oam-dev/kubevela.git
  • Build Vela CLI
make
  • Configure vela to PATH

after build, make will create vela binary to bin/, Set this path to PATH.

export PATH=$PATH:/your/path/to/project/kubevela/bin

Then you can use vela command directly.

  • Build Vela Core
make manager
  • Run Vela Core

Firstly make sure your cluster has CRDs.

make core-install

Run locally:

make core-run

This command will run controller locally, it will use your local KubeConfig which means you need to have a k8s cluster locally. If you don't have a one, we suggest that you could setup up a cluster with kind.

Use

  • Create environment
vela env init myenv --namespace myenv --email my@email.com --domain kubevela.io 
  • Create Component

For example, use the following command to create and run an application.

$ vela svc deploy mysvc -t webservice --image crccheck/hello-world --port 8000 -a abc
  App abc deployed
  • Add Trait
$ vela route abc
  Adding route for app mysvc
  ⠋ Deploying ...
  ✅ Application Deployed Successfully!
    - Name: mysvc
      Type: webservice
      HEALTHY Ready: 1/1
      Last Deployment:
        Created at: 2020-11-02 11:17:28 +0800 CST
        Updated at: 2020-11-02T11:21:23+08:00
      Routes:
        - route: Visiting URL: http://abc.kubevela.io	IP: 47.242.68.137
  • Check Status
$ vela status abc
  About:
  
    Name:      	abc
    Namespace: 	default
    Created at:	2020-11-02 11:17:28.067738 +0800 CST
    Updated at:	2020-11-02 11:28:13.490986 +0800 CST
  
  Services:
  
    - Name: mysvc
      Type: webservice
      HEALTHY Ready: 1/1
      Last Deployment:
        Created at: 2020-11-02 11:17:28 +0800 CST
        Updated at: 2020-11-02T11:28:13+08:00
      Routes:
        - route: Visiting URL: http://abc.kubevela.io	IP: 47.242.68.137
  • Delete App
$ vela ls
  SERVICE       	APP      	TYPE	TRAITS	STATUS  	CREATED-TIME
  mysvc            	abc       	    	      	Deployed 	2020-11-02 11:17:28 +0800 CST

$ vela delete abc
  Deleting Application "abc"
  delete apps succeed abc from default

Tests

Unit test

make test

E2E test

Before e2e test start, make sure you have vela-core running.

make core-run

Start to test.

make e2e-test

Make a pull request

Remember to write unit-test and e2e test before making a pull request.