Compare commits

..

119 Commits

Author SHA1 Message Date
Hongchao Deng
00ee2bfad4 Merge pull request #621 from hongchaodeng/fix-config
fix config in webservice template
2020-11-17 11:49:40 -08:00
Hongchao Deng
e6445f7458 fix config in webservice template
Signed-off-by: Hongchao Deng <hongchaodeng1@gmail.com>
2020-11-17 11:38:16 -08:00
Hongchao Deng
debc0da3b6 Merge pull request #620 from wonderflow/golint
add description for export const variable and function
2020-11-17 11:15:14 -08:00
Hongchao Deng
ea823db8ea Merge pull request #619 from wonderflow/goimports
fix go imports lint complain
2020-11-17 11:14:18 -08:00
天元
fb8c33af8d add description for export const variable and function, fix golint
Signed-off-by: 天元 <jianbo.sjb@alibaba-inc.com>
2020-11-17 21:04:53 +08:00
天元
974027e233 fix go imports lint complain
Signed-off-by: 天元 <jianbo.sjb@alibaba-inc.com>
2020-11-17 20:40:08 +08:00
Jianbo Sun
cb946bff95 Merge pull request #618 from zzxwill/docs-webservice-autoscale
Minor updates on webservice/autoscale docs/comments
2020-11-17 13:25:11 +08:00
zzxwill
f22c8995f4 Minor updates on webservice/autoscale docs/comments
based on the comments https://github.com/oam-dev/kubevela/pull/566#discussion_r522385511
and https://github.com/oam-dev/kubevela/issues/585#issuecomment-726253432,
update docs and comments on webservice and autoscale
2020-11-17 13:10:49 +08:00
Jianbo Sun
550d708637 Merge pull request #617 from wonderflow/fixci
update KIND action to fix CI
2020-11-17 11:11:51 +08:00
天元
1a592496a1 update KIND action to fix CI
Signed-off-by: 天元 <jianbo.sjb@alibaba-inc.com>
2020-11-17 10:47:44 +08:00
Jianbo Sun
a5eb3161eb Merge pull request #613 from wonderflow/ext1
refactor extend trait feature and doc
2020-11-17 10:16:39 +08:00
Hongchao Deng
ffa965d637 Merge pull request #616 from resouer/badge
Remove duplicated badges
2020-11-16 17:34:34 -08:00
Harry Zhang
ef16da72f5 Remove duplicated badges 2020-11-16 15:42:40 -08:00
Hongchao Deng
19657d488f Merge pull request #615 from szihai/master
add README badges
2020-11-16 13:36:44 -08:00
andy shi
b9fc2180c5 add README badges 2020-11-16 12:38:25 -08:00
天元
daef0523fa refactor extend trait feature and doc
Signed-off-by: 天元 <jianbo.sjb@alibaba-inc.com>
2020-11-16 19:22:38 +08:00
Jianbo Sun
3269c4f48f Merge pull request #612 from wonderflow/rollout1
tunning docs
2020-11-16 14:32:44 +08:00
Hongchao Deng
2526760080 Merge pull request #611 from resouer/readme
Use doc site for quick start
2020-11-15 22:30:02 -08:00
Harry Zhang
5ec22917a1 Use doc site for quick start 2020-11-15 22:07:49 -08:00
天元
efb76ee5ee tunning docs 2020-11-16 14:07:38 +08:00
andy shi
47222606dd Fix cloud service doc (#607)
* first version cloud-service

* revise cloud service doc

* remove sensitive information

* update document

* add cloud service to sidebar

* add cloud service to sidebar

* formatting instructions

* fix syntax
2020-11-16 10:39:56 +08:00
Jianbo Sun
fe81ed1653 Merge pull request #593 from wonderflow/upd
refactor crd generate mode
2020-11-16 10:39:04 +08:00
Jianbo Sun
51fe5e7c7b Merge pull request #610 from resouer/roadmap
Update roadmap a bit
2020-11-15 14:31:55 +08:00
Harry Zhang
3e6002cc95 Update roadmap 2020-11-14 21:52:10 -08:00
Hongchao Deng
6792d7ded1 Merge pull request #608 from resouer/cap
Add details in cap mgmt
2020-11-14 13:23:38 -08:00
Hongchao Deng
2b2eb9701c Merge pull request #606 from resouer/dev
Refactor workload type doc
2020-11-14 13:23:07 -08:00
Harry Zhang
93559a2f01 Add details in cap mgmt 2020-11-13 23:17:35 -08:00
Harry Zhang
ecf3f5d664 Refactor workload type doc 2020-11-13 22:32:48 -08:00
Hongchao Deng
54e30b1f8b Merge pull request #605 from resouer/dev
Add better rollout trait doc
2020-11-13 18:35:52 -08:00
Harry Zhang
de7bb9ba46 Add better rollout trait doc 2020-11-13 17:23:05 -08:00
Hongchao Deng
c1d6dedb5d Merge pull request #604 from hongchaodeng/doc-extend
extend kubevela: add openfaas workload
2020-11-13 17:13:07 -08:00
天元
9a89699691 refactor crd generate mode
Signed-off-by: 天元 <jianbo.sjb@alibaba-inc.com>
2020-11-14 09:10:39 +08:00
Hongchao Deng
34819f8d80 Update docs/en/platform-engineers/workload-type.md
Co-authored-by: Jianbo Sun <wonderflow.sun@gmail.com>
2020-11-13 17:10:27 -08:00
Hongchao Deng
6486b7878f extend kubevela: add openfaas workload 2020-11-13 16:14:33 -08:00
Hongchao Deng
9fcfb7e1df Merge pull request #603 from resouer/rollout
Fix nits in rollout ref doc
2020-11-13 16:07:01 -08:00
Harry Zhang
8d4fe38cc3 Fix nits in rollout ref doc 2020-11-13 15:33:08 -08:00
Hongchao Deng
48052e59ee Merge pull request #599 from hongchaodeng/cli2
update descriptions of capabilities
2020-11-13 14:27:47 -08:00
Hongchao Deng
b0c9e4b78a update descriptions of capabilities 2020-11-13 12:38:45 -08:00
Hongchao Deng
4e7af35e61 Merge pull request #598 from hongchaodeng/cli
upate descriptions of commands
2020-11-13 12:38:18 -08:00
Hongchao Deng
4264a63613 Merge pull request #600 from resouer/fix
Fixe several nits in the doc and guide
2020-11-13 12:38:02 -08:00
Harry Zhang
f90140ee5b Fixe several nits in the doc and guide 2020-11-13 12:35:19 -08:00
Hongchao Deng
57dc83976d upate descriptions of commands
Signed-off-by: Hongchao Deng <hongchaodeng1@gmail.com>
2020-11-13 12:31:57 -08:00
Hongchao Deng
2a88bf271a Merge pull request #596 from resouer/dev
Hide empty docs
2020-11-13 11:39:18 -08:00
Harry Zhang
84a17764ed Hide empty docs 2020-11-13 10:59:14 -08:00
Hongchao Deng
98a6d7a8cf Merge pull request #594 from resouer/dev
Fix typos in docs
2020-11-13 10:21:28 -08:00
Harry Zhang
dd5a74235d Fix typos in docs 2020-11-13 10:18:33 -08:00
Jianbo Sun
c10cbead76 Merge pull request #592 from hongchaodeng/cli
clean up vela cli help info to be app focused
2020-11-13 15:58:29 +08:00
Hongchao Deng
28e417ef47 add init to get start
Signed-off-by: Hongchao Deng <hongchaodeng1@gmail.com>
2020-11-12 22:09:59 -08:00
Hongchao Deng
43a674b6f7 unify format 2020-11-12 21:09:47 -08:00
Hongchao Deng
cfab53f97b clean up vela cli help info to be app focused 2020-11-12 21:04:37 -08:00
Hongchao Deng
df7dca81da Merge pull request #586 from wonderflow/froute
go through rollout with kind cluster and fix bugs
2020-11-12 19:45:40 -08:00
andy shi
22b6e87d58 revise cloud service doc (#591)
* first version cloud-service

* revise cloud service doc

* remove sensitive information
2020-11-13 11:44:10 +08:00
Jianbo Sun
4b768c49a6 Merge pull request #587 from tossmilestone/add-missing-command-type
Add missing TagCommandType
2020-11-13 11:43:06 +08:00
天元
cd4615405f updated oam-k8s-runtime and go through rollout fix bugs
Signed-off-by: 天元 <jianbo.sjb@alibaba-inc.com>
2020-11-13 11:24:49 +08:00
Jianbo Sun
ccc3576a4c Merge pull request #566 from zzxwill/docs-autoscale
Revise autoscaler doc with appfile focused
2020-11-13 11:08:50 +08:00
zzxwill
3dd5e493c6 update reference doc 2020-11-13 10:22:36 +08:00
Xiaoxi He
e120e141ee Add missing TagCommandType 2020-11-13 00:14:20 +08:00
zzxwill
e794da5492 fix unit-test issue 2020-11-12 20:01:45 +08:00
zzxwill
7031e04c75 Revise Autoscaler doc with appfile focused
- Splitted autoscale docs to be appfile focused,
and add cpu utilization scaling policy for appfile
- Allow user to input parameter with int type, like
10 instead of "10"
- Change cpuRequest/cpu to proper names

To fix #564
2020-11-12 19:02:14 +08:00
Jianbo Sun
e8de0e29df Merge pull request #584 from wonderflow/remove
remove annotation for apiversion and kind, use discoverymapper instead
2020-11-12 15:58:53 +08:00
天元
d67ce4d2a1 refactor server and fix CI
Signed-off-by: 天元 <jianbo.sjb@alibaba-inc.com>
2020-11-12 15:19:50 +08:00
天元
40ab610a8e remove annotation for apiversion and kind, use discoverymapper instead
Signed-off-by: 天元 <jianbo.sjb@alibaba-inc.com>
2020-11-12 12:04:08 +08:00
Hongchao Deng
78b1c5b32c Merge pull request #582 from hongchaodeng/ci
CI: ignore all markdown changes
2020-11-11 19:54:11 -08:00
Hongchao Deng
7b957df709 Merge pull request #583 from resouer/dev
Fix typo in previous fix
2020-11-11 19:44:35 -08:00
Hongchao Deng
3edc6ed317 CI: ignore all markdown changes 2020-11-11 19:42:41 -08:00
Harry Zhang
c43dad4907 Fix typo 2020-11-11 19:42:37 -08:00
Hongchao Deng
b4b9fcfaf0 Merge pull request #579 from resouer/dev
Focus on appfile in docs part 3 (w/ ref docs)
2020-11-11 19:40:37 -08:00
Harry Zhang
3af42feb02 Focus on appfile in docs part 3 (w/ ref docs) 2020-11-11 19:19:42 -08:00
Lei Zhang (Harry)
16ddba80b3 Merge pull request #581 from hongchaodeng/image
fix metrics image and merge resource folders
2020-11-11 19:09:43 -08:00
Jianbo Sun
32bb102a86 Merge pull request #573 from wonderflow/raw
keep silence when no Capability discovered && clean code
2020-11-12 11:08:38 +08:00
Hongchao Deng
0fcc6498cb fix metrics image and merge resource folders
Signed-off-by: Hongchao Deng <hongchaodeng1@gmail.com>
2020-11-11 19:00:05 -08:00
天元
ab72ddbea4 clean code
Signed-off-by: 天元 <jianbo.sjb@alibaba-inc.com>
2020-11-12 10:54:21 +08:00
Lei Zhang (Harry)
10d360c03c Merge pull request #580 from hongchaodeng/doc
vela up support url, fix scale/rollout/metrics to focus on appfile, fix reference doc
2020-11-11 18:09:10 -08:00
Hongchao Deng
4b609e0fff vela up support url, fix scale/rollout/metrics to focus on appfile, fix reference doc
Signed-off-by: Hongchao Deng <hongchaodeng1@gmail.com>
2020-11-11 17:13:24 -08:00
Lei Zhang (Harry)
49e8aca2bd Merge pull request #571 from wonderflow/fixlink
fix link
2020-11-11 11:18:49 -08:00
天元
c5ecd0aff3 keep silence when no Capability discovered 2020-11-11 17:44:32 +08:00
Jianbo Sun
adac554333 Merge pull request #570 from wonderflow/fixrollout
update rollout doc
2020-11-11 17:24:14 +08:00
天元
c6e15fae2d add reference doc
Signed-off-by: 天元 <jianbo.sjb@alibaba-inc.com>
2020-11-11 17:19:23 +08:00
天元
7f75d22ab6 fix link
Signed-off-by: 天元 <jianbo.sjb@alibaba-inc.com>
2020-11-11 17:10:26 +08:00
Jianbo Sun
e148a901a9 Merge pull request #569 from wonderflow/redou
delete redundant example folder, it's docs/examples
2020-11-11 17:08:48 +08:00
天元
9c5e156e23 update rollout doc 2020-11-11 16:59:50 +08:00
天元
626eb5eb68 delete redundant example folder, it's docs/examples 2020-11-11 16:35:35 +08:00
Jianbo Sun
72f3d22942 Merge pull request #567 from wonderflow/init
update vela init UI
2020-11-11 16:28:19 +08:00
天元
07351d9dd7 update vela init UI
Signed-off-by: 天元 <jianbo.sjb@alibaba-inc.com>
2020-11-11 16:16:01 +08:00
Hongchao Deng
6ac7e88a63 Merge pull request #563 from resouer/fix
Focus on appfile in docs (part 2)
2020-11-10 19:14:03 -08:00
Harry Zhang
36d2b9e761 Focus on appfile in docs (part 2) 2020-11-10 17:36:56 -08:00
Hongchao Deng
1681fe7de2 Merge pull request #561 from hongchaodeng/ci
ignore dashboard build on doc change
2020-11-10 15:33:50 -08:00
Hongchao Deng
214a5ee4aa Merge pull request #562 from resouer/doc
Fix the previous missing directory
2020-11-10 15:31:30 -08:00
Harry Zhang
e69548a72a Seperate install and getting started. 2020-11-10 15:26:03 -08:00
Lei Zhang (Harry)
877b7b8cb6 Merge pull request #560 from oam-dev/revert-558-doc
Revert "Focus on appfile in docs (part 1)"
2020-11-10 15:25:14 -08:00
Hongchao Deng
2476f83b1b ignore dashboard build on doc change 2020-11-10 15:21:38 -08:00
Lei Zhang (Harry)
c9929cf7cf Revert "Focus on appfile in docs (part 1)" 2020-11-10 15:18:37 -08:00
Hongchao Deng
8b9c927572 Merge pull request #558 from resouer/doc
Focus on appfile in docs (part 1)
2020-11-10 15:04:13 -08:00
Hongchao Deng
b59fe17f4d Merge pull request #559 from Fei-Guo/master
Revise design.md
2020-11-10 15:01:34 -08:00
Harry Zhang
645fd3f917 Focus on appfile in docs (part 1) 2020-11-10 14:54:14 -08:00
Lei Zhang (Harry)
15e1564983 Merge pull request #556 from hongchaodeng/ci
make CI ignore doc change
2020-11-10 14:38:56 -08:00
Guo, Fei
c24c039b15 Address review comments 2020-11-10 14:34:26 -08:00
Guo, Fei
8e2205ef07 Revise design.md 2020-11-10 14:19:26 -08:00
Hongchao Deng
cd3c91b537 make CI ignore doc change 2020-11-10 11:01:51 -08:00
Lei Zhang (Harry)
f6e3fc31d1 Merge pull request #554 from hongchaodeng/doc
fix doc link
2020-11-10 10:10:19 -08:00
Hongchao Deng
1f5d3bde7b fix link 2020-11-10 09:21:17 -08:00
Jianbo Sun
0fc1c3132e Merge pull request #546 from zzxwill/issue-autoscaler
Fix autoscale inconsistence UI
2020-11-10 20:47:48 +08:00
Jianbo Sun
f18ee6586a Merge pull request #540 from wonderflow/rollout
support rollout trait
2020-11-10 20:39:16 +08:00
zzxwill
da8457fbf0 Fix autoscale inconsistence UI
fixed autoscale Cli and Appfile inconsistence
and refactor `vela status` output for autoscale
2020-11-10 20:30:04 +08:00
天元
29e97a6040 fix doc 2020-11-10 20:22:39 +08:00
天元
5c0f26c6f6 fix doc gen path 2020-11-10 20:16:15 +08:00
天元
fd3f300901 support rollout trait
Signed-off-by: 天元 <jianbo.sjb@alibaba-inc.com>
2020-11-10 20:13:27 +08:00
guoxudong
025ce5d74d move website & keep design md (#551)
* move website & keep design md

* fix

* update README

* fix

* fix

* rename

* fix
2020-11-10 20:09:13 +08:00
Hongchao Deng
bbb2c527d9 Merge pull request #543 from hongchaodeng/doc
README: update doc link to website
2020-11-09 13:03:26 -08:00
Hongchao Deng
65db8753de README: update doc link to website 2020-11-09 12:52:15 -08:00
Jianbo Sun
890aef14f3 Merge pull request #539 from lujinda/fix
Fix `capabilities system of OAM` links
2020-11-09 21:23:21 +08:00
lujinda
7371496f27 Fix capabilities system of OAM links 2020-11-09 20:27:36 +08:00
Jianbo Sun
f792bf2bbf Merge pull request #535 from zzxwill/issue-ls
Fix `vela ls` issue
2020-11-09 12:28:48 +08:00
zzxwill
9ca4f64030 Fix vela ls issue
By default, all svc deployed without `--staging` will appear
to be `staging` in cmd `vela ls`.
To fix #534
2020-11-09 11:34:07 +08:00
Jianbo Sun
d5909a13f3 Merge pull request #532 from resouer/typo
Minor fixes in design and readme
2020-11-09 10:31:34 +08:00
Jianbo Sun
9b5c72e5ad Merge pull request #533 from captainroy-hy/enhance-cap-list
Don't output all existing caps during vela workloads/traits
2020-11-09 10:23:02 +08:00
roy wang
88d3042767 remove vela system update command
sync caps from cluster before `vela env init`

fix e2e-test

Signed-off-by: roy wang <seiwy2010@gmail.com>
2020-11-08 16:42:40 +09:00
Harry Zhang
9f6e53269d Minor fixes in design and readme 2020-11-07 22:11:29 -08:00
roy wang
66f157cca7 not output all existing caps during vela workloads/traits
Signed-off-by: roy wang <seiwy2010@gmail.com>
2020-11-07 17:53:26 +09:00
341 changed files with 5382 additions and 3394 deletions

View File

@@ -4,6 +4,10 @@ on:
push:
branches: [ master ]
pull_request:
branches: [master]
paths-ignore:
- 'docs/**'
- '**.md'
defaults:
run:
working-directory: ./dashboard

View File

@@ -5,6 +5,9 @@ on:
branches: [master]
pull_request:
branches: [master]
paths-ignore:
- 'docs/**'
- '**.md'
jobs:
build:
@@ -19,7 +22,7 @@ jobs:
go get -v -t -d ./...
- name: Setup Kind Cluster
uses: engineerd/setup-kind@v0.4.0
uses: engineerd/setup-kind@v0.5.0
with:
version: "v0.7.0"
skipClusterCreation: true

View File

@@ -5,6 +5,9 @@ on:
branches: [master]
pull_request:
branches: [master]
paths-ignore:
- 'docs/**'
- '**.md'
jobs:
build:
@@ -25,12 +28,12 @@ jobs:
sudo apt-get install -y golang-ginkgo-dev
- name: Setup Kind Cluster
uses: engineerd/setup-kind@v0.4.0
uses: engineerd/setup-kind@v0.5.0
with:
version: "v0.7.0"
- name: install Kubebuilder
uses: RyanSiu1995/kubebuilder-action@v1
uses: wonderflow/kubebuilder-action@v1.1
- name: Run Make test
run: make test

View File

@@ -14,6 +14,8 @@ contributing to `kubevela` or build a PoC (Proof of Concept).
3. ginkgo 1.14.0+ (just for [E2E test](https://github.com/oam-dev/kubevela/blob/master/DEVELOPMENT.md#e2e-test))
4. golangci-lint 1.31.0+, it will install automatically if you run `make`, you can [install it manually](https://golangci-lint.run/usage/install/#local-installation) if the installation is too slow.
We also recommend you to learn about KubeVela's [design](docs/en/design.md) before dive into its code.
## Build
* Clone this project

View File

@@ -1,14 +1,14 @@
# Vela version
VELA_VERSION ?= 0.1.0
# Repo info
GIT_COMMIT ?= git-$(shell git rev-parse --short HEAD)
VELA_VERSION_VAR := github.com/oam-dev/kubevela/version.VelaVersion
GIT_COMMIT ?= git-$(shell git rev-parse --short HEAD)
VELA_VERSION_VAR := github.com/oam-dev/kubevela/version.VelaVersion
VELA_GITVERSION_VAR := github.com/oam-dev/kubevela/version.GitRevision
LDFLAGS ?= "-X $(VELA_VERSION_VAR)=$(VELA_VERSION) -X $(VELA_GITVERSION_VAR)=$(GIT_COMMIT)"
LDFLAGS ?= "-X $(VELA_VERSION_VAR)=$(VELA_VERSION) -X $(VELA_GITVERSION_VAR)=$(GIT_COMMIT)"
GOX = go run github.com/mitchellh/gox
TARGETS := darwin/amd64 linux/amd64 windows/amd64
DIST_DIRS := find * -type d -exec
GOX = go run github.com/mitchellh/gox
TARGETS := darwin/amd64 linux/amd64 windows/amd64
DIST_DIRS := find * -type d -exec
# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
@@ -38,8 +38,8 @@ npm-build:
npm-install:
cd dashboard && npm install && cd ./..
generate-doc:
rm -r docs/cli/*
doc-gen:
rm -r docs/en/cli/*
go run hack/docgen/gen.go
generate-source:
@@ -64,8 +64,9 @@ run: fmt vet
go run ./cmd/core/main.go
# Run go fmt against code
fmt:
fmt: goimports
go fmt ./...
$(GOIMPORTS) -local github.com/oam-dev/kubevela -w ./pkg ./cmd
./hack/cue-fmt.sh
# Run go vet against code
@@ -126,10 +127,12 @@ core-run: generate fmt vet manifests
# Install CRDs and Definitions of Vela Core into a cluster, this is for develop convenient.
core-install: manifests
kubectl apply -f hack/namespace.yaml
kubectl apply -f charts/vela-core/crds/
kubectl apply -f charts/vela-core/templates/defwithtemplate/
kubectl apply -f charts/vela-core/templates/definitions/
bin/vela system update
kubectl apply -f charts/vela-core/templates/velaConfig.yaml
bin/vela workloads
# Uninstall CRDs and Definitions of Vela Core from a cluster, this is for develop convenient.
core-uninstall: manifests
@@ -140,6 +143,7 @@ core-uninstall: manifests
# Generate manifests e.g. CRD, RBAC etc.
manifests: controller-gen
$(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=manager-role webhook paths="./..." output:crd:artifacts:config=charts/vela-core/crds
go generate $(foreach t,pkg api,./$(t)/...)
./hack/vela-templates/gen_definitions.sh
# Generate code
@@ -182,3 +186,15 @@ GOLANGCILINT=$(GOBIN)/golangci-lint
else
GOLANGCILINT=$(shell which golangci-lint)
endif
.PHONY: goimports
goimports:
ifeq (, $(shell which goimports))
@{ \
set -e ;\
GO111MODULE=off go get -u golang.org/x/tools/cmd/goimports ;\
}
GOIMPORTS=$(GOBIN)/goimports
else
GOIMPORTS=$(shell which goimports)
endif

View File

@@ -1,4 +1,13 @@
![alt](resources/KubeVela-03.png)
![Build status](https://github.com/oam-dev/kubevela/workflows/E2E/badge.svg)
[![Go Report Card](https://goreportcard.com/badge/github.com/oam-dev/kubevela)](https://goreportcard.com/report/github.com/oam-dev/kubevela)
![Docker Pulls](https://img.shields.io/docker/pulls/oamdev/vela-core)
[![codecov](https://codecov.io/gh/oam-dev/kubevela/branch/master/graph/badge.svg)](https://codecov.io/gh/oam-dev/kubevela)
[![LICENSE](https://img.shields.io/github/license/oam-dev/kubevela.svg?style=flat-square)](/LICENSE)
[![Releases](https://img.shields.io/github/release/oam-dev/kubevela/all.svg?style=flat-square)](https://github.com/oam-dev/kubevela/releases)
[![TODOs](https://img.shields.io/endpoint?url=https://api.tickgit.com/badge?repo=github.com/oam-dev/kubevela)](https://www.tickgit.com/browse?repo=github.com/oam-dev/kubevela)
[![Twitter](https://img.shields.io/twitter/url?style=social&url=https%3A%2F%2Ftwitter.com%2Foam_dev)](https://twitter.com/oam_dev)
![alt](docs/resources/KubeVela-03.png)
*Make shipping applications more enjoyable.*
@@ -11,18 +20,18 @@ For platform builders, KubeVela serves as a framework that empowers them to crea
- Slack: [Discuss](https://cloud-native.slack.com/archives/C01BLQ3HTJA)
- Gitter: [Community](https://gitter.im/oam-dev/community)
> NOTE: KubeVela is still in early stage and iterating quickly. It's currently under preview release.
## Quick Start
Quick start guides are available on [this section](docs/quick-start.md).
Quick start guides are available on [this section](https://kubevela.io/#/en/quick-start).
## Documentation
Full documentation is available on the [documentation section](docs/README.md).
For full documentation, please visit the KubeVela website: [https://kubevela.io](https://kubevela.io/).
## Contributing
Check out [CONTRIBUTING](./CONTRIBUTING.md) to see how to develop with KubeVela.
## Code of Conduct
This project has adopted the [CNCF Code of Conduct](https://github.com/cncf/foundation/blob/master/code-of-conduct.md). See [CODE OF CONDUCT](CODE_OF_CONDUCT.md) for details.
> NOTE: KubeVela is an early project and iterating quickly to continue to make it easier to ship applications and build platforms atop. It's still under preview release for now.

2
api/api.go Normal file
View File

@@ -0,0 +1,2 @@
// package api contains all api types of KubeVela
package api

View File

@@ -34,10 +34,10 @@ type ApplicationDeploymentStatus struct {
runtimev1alpha1.ConditionedStatus `json:",inline"`
}
// ApplicationDeployment is the Schema for the ApplicationDeployment API
// +kubebuilder:object:root=true
// +kubebuilder:resource:categories={oam}
// +kubebuilder:subresource:status
// ApplicationDeployment is the Schema for the ApplicationDeployment API
type ApplicationDeployment struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
@@ -46,8 +46,8 @@ type ApplicationDeployment struct {
Status ApplicationDeploymentStatus `json:"status,omitempty"`
}
// +kubebuilder:object:root=true
// ApplicationDeploymentList contains a list of ApplicationDeployment
// +kubebuilder:object:root=true
type ApplicationDeploymentList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`

8
api/generate.go Normal file
View File

@@ -0,0 +1,8 @@
// +build generate
// See the below link for details on what is happening here.
// https://github.com/golang/go/wiki/Modules#how-can-i-track-tool-dependencies-for-a-module
//go:generate go run ../hack/crd/update.go ../charts/vela-core/crds/
package api

View File

@@ -5,6 +5,7 @@ import (
"k8s.io/client-go/rest"
)
// Args is args for controller-runtime client
type Args struct {
Config *rest.Config
Schema *runtime.Scheme

View File

@@ -26,12 +26,14 @@ import (
"k8s.io/apimachinery/pkg/runtime"
)
// Source record the source of Capability
type Source struct {
RepoName string `json:"repoName"`
ChartName string `json:"chartName,omitempty"`
}
type CrdInfo struct {
// CRDInfo record the CRD info of the Capability
type CRDInfo struct {
APIVersion string `json:"apiVersion"`
Kind string `json:"kind"`
}
@@ -55,29 +57,38 @@ type Capability struct {
// Plugin Source
Source *Source `json:"source,omitempty"`
Install *Installation `json:"install,omitempty"`
CrdInfo *CrdInfo `json:"crdInfo,omitempty"`
CrdInfo *CRDInfo `json:"crdInfo,omitempty"`
}
// Chart defines all necessary information to install a whole chart
type Chart struct {
Repo string `json:"repo"`
URL string `json:"url"`
Name string `json:"name"`
Namespace string `json:"namespace,omitempty"`
Version string `json:"version"`
Repo string `json:"repo"`
URL string `json:"url"`
Name string `json:"name"`
Namespace string `json:"namespace,omitempty"`
Version string `json:"version"`
Values map[string]interface{} `json:"values"`
}
// Installation defines the installation method for this Capability, currently only helm is supported
type Installation struct {
Helm Chart `json:"helm"`
//TODO(wonderflow) add raw yaml file support for install capability
}
// CapType defines the type of capability
type CapType string
const (
// TypeWorkload represents OAM Workload
TypeWorkload CapType = "workload"
TypeTrait CapType = "trait"
TypeScope CapType = "scope"
// TypeTrait represents OAM Trait
TypeTrait CapType = "trait"
// TypeScope represent OAM Scope
TypeScope CapType = "scope"
)
// Parameter defines a parameter for cli from capability template
type Parameter struct {
Name string `json:"name"`
Short string `json:"short,omitempty"`
@@ -92,11 +103,8 @@ type Parameter struct {
func ConvertTemplateJSON2Object(in *runtime.RawExtension) (Capability, error) {
var t Capability
var extension Capability
if in == nil {
return t, fmt.Errorf("extension field is nil")
}
if in.Raw == nil {
return t, fmt.Errorf("template object is nil")
if in == nil || in.Raw == nil {
return t, fmt.Errorf("no template found")
}
err := json.Unmarshal(in.Raw, &extension)
if err == nil {
@@ -105,6 +113,7 @@ func ConvertTemplateJSON2Object(in *runtime.RawExtension) (Capability, error) {
return t, err
}
// SetFlagBy set cli flag from Parameter
func SetFlagBy(flags *pflag.FlagSet, v Parameter) {
name := v.Name
if v.Alias != "" {
@@ -144,6 +153,7 @@ func SetFlagBy(flags *pflag.FlagSet, v Parameter) {
}
}
// CapabilityCmpOptions will set compare option
var CapabilityCmpOptions = []cmp.Option{
cmp.Comparer(func(a, b Parameter) bool {
if a.Name != b.Name || a.Short != b.Short || a.Required != b.Required ||
@@ -188,7 +198,7 @@ var CapabilityCmpOptions = []cmp.Option{
case int:
va = float64(vala)
case float64:
va = float64(vala)
va = vala
}
switch valb := b.Default.(type) {
case int64:
@@ -205,6 +215,7 @@ var CapabilityCmpOptions = []cmp.Option{
return true
})}
// EqualCapability will check whether two capabilities is equal
func EqualCapability(a, b Capability) bool {
return cmp.Equal(a, b, CapabilityCmpOptions...)
}

View File

@@ -1,28 +1,33 @@
package types
const (
DefaultOAMNS = "vela-system"
DefaultOAMReleaseName = "kubevela"
DefaultOAMRuntimeChartName = "vela-core"
DefaultOAMVersion = ">0.0.0-0"
DefaultEnvName = "default"
// DefaultKubeVelaNS defines the default KubeVela namespace in Kubernetes
DefaultKubeVelaNS = "vela-system"
// DefaultKubeVelaReleaseName defines the default name of KubeVela Release
DefaultKubeVelaReleaseName = "kubevela"
// DefaultKubeVelaChartName defines the default chart name of KubeVela, this variable MUST align to the chart name of this repo
DefaultKubeVelaChartName = "vela-core"
// DefaultKubeVelaVersion defines the default version needed for KubeVela chart
DefaultKubeVelaVersion = ">0.0.0-0"
// DefaultEnvName defines the default environment name for Apps created by KubeVela
DefaultEnvName = "default"
// DefaultAppNamespace defines the default K8s namespace for Apps created by KubeVela
DefaultAppNamespace = "default"
)
const (
AnnAPIVersion = "definition.oam.dev/apiVersion"
AnnKind = "definition.oam.dev/kind"
// AnnDescription is the annotation which describe what is the capability used for in a WorkloadDefinition/TraitDefinition Object
AnnDescription = "definition.oam.dev/description"
LabelPodSpecable = "workload.oam.dev/podspecable"
)
const (
// StatusDeployed represents the App was deployed
StatusDeployed = "Deployed"
StatusStaging = "Staging"
// StatusStaging represents the App was changed locally and it's spec is diff from the deployed one, or not deployed at all
StatusStaging = "Staging"
)
// EnvMeta stores the info for app environment
type EnvMeta struct {
Name string `json:"name"`
Namespace string `json:"namespace"`
@@ -35,12 +40,14 @@ type EnvMeta struct {
}
const (
// TagCommandType used for tag cli category
TagCommandType = "commandType"
TypeStart = "Getting Started"
TypeApp = "Applications"
TypeTraits = "Traits"
TypeRelease = "Release"
TypeOthers = "Others"
TypeSystem = "System"
// TypeStart defines one category
TypeStart = "Getting Started"
// TypeApp defines one category
TypeApp = "Managing Applications"
// TypeCap defines one category
TypeCap = "Managing Capabilities"
// TypeSystem defines one category
TypeSystem = "System"
)

View File

@@ -30,9 +30,9 @@ type Protocol string
// TriggerType defines the type of trigger
type TriggerType string
// Autoscaler is the Schema for the autoscalers API
// +kubebuilder:object:root=true
// +kubebuilder:resource:categories={oam}
// Autoscaler is the Schema for the autoscalers API
type Autoscaler struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
@@ -41,18 +41,22 @@ type Autoscaler struct {
Status AutoscalerStatus `json:"status,omitempty"`
}
// SetConditions set condition for CR status
func (as *Autoscaler) SetConditions(c ...v1alpha1.Condition) {
as.Status.SetConditions(c...)
}
// GetCondition get condition from CR status
func (as *Autoscaler) GetCondition(conditionType v1alpha1.ConditionType) v1alpha1.Condition {
return as.Status.GetCondition(conditionType)
}
// GetWorkloadReference get workload reference
func (as *Autoscaler) GetWorkloadReference() v1alpha1.TypedReference {
return as.Spec.WorkloadReference
}
// SetWorkloadReference set workload reference
func (as *Autoscaler) SetWorkloadReference(reference v1alpha1.TypedReference) {
as.Spec.WorkloadReference = reference
}

View File

@@ -99,20 +99,22 @@ func init() {
var _ oam.Trait = &MetricsTrait{}
// SetConditions for set CR condition
func (tr *MetricsTrait) SetConditions(c ...runtimev1alpha1.Condition) {
tr.Status.SetConditions(c...)
}
// GetCondition for get CR condition
func (tr *MetricsTrait) GetCondition(c runtimev1alpha1.ConditionType) runtimev1alpha1.Condition {
return tr.Status.GetCondition(c)
}
// GetWorkloadReference of this ManualScalerTrait.
// GetWorkloadReference of this MetricsTrait.
func (tr *MetricsTrait) GetWorkloadReference() runtimev1alpha1.TypedReference {
return tr.Spec.WorkloadReference
}
// SetWorkloadReference of this ManualScalerTrait.
// SetWorkloadReference of this MetricsTrait.
func (tr *MetricsTrait) SetWorkloadReference(r runtimev1alpha1.TypedReference) {
tr.Spec.WorkloadReference = r
}

View File

@@ -73,10 +73,12 @@ func init() {
var _ oam.Workload = &PodSpecWorkload{}
// SetConditions set condition for this CR
func (in *PodSpecWorkload) SetConditions(c ...cpv1alpha1.Condition) {
in.Status.SetConditions(c...)
}
// GetCondition set condition for this CR
func (in *PodSpecWorkload) GetCondition(c cpv1alpha1.ConditionType) cpv1alpha1.Condition {
return in.Status.GetCondition(c)
}

View File

@@ -66,6 +66,7 @@ type Rule struct {
Backend *Backend `json:"backend,omitempty"`
}
// TLS defines certificate issuer and type for mTLS configuration
type TLS struct {
IssuerName string `json:"issuerName,omitempty"`
@@ -74,13 +75,17 @@ type TLS struct {
Type IssuerType `json:"type,omitempty"`
}
// IssuerType defines the type of issuer
type IssuerType string
const (
ClusterIssuer IssuerType = "ClusterIssuer"
// ClusterIssuer is a cluster level type of issuer
ClusterIssuer IssuerType = "ClusterIssuer"
// NamespaceIssuer is the default one
NamespaceIssuer IssuerType = "Issuer"
)
// Backend defines backend configure for route trait.
// Route will automatically discover podSpec and label for BackendService.
// If BackendService is already set, discovery won't work.
// If BackendService is not set, the discovery mechanism will work.
@@ -109,10 +114,10 @@ type RouteStatus struct {
runtimev1alpha1.ConditionedStatus `json:",inline"`
}
// Route is the Schema for the routes API
// +kubebuilder:object:root=true
// +kubebuilder:resource:categories={oam}
// +kubebuilder:subresource:status
// Route is the Schema for the routes API
type Route struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
@@ -121,8 +126,8 @@ type Route struct {
Status RouteStatus `json:"status,omitempty"`
}
// +kubebuilder:object:root=true
// RouteList contains a list of Route
// +kubebuilder:object:root=true
type RouteList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
@@ -135,20 +140,22 @@ func init() {
var _ oam.Trait = &Route{}
// SetConditions set condition for CR status
func (r *Route) SetConditions(c ...runtimev1alpha1.Condition) {
r.Status.SetConditions(c...)
}
// GetCondition get condition from CR status
func (r *Route) GetCondition(c runtimev1alpha1.ConditionType) runtimev1alpha1.Condition {
return r.Status.GetCondition(c)
}
// GetWorkloadReference of this ManualScalerTrait.
// GetWorkloadReference of this Route Trait.
func (r *Route) GetWorkloadReference() runtimev1alpha1.TypedReference {
return r.Spec.WorkloadReference
}
// SetWorkloadReference of this ManualScalerTrait.
// SetWorkloadReference of this Route Trait.
func (r *Route) SetWorkloadReference(rt runtimev1alpha1.TypedReference) {
r.Spec.WorkloadReference = rt
}

View File

@@ -1230,6 +1230,7 @@ spec:
can be referred to by services.
type: string
protocol:
default: TCP
description: Protocol for port. Must be UDP, TCP,
or SCTP. Defaults to "TCP".
type: string
@@ -2364,6 +2365,7 @@ spec:
can be referred to by services.
type: string
protocol:
default: TCP
description: Protocol for port. Must be UDP, TCP,
or SCTP. Defaults to "TCP".
type: string
@@ -3503,6 +3505,7 @@ spec:
can be referred to by services.
type: string
protocol:
default: TCP
description: Protocol for port. Must be UDP, TCP,
or SCTP. Defaults to "TCP".
type: string

View File

@@ -2,9 +2,6 @@ apiVersion: core.oam.dev/v1alpha2
kind: ScopeDefinition
metadata:
name: healthscopes.core.oam.dev
annotations:
definition.oam.dev/apiVersion: core.oam.dev/v1alpha2
definition.oam.dev/kind: HealthScope
namespace: default
spec:
workloadRefsPath: spec.workloadRefs

View File

@@ -3,33 +3,31 @@ kind: TraitDefinition
metadata:
name: autoscale
annotations:
definition.oam.dev/apiVersion: standard.oam.dev/v1alpha1
definition.oam.dev/kind: Autoscaler
definition.oam.dev/description: "Automatically scale workloads"
definition.oam.dev/description: "Automatically scale the app following certain triggers or metrics"
spec:
appliesToWorkloads:
- webservice
- backend
- deployments.apps
- podspecworkload
- worker
workloadRefPath: spec.workloadRef
definitionRef:
name: autoscalers.standard.oam.dev
extension:
template: |
import "strconv"
output: {
apiVersion: "standard.oam.dev/v1alpha1"
kind: "Autoscaler"
spec: {
minReplicas: parameter.min
maxReplicas: parameter.max
if parameter["cpu"] != _|_ && parameter["cron"] != _|_ {
if parameter["cpuPercent"] != _|_ && parameter["cron"] != _|_ {
triggers: [cpuScaler, cronScaler]
}
if parameter["cpu"] != _|_ && parameter["cron"] == _|_ {
if parameter["cpuPercent"] != _|_ && parameter["cron"] == _|_ {
triggers: [cpuScaler]
}
if parameter["cpu"] == _|_ && parameter["cron"] != _|_ {
if parameter["cpuPercent"] == _|_ && parameter["cron"] != _|_ {
triggers: [cronScaler]
}
}
@@ -39,16 +37,23 @@ spec:
type: "cpu"
condition: {
type: "Utilization"
if parameter["cpu"] != _|_ {
value: parameter.cpu
if parameter["cpuPercent"] != _|_ {
// Temporarily use `strconv` for type converting. This bug will be fixed in kubevela#585
value: strconv.FormatInt(parameter.cpuPercent, 10)
}
}
}
cronScaler: {
type: "cron"
if parameter["cron"] != _|_ {
condition: parameter.cron
if parameter["cron"] != _|_ && parameter.cron["replicas"] != _|_ {
condition: {
startAt: parameter.cron.startAt
duration: parameter.cron.duration
days: parameter.cron.days
replicas: strconv.FormatInt(parameter.cron.replicas, 10)
timezone: parameter.cron.timezone
}
}
}
@@ -58,15 +63,19 @@ spec:
// +usage=maximal replicas of the workload
max: int
// +usage=specify the value for CPU utilization, like 80, which means 80%
cpu?: string
// +alias=cpu-percent
cpuPercent?: int
// +usage=just for `appfile`, not available for Cli usage
cron?: {
startAt: string
// +usage=the time to start scaling, like `08:00`
startAt: string
// +usage=for how long the scaling will last
duration: string
// +usage=several workdays or weekends, like "Monday, Tuesday"
days: string
replicas: string
// +usage=timezone, like "America/Seattle"
days: string
// +usage=the target replicas to be scaled to
replicas: int
// +usage=timezone, like "America/Los_Angeles"
timezone: string
}
}

View File

@@ -2,15 +2,12 @@ apiVersion: core.oam.dev/v1alpha2
kind: TraitDefinition
metadata:
annotations:
definition.oam.dev/apiVersion: core.oam.dev/v1alpha2
definition.oam.dev/kind: ManualScalerTrait
definition.oam.dev/description: "Scale replica for workload"
definition.oam.dev/description: "Manually scale the app"
name: scaler
spec:
appliesToWorkloads:
- webservice
- containerizedworkloads.core.oam.dev
- deployments.apps
- worker
definitionRef:
name: manualscalertraits.core.oam.dev
workloadRefPath: spec.workloadRef
@@ -20,11 +17,11 @@ spec:
apiVersion: "core.oam.dev/v1alpha2"
kind: "ManualScalerTrait"
spec: {
replicaCount: parameter.replica
replicaCount: parameter.replicas
}
}
parameter: {
//+short=r
replica: *1 | int
replicas: *1 | int
}

View File

@@ -1,20 +1,14 @@
apiVersion: core.oam.dev/v1alpha2
kind: TraitDefinition
metadata:
name: metric
name: metrics
annotations:
definition.oam.dev/apiVersion: standard.oam.dev/v1alpha1
definition.oam.dev/kind: MetricsTrait
definition.oam.dev/description: "Add metric monitoring for workload"
definition.oam.dev/description: "Configure metrics targets to be monitored for the app"
spec:
appliesToWorkloads:
- webservice
- backend
- task
- containerizedworkloads.core.oam.dev
- clonesetworkloads.apps.kruise.io
- deployments.apps
- statefulsets.apps
definitionRef:
name: metricstraits.standard.oam.dev
workloadRefPath: spec.workloadRef
@@ -31,7 +25,7 @@ spec:
// +usage=format of the metrics, default as prometheus
// +short=f
format: *"prometheus" | string
// +usage= the metric path of the service
// +usage= the metrics path of the service
path: *"/metrics" | string
scheme: *"http" | string
enabled: *true | bool

View File

@@ -0,0 +1,51 @@
apiVersion: core.oam.dev/v1alpha2
kind: TraitDefinition
metadata:
name: rollout
annotations:
definition.oam.dev/description: "Configure canary deployment strategy to release the app"
spec:
appliesToWorkloads:
- webservice
definitionRef:
name: canaries.flagger.app
workloadRefPath: spec.targetRef
revisionEnabled: true
extension:
template: |-
output: {
apiVersion: "flagger.app/v1beta1"
kind: "Canary"
spec: {
provider: "smi"
progressDeadlineSeconds: 60
service: {
// Currently Traffic route is not supported, but this is required field for flagger CRD
port: 80
// Currently Traffic route is not supported, but this is required field for flagger CRD
targetPort: 8080
}
analysis: {
interval: parameter.interval
// max number of failed metric checks before rollback
threshold: 10
// max traffic percentage routed to canary
// percentage (0-100)
maxWeight: 50
// canary increment step
// percentage (0-100)
stepWeight: parameter.stepWeight
// max replicas scale up to canary
maxReplicas: parameter.replicas
}
}
}
parameter: {
// +usage=total replicas of the workload
replicas: *2 | int
// +alias=step-weight
// +usage=weight percent of every step in rolling update
stepWeight: *50 | int
interval: *"30s" | string
}

View File

@@ -3,13 +3,10 @@ kind: TraitDefinition
metadata:
name: route
annotations:
definition.oam.dev/apiVersion: standard.oam.dev/v1alpha1
definition.oam.dev/kind: Route
definition.oam.dev/description: "Add a route for workload"
definition.oam.dev/description: "Configure route policy to the app"
spec:
appliesToWorkloads:
- webservice
- deployments.apps
workloadRefPath: spec.workloadRef
definitionRef:
name: routes.standard.oam.dev

View File

@@ -3,9 +3,7 @@ kind: WorkloadDefinition
metadata:
name: task
annotations:
definition.oam.dev/apiVersion: "v1"
definition.oam.dev/kind: "Job"
definition.oam.dev/description: "One-time task/job"
definition.oam.dev/description: "One-off task to run a piece of code or script to completion"
spec:
definitionRef:
name: jobs
@@ -34,7 +32,7 @@ spec:
// +short=c
count: *1 | int
// +usage=specify app image
// +usage=Which image would you like to use for your service
// +short=i
image: string

View File

@@ -3,9 +3,7 @@ kind: WorkloadDefinition
metadata:
name: webservice
annotations:
definition.oam.dev/apiVersion: "apps/v1"
definition.oam.dev/kind: "Deployment"
definition.oam.dev/description: "Long running service with network routes"
definition.oam.dev/description: "Long-running scalable service with stable endpoint to receive external traffic"
spec:
definitionRef:
name: deployments.apps
@@ -38,24 +36,19 @@ spec:
}
if context["config"] != _|_ {
env: [
for k, v in context.config {
name: k
value: v
},
]
env: context.config
}
ports: [{
containerPort: parameter.port
}]
if parameter["cpuRequests"] != _|_ {
if parameter["cpu"] != _|_ {
resources: {
limits:
cpu: parameter.cpuRequests
cpu: parameter.cpu
requests:
cpu: parameter.cpuRequests
cpu: parameter.cpu
}
}
}]
@@ -64,15 +57,15 @@ spec:
}
}
parameter: {
// +usage=specify app image
// +usage=Which image would you like to use for your service
// +short=i
image: string
cmd?: [...string]
// +usage=specify port for container
// +usage=Which port do you want customer traffic sent to
// +short=p
port: *6379 | int
port: *80 | int
env?: [...{
name: string
@@ -84,8 +77,7 @@ spec:
}
}
}]
// +usage=CPU core requests for the workload
// +alias=cpu-requests
cpuRequests?: string
// +usage=Number of CPU units for the service, like `0.5` (0.5 CPU core), `1` (1 CPU core)
cpu?: string
}

View File

@@ -3,9 +3,7 @@ kind: WorkloadDefinition
metadata:
name: worker
annotations:
definition.oam.dev/apiVersion: "apps/v1"
definition.oam.dev/kind: "Deployment"
definition.oam.dev/description: "Backend worker without ports exposed"
definition.oam.dev/description: "Long-running scalable backend worker without network endpoint"
spec:
definitionRef:
name: deployments.apps
@@ -43,7 +41,7 @@ spec:
}
parameter: {
// +usage=specify app image
// +usage=Which image would you like to use for your service
// +short=i
image: string

View File

@@ -2,7 +2,8 @@ apiVersion: v1
kind: ConfigMap
metadata:
name: vela-config
namespace: {{ .Release.Namespace }}
# TODO: Currently namespace MUST be vela-system
namespace: vela-system
data:
servicemonitors.monitoring.coreos.com: |
{
@@ -14,11 +15,11 @@ data:
}
flagger.app: |
{
"repo": "flagger",
"urL": "https://flagger.app",
"repo": "oam-flagger",
"urL": "https://oam.dev/flagger/archives/",
"name": "flagger",
"namespace": "vela-system",
"version": "1.2.0"
"version": "1.1.0"
}
keda: |
{
@@ -27,4 +28,4 @@ data:
"name": "keda",
"namespace": "keda",
"version": "2.0.0-rc3"
}
}

View File

@@ -426,7 +426,7 @@ Please also specify `traits` values if need to attach a trait to several traits
"workload_name": "poc5",
"flags": [
{
"name": "replica",
"name": "replicas",
"value": "4"
}
]
@@ -444,7 +444,7 @@ sample response
"data": {
"name": "podspecworkload",
"type": "workload",
"template": "#Template: {\n\tapiVersion: \"core.oam.dev/v1alpha2\"\n\tkind: \"PodSpecWorkload\"\n\tmetadata: name: podspecworkload.name\n\tspec: {\n\t\tcontainers: [{\n\t\t\timage: containerized.image\n\t\t\tname: containerized.name\n\t\t\tports: [{\n\t\t\t\tcontainerPort: containerized.port\n\t\t\t\tprotocol: \"TCP\"\n\t\t\t\tname: \"default\"\n\t\t\t}]\n\t\t}]\n\t}\n}\ncontainerized: {\n\tname: string\n\t// +usage=specify app image\n\t// +short=i\n\timage: string\n\t// +usage=specify port for container\n\t// +short=p\n\tport: *6379 | int\n}\n",
"template": "#Template: {\n\tapiVersion: \"core.oam.dev/v1alpha2\"\n\tkind: \"PodSpecWorkload\"\n\tmetadata: name: podspecworkload.name\n\tspec: {\n\t\tcontainers: [{\n\t\t\timage: containerized.image\n\t\t\tname: containerized.name\n\t\t\tports: [{\n\t\t\t\tcontainerPort: containerized.port\n\t\t\t\tprotocol: \"TCP\"\n\t\t\t\tname: \"default\"\n\t\t\t}]\n\t\t}]\n\t}\n}\ncontainerized: {\n\tname: string\n\t// +usage=Which image would you like to use for your service\n\t// +short=i\n\timage: string\n\t// +usage=Which port do you want customer traffic sent to\n\t// +short=p\n\tport: *6379 | int\n}\n",
"parameters": [{
"name": "name",
"required": true,
@@ -455,13 +455,13 @@ sample response
"short": "i",
"required": true,
"default": "",
"usage": "specify app image",
"usage": "Which image would you like to use for your service",
"type": 16
}, {
"name": "port",
"short": "p",
"default": 6379,
"usage": "specify port for container",
"usage": "Which port do you want customer traffic sent to",
"type": 4
}],
"definition": "/Users/zhouzhengxi/.vela/capabilities/containerizedworkloads.core.oam.dev.cue",
@@ -492,13 +492,13 @@ sample response
"short": "i",
"required": true,
"default": "",
"usage": "specify app image",
"usage": "Which image would you like to use for your service",
"type": 16
}, {
"name": "port",
"short": "p",
"default": 6379,
"usage": "specify port for container",
"usage": "Which port do you want customer traffic sent to",
"type": 4
}]
}, {
@@ -534,7 +534,7 @@ sample request
"name": "scale",
"flags": [
{
"name": "replica",
"name": "replicas",
"value": "4"
}
]
@@ -556,9 +556,9 @@ sample response
"data": {
"name": "manualscaler",
"type": "trait",
"template": "#Template: {\n\tapiVersion: \"core.oam.dev/v1alpha2\"\n\tkind: \"ManualScalerTrait\"\n\tspec: {\n\t\treplicaCount: manualscaler.replica\n\t}\n}\nmanualscaler: {\n\t//+short=r\n\treplica: *2 | int\n}\n",
"template": "#Template: {\n\tapiVersion: \"core.oam.dev/v1alpha2\"\n\tkind: \"ManualScalerTrait\"\n\tspec: {\n\t\treplicaCount: manualscaler.replicas\n\t}\n}\nmanualscaler: {\n\t//+short=r\n\treplicas: *2 | int\n}\n",
"parameters": [{
"name": "replica",
"name": "replicas",
"short": "r",
"default": 2,
"type": 4
@@ -675,7 +675,7 @@ sample response
"data": [{
"name": "podspecworkload",
"type": "workload",
"template": "#Template: {\n\tapiVersion: \"core.oam.dev/v1alpha2\"\n\tkind: \"ContainerizedWorkload\"\n\tmetadata: name: podspecworkload.name\n\tspec: {\n\t\tcontainers: [{\n\t\t\timage: containerized.image\n\t\t\tname: containerized.name\n\t\t\tports: [{\n\t\t\t\tcontainerPort: containerized.port\n\t\t\t\tprotocol: \"TCP\"\n\t\t\t\tname: \"default\"\n\t\t\t}]\n\t\t}]\n\t}\n}\ncontainerized: {\n\tname: string\n\t// +usage=specify app image\n\t// +short=i\n\timage: string\n\t// +usage=specify port for container\n\t// +short=p\n\tport: *6379 | int\n}\n",
"template": "#Template: {\n\tapiVersion: \"core.oam.dev/v1alpha2\"\n\tkind: \"ContainerizedWorkload\"\n\tmetadata: name: podspecworkload.name\n\tspec: {\n\t\tcontainers: [{\n\t\t\timage: containerized.image\n\t\t\tname: containerized.name\n\t\t\tports: [{\n\t\t\t\tcontainerPort: containerized.port\n\t\t\t\tprotocol: \"TCP\"\n\t\t\t\tname: \"default\"\n\t\t\t}]\n\t\t}]\n\t}\n}\ncontainerized: {\n\tname: string\n\t// +usage=Which image would you like to use for your service\n\t// +short=i\n\timage: string\n\t// +usage=Which port do you want customer traffic sent to\n\t// +short=p\n\tport: *6379 | int\n}\n",
"parameters": [{
"name": "name",
"required": true,
@@ -686,13 +686,13 @@ sample response
"short": "i",
"required": true,
"default": "",
"usage": "specify app image",
"usage": "Which image would you like to use for your service",
"type": 16
}, {
"name": "port",
"short": "p",
"default": 6379,
"usage": "specify port for container",
"usage": "Which port do you want customer traffic sent to",
"type": 4
}],
"definition": "/Users/zhouzhengxi/.vela/centers/c1/.tmp/containerizedworkloads.core.oam.dev.cue",
@@ -702,9 +702,9 @@ sample response
},{
"name": "rollout",
"type": "trait",
"template": "#Template: {\n\tapiVersion: \"extend.oam.dev/v1alpha2\"\n\tkind: \"SimpleRolloutTrait\"\n\tspec: {\n\t\treplica: rollout.replica\n\t\tmaxUnavailable: rollout.maxUnavailable\n\t\tbatch: rollout.batch\n\t}\n}\nrollout: {\n\treplica: *3 | int\n\tmaxUnavailable: *1 | int\n\tbatch: *2 | int\n}\n",
"template": "#Template: {\n\tapiVersion: \"extend.oam.dev/v1alpha2\"\n\tkind: \"SimpleRolloutTrait\"\n\tspec: {\n\t\treplicas: rollout.replicas\n\t\tmaxUnavailable: rollout.maxUnavailable\n\t\tbatch: rollout.batch\n\t}\n}\nrollout: {\n\treplicas: *3 | int\n\tmaxUnavailable: *1 | int\n\tbatch: *2 | int\n}\n",
"parameters": [{
"name": "replica",
"name": "replicas",
"default": 3,
"type": 4
}, {

View File

@@ -50,14 +50,14 @@ services:
- /mnt/path=sec:my-secret
scale:
replica: 2
replicas: 2
auto: # automatic scale up and down based on given metrics
range: "1-10"
cpu: 80 # if cpu utilization is above 80%, scale up
qps: 1000 # if qps is higher than 1k, scale up
canary: # Auto-create canary deployment. Only upgrade after verify successfully.
replica: 1 # canary deployment size
replicas: 1 # canary deployment size
headers:
- "foo:bar.*"
```
@@ -72,7 +72,7 @@ It will build container image, render deployment manifests in yaml, and apply th
### Extensible Design
The Appfile could be extended with more configurations by adding more capabilities to the OAM system. The config fields in Appfile are strongly correlated to the [capabilities system of OAM](https://github.com/oam-dev/kubevela/blob/master/DESIGN.md#capability-register-and-discovery) Config fields are registered in the capabilities system and exposed via a [CUE template](https://cuelang.org/).
The Appfile could be extended with more configurations by adding more capabilities to the OAM system. The config fields in Appfile are strongly correlated to the [capabilities system of OAM](https://github.com/oam-dev/kubevela/blob/master/docs/design.md#2-capability-oriented-architecture) Config fields are registered in the capabilities system and exposed via a [CUE template](https://cuelang.org/).
Here is an example of a capability definition that platform builders register:
@@ -140,7 +140,7 @@ In the following, we will discuss technical details of the proposed design.
### Registration via Definition/Capability
Vela allows platform builders to extend Appfile config fields by registering them via [capabilities system of OAM](https://github.com/oam-dev/kubevela/blob/master/DESIGN.md#capability-register-and-discovery).
Vela allows platform builders to extend Appfile config fields by registering them via [capabilities system of OAM](https://github.com/oam-dev/kubevela/blob/master/docs/design.md#2-capability-oriented-architecture).
The entire template should be put under `spec.extension.template` as raw string:
@@ -356,4 +356,4 @@ spec:
}]
}
}
```
```

0
docs/.nojekyll Normal file
View File

1
docs/CNAME Normal file
View File

@@ -0,0 +1 @@
kubevela.io

View File

@@ -1,34 +1,31 @@
# KubeVela Documentation
# KubeVela Website
[kubevela.io](https://kubevela.io)
Learn and use KubeVela with tutorials and user stories.
## Contributing
**Overview**
- [Introduction](introduction.md)
- [Installation](./install.md)
- [Quick Start](quick-start.md)
- [Concepts](concepts.md)
- Fork and clone
**For Developers**
- [Setting Up Deployment Environment](developers/config-enviroments.md)
- [Initializing Application](developers/app-init.md)
- [Setting Routes](developers/set-route.md)
- [Setting Auto-scaling Policy](developers/set-autoscale.md)
- [Setting Rollout Strategy](developers/set-rollout.md)
- [Monitoring Application](developers/set-metrics.md)
- [Using Appfile](developers/devex/appfile.md)
- [Check Application Logs](developers/check-logs.md)
- [Execute Commands in Container](developers/exec-cmd.md)
- [Port Forward to Container](developers/port-forward.md)
- [Configuring data/env in Application](developers/config-app.md)
- [Consuming Cloud Services](developers/cloud-service.md)
- [Managing Capabilities](developers/cap-center.md)
- [Capability References](developers/references/README.md)
```
$ git clone git@github.com:oam-dev/kubevela.git
$ cd kubevela/docs
```
**For Platform Engineers**
- [Extending KubeVela](platform-engineers/extending-kubevela.md)
- Install docsify-cli
```
$ npm i docsify-cli -g
```
**Internals**
- [Design and Architecture](design.md)
- Make your changes
**Roadmap**
- [Roadmap of KubeVela](roadmap.md)
- Local preview
```
$ docsify serve
Serving /xxx/kubevela.io now.
Listening at http://localhost:3000
```
Preview your changes at [http://127.0.0.1:3000/](http://127.0.0.1:3000/).
- Push your commit
Thanks for your contribution!

9
docs/_coverpage.md Normal file
View File

@@ -0,0 +1,9 @@
<p align="center">
<img src="static/logo.svg" alt="kubevela logo" width=300 height=300 />
</p>
> Make shipping applications more enjoyable.
[GitHub](https://github.com/oam-dev/kubevela)
[Get Started](en/quick-start)

5
docs/_navbar.md Normal file
View File

@@ -0,0 +1,5 @@
- [Home](/)
<!-- - [Blog](/en/blog/README.md) -->
<!-- - Language
- [中文](/zh-cn/)
- [English](/en/) -->

76
docs/_sidebar.md Normal file
View File

@@ -0,0 +1,76 @@
- Overview
- [Introduction](/en/introduction.md)
- [Getting Started](/en/quick-start.md)
- Using KubeVela
- Appfile
- [Learning Appfile](/en/developers/learn-appfile.md)
- Operating
- [Setting Routes](/en/developers/set-route.md)
- [Setting Auto-scaling Policy](/en/developers/set-autoscale.md)
- [Setting Rollout Strategy](/en/developers/set-rollout.md)
- [Setting Monitoring Policy](/en/developers/set-metrics.md)
- Debugging
- [Port Forwarding](/en/developers/port-forward.md)
- [Check Application Logs](/en/developers/check-logs.md)
- [Execute Commands in Container](/en/developers/exec-cmd.md)
- Extensibility
- [Managing Capabilities](/en/developers/cap-center.md)
- Configuring
- [Setting Up Deployment Environment](/en/developers/config-enviroments.md)
- [Configuring data/env in Application](/en/developers/config-app.md)
- [Alternative Commands](/en/developers/alternative-cmd.md)
- Extending KubeVela
- [Add Workload Type](/en/platform-engineers/workload-type.md)
- [Add Trait](/en/platform-engineers/trait.md)
- [Add Cloud Services](/en/platform-engineers/cloud-services.md)
- Roadmap
- [KubeVela Roadmap](/en/roadmap.md)
- References
- [Concepts and Glossaries](/en/concepts.md)
- [Appfile](/en/developers/references/devex/appfile.md)
- Capabilities
- Workload Types
- [Web Service](/en/developers/references/workload-types/web-service.md)
- [Task](/en/developers/references/workload-types/task.md)
- [Worker](/en/developers/references/workload-types/backend-worker.md)
- Traits
- [Route](/en/developers/references/traits/route.md)
- [Autoscale](/en/developers/references/traits/autoscale.md)
- [Rollout](/en/developers/references/traits/rollout.md)
- [Metrics](/en/developers/references/traits/metrics.md)
- CLI
- General
- [vela config](/en/cli/vela_config.md)
- [vela env](/en/cli/vela_env.md)
- [vela init](/en/cli/vela_init.md)
- [vela install](/en/cli/vela_install.md)
- [vela up](/en/cli/vela_up.md)
- [vela version](/en/cli/vela_version.md)
- Applications
- [vela delete](/en/cli/vela_delete.md)
- [vela exec](/en/cli/vela_exec.md)
- [vela logs](/en/cli/vela_logs.md)
- [vela ls](/en/cli/vela_ls.md)
- [vela port-forward](/en/cli/vela_port-forward.md)
- [vela show](/en/cli/vela_show.md)
- [vela status](/en/cli/vela_status.md)
- [vela svc](/en/cli/vela_svc.md)
- Workload Types
- [vela workloads](/en/cli/vela_workloads.md)
- Traits
- [vela traits](/en/cli/vela_traits.md)
- [vela scaler](/en/cli/vela_scaler.md)
- [vela route](/en/cli/vela_route.md)
- [vela autoscale](/en/cli/vela_autoscale.md)
- [vela rollout](/en/cli/vela_rollout.md)
- [vela metrics](/en/cli/vela_metric.md)
- System
- [vela completion](/en/cli/vela_completion.md)
- [vela dashboard](/en/cli/vela_dashboard.md)
- [vela system](/en/cli/vela_system.md)
- [vela template](/en/cli/vela_template.md)
- Extensibility
- [vela cap](/en/cli/vela_cap.md)

View File

@@ -1,35 +0,0 @@
## vela system update
Sync definition from cluster
### Synopsis
Refresh and sync definition files from cluster
```
vela system update
```
### Examples
```
vela system update
```
### Options
```
-h, --help help for update
```
### Options inherited from parent commands
```
-e, --env string specify environment name for application
```
### SEE ALSO
* [vela system](vela_system.md) - System management utilities
###### Auto generated by spf13/cobra on 6-Nov-2020

View File

@@ -1,159 +0,0 @@
# KubeVela Design
This document is the detailed design and architecture of the KubeVela being built in this repository.
> All the diagram in this documentation could be found in [this slides](https://docs.google.com/presentation/d/1Y3gnKrd7fUZGgee7Ia9vBsRIYhcZLQwMUCDkk1RJvQc/edit?usp=sharing).
## Overview
KubeVela is a simple, complete, but highly extensible cloud native application platform based on Kubernetes. KubeVela intends to bring application-centric experience to end users and democratize building cloud native application platforms for platform engineers.
## User Stories
As a end user (e.g. application developers, operators etc) of the platform, I only want to focus on coding my business logic and ship them to various environments at ease. Let's say:
- Here's my source code.
- Here's my application configuration (described in end user PoV).
- Deploy it in test environment.
- Deploy it in production environment.
- Monitoring, debugging, rollout/rollback the application.
- Dockerfile is fine, but please keep it simple.
As a platform engineer, I want to build a easy-to-use platform for end users. In detail, the platform should be:
- Heroku-like (_in terms of both user experience and functionality_).
- and I prefer to build my own version with OSS tools, particularly, with Kubernetes (for obvious reason).
- Easy to build.
- I am too busy to reinvent any wheel, I want to reuse every capability in Kubernetes community as possible, with minimal effort. Writing some simple CRD and controllers is fine, but please, just the simple ones like copy-paste.
- Powerful and highly extensible.
- I don't want to lock users with restricted abstractions and capabilities like traditional PaaS or FaaS/Serverless. I love Kubernetes and what it has enabled. So in terms of capability, I hope my platform is fully open and has unlimited possibilities like Kubernetes itself, rather than another opinionated close system like traditional PaaS.
## Core Principles
In nutshell, the principles for KubeVela project are:
- For end users, it out-of-the-box provides a fully featured PaaS-like experience, nothing special.
- For platform builders, it works like a special Kubernetes "distro" or extensible PaaS core that could be used to build something more complex on top of. It allows platform builders to integrate any existing capabilities in Kubernetes ecosystem to end users with minimal effort, or develop a new capability at ease in a standardized and Kubernetes-native approach.
## Design Details
### 1. Application Centric
The API and interfaces of KubeVela intends to make users think in terms of application, not containers or infrastructure.
Lacking application context impacts the user experience and significantly raised the bar to adopt cloud native stack. We believe "application" is the natural mindset of developers and it's the core concept an application platform should expose.
![alt](../resources/app-centric.png)
KubeVela intends to let developers push code, define application in developer facing primitives, and make daily operations as configurations of the application.
Thus, KubeVela choose to:
1. Introduce "application" as first class citizen and main API.
2. Build the whole system around "application", i.e. model capabilities of Kubernetes as application configuration, with clarity and manageability.
#### Solution
Instead of creating a in-house "application CRD", KubeVela adopts [Open Application Model (OAM)](https://github.com/oam-dev/spec) as its application definition, since OAM:
1. defines micro-services application by default.
2. models day 2 operations as part of the application (i.e. `Application Traits`).
2. is highly extensible: every workload and trait in OAM is a independent definition, no abstraction or capability lock-in.
### 2. Capability Oriented Architecture
To enable platform builders use KubeVela to create their own application platforms in an easy and Kubernetes native approach, KubeVela intends to make its every capability a standalone "plug-in".
![alt](../resources/coa.png)
For example, there are several "built-in" workload types in KubeVela such as `Web Service` or `Task`. It is by design that they are all independent CRD controllers that abstract Kubernetes built-in workloads and create Service automatically if needed. KubeVela itself is **NOT** aware of the specification or implementation of these workload types.
This means platform builders are free to bring their own workload types by simply install a CRD controller, or even just reference a k8s built-in resource like StatefulSet as new workload type.
Similarly, all the "built-in" operations such as `scaling` or `rollout` (i.e. "traits" in KubeVela) are also independent CRD controllers which are **NOT** bound with specific workload types. Platform builders are free to bring their own traits implementations by simply providing a CRD controller, reference a k8s built-in resource like `HPA` or `NetworkPolicy` as trait is also possible.
This loosely coupled design of KubeVela adopts the idea of Capability Oriented Architecture (COA), i.e. instead of creating a close system like traditional PaaS, KubeVela intends to become an application-centric framework to connect end users with underlying infrastructure capabilities.
#### Solution
KubeVela core is built with [OAM Kubernetes Runtime](https://github.com/crossplane/oam-kubernetes-runtime) which met the requirements of KubeVela such as supporting bring in standalone controllers as workload type and trait, it also defined a clear interface between how a trait could operate a workload instance in a generic approach. Overall, this library defined a set of abstraction and interfaces for platform builder to assemble various Kubernetes capabilities into a PaaS without coupling them together or introducing any glue code.
##### Capability Register and Discovery
KubeVela leverages [OAM definition objects](https://github.com/oam-dev/spec/blob/master/4.workload_definitions.md) to register and discover workloads and traits:
```console
$ kubectl apply -f workload-definition.yaml # register a new workload type
$ kubectl apply -f trait-definition.yaml # register a new trait
```
Note that OAM definition objects only care about API resource, not including the controllers. Thus KubeVela intends to include a **CRD registry** so whenever a new API resource is installed as workload or trait, KubeVela could install its controller automatically from the registry. That of course means we envision the CRD registry could register a CRD and Helm chart (which contains the manifest of the controller). In practice, we are currently evaluating RedHat's Operator Lifecycle Manager (OLM) but no the final conclusion yet.
##### Cloud Services Integration
For capabilities like cloud services, KubeVela intends to leverage Kubernetes as the universal control plane so [Crossplane](https://github.com/crossplane/crossplane) core will be used to register cloud services as workload types.
### 3. Extensible User Interface
KubeVela is built with Kubernetes and OAM (which adopts Kubernetes API model). So in nutshell, **ALL** functionalities of KubeVela core can be handled by simple `kubectl`, for example:
```yaml
$ kubectl apply -f frontend-component.yaml # create frontend component
$ kubectl apply -f backend-component.yaml # create backend component
$ kubectl apply -f application-config.yaml # assign operational traits to components and deploy the whole application
```
We call these server side objects "the application model of KubeVela", they are essentially the Kubernetes API objects KubeVela exposes.
However, we also agree that Kubernetes API model is great to build platforms like KubeVela with but when directly exposed to end users, it creates heavy mental burden and high learning curve. Hence, as any other user facing platforms, KubeVela intend to introduce a lightweight user facing layer with following goals in mind:
- Shorten the learning curve of new developers. Most capabilities in KubeVela are developed by big
companies that run very complex workloads. However, for the bigger developer community, the new user facing layer will provide a much simpler path to on-board KubeVela.
- Developers can describe their applications and behavior of their components without making assumptions on availability of specific Kubernetes API. For instance, a developer will be able to model auto-scaling needs without referring to the CRD of auto-scaling trait.
- Provides a single source of truth of the application description. The user facing layer allows developers to work with a single artifact to capture the application definition. This artifact is the definitive truth of how the application is supposed to look like. It simplifies administrative tasks such as change management. It also serves as an anchor for application truth to avoid configuration drifts during operation.
- Highly extensible. For example, when a new workload type or trait is installed, the end users could access this new capability directly from user interface layer, no re-compile or re-deploy of KubeVela is required.
#### Solution
We concluded such "highly extensible user interface layer" as a need for a dynamic "modeling language" on top of the KubeVela's application model objects. After evaluation, we decided to adopt [CUElang](https://github.com/cuelang/cue) since it's perfect as a pure data configuration language that allow us to build developer facing tools, nothing more, nothing less.
In detail, we integrated CUE based abstraction as part of OAM implementation since the *abstraction* and *model* are closely related. For platform builders, every workload or trait definition in KubeVela references a CUE template as its abstraction between human and the underlying Kubernetes capability, platform builders are free to modify those templates at any time
On the other hand, it's by intention that the end users of KubeVela don't need to learn or write CUE. Instead, we created following tools for them by leveraging above OAM + CUE user interface layer:
1. A command line tool.
2. A GUI dashboard.
3. A Docker Compose style `appfile`.
For example, the `vela cli`:
```console
$ vela svc deploy frontend -t webservice --image oamdev/testapp:v1 --port 80 --app helloworld
```
The `-t webservice --image oamdev/testapp:v1 --port 80` arguments are not hard coded, they are schema defined by in-line CUE template of `WebService` workload definition.
The `appfile` is essentially a YAML version of command line tool but it can support more complex structures with a single command like `$ vela up`:
![alt](../resources/appfile.png)
The schema of above `appfile` is not hard coded as well, they are organized following OAM and enforced by CUE templates of `WebService` workload definition, `Scaling` trait definition and `Canary` trait definition.
> Appfile has its [independent design doc](./design/appfile-design.md) which includes more details. There's also [an example](./design/appfile-design.md#multiple-outputs-in-traitdefinition) showing how platform builder could use CUE to define a `route` capability in KubeVela.
We will skip the example of dashboard, but similarly, the schema of GUI forms are defined by in-lined CUE template of definition objects.
## Architecture
![alt](../resources/arch.png)
From highest level, KubeVela is composed by only two components:
### 1. User interface layer
Including: `cli`, `dashboard`, `appfile`, they are all client side tools based on the CUE based abstractions mentioned above.
### 2. KubeVela core
Including:
- [OAM Kubernetes runtime](https://github.com/crossplane/oam-kubernetes-runtime) to provide application-centric building blocks such as `Component` and `Application` etc.
- [Built-in workload and trait controllers](https://github.com/oam-dev/kubevela/tree/master/pkg/controller/v1alpha1) to provide core capabilities such as `webservice`, `route` and `rollout` etc.
- Capability Management: manage features of KubeVela following Capability Oriented Architecture.
- Every feature of KubeVela is a "addon", and it is registered by Kubernetes API resource (including CRD) leveraging OAM definition objects.
- CRD Registry: register controllers of Kubernetes add-ons and discover them by CRD. This will enable automatically install controllers/operators when CRD is missing in the cluster.

View File

@@ -1,94 +0,0 @@
# Initializating Application
## `vela init`
To initialize and deploy an application with one service, run:
> If you only want to initialize without deploying the app, add `--render-only` flag
```console
$ vela init
Welcome to use KubeVela CLI! We're going to help you run applications through a couple of questions.
Environment: default, namespace: default
? What is the domain of your application service (optional): example.com
? What is your email (optional, used to generate certification):
? What would you like to name your application (required): testapp
? Choose the workload type for your application (required, e.g., webservice): webservice
? What would you like to name this webservice (required): testsvc
? specify app image crccheck/hello-world
? specify port for container 8000
...
✅ Application Deployed Successfully!
- Name: testsvc
Type: webservice
HEALTHY Ready: 1/1
Routes:
Last Deployment:
Created at: ...
Updated at: ...
```
Check the application:
```console
$ vela show testapp
About:
Name: testapp
Created at: ...
Updated at: ...
Environment:
Namespace: default
Services:
- Name: testsvc
WorkloadType: webservice
Arguments:
image: crccheck/hello-world
port: 8000
Traits:
```
## Deploy Multiple Services
You can also use KubeVela CLI to deploy multiple services for an application.
Check the available workload types.
```console
$ vela workloads
NAME DESCRIPTION
worker Backend worker without ports exposed
webservice Long running service with network routes
```
Deploy the first service named `frontend` with `Web Service` type:
```console
$ vela svc deploy frontend --app testapp -t webservice --image crccheck/hello-world
App testapp deployed
```
> TODO auto generate a random application name, so --app testapp becomes optional
Deploy the second service named `backend` with "Backend Worker" type:
```console
$ vela svc deploy backend --app testapp2 -t worker --image crccheck/hello-world
App testapp2 deployed
```
```console
$ vela ls
SERVICE APP TYPE TRAITS STATUS CREATED-TIME
frontend testapp ...
backend testapp ...
```

View File

@@ -1,71 +0,0 @@
# Managing Capabilities
This tutorial talks about how to install capabilities (caps) from remote centers.
## Add Cap Center
Add and sync a remote center:
```console
$ vela cap center config my-center https://github.com/oam-dev/catalog/tree/master/registry
successfully sync 1/1 from my-center remote center
Successfully configured capability center my-center and sync from remote
$ vela cap center sync my-center
successfully sync 1/1 from my-center remote center
sync finished
```
## List Cap Centers
```console
$ vela cap center ls
NAME ADDRESS
my-center https://github.com/oam-dev/catalog/tree/master/registry
```
## [Optional] Remove Cap Center
```console
$ vela cap center remove my-center
```
## List Caps
```console
$ vela cap ls my-center
NAME CENTER TYPE DEFINITION STATUS APPLIES-TO
kubewatch my-center trait kubewatches.labs.bitnami.com uninstalled []
```
## Install Cap
```console
$ vela cap install my-center/kubewatch
Installing trait capability kubewatch
"my-repo" has been added to your repositories
2020/11/06 16:19:30 [debug] creating 1 resource(s)
2020/11/06 16:19:30 [debug] CRD kubewatches.labs.bitnami.com is already present. Skipping.
2020/11/06 16:19:37 [debug] creating 3 resource(s)
Successfully installed chart (kubewatch) with release name (kubewatch)
Successfully installed capability kubewatch from my-center
```
Check traits installed:
```console
$ vela traits
Synchronizing capabilities from cluster⌛ ...
Sync capabilities successfully ✅ (no changes)
TYPE CATEGORY DESCRIPTION
kubewatch trait Add a watch for resource
...
```
## Uninstall Cap
> Note: make sure no apps are using the capability before uninstalling.
```console
$ vela cap uninstall my-center/kubewatch
Successfully removed chart (kubewatch) with release name (kubewatch)
```

View File

@@ -1,68 +0,0 @@
# Cloud service
In this demo, we will add an RDS database from Alibaba Cloud to our application.
## What is cloud service
Cloud service refers to the managed cloud resources. For example, you can buy a PostgreSql database from a cloud vendor instead of setting up your own. Cloud service are normally outside of your Kubernetes cluster, but logically they are still part of your application. KubeVela provides application centric view of your applications. It will treat every service the same.
## Crossplane
Crossplane is an open source Kubernetes add-on that extends any cluster with the ability to provision and manage cloud infrastructure, services, and applications using kubectl, GitOps, or any tool that works with the Kubernetes API. The benefit of using Crossplane is it will provide centralized control plane disregard where your cluster is.
KubeVela will delegate the lifecycle management of cloud service to Crossplane.
## Install Crossplane (This demo uses crossplane version 0.13)
You will need a Kubernetes cluster ver> 1.16 (Minikube and Kind clusters are fine).
Also you will need to have KubeVela installed on the cluster.
The folder that containes all the demo scripts are under `../../examples/kubecondemo/`. For your convience, cd to that folder first:
`cd ../../examples/kubecondemo/`
To provision a cloud resource, you need to have the Access Key and Secret to your Alibaba cloud account.
* Create crossplane namespace: `kubectl create ns crossplane-system`
* Install crossplane helm chart: `helm install crossplane charts/crossplane/ --namespace crossplane-system`
* Install crossplane cli: `curl -sL https://raw.githubusercontent.com/crossplane/crossplane/release-0.13/install.sh | sh`
* Add crossplane to `PATH`: `sudo mv kubectl-crossplane /usr/local/bin`
* Configure cloud provider(Alibaba Cloud)
* Add cloud provider: `kubectl crossplane install provider crossplane/provider-alibaba:v0.3.0`
* Create provider secret: `kubectl create secret generic alibaba-creds --from-literal=accessKeyId=<change here> --from-literal=accessKeySecret=<change here> -n crossplane-system`
* Configure the provider: `kubectl apply -f script/provider.yaml`
* Configure infrastructure: `kubectl crossplane install configuration crossplane/getting-started-with-alibaba:v0.13`
So far we have configured Crossplane on the cluster.
## Import the database workload definition
First, register the db workload definition:
`kubectl apply -f script/def_db.yaml`
The webservice workload is different from the default version so we have to overwrite it.
`kubectl apply -f cript/webservice.yaml`
Don't forget to update vela:
`vela system update`
## Apply the appfile
In the Appfile, we claim an RDS instance just like other services:
``` yaml
database:
type: rds
name: alibabaRds
...
```
Next, we start the application:
`vela up`
## Verify the database status
Under the hood, we can verify the status of database(usually takes >6 min to be ready):
`kubectl get postgresqlinstance`
When the database is ready, you can see the `READY: True` output.
## Access the web-ui
In the Appfile we added a route trait. To access the web-ui, please check out the [route](set-route.md) documentation.

View File

@@ -1,242 +0,0 @@
# Using Appfile for More Flexible Configuration
Appfile supports more flexible options than CLI/UI to configure appliation deployment on Vela.
A detailed design doc could be found [here](../../design/appfile-design.md).
In this tutorial, we will build and deploy an example NodeJS app under [examples/testapp/](https://github.com/oam-dev/kubevela/tree/master/examples/testapp).
## Prerequisites
- [docker](https://docs.docker.com/get-docker/) installed on the host
- [vela](../../install.md) installed and configured
## 1. Download test app code
git clone and go to the testapp directory:
```console
$ git clone https://github.com/oam-dev/kubevela.git
$ cd kubevela/examples/testapp
```
The example contains NodeJS app code, Dockerfile to build the app.
## 2. Deploy app in one command
In the directory there is a [vela.yaml](../../../examples/testapp/vela.yaml) which follows Appfile format supported by Vela.
We are going to use it to build and deploy the app.
ATTENTION: change the image field in vela.yaml to something you can push to on your host:
> Or you may try the local testing option introduced in the following section.
```yaml
image: oamdev/testapp:v1
```
Run the following command:
```console
$ vela up
Parsing vela.yaml ...
Loading templates ...
Building service (express-server)...
Sending build context to Docker daemon 71.68kB
Step 1/10 : FROM mhart/alpine-node:12
---> 9d88359808c3
...
pushing image (oamdev/testapp:v1)...
...
Rendering configs for service (express-server)...
Writing deploy config to (.vela/deploy.yaml)
Applying deploy configs ...
Checking if app has been deployed...
App has not been deployed, creating a new deployment...
✅ App has been deployed 🚀🚀🚀
Port forward: vela port-forward testapp
SSH: vela exec testapp
Logging: vela logs testapp
App status: vela status testapp
Service status: vela status testapp --svc express-server
```
Check the status of the service:
```console
$ vela status testapp
About:
Name: testapp
Namespace: default
Created at: 2020-11-02 11:08:32.138484 +0800 CST
Updated at: 2020-11-02 11:08:32.138485 +0800 CST
Services:
- Name: express-server
Type: webservice
HEALTHY Ready: 1/1
Last Deployment:
Created at: 2020-11-02 11:08:33 +0800 CST
Updated at: 2020-11-02T11:08:32+08:00
Routes:
```
### Alternative: Local testing without pushing image remotely
If you have local [kind](../../install.md#kind) cluster running, you may try the local push option without pushing image remotely.
Add local option to `build`:
```yaml
build:
# push image into local kind cluster without remote transfer
push:
local: kind
docker:
file: Dockerfile
context: .
```
Then deploy the app to kind:
```console
$ vela up
```
### [Optional] Check rendered manifests
By default, Vela renders the final manifests in `.vela/deploy.yaml`:
```yaml
apiVersion: core.oam.dev/v1alpha2
kind: ApplicationConfiguration
metadata:
name: testapp
namespace: default
spec:
components:
- componentName: express-server
---
apiVersion: core.oam.dev/v1alpha2
kind: Component
metadata:
name: express-server
namespace: default
spec:
workload:
apiVersion: apps/v1
kind: Deployment
metadata:
name: express-server
...
---
apiVersion: core.oam.dev/v1alpha2
kind: HealthScope
metadata:
name: testapp-default-health
namespace: default
spec:
...
```
## 3. Add routing
Add routing config under `express-server`:
```yaml
servcies:
express-server:
...
route:
domain: example.com
rules:
- path: /testapp
rewriteTarget: /
```
Apply again:
```console
$ vela up
```
Check the status until we see route trait ready:
```console
$ vela status testapp
About:
Name: testapp
Namespace: default
Created at: ...
Updated at: ...
Services:
- Name: express-server
Type: webservice
HEALTHY Ready: 1/1
Last Deployment:
Created at: ...
Updated at: ...
Routes:
- route: Visiting URL: http://example.com IP: localhost
```
**In [kind cluster setup](../../install.md#kind)**, you can visit the service via localhost:
> If not in kind cluster, replace localhost with ingress address
```
$ curl -H "Host:example.com" http://localhost/testapp
Hello World
```
## 4. Add monitoring metrics
TODO
## [Optional] Configure "task" workload type
By now we have deployed a *webservice* workload. We can also add a *task* workload in appfile:
> Below is a simplified [k8s job example](https://kubernetes.io/docs/concepts/workloads/controllers/job/#running-an-example-job) using Vela:
```yaml
services:
pi:
image: perl
cmd: ["perl", "-Mbignum=bpi", "-wle", "print bpi(2000)"]
express-server:
...
```
Then deploy appfile again:
```console
$ vela up
```
## What's Next?
Congratulations! You have just deployed an app using Vela.
Here are some next steps that you can have more play with your app:
- [Check Application Logs](../check-logs.md)
- [Execute Commands in Container](../exec-cmd.md)
- [Port Forward to Container](../port-forward.md)
## References
For more configuration options of built-in capabilities, check [references](../references/README.md)

View File

@@ -1,12 +0,0 @@
# Port Forward to Container
Run:
```
$ vela port-forward testapp
Forwarding from 127.0.0.1:8080 -> 8080
Forwarding from [::1]:8080 -> 8080
Forward successfully! Opening browser ...
Handling connection for 8080
```

View File

@@ -1,9 +0,0 @@
# KubeVela Capability References
- [workload types](https://github.com/oam-dev/kubevela/tree/master/docs/developers/references/workload-types)
- [trait](https://github.com/oam-dev/kubevela/tree/master/docs/developers/references/traits)
Note: All the contents under this directory are designed to be referenced by other documentations as the full schema or usage of specific workload types or traits.
In the upcoming releases, we plan to auto-generate all these reference documentations from the CUE templates in KubeVela's definition objects.

View File

@@ -1,17 +0,0 @@
# Route
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Domain** | **string** | | [default to ]
**Issuer** | **string** | | [default to ]
**Rules** | [**[]RouteRules**](#routerules) | | [optional]
### RouteRules
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Path** | **string** | |
**RewriteTarget** | **string** | | [default to ]

View File

@@ -1,7 +0,0 @@
# Scaler
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Replica** | **int32** | | [default to 1]

View File

@@ -1,8 +0,0 @@
# Worker
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Cmd** | **[]string** | | [optional]
**Image** | **string** | pecify app image |

View File

@@ -1,9 +0,0 @@
# Task
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Cmd** | **[]string** | | [optional]
**Count** | **int32** | specify number of tasks to run in parallel | [default to 1]
**Image** | **string** | specify app image |

View File

@@ -1,33 +0,0 @@
# Webservice
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Cmd** | **[]string** | | [optional]
**Env** | [**[]WebserviceEnv**](#webserviceenv) | | [optional]
**Image** | **string** | specify app image |
**Port** | **int32** | specify port for container | [default to 6379]
### WebserviceEnv
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Name** | **string** | |
**Value** | **string** | | [optional]
**ValueFrom** | [**WebserviceValueFrom**](#webservicevaluefrom) | | [optional]
### WebserviceValueFrom
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**SecretKeyRef** | [**WebserviceValueFromSecretKeyRef**](#webservicevaluefromsecretkeyref) | |
### WebserviceValueFromSecretKeyRef
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Name** | **string** | |
**Key** | **string** | |

View File

@@ -1,235 +0,0 @@
# Automatically scale workloads by resource utilization metrics and cron
Contents:
- [Scale by CPU resource utilization metrics](#Scale by CPU resource utilization metrics)
- [Scale workload by cron](#Scale workload by cron)
## Scale by CPU resource utilization metrics
Introduce how to automatically scale workloads by resource utilization metrics in Cli. Currently, only cpu utilization
is supported.
- Deploy an application
Run the following command to deploy application `helloworld`.
```
$ vela svc deploy frontend -t webservice -a helloworld --image nginx:1.9.2 --port 80 --cpu-requests=0.05
App helloworld deployed
```
By default, the replicas of the workload webservice `helloworld` is.
- Scale the application by CPU utilization metrics
```
$ vela autoscale helloworld --svc frontend --min 1 --max 5 --cpu 5
Adding autoscale for app frontend
⠋ Checking Status ...
✅ Application Deployed Successfully!
- Name: frontend
Type: webservice
HEALTHY Ready: 1/1
Traits:
- ✅ autoscale: type: cpu minReplicas: 1 maxReplicas: 5 CPUUtilization(target/current): 5%/0% replicas: 0
Last Deployment:
Created at: 2020-11-06 16:10:54 +0800 CST
Updated at: 2020-11-06T16:19:04+08:0
```
- Access the application with heavy requests
```
$ vela port-forward helloworld 80
Forwarding from 127.0.0.1:80 -> 80
Forwarding from [::1]:80 -> 80
Forward successfully! Opening browser ...
Handling connection for 80
Handling connection for 80
Handling connection for 80
Handling connection for 80
```
On your macOS, you might need to add `sudo` ahead of the command.
- Use Apache HTTP server benchmarking tool `ab` to access the application.
```
$ ab -n 10000 -c 200 http://127.0.0.1/
This is ApacheBench, Version 2.3 <$Revision: 1843412 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking 127.0.0.1 (be patient)
Completed 1000 requests
```
Monitor the replicas of the workload, and its replicas gradually increase from one to four.
```
$ vela status helloworld --svc frontend
About:
Name: helloworld
Namespace: default
Created at: 2020-11-05 20:07:21.830118 +0800 CST
Updated at: 2020-11-05 20:50:42.664725 +0800 CST
Services:
- Name: frontend
Type: webservice
HEALTHY Ready: 1/1
Traits:
- ✅ autoscale: type: cpu minReplicas: 1 maxReplicas: 5 CPUUtilization(target/current): 5%/10% replicas: 2
Last Deployment:
Created at: 2020-11-05 20:07:23 +0800 CST
Updated at: 2020-11-05T20:50:42+08:00
```
```
$ vela status helloworld --svc frontend
About:
Name: helloworld
Namespace: default
Created at: 2020-11-05 20:07:21.830118 +0800 CST
Updated at: 2020-11-05 20:50:42.664725 +0800 CST
Services:
- Name: frontend
Type: webservice
HEALTHY Ready: 1/1
Traits:
- ✅ autoscale: type: cpu minReplicas: 1 maxReplicas: 5 CPUUtilization(target/current): 5%/14% replicas: 4
Last Deployment:
Created at: 2020-11-05 20:07:23 +0800 CST
Updated at: 2020-11-05T20:50:42+08:00
```
Stop `ab` tool, and the replicas will decrease to one eventually.
## Scale workload by cron
Introduce how to automatically scale workloads by cron in Appfile.
- Prepare Appfile
Follow the instructions of [appfile](./devex/appfile.md) to prepare the `vela.yaml` as below.
```
name: testapp
services:
express-server:
# this image will be used in both build and deploy steps
image: zzxwill/kubevela-appfile-demo:v1
build:
# Here more runtime specific build templates will be supported, like NodeJS, Go, Python, Ruby.
docker:
file: Dockerfile
context: .
cmd: ["node", "server.js"]
port: 8080
autoscale:
minReplicas: 1
maxReplicas: 4
cron:
startAt: "14:00"
duration: "2h"
days: "Monday, Thursday"
replicas: "2"
timezone: "America/Seattle"
```
- Deploy an application
Run the following command to deploy the application defined in `vela.yaml`.
```
$ vela up
Parsing vela.yaml ...
Loading templates ...
Building service (express-server)...
#2 [internal] load build definition from Dockerfile
#2 sha256:c25a03ff9861be1da16a316055d11b83778efa23c655d0e69a902487bbf3c303
#2 transferring dockerfile: 37B 0.0s done
#2 DONE 0.1s
...
pushing image (zzxwill/kubevela-appfile-demo:v1)...
The push refers to repository [docker.io/zzxwill/kubevela-appfile-demo]
1893e9ad9204: Preparing
b60a6f0fd043: Preparing
...
89ae5c4ee501: Layer already exists
b60a6f0fd043: Layer already exists
1893e9ad9204: Pushed
v1: digest: sha256:11e48ce2205a1d92c1c920b3a3f41d3ee357fa2794261dc0d0e8010068e68da6 size: 1365
Rendering configs for service (express-server)...
Writing deploy config to (.vela/deploy.yaml)
Applying deploy configs ...
Checking if app has been deployed...
App has not been deployed, creating a new deployment...
✅ App has been deployed 🚀🚀🚀
Port forward: vela port-forward testapp
SSH: vela exec testapp
Logging: vela logs testapp
App status: vela status testapp
Service status: vela status testapp --svc express-server
```
- Check the replicas and wait for the scaling to take effect
Check the replicas of the application, there is one replica.
```
$ vela status testapp
About:
Name: testapp
Namespace: default
Created at: 2020-11-05 17:09:02.426632 +0800 CST
Updated at: 2020-11-05 17:09:02.426632 +0800 CST
Services:
- Name: express-server
Type: webservice
HEALTHY Ready: 1/1
Traits:
- ✅ autoscale: type: cron minReplicas: 1 maxReplicas: 4 replicas: 1
Last Deployment:
Created at: 2020-11-05 17:09:03 +0800 CST
Updated at: 2020-11-05T17:09:02+08:00
```
Wait till the time clocks `startAt`, and check again. The replicas become to two, which is specified as
`replicas` in `vela.yaml`.
```
$ vela status testapp
About:
Name: testapp
Namespace: default
Created at: 2020-11-05 17:09:02.426632 +0800 CST
Updated at: 2020-11-05 17:09:02.426632 +0800 CST
Services:
- Name: express-server
Type: webservice
HEALTHY Ready: 1/1
Traits:
- ✅ autoscale: type: cron minReplicas: 1 maxReplicas: 4 replicas: 2
Last Deployment:
Created at: 2020-11-05 17:09:03 +0800 CST
Updated at: 2020-11-05T17:09:02+08:00
```
Wait after the period ends, the replicas will be one eventually.

View File

@@ -1,40 +0,0 @@
# Monitoring Application
If your application has exposed metrics, you can easily setup monitoring system
with the help of `metric` capability.
Let's run [`christianhxc/gorandom:1.0`](https://github.com/christianhxc/prometheus-tutorial) as an example app.
The app will emit random latencies as metrics.
```console
$ vela svc deploy metricapp -t webservice --image christianhxc/gorandom:1.0 --port 8080
```
Then add metric by:
```console
$ vela metric metricapp
Adding metric for app metricapp
⠋ Deploying ...
✅ Application Deployed Successfully!
- Name: metricapp
Type: webservice
HEALTHY Ready: 1/1
Routes:
- ✅ metric: Monitoring port: 8080, path: /metrics, format: prometheus, schema: http.
Last Deployment:
Created at: 2020-11-02 14:31:56 +0800 CST
Updated at: 2020-11-02T14:32:00+08:00
```
The metrics trait will automatically discover port and label to monitor if no parameters specified.
If more than one ports found, it will choose the first one by default.
## Verify that the metrics are collected on prometheus
```shell script
kubectl --namespace monitoring port-forward `k -n monitoring get pods -l prometheus=oam -o name` 9090
```
Then access the prometheus dashboard via http://localhost:9090/targets

View File

@@ -1,3 +0,0 @@
# Setting Rollout Strategy
> TODO

View File

@@ -1,72 +0,0 @@
# Setting Routes
Once your web services of the application deployed, you can visit it locally via `port-forward` or
from outside world via `route` feature.
```console
$ vela svc ls
NAME APP WORKLOAD TRAITS STATUS CREATED-TIME
frontend testapp webservice Deployed 2020-09-18 22:42:04 +0800 CST
```
## `port-forward`
It will directly open browser for you.
```console
$ vela port-forward testapp
Forwarding from 127.0.0.1:8080 -> 80
Forwarding from [::1]:8080 -> 80
Forward successfully! Opening browser ...
Handling connection for 8080
Handling connection for 8080
```
## `route`
`route` is mainly used for public visiting your app.
### If you have didn't configure domain in environment
You can manually configure it by setting domain parameter.
```console
$ vela route testapp --domain frontend.mycustom.domain
Adding route for app frontend
Rendering configs for service (frontend)...
⠋ Deploying ...
✅ Application Deployed Successfully!
Showing status of service(type: webservice) frontend deployed in Environment myenv
Service frontend Status: HEALTHY Ready: 1/1
route: Visiting URL: http://frontend.mycustom.domain IP: 123.57.10.233
Last Deployment:
Created at: 2020-10-29 15:45:13 +0800 CST
Updated at: 2020-10-29T16:12:45+08:00
```
Then you will be able to visit by:
```shell script
$ curl -H "Host:frontend.mycustom.domain" 123.57.10.233
```
### If you have domain set in environment
```console
$ vela route testapp
Adding route for app frontend
Rendering configs for service (frontend)...
⠋ Deploying ...
✅ Application Deployed Successfully!
Showing status of service(type: webservice) frontend deployed in Environment default
Service frontend Status: HEALTHY Ready: 1/1
route: Visiting URL: https://frontend.123.57.10.233.xip.io IP: 123.57.10.233
Last Deployment:
Created at: 2020-10-29 11:26:46 +0800 CST
Updated at: 2020-10-29T11:28:01+08:00
```

25
docs/en/README.md Normal file
View File

@@ -0,0 +1,25 @@
![alt](../resources/KubeVela-03.png)
*Make shipping applications more enjoyable.*
# KubeVela
For developers, KubeVela is an easy-to-use tool that enables them to describe and ship their applications to Kubernetes with minimal effort.
For platform builders, KubeVela serves as a framework that empowers them to create developer facing yet highly extensible platforms at ease.
- Slack: [Discuss](https://cloud-native.slack.com/archives/C01BLQ3HTJA)
- Gitter: [Community](https://gitter.im/oam-dev/community)
> NOTE: KubeVela is still in early stage and iterating quickly. It's currently under preview release.
## Quick Start
Quick start guides are available on [this section](/en/quick-start).
## Contributing
Check out [CONTRIBUTING](https://github.com/oam-dev/kubevela/blob/master/CONTRIBUTING.md) to see how to develop with KubeVela.
## Code of Conduct
This project has adopted the [CNCF Code of Conduct](https://github.com/cncf/foundation/blob/master/code-of-conduct.md). See [CODE OF CONDUCT](CODE_OF_CONDUCT.md) for details.

1
docs/en/blog/README.md Normal file
View File

@@ -0,0 +1 @@
## Some blog

1
docs/en/blog/_sidebar.md Normal file
View File

@@ -0,0 +1 @@
- [Blog](/en/blog/README.md)

View File

@@ -20,23 +20,24 @@ vela [flags]
### SEE ALSO
* [vela autoscale](vela_autoscale.md) - Attach autoscale trait to an app
* [vela cap](vela_cap.md) - Capability Management
* [vela cap](vela_cap.md) - Manage capability centers and installing/uninstalling capabilities
* [vela completion](vela_completion.md) - Output shell completion code for the specified shell (bash or zsh)
* [vela config](vela_config.md) - Manage application configurations
* [vela config](vela_config.md) - Manage configurations
* [vela dashboard](vela_dashboard.md) - Setup API Server and launch Dashboard
* [vela delete](vela_delete.md) - Delete Applications
* [vela env](vela_env.md) - Manage application environments
* [vela exec](vela_exec.md) - Execute a command in a container
* [vela init](vela_init.md) - Init an OAM Application
* [vela install](vela_install.md) - Initialize vela on both client and server
* [vela delete](vela_delete.md) - Delete an application
* [vela env](vela_env.md) - Manage environments
* [vela exec](vela_exec.md) - Execute command in a container
* [vela init](vela_init.md) - Create scaffold for an application
* [vela install](vela_install.md) - Install Vela Core with built-in capabilities
* [vela logs](vela_logs.md) - Tail logs for application
* [vela ls](vela_ls.md) - List services
* [vela metric](vela_metric.md) - Attach metric trait to an app
* [vela port-forward](vela_port-forward.md) - Forward one or more local ports to a Pod of a service in an application
* [vela metrics](vela_metrics.md) - Attach metrics trait to an app
* [vela port-forward](vela_port-forward.md) - Forward local ports to services in an application
* [vela rollout](vela_rollout.md) - Attach rollout trait to an app
* [vela route](vela_route.md) - Attach route trait to an app
* [vela scaler](vela_scaler.md) - Attach scaler trait to an app
* [vela show](vela_show.md) - Get details of an application
* [vela status](vela_status.md) - get status of an application
* [vela show](vela_show.md) - Show details of an application
* [vela status](vela_status.md) - Show status of an application
* [vela svc](vela_svc.md) - Manage services
* [vela system](vela_system.md) - System management utilities
* [vela template](vela_template.md) - Manage templates
@@ -45,4 +46,4 @@ vela [flags]
* [vela version](vela_version.md) - Prints out build version information
* [vela workloads](vela_workloads.md) - List workloads
###### Auto generated by spf13/cobra on 6-Nov-2020
###### Auto generated by spf13/cobra on 16-Nov-2020

View File

@@ -19,19 +19,13 @@ vela autoscale frontend
### Options
```
--days string
--cpu-percent int specify the value for CPU utilization, like 80, which means 80%
--detach detach trait from service
--duration string
-h, --help help for autoscale
--maxReplicas int (default 4)
--minReplicas int (default 1)
--name string
--replicas string (default "2")
--max int maximal replicas of the workload
--min int minimal replicas of the workload
-s, --staging only save changes locally without real update application
--startAt string
--svc string specify one service belonging to the application
--timezone string (default "Asia/Shanghai")
--type string (default "cron")
```
### Options inherited from parent commands
@@ -44,4 +38,4 @@ vela autoscale frontend
* [vela](vela.md) -
###### Auto generated by spf13/cobra on 6-Nov-2020
###### Auto generated by spf13/cobra on 16-Nov-2020

View File

@@ -1,10 +1,10 @@
## vela cap
Capability Management
Manage capability centers and installing/uninstalling capabilities
### Synopsis
Capability Management with config, list, add, remove capabilities
Manage capability centers and installing/uninstalling capabilities
### Options
@@ -26,4 +26,4 @@ Capability Management with config, list, add, remove capabilities
* [vela cap ls](vela_cap_ls.md) - List capabilities from cap-center
* [vela cap uninstall](vela_cap_uninstall.md) - Uninstall capability from cluster
###### Auto generated by spf13/cobra on 6-Nov-2020
###### Auto generated by spf13/cobra on 16-Nov-2020

View File

@@ -20,10 +20,10 @@ Manage Capability Center with config, sync, list
### SEE ALSO
* [vela cap](vela_cap.md) - Capability Management
* [vela cap](vela_cap.md) - Manage capability centers and installing/uninstalling capabilities
* [vela cap center config](vela_cap_center_config.md) - Configure (add if not exist) a capability center, default is local (built-in capabilities)
* [vela cap center ls](vela_cap_center_ls.md) - List all capability centers
* [vela cap center remove](vela_cap_center_remove.md) - Remove specified capability center
* [vela cap center sync](vela_cap_center_sync.md) - Sync capabilities from remote center, default to sync all centers
###### Auto generated by spf13/cobra on 6-Nov-2020
###### Auto generated by spf13/cobra on 16-Nov-2020

View File

@@ -33,4 +33,4 @@ vela cap center config mycenter https://github.com/oam-dev/catalog/cap-center
* [vela cap center](vela_cap_center.md) - Manage Capability Center
###### Auto generated by spf13/cobra on 6-Nov-2020
###### Auto generated by spf13/cobra on 16-Nov-2020

View File

@@ -32,4 +32,4 @@ vela cap center ls
* [vela cap center](vela_cap_center.md) - Manage Capability Center
###### Auto generated by spf13/cobra on 6-Nov-2020
###### Auto generated by spf13/cobra on 16-Nov-2020

View File

@@ -32,4 +32,4 @@ vela cap center remove mycenter
* [vela cap center](vela_cap_center.md) - Manage Capability Center
###### Auto generated by spf13/cobra on 6-Nov-2020
###### Auto generated by spf13/cobra on 16-Nov-2020

View File

@@ -32,4 +32,4 @@ vela cap center sync mycenter
* [vela cap center](vela_cap_center.md) - Manage Capability Center
###### Auto generated by spf13/cobra on 6-Nov-2020
###### Auto generated by spf13/cobra on 16-Nov-2020

View File

@@ -31,6 +31,6 @@ vela cap install mycenter/route
### SEE ALSO
* [vela cap](vela_cap.md) - Capability Management
* [vela cap](vela_cap.md) - Manage capability centers and installing/uninstalling capabilities
###### Auto generated by spf13/cobra on 6-Nov-2020
###### Auto generated by spf13/cobra on 16-Nov-2020

View File

@@ -30,6 +30,6 @@ vela cap ls
### SEE ALSO
* [vela cap](vela_cap.md) - Capability Management
* [vela cap](vela_cap.md) - Manage capability centers and installing/uninstalling capabilities
###### Auto generated by spf13/cobra on 6-Nov-2020
###### Auto generated by spf13/cobra on 16-Nov-2020

View File

@@ -31,6 +31,6 @@ vela cap uninstall route
### SEE ALSO
* [vela cap](vela_cap.md) - Capability Management
* [vela cap](vela_cap.md) - Manage capability centers and installing/uninstalling capabilities
###### Auto generated by spf13/cobra on 6-Nov-2020
###### Auto generated by spf13/cobra on 16-Nov-2020

View File

@@ -27,4 +27,4 @@ of vela commands.
* [vela completion bash](vela_completion_bash.md) - generate autocompletions script for bash
* [vela completion zsh](vela_completion_zsh.md) - generate autocompletions script for zsh
###### Auto generated by spf13/cobra on 6-Nov-2020
###### Auto generated by spf13/cobra on 16-Nov-2020

View File

@@ -36,4 +36,4 @@ vela completion bash
* [vela completion](vela_completion.md) - Output shell completion code for the specified shell (bash or zsh)
###### Auto generated by spf13/cobra on 6-Nov-2020
###### Auto generated by spf13/cobra on 16-Nov-2020

View File

@@ -33,4 +33,4 @@ vela completion zsh
* [vela completion](vela_completion.md) - Output shell completion code for the specified shell (bash or zsh)
###### Auto generated by spf13/cobra on 6-Nov-2020
###### Auto generated by spf13/cobra on 16-Nov-2020

View File

@@ -1,10 +1,10 @@
## vela config
Manage application configurations
Manage configurations
### Synopsis
Manage application configurations under given env
Manage configurations
### Options
@@ -26,4 +26,4 @@ Manage application configurations under given env
* [vela config ls](vela_config_ls.md) - List configs
* [vela config set](vela_config_set.md) - Set data for a config
###### Auto generated by spf13/cobra on 6-Nov-2020
###### Auto generated by spf13/cobra on 16-Nov-2020

View File

@@ -30,6 +30,6 @@ vela config del <config-name>
### SEE ALSO
* [vela config](vela_config.md) - Manage application configurations
* [vela config](vela_config.md) - Manage configurations
###### Auto generated by spf13/cobra on 6-Nov-2020
###### Auto generated by spf13/cobra on 16-Nov-2020

View File

@@ -30,6 +30,6 @@ vela config get <config-name>
### SEE ALSO
* [vela config](vela_config.md) - Manage application configurations
* [vela config](vela_config.md) - Manage configurations
###### Auto generated by spf13/cobra on 6-Nov-2020
###### Auto generated by spf13/cobra on 16-Nov-2020

View File

@@ -30,6 +30,6 @@ vela config ls
### SEE ALSO
* [vela config](vela_config.md) - Manage application configurations
* [vela config](vela_config.md) - Manage configurations
###### Auto generated by spf13/cobra on 6-Nov-2020
###### Auto generated by spf13/cobra on 16-Nov-2020

View File

@@ -30,6 +30,6 @@ vela config set <config-name> KEY=VALUE K2=V2
### SEE ALSO
* [vela config](vela_config.md) - Manage application configurations
* [vela config](vela_config.md) - Manage configurations
###### Auto generated by spf13/cobra on 6-Nov-2020
###### Auto generated by spf13/cobra on 16-Nov-2020

View File

@@ -38,4 +38,4 @@ dashboard
* [vela](vela.md) -
###### Auto generated by spf13/cobra on 6-Nov-2020
###### Auto generated by spf13/cobra on 16-Nov-2020

View File

@@ -1,13 +1,13 @@
## vela delete
Delete Applications
Delete an application
### Synopsis
Delete Applications
Delete an application
```
vela delete <APPLICATION_NAME>
vela delete APP_NAME
```
### Examples
@@ -33,4 +33,4 @@ vela delete frontend
* [vela](vela.md) -
###### Auto generated by spf13/cobra on 6-Nov-2020
###### Auto generated by spf13/cobra on 16-Nov-2020

View File

@@ -1,10 +1,10 @@
## vela env
Manage application environments
Manage environments
### Synopsis
Manage application environments
Manage environments
### Options
@@ -26,4 +26,4 @@ Manage application environments
* [vela env ls](vela_env_ls.md) - List environments
* [vela env set](vela_env_set.md) - Set an environment
###### Auto generated by spf13/cobra on 6-Nov-2020
###### Auto generated by spf13/cobra on 16-Nov-2020

View File

@@ -30,6 +30,6 @@ vela env delete test
### SEE ALSO
* [vela env](vela_env.md) - Manage application environments
* [vela env](vela_env.md) - Manage environments
###### Auto generated by spf13/cobra on 6-Nov-2020
###### Auto generated by spf13/cobra on 16-Nov-2020

View File

@@ -23,6 +23,7 @@ vela env init test --namespace test --email my@email.com
--email string specify email for production TLS Certificate notification
-h, --help help for init
--namespace string specify K8s namespace for env
-s, --sync synchronize capabilities from cluster into local (default true)
```
### Options inherited from parent commands
@@ -33,6 +34,6 @@ vela env init test --namespace test --email my@email.com
### SEE ALSO
* [vela env](vela_env.md) - Manage application environments
* [vela env](vela_env.md) - Manage environments
###### Auto generated by spf13/cobra on 6-Nov-2020
###### Auto generated by spf13/cobra on 16-Nov-2020

View File

@@ -30,6 +30,6 @@ vela env ls [env-name]
### SEE ALSO
* [vela env](vela_env.md) - Manage application environments
* [vela env](vela_env.md) - Manage environments
###### Auto generated by spf13/cobra on 6-Nov-2020
###### Auto generated by spf13/cobra on 16-Nov-2020

View File

@@ -30,6 +30,6 @@ vela env set test
### SEE ALSO
* [vela env](vela_env.md) - Manage application environments
* [vela env](vela_env.md) - Manage environments
###### Auto generated by spf13/cobra on 6-Nov-2020
###### Auto generated by spf13/cobra on 16-Nov-2020

View File

@@ -1,13 +1,13 @@
## vela exec
Execute a command in a container
Execute command in a container
### Synopsis
Execute a command in the 1st container of specific Application => Service => (1st)Pod
Execute command in a container
```
vela exec [flags] AppName -- COMMAND [args...]
vela exec [flags] APP_NAME -- COMMAND [args...]
```
### Options
@@ -29,4 +29,4 @@ vela exec [flags] AppName -- COMMAND [args...]
* [vela](vela.md) -
###### Auto generated by spf13/cobra on 6-Nov-2020
###### Auto generated by spf13/cobra on 16-Nov-2020

View File

@@ -1,10 +1,10 @@
## vela init
Init an OAM Application
Create scaffold for an application
### Synopsis
Init an OAM Application by one command
Create scaffold for an application
```
vela init
@@ -33,4 +33,4 @@ vela init
* [vela](vela.md) -
###### Auto generated by spf13/cobra on 6-Nov-2020
###### Auto generated by spf13/cobra on 16-Nov-2020

View File

@@ -1,10 +1,10 @@
## vela install
Initialize vela on both client and server
Install Vela Core with built-in capabilities
### Synopsis
Install OAM runtime and vela builtin capabilities.
Install Vela Core with built-in capabilities
```
vela install [flags]
@@ -18,7 +18,7 @@ vela install [flags]
--image-repo string vela core image repo, this will align to chart value image.repo (default "oamdev/vela-core")
--image-tag string vela core image repo, this will align to chart value image.tag (default "latest")
-p, --vela-chart-path string path to vela core chart to override default chart
-w, --wait wait until vela-core is ready to serve
-w, --wait string wait until vela-core is ready to serve, default will not wait (default "0s")
```
### Options inherited from parent commands
@@ -31,4 +31,4 @@ vela install [flags]
* [vela](vela.md) -
###### Auto generated by spf13/cobra on 6-Nov-2020
###### Auto generated by spf13/cobra on 16-Nov-2020

View File

@@ -27,4 +27,4 @@ vela logs [flags]
* [vela](vela.md) -
###### Auto generated by spf13/cobra on 6-Nov-2020
###### Auto generated by spf13/cobra on 16-Nov-2020

View File

@@ -4,7 +4,7 @@ List services
### Synopsis
List services with their application, type, traits, status and created time, etc.
List services of all applications
```
vela ls
@@ -33,4 +33,4 @@ vela ls
* [vela](vela.md) -
###### Auto generated by spf13/cobra on 6-Nov-2020
###### Auto generated by spf13/cobra on 16-Nov-2020

View File

@@ -1,19 +1,19 @@
## vela metric
## vela metrics
Attach metric trait to an app
Attach metrics trait to an app
### Synopsis
Attach metric trait to an app
Attach metrics trait to an app
```
vela metric <appname> [args]
vela metrics <appname> [args]
```
### Examples
```
vela metric frontend
vela metrics frontend
```
### Options
@@ -22,8 +22,8 @@ vela metric frontend
--detach detach trait from service
--enabled (default true)
-f, --format string format of the metrics, default as prometheus (default "prometheus")
-h, --help help for metric
--path string the metric path of the service (default "/metrics")
-h, --help help for metrics
--path string the metrics path of the service (default "/metrics")
--port int the port for metrics, will discovery automatically by default
--scheme string (default "http")
-s, --staging only save changes locally without real update application
@@ -40,4 +40,4 @@ vela metric frontend
* [vela](vela.md) -
###### Auto generated by spf13/cobra on 6-Nov-2020
###### Auto generated by spf13/cobra on 16-Nov-2020

View File

@@ -1,10 +1,10 @@
## vela port-forward
Forward one or more local ports to a Pod of a service in an application
Forward local ports to services in an application
### Synopsis
Forward one or more local ports to a Pod of a service in an application
Forward local ports to services in an application
```
vela port-forward APP_NAME [options] [LOCAL_PORT:]REMOTE_PORT [...[LOCAL_PORT_N:]REMOTE_PORT_N] [flags]
@@ -16,6 +16,7 @@ vela port-forward APP_NAME [options] [LOCAL_PORT:]REMOTE_PORT [...[LOCAL_PORT_N:
--address strings Addresses to listen on (comma separated). Only accepts IP addresses or localhost as a value. When localhost is supplied, vela will try to bind on both 127.0.0.1 and ::1 and will fail if neither of these addresses are available to bind. (default [localhost])
-h, --help help for port-forward
--pod-running-timeout duration The length of time (like 5s, 2m, or 3h, higher than zero) to wait until at least one pod is running (default 1m0s)
--route forward ports from route trait service
```
### Options inherited from parent commands
@@ -28,4 +29,4 @@ vela port-forward APP_NAME [options] [LOCAL_PORT:]REMOTE_PORT [...[LOCAL_PORT_N:
* [vela](vela.md) -
###### Auto generated by spf13/cobra on 6-Nov-2020
###### Auto generated by spf13/cobra on 16-Nov-2020

View File

@@ -0,0 +1,41 @@
## vela rollout
Attach rollout trait to an app
### Synopsis
Attach rollout trait to an app
```
vela rollout <appname> [args]
```
### Examples
```
vela rollout frontend
```
### Options
```
--detach detach trait from service
-h, --help help for rollout
--interval string (default "30s")
--replicas int total replicas of the workload (default 2)
-s, --staging only save changes locally without real update application
--step-weight int weight percent of every step in rolling update (default 50)
--svc string specify one service belonging to the application
```
### Options inherited from parent commands
```
-e, --env string specify environment name for application
```
### SEE ALSO
* [vela](vela.md) -
###### Auto generated by spf13/cobra on 16-Nov-2020

View File

@@ -37,4 +37,4 @@ vela route frontend
* [vela](vela.md) -
###### Auto generated by spf13/cobra on 6-Nov-2020
###### Auto generated by spf13/cobra on 16-Nov-2020

View File

@@ -19,11 +19,11 @@ vela scaler frontend
### Options
```
--detach detach trait from service
-h, --help help for scaler
-r, --replica int (default 1)
-s, --staging only save changes locally without real update application
--svc string specify one service belonging to the application
--detach detach trait from service
-h, --help help for scaler
-r, --replicas int (default 1)
-s, --staging only save changes locally without real update application
--svc string specify one service belonging to the application
```
### Options inherited from parent commands
@@ -36,4 +36,4 @@ vela scaler frontend
* [vela](vela.md) -
###### Auto generated by spf13/cobra on 6-Nov-2020
###### Auto generated by spf13/cobra on 16-Nov-2020

View File

@@ -1,19 +1,19 @@
## vela show
Get details of an application
Show details of an application
### Synopsis
Get details of an application
Show details of an application
```
vela show <APPLICATION-NAME> [flags]
vela show APP_NAME [flags]
```
### Examples
```
vela show <APPLICATION-NAME>
vela show APP_NAME
```
### Options
@@ -33,4 +33,4 @@ vela show <APPLICATION-NAME>
* [vela](vela.md) -
###### Auto generated by spf13/cobra on 6-Nov-2020
###### Auto generated by spf13/cobra on 16-Nov-2020

View File

@@ -1,19 +1,19 @@
## vela status
get status of an application
Show status of an application
### Synopsis
get status of an application, including workloads and traits of each service.
Show status of an application, including workloads and traits of each service.
```
vela status <APPLICATION-NAME> [flags]
vela status APP_NAME [flags]
```
### Examples
```
vela status <APPLICATION-NAME>
vela status APP_NAME
```
### Options
@@ -33,4 +33,4 @@ vela status <APPLICATION-NAME>
* [vela](vela.md) -
###### Auto generated by spf13/cobra on 6-Nov-2020
###### Auto generated by spf13/cobra on 16-Nov-2020

View File

@@ -24,4 +24,4 @@ Manage services
* [vela](vela.md) -
* [vela svc deploy](vela_svc_deploy.md) - Initialize and run a service
###### Auto generated by spf13/cobra on 6-Nov-2020
###### Auto generated by spf13/cobra on 16-Nov-2020

View File

@@ -35,4 +35,4 @@ vela svc deploy -t <SERVICE_TYPE>
* [vela svc](vela_svc.md) - Manage services
###### Auto generated by spf13/cobra on 6-Nov-2020
###### Auto generated by spf13/cobra on 16-Nov-2020

View File

@@ -22,6 +22,5 @@ System management utilities
* [vela](vela.md) -
* [vela system info](vela_system_info.md) - Show vela client and cluster chartPath
* [vela system update](vela_system_update.md) - Sync definition from cluster
###### Auto generated by spf13/cobra on 6-Nov-2020
###### Auto generated by spf13/cobra on 16-Nov-2020

View File

@@ -26,4 +26,4 @@ vela system info [flags]
* [vela system](vela_system.md) - System management utilities
###### Auto generated by spf13/cobra on 6-Nov-2020
###### Auto generated by spf13/cobra on 16-Nov-2020

View File

@@ -23,4 +23,4 @@ Manage templates
* [vela](vela.md) -
* [vela template context](vela_template_context.md) - Show context parameters
###### Auto generated by spf13/cobra on 6-Nov-2020
###### Auto generated by spf13/cobra on 16-Nov-2020

Some files were not shown because too many files have changed in this diff Show More