Compare commits

..

336 Commits

Author SHA1 Message Date
Jianbo Sun
816b7d2d6f Merge pull request #637 from wonderflow/display
add tips about vela install capability not ready instead of directly fail
2020-11-20 10:21:35 +08:00
Jianbo Sun
050b66b5d0 Merge pull request #636 from wonderflow/check
check helm release first before add repo and install chart
2020-11-20 09:53:08 +08:00
天元
6862435594 add tips about vela install capability not ready instead of directly fail, it could self-heal after background installation succeed
Signed-off-by: 天元 <jianbo.sjb@alibaba-inc.com>
2020-11-20 09:51:22 +08:00
天元
c195580126 check helm release first before add repo and install chart 2020-11-20 09:39:59 +08:00
Hongchao Deng
0747b03c50 Merge pull request #635 from hongchaodeng/hide_ui
hide dashboard command
2020-11-19 17:27:27 -08:00
Jianbo Sun
25558b2c86 Merge pull request #633 from zzxwill/docs-cli
Update vela Cli description
2020-11-20 09:22:56 +08:00
Hongchao Deng
f1ff1564fb hide dashboard command 2020-11-19 17:12:31 -08:00
Hongchao Deng
ebfd1dfe15 Merge pull request #634 from resouer/doc
Fix broken link in introduction
2020-11-19 15:38:55 -08:00
Harry Zhang
51873e0b4d Fix broken link in introduction 2020-11-19 15:32:25 -08:00
zzxwill
bcd6fb08cc Update vela Cli description
To make it consistent to the description of KubeVela repo
2020-11-19 16:22:34 +08:00
Jianbo Sun
7a81bba7ca Merge pull request #627 from wonderflow/newname
change demo app name to avoid see unhealthy status too quick
2020-11-18 17:03:57 +08:00
天元
5a4b70479c change demo app name to avoid see unhealthy status too quick 2020-11-18 17:00:40 +08:00
Jianbo Sun
2becbebceb Merge pull request #624 from oam-dev/wonderflow-patch-1
Update install.md
2020-11-18 16:40:13 +08:00
Jianbo Sun
cf57610e20 Update install.md
Signed-off-by: 天元 <jianbo.sjb@alibaba-inc.com>
2020-11-18 16:39:21 +08:00
Hongchao Deng
244b3f7f48 Merge pull request #622 from wonderflow/gosec
fix go sec and remove unnecessary code
2020-11-17 20:34:21 -08:00
天元
42c9e68512 fix go sec and remove unnecessary code
Signed-off-by: 天元 <jianbo.sjb@alibaba-inc.com>
2020-11-18 10:34:22 +08:00
Jianbo Sun
17b4a2c966 Merge pull request #623 from resouer/fix
Update design description
2020-11-18 10:15:54 +08:00
Harry Zhang
5266274c60 Update design description 2020-11-17 16:47:18 -08:00
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
Hongchao Deng
94fad7229b Merge pull request #530 from hongchaodeng/doc-cap
doc: add managing caps
2020-11-06 19:11:17 -08:00
Hongchao Deng
2b71fd5201 add back traits doc 2020-11-06 18:59:49 -08:00
Hongchao Deng
a199c1f009 fix cap uninstall 2020-11-06 17:57:46 -08:00
Hongchao Deng
936b4dfa32 doc: add cap center
Signed-off-by: Hongchao Deng <hongchaodeng1@gmail.com>
2020-11-06 17:57:44 -08:00
andy shi
35f3b68d45 first version cloud-service (#517)
* first version cloud-service

* change working directory
2020-11-06 17:45:45 -08:00
Zheng Xi Zhou
91f47586cf Autoscaler for appfile (#510)
* Autoscaler for appfile

completed spec.extension.template to support autoscale in
cli and appfile

* add alias name  to cpuRequest in Cli for deploying webservice
2020-11-07 07:54:59 +08:00
Jianbo Sun
37bbc37fa2 Merge pull request #527 from furykerry/changerun
remove vela app & vela app run cli options
2020-11-06 23:24:58 +08:00
守辰
a9ea45370d remove vela app & vela app run cli options
Signed-off-by: 守辰 <shouchen.zz@alibaba-inc.com>
2020-11-06 19:23:01 +08:00
Jianbo Sun
a9d7e3844b Merge pull request #525 from wonderflow/revisonroute
only choose OAM app labels for route trait
2020-11-06 15:49:18 +08:00
天元
0d2c251b45 only choose OAM app labels for route trait
Signed-off-by: 天元 <jianbo.sjb@alibaba-inc.com>
2020-11-06 15:35:42 +08:00
Jianbo Sun
b02b0db950 Merge pull request #524 from Fei-Guo/master
Revise concepts.md
2020-11-06 15:23:30 +08:00
Guo, Fei
b2db04e8c2 Revise conecepts.md 2020-11-05 23:04:07 -08:00
Jianbo Sun
c23ff6810a Merge pull request #518 from silotrd/master
Function SyncCapabilityFromCenter Called twices.
2020-11-06 14:56:03 +08:00
Jianbo Sun
9a6523cade Merge pull request #523 from wonderflow/replica
don't specify replica in template
2020-11-06 14:44:48 +08:00
linjie.miao
e52d173d57 SyncCapabilityFromCenter This function is
called one more time.
2020-11-06 14:43:51 +08:00
天元
9a27c604b1 don't specify replica in template
Signed-off-by: 天元 <jianbo.sjb@alibaba-inc.com>
2020-11-06 14:30:17 +08:00
Jianbo Sun
d91c5b9bfe Merge pull request #520 from wonderflow/fixrace
fix datarace for map
2020-11-06 13:50:13 +08:00
天元
b7cdedd0cb fix datarace for map, fix #444 2020-11-06 13:22:00 +08:00
Jianbo Sun
1c67b6ea16 Merge pull request #519 from wonderflow/removename
don't specify name for workload object in component
2020-11-06 13:21:34 +08:00
天元
630e27f762 don't add name for workload object 2020-11-06 13:05:40 +08:00
Lei Zhang (Harry)
35ae4109bc Merge pull request #516 from resouer/concepts
Add concepts doc to kubevela
2020-11-05 21:02:45 -08:00
Harry Zhang
81df4e23af Add concepts doc to kubevela 2020-11-05 20:50:21 -08:00
Jianbo Sun
1e6c3d66c5 Merge pull request #515 from Fei-Guo/master
Some corrections for QuickStart.md
2020-11-06 09:58:09 +08:00
Hongchao Deng
86f05cf47a minor update (#514)
the copy-paste friendly thing could be handled on website.
2020-11-05 12:09:51 -08:00
Guo, Fei
f02982b6a1 Some corrections for QuickStart.md 2020-11-05 12:07:07 -08:00
Jianbo Sun
5ca9aa4ed2 Merge pull request #513 from silotrd/master
The return value of `vela ls` must contain the TYPE and TRAITS fields.
2020-11-05 18:18:00 +08:00
linjie.miao
2b47a934d3 The return value of vela ls must contain the TYPE and TRAITS fields. 2020-11-05 15:39:37 +08:00
Jianbo Sun
1736efb33c Merge pull request #512 from hongchaodeng/doc
minor update on extending vela
2020-11-05 13:49:21 +08:00
Hongchao Deng
3dcd861d0c minor update on extending vela
Signed-off-by: Hongchao Deng <hongchaodeng1@gmail.com>
2020-11-04 20:43:34 -08:00
Hongchao Deng
1809b47bb9 doc: add extending vela (#511)
* doc: add extending vela

- also rename in `system update` name -> type, type -> category

Signed-off-by: Hongchao Deng <hongchaodeng1@gmail.com>

* github action: fixed ubuntu version

Signed-off-by: Hongchao Deng <hongchaodeng1@gmail.com>

* update
2020-11-05 10:09:29 +08:00
Jianbo Sun
d621cc34b6 Merge pull request #505 from captainroy-hy/combine-sys-update
update local caps before listing workloads&traits
2020-11-05 07:48:18 +08:00
roy wang
24c7f23e8a update local caps before listing workloads&traits
refine output of `vela system update`

add e2e-test

Signed-off-by: roy wang <seiwy2010@gmail.com>
2020-11-05 01:40:03 +09:00
Hongchao Deng
6efb68f51f Merge pull request #506 from silotrd/master
Logs need to be printed in real time when vela executes docker command
2020-11-04 07:39:42 -08:00
Jianbo Sun
2121fa6cc1 Merge pull request #500 from zzxwill/docs-scale
Add Autoscaler docs and support cli and appfile
2020-11-04 14:32:20 +08:00
Jianbo Sun
f19d8be2f6 Merge pull request #509 from hongchaodeng/e2e
skip capability e2e due to rate limit
2020-11-04 14:30:56 +08:00
Hongchao Deng
ce286701a2 Merge pull request #508 from hongchaodeng/doc-extend
Update CLI printout in various docs
2020-11-03 21:46:39 -08:00
Hongchao Deng
6b4325eebc skip capability e2e due to rate limit
plan to change e2e into a mock UT to avoid remote call.

Signed-off-by: Hongchao Deng <hongchaodeng1@gmail.com>
2020-11-03 21:37:35 -08:00
Hongchao Deng
6ca3381882 update kubecon demo 2020-11-03 21:30:17 -08:00
Hongchao Deng
6ec5799ce4 update cli printout 2020-11-03 21:21:27 -08:00
Hongchao Deng
8b028fff31 Merge pull request #507 from Fei-Guo/master
Some revisions for the printed out messages
2020-11-03 21:11:15 -08:00
Guo, Fei
08c784506e fix a nit 2020-11-03 20:50:21 -08:00
Guo, Fei
e6b5e11311 Clean up for printed messages 2020-11-03 20:48:11 -08:00
linjie.miao
5c7f37f034 When executing commands such as docker build/push, logs are
required to be printed to the console in real time.
2020-11-04 11:57:46 +08:00
zzxwill
81d40a2f51 Wrongly rebased newly merged requests from comments, fixed it.
co-authored-by: 天元 <jianbo.sjb@alibaba-inc.com>
2020-11-04 11:39:05 +08:00
Hongchao Deng
27621463fd Merge pull request #504 from hongchaodeng/doc
doc: add app init, config, and capability references
2020-11-03 19:35:59 -08:00
Hongchao Deng
e20b6c9bf4 doc: add app init, config, and capability references
additionally:

- change backend workload type to worker
- add cue format script

Signed-off-by: Hongchao Deng <hongchaodeng1@gmail.com>
2020-11-03 19:25:41 -08:00
Jianbo Sun
2c7391f2d0 Merge pull request #502 from wonderflow/metrics
start promethus instance on installation
2020-11-03 16:37:20 +08:00
天元
5066320a2f start promethus instance on installation
Signed-off-by: 天元 <jianbo.sjb@alibaba-inc.com>
2020-11-03 16:15:46 +08:00
Lei Zhang (Harry)
31bc537b5d Merge pull request #501 from Fei-Guo/master
Fix some small nits for introduction
2020-11-02 21:26:20 -08:00
Guo, Fei
b2750906fa Fix some small nits for introduction 2020-11-02 21:07:43 -08:00
zzxwill
d082502406 Add Autoscaler docs and support cli and appfile
added Autoscaler docs and add spec.extension.template
for cli and appfile
2020-11-03 12:02:23 +08:00
Jianbo Sun
0afddf945a Merge pull request #487 from resouer/followup
Follow up introduction doc
2020-11-03 11:13:24 +08:00
Harry Zhang
104c33403e Follow up introduction doc 2020-11-02 18:54:34 -08:00
Hongchao Deng
3097a46a04 Merge pull request #493 from wonderflow/metrics
fix metric capability and add tutroial
2020-11-02 08:27:35 -08:00
Jianbo Sun
526712d56c Merge pull request #498 from FillZpp/fix-defer-in-main
Fix invalid defer in waitWebhookSecretVolume
2020-11-02 21:06:52 +08:00
Siyu Wang
2cfa7b7ec7 Fix invalid defer in waitWebhookSecretVolume
Signed-off-by: Siyu Wang <FillZpp.pub@gmail.com>
2020-11-02 20:13:30 +08:00
天元
26b6327919 fix metric capability and add tutroial
Signed-off-by: 天元 <jianbo.sjb@alibaba-inc.com>
2020-11-02 15:50:20 +08:00
Hongchao Deng
0168f5fdda Merge pull request #496 from hongchaodeng/doc-init
doc for quick start, exec/logs/port-forward; add render-only to init cmd
2020-11-01 23:46:12 -08:00
Hongchao Deng
c02e3a7b54 doc: add quickstart, exec/logs/portforward 2020-11-01 23:34:12 -08:00
Hongchao Deng
7cfc80cd41 add render-only to ini cmd and ignore route if domain is empty 2020-11-01 23:34:12 -08:00
Jianbo Sun
e043e6b764 Merge pull request #497 from zzxwill/doc-vela-status-show
Add unit-test for `vela up`
2020-11-02 14:45:05 +08:00
zzxwill
33ed0a9a20 Add unit-test for vela up
During to decrease of code coverage, added unit-test
for `vela up`
2020-11-02 14:24:38 +08:00
Jianbo Sun
7d021d6e89 Merge pull request #495 from zzxwill/doc-vela-status-show
Update `vela show/status` related docs
2020-11-02 13:07:07 +08:00
zzxwill
f77999e8dc Update related vela show/status docs
updated related `vela show/status` docs, also update
`vela ls/delete` related documentation
2020-11-02 11:49:48 +08:00
Hongchao Deng
6fb615be73 Merge pull request #445 from szihai/master
Add Kubecon demo page
2020-11-01 19:10:47 -08:00
Zheng Xi Zhou
5f34351706 Merge pull request #480 from zzxwill/app-status
Refactor "vela status"
2020-11-02 09:57:21 +08:00
szihai
b6be560ad0 use webservice based on podspecworkload 2020-11-01 13:06:36 -08:00
szihai
371cfa3a57 add webservice template 2020-11-01 09:44:09 -08:00
zzxwill
435ac44cbf fix issue 'ineffectual assignment to err' 2020-11-01 21:09:37 +08:00
zzxwill
c212ac93ff revert modification for make manifests 2020-11-01 16:25:18 +08:00
zzxwill
865c52e883 Refactor "vela status"
merged `vela app status` and `vela svc status`
to `vela status`.
To fix #474
2020-11-01 16:25:17 +08:00
Zheng Xi Zhou
e58d705a8b Merge pull request #478 from zzxwill/app-show
Refactor `vela show`
2020-11-01 11:44:04 +08:00
zzxwill
0a3b3ffdb1 address Wonderflow's offline advice 2020-11-01 10:02:49 +08:00
Jianbo Sun
a4be8bbbe1 Merge pull request #490 from hongchaodeng/doc-fix
fix installation link and minor update on intro
2020-11-01 09:00:21 +08:00
Hongchao Deng
27bb0f8844 fix installation link
Signed-off-by: Hongchao Deng <hongchaodeng1@gmail.com>
2020-10-31 15:30:18 -07:00
Ryan Zhang
7e5e2de263 Merge pull request #489 from zzxwill/null-yaml
Fix `charts/vela-core/crds/_.yaml` generation issue
2020-10-31 14:47:46 +08:00
zzxwill
cc93367b22 Fix charts/vela-core/crds/_.yaml generation issue
Fixed the issue of `charts/vela-core/crds/_.yaml` generation
by removing unkonwn struct in pkg/commands/show.go.
2020-10-31 13:43:10 +08:00
Hongchao Deng
9c5c3f879f Merge pull request #488 from hongchaodeng/ing
remove ingress from velaConfig and add it in install.md
2020-10-30 22:36:39 -07:00
Hongchao Deng
5bda371861 remove ingress from velaConfig and add it in install.md
Signed-off-by: Hongchao Deng <hongchaodeng1@gmail.com>
2020-10-30 22:22:57 -07:00
Jianbo Sun
94aa38640a Merge pull request #485 from hongchaodeng/fixing
fix check route status when using local kind
2020-10-31 13:07:48 +08:00
Hongchao Deng
d44832aa01 Merge pull request #486 from hongchaodeng/fix-scale
update manualscale cue template and appfile guide
2020-10-30 21:52:38 -07:00
Hongchao Deng
8b3c2104bc update manualscale cue to set default replica 1 and update appfile example to exclude scaler trait 2020-10-30 21:14:53 -07:00
Hongchao Deng
d003a6652d fix check route status when using local kind 2020-10-30 20:56:37 -07:00
zzxwill
6ffee730ec Update cli docs 2020-10-31 11:52:12 +08:00
zzxwill
838995e816 Refactor vela show
Merge `vela app show` and `vela svc show` in `vela show`
to display all details information of an application
2020-10-31 11:52:12 +08:00
Jianbo Sun
c51f4d5074 Merge pull request #484 from hongchaodeng/doc-exec
doc: separate appfile chapter into a few sections to gradually add traits, workloads
2020-10-31 10:33:16 +08:00
Jianbo Sun
c8fc39370e Merge pull request #483 from hongchaodeng/fix-ing
fix ingress rewrite-target
2020-10-31 10:22:54 +08:00
Hongchao Deng
9c2b75d9af update
Signed-off-by: Hongchao Deng <hongchaodeng1@gmail.com>
2020-10-30 19:07:00 -07:00
Hongchao Deng
9be4316256 doc: separate appfile chapter into a few sections to gradually add traits, workloads
Signed-off-by: Hongchao Deng <hongchaodeng1@gmail.com>
2020-10-30 19:07:00 -07:00
Hongchao Deng
854e88f385 fix ingress rewrite-target 2020-10-30 17:20:02 -07:00
Lei Zhang (Harry)
085151cf1f Merge pull request #477 from Fei-Guo/master
Revise introduction.md
2020-10-30 15:10:09 -07:00
szihai
0381b0fb95 updated crossplane charts, README, and db workload template 2020-10-30 14:51:46 -07:00
Guo, Fei
bb3111d68d Change Kubevela to KubeVela 2020-10-30 14:49:40 -07:00
Guo, Fei
cf19fed17f Revise based on review comments 2020-10-30 14:37:39 -07:00
Hongchao Deng
f94d2128d9 Merge pull request #481 from zzxwill/cli-description
Refine some minor Cli description
2020-10-30 11:10:18 -07:00
Hongchao Deng
2632617e70 Merge pull request #482 from silotrd/master
[Feature #443] should report capability not exist instead of file not found
2020-10-30 11:07:58 -07:00
root
f4f0d92a74 [Feature #443] should report capability not exist instead of file not found #433 2020-10-30 16:56:37 +00:00
zzxwill
85aa774dd4 Refine some Cli description
Refined some description and adjust cli order in `-h`
2020-10-30 23:28:02 +08:00
Hongchao Deng
aea6fd4589 Merge pull request #476 from hongchaodeng/doc-appfile
Add appfile tutorial and fix code
2020-10-30 00:19:39 -07:00
Hongchao Deng
629ceee307 fix
Signed-off-by: Hongchao Deng <hongchaodeng1@gmail.com>
2020-10-30 00:08:15 -07:00
Guo, Fei
deb73c34fa Format change 2020-10-29 23:22:52 -07:00
Guo, Fei
54ac8eb6c2 revise introduction 2020-10-29 23:06:37 -07:00
Hongchao Deng
2451236791 update install guide 2020-10-29 22:41:31 -07:00
Hongchao Deng
8fdf48eac1 Add appfile tutorial and fix code
includes:
- fix up command to save appfile to env dir
- update cue template to include cmd and config
- move design to doc/design
2020-10-29 22:41:07 -07:00
Jianbo Sun
5cc97bc2c0 Merge pull request #475 from wonderflow/newroute
merge vela app/svc delete to vela delete
2020-10-30 11:58:45 +08:00
天元
f016ada842 merge vela app/svc delete to vela delete
Signed-off-by: 天元 <jianbo.sjb@alibaba-inc.com>
2020-10-30 11:42:27 +08:00
Zhe Jiang
24ef896142 Spelling mistakes (#471)
* Spelling mistakes

* Update docs/install.md

Co-authored-by: Jianbo Sun <wonderflow.sun@gmail.com>
2020-10-30 09:56:45 +08:00
Lei Zhang (Harry)
488cc9d545 Merge pull request #469 from resouer/docs
Rename owners file and update design doc
2020-10-29 15:48:06 -07:00
Harry Zhang
f0fe340d7d Update design doc to reflect recent idea 2020-10-29 15:21:35 -07:00
Lei Zhang (Harry)
c87594ad04 Merge pull request #472 from hongchaodeng/doc
fix and clean up charts
2020-10-29 15:03:25 -07:00
Hongchao Deng
391a1e5e89 add codecov.yml
disable patch status
2020-10-29 14:35:55 -07:00
Hongchao Deng
72d0284454 install.md: update clean CRD section 2020-10-29 14:17:38 -07:00
Hongchao Deng
0ef3d8650b fix and clean up charts
currently the charts has following issues:
- cert-manager has manifests in multiple places. Should be combined into one.
  Prefer pure yaml since its helm chart requires `--set installCRDs=true` flag and uninstalling CRD via helm is inconvient.
- The bootstrap of vela-core will setup metrics controller. This requires Prometheus Operator CRD. Move related CRD to vela-core chart.
- move prometheus to vela-system namespace. Remove monitoring namespace.
- remove grafana. It's already a dependency of prometheus chart.
- change default image pull policy to IfNotPresent. Should not be Always.

Signed-off-by: Hongchao Deng <hongchaodeng1@gmail.com>
2020-10-29 13:56:33 -07:00
Jianbo Sun
7150d71716 Merge pull request #450 from wonderflow/newroute
add route tuturiol
2020-10-29 17:59:35 +08:00
天元
091b70deba add route tuturiol
Signed-off-by: 天元 <jianbo.sjb@alibaba-inc.com>
2020-10-29 17:36:51 +08:00
Jianbo Sun
8e0641baca Merge pull request #470 from captainroy-hy/vela-portforward
vela port-forward
2020-10-29 15:34:29 +08:00
Hongchao Deng
4426133c43 Fix vela install to include all dependencies (#467)
* Fix vela install to include all dependencies

rewrite server dependency component install:

- Don't rely on crd name. Continue installing all charts.
- Rewrite signal handler to uninstall dependencies before exiting.

Signed-off-by: Hongchao Deng <hongchaodeng1@gmail.com>

* fix

Signed-off-by: Hongchao Deng <hongchaodeng1@gmail.com>
2020-10-29 15:24:02 +08:00
roy wang
32daa8f280 vela port-forward
add unit test and e2e test
refresh cli doc of vela port-forward

Signed-off-by: roy wang <seiwy2010@gmail.com>
2020-10-29 16:21:33 +09:00
Harry Zhang
0f85f9763d Rename owners file 2020-10-28 15:00:07 -07:00
Lei Zhang (Harry)
1c3f7f925e Merge pull request #452 from resouer/dev
Add onwers file and fix typo
2020-10-28 14:58:20 -07:00
Harry Zhang
aae80847a1 Add onwers file and fix typo 2020-10-28 14:30:50 -07:00
Lei Zhang (Harry)
4d30423d55 Add introducation doc (#459) 2020-10-28 11:45:43 -07:00
Jianbo Sun
e9b4257107 Merge pull request #456 from captainroy-hy/refresh-cli-docs
refresh cli docs
2020-10-28 13:29:49 +08:00
Hongchao Deng
b52fc92e93 change podspec workload to deployment in built-in templates (#458)
* change podspec workload to deployment in built-in templates

* fix

Signed-off-by: Hongchao Deng <hongchaodeng1@gmail.com>
2020-10-28 13:28:27 +08:00
roy wang
1522280e50 refresh cli docs
Signed-off-by: roy wang <seiwy2010@gmail.com>
2020-10-28 14:16:19 +09:00
Hongchao Deng
5f4a55f594 Merge pull request #457 from hongchaodeng/kind
e2e: delete kind cluster at the end
2020-10-27 21:10:09 -07:00
Hongchao Deng
42115e7774 e2e: delete kind cluster in setup
Signed-off-by: Hongchao Deng <hongchaodeng1@gmail.com>
2020-10-27 20:55:50 -07:00
Jianbo Sun
137b56cb03 Merge pull request #455 from hongchaodeng/runner
setup and use self hosted runner
2020-10-28 10:00:10 +08:00
Jianbo Sun
c25a22a17d Merge pull request #449 from captainroy-hy/term-service
change term "component" to "service" in commands
2020-10-28 09:51:11 +08:00
Hongchao Deng
cf22e96b37 Merge pull request #454 from resouer/roadmap
Add roadmap doc and update extending doc
2020-10-27 18:30:40 -07:00
Hongchao Deng
82f5ee0bd3 setup and use self hosted runner 2020-10-27 15:49:43 -07:00
Harry Zhang
e827da2db2 Add roadmap doc and update extending doc 2020-10-27 14:36:18 -07:00
szihai
ac4b948a4e Merge branch 'master' of https://github.com/szihai/kubevela 2020-10-27 10:40:37 -07:00
szihai
782664696f move to /example folder 2020-10-27 10:38:31 -07:00
roy wang
69944f9dad change term "component" to "service" in commands
Signed-off-by: roy wang <seiwy2010@gmail.com>
2020-10-27 19:31:24 +09:00
Jianbo Sun
5dd91add89 Merge pull request #447 from wonderflow/fixdoc
fix doc gen path
2020-10-27 17:06:21 +08:00
Jianbo Sun
d2452ad8ef Merge pull request #446 from wonderflow/oam-runtime
upgrade oam-k8s-runtime dependency
2020-10-27 17:06:01 +08:00
Hongchao Deng
b8cb0565a8 Merge pull request #439 from hongchaodeng/template
update templates
2020-10-27 02:00:46 -07:00
Hongchao Deng
ac9a2a2b81 fix e2e
Signed-off-by: Hongchao Deng <hongchaodeng1@gmail.com>
2020-10-27 01:38:10 -07:00
天元
4d4ea8f3c4 fix doc gen path 2020-10-27 15:48:44 +08:00
天元
4c70136ba1 upgrade oam-k8s-runtime dependency 2020-10-27 15:32:42 +08:00
Hongchao Deng
f962dc0f11 fix ut 2020-10-26 23:38:11 -07:00
Hongchao Deng
95823cdcdb fix 2020-10-26 23:19:59 -07:00
Hongchao Deng
182805c9ca move and remove extra parameter def
Signed-off-by: Hongchao Deng <hongchaodeng1@gmail.com>
2020-10-26 23:14:48 -07:00
Jianbo Sun
1c1508b0c3 Merge branch 'master' into master 2020-10-27 13:52:11 +08:00
Hongchao Deng
cba72cb6e6 fix e2e
Signed-off-by: Hongchao Deng <hongchaodeng1@gmail.com>
2020-10-26 21:52:18 -07:00
Hongchao Deng
cff6a74430 capability: use def name as name
Signed-off-by: Hongchao Deng <hongchaodeng1@gmail.com>
2020-10-26 20:51:16 -07:00
Hongchao Deng
e9186fa8eb fix plugin test 2020-10-26 20:51:16 -07:00
Hongchao Deng
3d17464c44 fix trait definition
Signed-off-by: Hongchao Deng <hongchaodeng1@gmail.com>
2020-10-26 20:51:16 -07:00
Hongchao Deng
eed2e2f219 fix
Signed-off-by: Hongchao Deng <hongchaodeng1@gmail.com>
2020-10-26 20:51:16 -07:00
Hongchao Deng
16d3cbd5a4 add readme 2020-10-26 20:51:16 -07:00
Hongchao Deng
80cf81e4d5 update templates
Signed-off-by: Hongchao Deng <hongchaodeng1@gmail.com>
2020-10-26 20:51:16 -07:00
szihai
f92cdcefe4 polish for pr 2020-10-26 20:10:36 -07:00
Jianbo Sun
ea836ee2eb Merge pull request #438 from wonderflow/scale
Implement Autoscaler Trait
2020-10-27 10:45:00 +08:00
天元
0990e6fa64 fix autoscaler
Signed-off-by: 天元 <jianbo.sjb@alibaba-inc.com>
2020-10-27 10:19:26 +08:00
Lei Zhang (Harry)
2b0759bcff Minor fix on doc framework (#442) 2020-10-26 16:31:38 -07:00
Lei Zhang (Harry)
d425ded75c Merge pull request #440 from resouer/init-doc
Bootstrap docs for kubevela
2020-10-26 15:02:00 -07:00
Harry Zhang
ec5b45a428 Init docs for kubevela
Move non user facint things into e2e
2020-10-26 14:34:22 -07:00
szihai
2e71e21991 add route 2020-10-26 01:45:11 -07:00
Jianbo Sun
24a92c9cbc Merge pull request #437 from captainroy-hy/app-centric
refact cmds from comp-centric into app-centric style
2020-10-26 15:29:35 +08:00
roy wang
410eb2be2b refact cmds from comp-centric into app-centric style
Signed-off-by: roy wang <seiwy2010@gmail.com>
2020-10-26 15:05:37 +09:00
zzxwill
fecf1a710d Implement Autoscaler Trait
Support Cron type and resource usages (cpu) type
scalling

integrate with OAM by getting child deployment resource via OAM util library

support scaling PodSpecWorkload

support deployment scaling

remove unnecessary comment

support KEDA cron + resource metrics with Keda context

fix ownerreference issue

reorg imports

address part of commemts and refactor code

revert ownerRef settings as somehome leaving spec.replicas doesn't work
2020-10-26 13:39:31 +08:00
szihai
75a7ad4139 formatting 2020-10-25 22:10:53 -07:00
szihai
e874f68f39 formatting 2020-10-25 22:09:59 -07:00
szihai
4bd850853f add sections 2020-10-25 22:00:22 -07:00
Jianbo Sun
fe5f4b1680 Merge pull request #434 from ryanzhang-oss/add-scale
Add Flagger OAM integration example README
2020-10-26 12:33:56 +08:00
Jianbo Sun
297131d23d Merge pull request #435 from captainroy-hy/cap-template-URI
fix getting CUE template from remote
2020-10-26 12:33:04 +08:00
Jianbo Sun
6cf7a30dd4 Merge pull request #436 from hongchaodeng/master
make default appfile as vela.yaml
2020-10-26 12:31:56 +08:00
Jianbo Sun
755e134b87 Merge pull request #428 from captainroy-hy/vela-exec
vela exec
2020-10-26 11:40:27 +08:00
Hongchao Deng
192f435cfc make default appfile as vela.yaml 2020-10-25 19:34:28 -07:00
szihai
c5baa3ea19 update workload type 2020-10-25 19:32:38 -07:00
szihai
45f4e7d575 change db port 2020-10-25 11:09:48 -07:00
Ryan Zhang
64da6af3dc add podSpec test 2020-10-25 22:53:06 +08:00
roy wang
879427176d fix getting CUE template through URI
fix e2e-test

Signed-off-by: roy wang <seiwy2010@gmail.com>
2020-10-25 23:42:32 +09:00
szihai
0962a6f776 add vela.yml 2020-10-25 01:42:50 -07:00
szihai
11d8f63e63 fix typo 2020-10-25 01:21:23 -07:00
szihai
f3e17ef90a fix typo 2020-10-25 00:38:28 -07:00
szihai
fbca8aab49 fix comp names for lab 2020-10-25 00:26:56 -07:00
szihai
770ecb3848 corrects to steps 2020-10-24 23:24:35 -07:00
roy wang
be6122edc3 vela exec
Signed-off-by: roy wang <seiwy2010@gmail.com>

add unit test

Signed-off-by: roy wang <seiwy2010@gmail.com>
2020-10-25 14:56:37 +09:00
szihai
26ca8b85da working template 2020-10-24 10:59:11 -07:00
szihai
791578ee0c modify readme 2020-10-24 10:51:46 -07:00
Ryan Zhang
109e807d17 add flagger rollout example README 2020-10-24 19:26:27 +08:00
Ryan Zhang
d3466a0c4a document 2020-10-24 17:14:07 +08:00
szihai
c810e9494c add demo scripts 2020-10-24 00:18:05 -07:00
Hongchao Deng
037f14806a Merge pull request #431 from hongchaodeng/configcmd
vela config command
2020-10-23 20:09:02 -07:00
Hongchao Deng
941f5a973a add unit test for config cmd 2020-10-23 19:50:07 -07:00
Hongchao Deng
b11ccee60d add unit test for config in appfile
Signed-off-by: Hongchao Deng <hongchaodeng1@gmail.com>
2020-10-23 19:28:50 -07:00
Hongchao Deng
1b82e3ae2a vela config command
Signed-off-by: Hongchao Deng <hongchaodeng1@gmail.com>
2020-10-23 13:49:10 -07:00
Hongchao Deng
da05d71014 Merge pull request #429 from hongchaodeng/fix-image
remove image constraint
2020-10-23 13:43:52 -07:00
Hongchao Deng
f2825f2181 remove image constraint
Signed-off-by: Hongchao Deng <hongchaodeng1@gmail.com>
2020-10-23 13:14:14 -07:00
Hongchao Deng
125a0ce081 Merge pull request #426 from hongchaodeng/configcmd
fix naming
2020-10-22 20:03:46 -07:00
Hongchao Deng
c4a8d31073 fix naming 2020-10-22 17:05:30 -07:00
Jianbo Sun
e286862c59 Merge pull request #422 from mosesyou/feature-up-file
add support for `vela up` specify file path
2020-10-22 23:09:35 +08:00
mosesyou
faaaf5fd59 add support for vela up specify file path 2020-10-22 14:35:41 +08:00
Jianbo Sun
cbc8a90152 Merge pull request #423 from wonderflow/fix
fix label not int
2020-10-22 13:20:00 +08:00
天元
3082b7b9dd fix label not int 2020-10-22 12:22:50 +08:00
Hongchao Deng
6675b8a806 Merge pull request #421 from hongchaodeng/master
fix codecov
2020-10-21 18:49:51 -07:00
Hongchao Deng
8b0764e170 fix codecov
Signed-off-by: Hongchao Deng <hongchaodeng1@gmail.com>
2020-10-21 17:15:13 -07:00
425 changed files with 15976 additions and 5644 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,18 +5,15 @@ on:
branches: [master]
pull_request:
branches: [master]
paths-ignore:
- 'docs/**'
- '**.md'
jobs:
build:
name: Build
runs-on: ubuntu-latest
name: e2e-tests
runs-on: aliyun
steps:
- name: Set up Go 1.13
uses: actions/setup-go@v1
with:
go-version: 1.13
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v2
@@ -24,22 +21,22 @@ jobs:
run: |
go get -v -t -d ./...
- name: Install ginkgo
run: |
sudo apt-get update
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"
skipClusterCreation: true
- name: Setup Kind Cluster
run: |
kind delete cluster
kind create cluster
kubectl version
kubectl cluster-info
- name: Load Image to kind cluster
run: make kind-load
- name: install Kubebuilder
uses: RyanSiu1995/kubebuilder-action@v1
- name: Run Make
run: make
@@ -48,7 +45,7 @@ jobs:
- name: Run e2e tests
run: |
make e2e-cleanup
make e2e-setup
make e2e-test
make e2e-api-test
make e2e-cleanup

View File

@@ -5,16 +5,19 @@ on:
branches: [master]
pull_request:
branches: [master]
paths-ignore:
- 'docs/**'
- '**.md'
jobs:
build:
name: Build
runs-on: ubuntu-latest
name: unit-tests
runs-on: ubuntu-20.04
steps:
- name: Set up Go 1.13
- name: Set up Go 1.14
uses: actions/setup-go@v1
with:
go-version: 1.13
go-version: 1.14
id: go
- name: Check out code into the Go module directory
@@ -22,16 +25,15 @@ jobs:
- name: Install ginkgo
run: |
sudo apt-get update
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

@@ -13,10 +13,10 @@ jobs:
VELA_VERSION: ${{ github.ref }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Set up Go 1.13
- name: Set up Go 1.14
uses: actions/setup-go@v1
with:
go-version: 1.13
go-version: 1.14
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v2

1
.gitignore vendored
View File

@@ -39,6 +39,7 @@ tmp/
cmd/vela/fake/source.go
cmd/vela/fake/chart_source.go
charts/vela-core/crds/_.yaml
.test_vela
.vela/

View File

@@ -1,5 +1,9 @@
# CONTRIBUTING
## About KubeVela
KubeVela project is initialized and maintained by the cloud native community since day 0 with [bootstrapping contributors from 8+ different organizations](https://github.com/oam-dev/kubevela/graphs/contributors). We intend for KubeVela to have a open governance since the very beginning and donate the project to neutral foundation as soon as it's released.
This doc explains how to set up a development environment, so you can get started
contributing to `kubevela` or build a PoC (Proof of Concept).
@@ -10,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
@@ -70,43 +76,60 @@ vela env init myenv --namespace myenv --email my@email.com --domain kubevela.io
For example, use the following command to create and run an application.
```shell script
$ vela comp deploy mycomp -t webservice --image crccheck/hello-world --port 8000
Creating AppConfig appcomp
SUCCEED
$ vela svc deploy mysvc -t webservice --image crccheck/hello-world --port 8000 -a abc
App abc deployed
```
* Add Trait
```shell script
$ vela route mycomp
Adding route for app abc
Succeeded!
$ vela route abc
Adding route for app mysvc
⠋ Deploying ...
✅ Application Deployed Successfully!
- Name: mysvc
Type: webservice
HEALTHY Ready: 1/1
Last Deployment:
Created at: 2020-11-02 11:17:28 +0800 CST
Updated at: 2020-11-02T11:21:23+08:00
Routes:
- route: Visiting URL: http://abc.kubevela.io IP: 47.242.68.137
```
* Check Status
```
$ vela comp status abc
Showing status of Component abc deployed in Environment t2
Component Status:
Name: abc PodSpecWorkload(type) UNKNOWN APIVersion standard.oam.dev/v1alpha1 Kind PodSpecWorkload workload is unknown for HealthScope
Traits
└─Trait/route
Last Deployment:
Created at: 2020-09-18 18:47:09 +0800 CST
Updated at: 2020-09-18T18:47:16+08:00
$ vela status abc
About:
Name: abc
Namespace: default
Created at: 2020-11-02 11:17:28.067738 +0800 CST
Updated at: 2020-11-02 11:28:13.490986 +0800 CST
Services:
- Name: mysvc
Type: webservice
HEALTHY Ready: 1/1
Last Deployment:
Created at: 2020-11-02 11:17:28 +0800 CST
Updated at: 2020-11-02T11:28:13+08:00
Routes:
- route: Visiting URL: http://abc.kubevela.io IP: 47.242.68.137
```
* Delete App
```shell script
$ vela app ls
abc
$ vela ls
SERVICE APP TYPE TRAITS STATUS CREATED-TIME
mysvc abc Deployed 2020-11-02 11:17:28 +0800 CST
$ vela app delete abc
Deleting Application "abc"
delete apps succeed abc from t2
$ vela delete abc
Deleting Application "abc"
delete apps succeed abc from default
```
## Tests
@@ -119,7 +142,7 @@ make test
### E2E test
** Before e2e test start, make sure you have vela-core running.**
**Before e2e test start, make sure you have vela-core running.**
```shell script
make core-run

192
DESIGN.md
View File

@@ -1,192 +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 and Open Application Model (OAM). KubeVela intends to bring application-centric experience to its 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 my 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 my 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 ships 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. It allows platform builders to ship any existing capabilities in cloud native 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 design 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. Can model operations as part of the application (i.e. `Trait`).
2. 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 as the extensible "PaaS core", 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
We decide to build KubeVela core with [OAM Kubernetes runtime](https://github.com/crossplane/oam-kubernetes-runtime) which already implemented the building block features such as standalone workload type and trait controllers. Whether a given trait could work with certain workload types is also clarified as `appliesTo` field of trait definition. For platform builders, OAM Kubernetes Runtime also provided a [lightweight library](https://github.com/crossplane/oam-kubernetes-runtime/blob/2be3900a3817aed570de9ec353e6ab0b50e100f0/pkg/controller/v1alpha2/core/traits/manualscalertrait/manualscalertrait_controller.go#L42) to implement trait controller so it doesn't need to care about workload kinds.
##### 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 also adopts Kubernetes API resource model. So in nutshell, **ALL** functionalities of KubeVela core are able to be consumed 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
```
However, Kubernetes API should not be the end game. Declarative YAML objects are great to build platforms like KubeVela with but when directly exposed to end users, it creates heavy mental burden and high learning curve. For example, even with highest level abstraction, the default [containerized workload schema](https://github.com/oam-dev/spec/blob/master/core/workloads/schema/containerized_workload.md) of OAM still has dozens fields to learn with many rough edges to be aware.
Thus KubeVela intends to introduce a lightweight user facing layer on top of its Kubernetes API objects 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 above requirements of the user interface layer as introducing a modeling language on top of the existing model objects. With this context, we decide to adopt [CUElang](https://github.com/cuelang/cue) as the modeling language of KubeVela. In detail, every workload or trait definition will inline a cue template as the contract between user and Kubernetes API object.
However, we don't assume users need to learn or write CUElang directly. Instead, the reason we choose CUElang is it's just perfect to help us create developer facing tools based on it. Thus, KubeVela introduced three most common tools based to CUElang for developers to use:
1. A command line tool.
2. A GUI dashboard.
3. A Docker Compose style `appfile`.
An example for `vela cli`:
```console
$ vela comp 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 so we can support more complex and serious scenarios by simply running `$ vela up hello-world.yaml`:
```yaml
version: "1.0-alpha.1"
name: helloworld
services:
express-server:
type: webservice # workload type
build:
docker:
file: Dockerfile
context: .
image: oamdev/testapp:v1
cmd: ["node", "server.js"]
ports:
- 8080:80
env:
- FOO=bar
scale: # scaling trait
replica: 2
auto:
range: "1-10"
cpu: 80
qps: 1000
canary: # canary trait
step: 5
headers:
- "foo:bar.*"
redis:
image: oamdev/redis
secrets:
my-secret: /local-path/my-secret # load local file into k8s secret
```
The schema of above `appfile` is not hard coded, they are defined by in-line CUE templates of `WebService` workload definition, `Scaling` trait definition and `Canary` trait definition.
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 to provide developer facing abstractions by leveraging CUElang based parametering and templating.
### 2. KubeVela core
Including:
- [OAM Kubernetes runtime](https://github.com/crossplane/oam-kubernetes-runtime) to provide application level 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 implement 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,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))
@@ -20,8 +20,8 @@ endif
all: build
# Run tests
test: fmt vet lint
./hack/unit_test.sh
test: vet lint
go test -race -coverprofile=coverage.txt -covermode=atomic ./pkg/... ./cmd/...
# Build manager binary
build: fmt vet lint
@@ -29,14 +29,17 @@ build: fmt vet lint
go build -o bin/vela -ldflags ${LDFLAGS} cmd/vela/main.go
git checkout cmd/vela/fake/chart_source.go
vela-cli:
go build -o bin/vela -ldflags ${LDFLAGS} cmd/vela/main.go
npm-build:
cd dashboard && npm run build && cd ./..
npm-install:
cd dashboard && npm install && cd ./..
generate-doc:
rm -r documentation/cli/*
doc-gen:
rm -r docs/en/cli/*
go run hack/docgen/gen.go
generate-source:
@@ -61,8 +64,10 @@ 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
vet:
@@ -88,7 +93,7 @@ e2e-setup:
e2e-test:
# Run e2e test
ginkgo -v -skipPackage setup,apiserver -r e2e
ginkgo -v -skipPackage capability,setup,apiserver -r e2e
e2e-api-test:
# Run e2e test
@@ -96,6 +101,7 @@ e2e-api-test:
e2e-cleanup:
# Clean up
rm -rf ~/.vela
# load docker image to the kind cluster
kind-load:
@@ -121,20 +127,24 @@ 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/
kubectl apply -f charts/third_party/prometheus
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
kubectl delete -f charts/vela-core/crds/
kubectl delete -f charts/vela-core/templates/definitions/
kubectl delete -f charts/third_party/prometheus
kubectl delete -f charts/vela-core/templates/defwithtemplate/
kubectl delete -f charts/vela-core/crds/
# 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
rm charts/vela-core/crds/_.yaml
go generate $(foreach t,pkg api,./$(t)/...)
./hack/vela-templates/gen_definitions.sh
# Generate code
generate: controller-gen
@@ -176,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

9
OWNERS Normal file
View File

@@ -0,0 +1,9 @@
approvers:
- kubevela-controller
- kubevela-devex
reviewers:
- kubevela-controller
- kubevela-dashboard
- oam-k8s-runtime
- oam-spec

49
OWNERS_ALIASES Normal file
View File

@@ -0,0 +1,49 @@
aliases:
kubevela-devex:
- hongchaodeng
- wonderflow
kubevela-dashboard:
- zzxwill
- hanxie-crypto
- hongchaodeng
kubevela-controller:
- resouer
- wonderflow
- hongchaodeng
- zzxwill
- ryanzhang-oss
oam-k8s-runtime: # inherit from https://github.com/crossplane/oam-kubernetes-runtime/blob/master/OWNERS.md
- hongchaodeng
- wonderflow
- ryanzhang-oss
- captainroy-hy
- negz
- hasheddan
oam-spec: # inherit from https://github.com/oam-dev/spec/blob/master/OWNERS.md
- hongchaodeng
- resouer
- vturecek
community-collaborators:
- Fei-Guo
- szihai
bootstrap-contributors: # thank you for bootstrapping KubeVela at the very early stage!
- xiaoyuaiheshui
- Ghostbaby
- wenxinnnnn
- silenceper
- erdun
- sunny0826
- mosesyou
- artursouza
- wonderflow
- hongchaodeng
- ryanzhang-oss
- woshilanren11
- hanxie-crypto
- zzxwill

349
README.md
View File

@@ -1,338 +1,37 @@
![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.*
# KubeVela
The Open Application Platform based on Kubernetes and Open Application Model (OAM).
For developers, KubeVela is an easy-to-use tool that enables them to describe and ship their applications to Kubernetes with minimal effort.
## Project Status
For platform builders, KubeVela serves as a framework that empowers them to create developer facing yet highly extensible platforms at ease.
:rotating_light: **Warning: this project is still a work in progress with lots of rough edges, please don't look inside unless you know what you are doing.**
- Slack: [Discuss](https://cloud-native.slack.com/archives/C01BLQ3HTJA)
- Gitter: [Community](https://gitter.im/oam-dev/community)
KubeVela project is initialized and maintained by the cloud native community since day 0 with [bootstrapping contributors from 8+ different organizations](https://github.com/oam-dev/kubevela/graphs/contributors). We intend for KubeVela to have a open governance since the very beginning and donate the project to neutral foundation as soon as it's released.
> NOTE: KubeVela is still in early stage and iterating quickly. It's currently under preview release.
## Purpose and Goal
## Quick Start
- For developers and operators
- KubeVela, as an out-of-box Cloud Native Application Management Platform, provides numerous workloads and operation tooling for application defining, deployment, scaling, traffic, rollout, routing, monitoring, logging, alerting, CI/CD and so on.
- For platform builders
- KubeVela, as a highly extensible PaaS/Serverless Core, provides pluggable capabilities, an elegant way to integrate any workloads and operational capabilities (i.e. traits).
Quick start guides are available on [this section](https://kubevela.io/#/en/quick-start).
## Design and Architecture
## Documentation
Read more about [KubeVela's high level design and architecture](DESIGN.md).
## Demo Instructions
See the demo instructions below get a sense of what we've accomplished and are working on.
## Install
### Prerequisites
- Kubernetes cluster running Kubernetes v1.15.0 or greater
- kubectl current context is configured for the target cluster install
- ```kubectl config current-context```
### Get the Vela CLI
Download the `vela` binary from the [releases page](https://github.com/oam-dev/kubevela/releases). Unpack the `vela` binary and add it to `$PATH` to get started.
```shell
sudo mv ./vela /usr/local/bin/vela
```
### Install Vela Core
```console
$ vela install
```
This command will install vela core controller into your K8s cluster, along with built-in workloads and traits.
## Using KubeVela
After `vela install` you will see available workloads and traits.
```console
$ vela workloads
NAME DEFINITION
backend podspecworkloads.standard.oam.dev
task jobs.batch.k8s.io
webservice podspecworkloads.standard.oam.dev
```
```console
$ vela traits
NAME DEFINITION APPLIES TO
route routes.standard.oam.dev webservice,backend
scale manualscalertraits.core.oam.dev webservice,backend
```
### Create environment
Before working with your application, you should prepare an deploy environment for it (e.g. test, staging, prod etc).
```console
$ vela env init demo --namespace demo --email my@email.com --domain kubevela.io
ENVIROMENT demo CREATED, Namespace: demo, Email: my@email.com.
```
Vela will create a Kubernetes namespace called `demo` , with namespace level issuer for certificate generation using the email you provided.
You could check the environment metadata in your local:
```console
$ cat ~/.vela/envs/demo/config.json
{"name":"demo","namespace":"demo","email":"my@email.com","domain":"kubevela.io","issuer":"oam-env-demo"}
```
### Create simple component
Then let's create application, we will use the `demo` environment.
```console
$ vela comp deploy mycomp -t webservice --image crccheck/hello-world --port 8000 --app myapp
Creating AppConfig appcomp
SUCCEED
```
### Create micro-services application
Vela supports micro-services application by default thanks to Open Application Model.
```console
$ vela comp deploy db -t backend --image crccheck/hello-world --app myapp
Creating App myapp
SUCCEED
```
```console
$ vela comp ls
NAME APP WORKLOAD TRAITS STATUS CREATED-TIME
db myapp backend Deployed 2020-09-18 22:42:04 +0800 CST
mycomp myapp webservice Deployed 2020-09-18 22:42:04 +0800 CST
```
#### Under the hood
In Kubernetes, vela creates an OAM application configuration named `myapp` to manage all related components.
```console
$ kubectl get appconfig -n demo
NAME AGE
myapp 24s
```
```console
$ kubectl get components -n demo
NAME AGE
mycomp 24s
db 10s
```
Vela Core is responsible for managing the underlying Kubernetes resources linked with the components and application configuration above.
```console
$ kubectl get deployment -n demo
NAME READY UP-TO-DATE AVAILABLE AGE
mycomp 1/1 1 1 38s
db 1/1 1 1 20s
```
```console
$ kubectl get svc -n demo
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
mycomp ClusterIP 172.21.4.228 <none> 8080/TCP 49s
```
### Manage operational configurations of the application
Vela leverages OAM trait system to manage operational configurations such as `scale`, `route`, `canary`, `autocale`etc in application centric approach.
Let's take `route` as example.
### `route`
If you want to use `route`, please make sure you have [nginx-ingress controller[https://kubernetes.github.io/ingress-nginx/deploy/] in your cluster.
```console
$ vela route mycomp --app myapp
Adding route for app mycomp
Succeeded!
```
For now you have to check the public address manually (this will be fixed soon so `vela route` will return visiting URL as result):
```console
$ kubectl get ingress -n demo
NAME HOSTS ADDRESS PORTS AGE
mycomp-trait-5b576c4fc mycomp.kubevela.io 123.57.10.233 80, 443 73s
```
And after you configure the `kubevela.io` domain pointing to the public address above.
Your application will be reached by `https://mycomp.kubevela.io` with `mTLS` automatically enabled.
### Under the hood
Vela will manage the underlying Kubernetes resource which implements the `route` trait.
```console
$ kubectl get routes.standard.oam.dev -n demo
NAME AGE
mycomp-trait-5b576c4fc 18s
```
`routes.standard.oam.dev` is a CRD controller which will manage ingress, domain, certificate etc for your application.
### Check status
Check the application:
```console
$ vela app show myapp
About:
Name: myapp
Created at: 2020-09-18 22:42:04.191171 +0800 CST
Updated at: 2020-09-18 22:51:11.128997 +0800 CST
Environment:
Namespace: demo
Components:
Name Type Traits
db backend
mycomp webservice route
```
Check specific component:
```console
$ vela comp show mycomp
About:
Name: mycomp
WorkloadType: webservice
Application: myapp
Environment:
Namespace: demo
Arguments:
image: crccheck/hello-world
name: mycomp
port: 8000
Traits:
route:
domain: mycomp.kubevela.io
issuer: oam-env-demo
name: route
```
```
$ vela comp status mycomp
Showing status of Component mycomp deployed in Environment demo
Component Status:
Name: mycomp PodSpecWorkload(type) UNKNOWN APIVersion standard.oam.dev/v1alpha1 Kind PodSpecWorkload workload is unknown for HealthScope
Traits
└─Trait/route
Last Deployment:
Created at: 2020-09-18 22:42:04 +0800 CST
Updated at: 2020-09-18T22:51:11+08:00
```
### Delete application or component
```console
$ vela app ls
myapp
```
```console
$ vela comp ls
NAME APP WORKLOAD TRAITS STATUS CREATED-TIME
db myapp backend Deployed 2020-09-18 22:42:04 +0800 CST
mycomp myapp webservice route Deployed 2020-09-18 22:42:04 +0800 CST
```
```console
$ vela comp delete db
Deleting Component 'db' from Application 'db'
```
```console
$ vela comp ls
NAME APP WORKLOAD TRAITS STATUS CREATED-TIME
mycomp myapp webservice route Deployed 2020-09-18 22:42:04 +0800 CST
```
```console
$ vela app delete myapp
Deleting Application "myapp"
delete apps succeed myapp from demo
```
## Dashboard
Vela has a simple client side dashboard for you to interact with (note it's still under development). The functionality is equivalent to the vela cli.
```console
$ vela dashboard
```
#### Auto-completion
##### bash
```console
To load completions in your current shell session:
$ source <(vela completion bash)
To load completions for every new session, execute once:
Linux:
$ vela completion bash > /etc/bash_completion.d/vela
MacOS:
$ vela completion bash > /usr/local/etc/bash_completion.d/vela
```
##### zsh
```console
To load completions in your current shell session:
$ source <(vela completion zsh)
To load completions for every new session, execute once:
$ vela completion zsh > "${fpath[1]}/_vela"
```
### Clean your environment
```console
$ helm uninstall kubevela -n vela-system
release "kubevela" uninstalled
```
```console
$ kubectl delete crd workloaddefinitions.core.oam.dev traitdefinitions.core.oam.dev scopedefinitions.core.oam.dev
customresourcedefinition.apiextensions.k8s.io "workloaddefinitions.core.oam.dev" deleted
customresourcedefinition.apiextensions.k8s.io "traitdefinitions.core.oam.dev" deleted
```
```console
$ rm -r ~/.vela
```
For full documentation, please visit the KubeVela website: [https://kubevela.io](https://kubevela.io/).
## Contributing
Check out [CONTRIBUTING.md](./CONTRIBUTING.md) to see how to develop with KubeVela.
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.md](CODE_OF_CONDUCT.md) for further details.
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.

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

@@ -21,16 +21,19 @@ import (
"fmt"
"cuelang.org/go/cue"
"github.com/google/go-cmp/cmp"
"github.com/spf13/pflag"
"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"`
}
@@ -54,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"`
@@ -84,17 +96,15 @@ type Parameter struct {
Default interface{} `json:"default,omitempty"`
Usage string `json:"usage,omitempty"`
Type cue.Kind `json:"type,omitempty"`
Alias string `json:"alias,omitempty"`
}
// ConvertTemplateJSON2Object convert spec.extension to object
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 {
@@ -103,7 +113,12 @@ 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 != "" {
name = v.Alias
}
switch v.Type {
case cue.IntKind:
var vv int64
@@ -117,11 +132,11 @@ func SetFlagBy(flags *pflag.FlagSet, v Parameter) {
case float64:
vv = int64(val)
}
flags.Int64P(v.Name, v.Short, vv, v.Usage)
flags.Int64P(name, v.Short, vv, v.Usage)
case cue.StringKind:
flags.StringP(v.Name, v.Short, v.Default.(string), v.Usage)
flags.StringP(name, v.Short, v.Default.(string), v.Usage)
case cue.BoolKind:
flags.BoolP(v.Name, v.Short, v.Default.(bool), v.Usage)
flags.BoolP(name, v.Short, v.Default.(bool), v.Usage)
case cue.NumberKind, cue.FloatKind:
var vv float64
switch val := v.Default.(type) {
@@ -134,6 +149,73 @@ func SetFlagBy(flags *pflag.FlagSet, v Parameter) {
case float64:
vv = val
}
flags.Float64P(v.Name, v.Short, vv, v.Usage)
flags.Float64P(name, v.Short, vv, v.Usage)
}
}
// 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 ||
a.Usage != b.Usage || a.Type != b.Type {
return false
}
switch a.Type {
case cue.IntKind:
var va, vb int64
switch vala := a.Default.(type) {
case int64:
va = vala
case json.Number:
va, _ = vala.Int64()
case int:
va = int64(vala)
case float64:
va = int64(vala)
}
switch valb := b.Default.(type) {
case int64:
vb = valb
case json.Number:
vb, _ = valb.Int64()
case int:
vb = int64(valb)
case float64:
vb = int64(valb)
}
return va == vb
case cue.StringKind:
return a.Default.(string) == b.Default.(string)
case cue.BoolKind:
return a.Default.(bool) == b.Default.(bool)
case cue.NumberKind, cue.FloatKind:
var va, vb float64
switch vala := a.Default.(type) {
case int64:
va = float64(vala)
case json.Number:
va, _ = vala.Float64()
case int:
va = float64(vala)
case float64:
va = vala
}
switch valb := b.Default.(type) {
case int64:
vb = float64(valb)
case json.Number:
vb, _ = valb.Float64()
case int:
vb = float64(valb)
case float64:
vb = valb
}
return va == vb
}
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

@@ -0,0 +1,122 @@
/*
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v1alpha1
import (
"github.com/crossplane/crossplane-runtime/apis/core/v1alpha1"
runtimev1alpha1 "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
// Protocol defines network protocols supported for things like container ports.
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}
type Autoscaler struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec AutoscalerSpec `json:"spec"`
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
}
// Trigger defines the trigger of Autoscaler
type Trigger struct {
// Name is the trigger name, if not set, it will be automatically generated and make it globally unique
Name string `json:"name,omitempty"`
// Type allows value in [cpu/memory/storage/ephemeral-storage、cron、pps、qps/rps、custom]
Type TriggerType `json:"type"`
// Condition set the condition when to trigger scaling
Condition map[string]string `json:"condition"`
}
// AutoscalerSpec defines the desired state of Autoscaler
type AutoscalerSpec struct {
// MinReplicas is the minimal replicas
// +optional
MinReplicas *int32 `json:"minReplicas,omitempty"`
// MinReplicas is the maximal replicas
// +optional
MaxReplicas *int32 `json:"maxReplicas,omitempty"`
// Triggers lists all triggers
Triggers []Trigger `json:"triggers"`
// TargetWorkload specify the workload which is going to be scaled,
// it could be WorkloadReference or the child resource of it
TargetWorkload TargetWorkload `json:"targetWorkload,omitempty"`
// WorkloadReference marks the owner of the workload
WorkloadReference runtimev1alpha1.TypedReference `json:"workloadRef,omitempty"`
}
// TargetWorkload holds the a reference to the scale target Object
type TargetWorkload struct {
Name string `json:"name"`
// +optional
APIVersion string `json:"apiVersion,omitempty"`
// +optional
Kind string `json:"kind,omitempty"`
}
// AutoscalerStatus defines the observed state of Autoscaler
type AutoscalerStatus struct {
runtimev1alpha1.ConditionedStatus `json:",inline"`
}
// +kubebuilder:object:root=true
// AutoscalerList contains a list of Autoscaler
type AutoscalerList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []Autoscaler `json:"items"`
}
func init() {
SchemeBuilder.Register(&Autoscaler{}, &AutoscalerList{})
}

View File

@@ -39,12 +39,11 @@ type ScapeServiceEndPoint struct {
// The default and only supported format is "prometheus" for now
Format string `json:"format,omitempty"`
// Number or name of the port to access on the pods targeted by the service.
// When this field has value implies that we need to create a service for the workload
// Mutually exclusive with port.
// The default is discovered automatically from podTemplate, metricTrait will create a service for the workload
TargetPort intstr.IntOrString `json:"port,omitempty"`
// Route service traffic to pods with label keys and values matching this
// The default is the labels in the workload
// Mutually exclusive with port.
// The default is discovered automatically from podTemplate.
// If no podTemplate, use the labels specified here, or use the labels of the workload
TargetSelector map[string]string `json:"selector,omitempty"`
// HTTP path to scrape for metrics.
// default is /metrics
@@ -63,8 +62,13 @@ type ScapeServiceEndPoint struct {
type MetricsTraitStatus struct {
runtimev1alpha1.ConditionedStatus `json:",inline"`
// ServiceMonitorNames managed by this trait
ServiceMonitorNames []string `json:"serviceMonitorName,omitempty"`
// ServiceMonitorName managed by this trait
ServiceMonitorName string `json:"serviceMonitorName,omitempty"`
// Port is the real port monitoring
Port intstr.IntOrString `json:"port,omitempty"`
// SelectorLabels is the real labels selected
SelectorLabels map[string]string `json:"selectorLabels,omitempty"`
}
// +kubebuilder:object:root=true
@@ -95,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

@@ -28,7 +28,7 @@ type PodSpecWorkloadSpec struct {
// Replicas is the desired number of replicas of the given podSpec.
// These are replicas in the sense that they are instantiations of the same podSpec.
// If unspecified, defaults to 1.
Replicas *int32 `json:"replicas"`
Replicas *int32 `json:"replicas,omitempty"`
// PodSpec describes the pods that will be created,
// we omit the meta part as it will be exactly the same as the PodSpecWorkload
@@ -46,6 +46,8 @@ type PodSpecWorkloadStatus struct {
// +kubebuilder:object:root=true
// PodSpecWorkload is the Schema for the PodSpec API
// +genclient:method=GetScale,verb=get,subresource=scale,result=k8s.io/api/autoscaling/v1.Scale
// +genclient:method=UpdateScale,verb=update,subresource=scale,input=k8s.io/api/autoscaling/v1.Scale,result=k8s.io/api/autoscaling/v1.Scale
// +kubebuilder:resource:categories={oam}
// +kubebuilder:subresource:status
type PodSpecWorkload struct {
@@ -71,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.
@@ -105,13 +110,14 @@ type BackendServiceRef struct {
type RouteStatus struct {
Ingresses []runtimev1alpha1.TypedReference `json:"ingresses,omitempty"`
Service *runtimev1alpha1.TypedReference `json:"service,omitempty"`
Status string `json:"status,omitempty"`
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"`
@@ -120,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"`
@@ -134,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

@@ -25,6 +25,115 @@ import (
runtime "k8s.io/apimachinery/pkg/runtime"
)
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Autoscaler) DeepCopyInto(out *Autoscaler) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.Spec.DeepCopyInto(&out.Spec)
in.Status.DeepCopyInto(&out.Status)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Autoscaler.
func (in *Autoscaler) DeepCopy() *Autoscaler {
if in == nil {
return nil
}
out := new(Autoscaler)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *Autoscaler) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *AutoscalerList) DeepCopyInto(out *AutoscalerList) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ListMeta.DeepCopyInto(&out.ListMeta)
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]Autoscaler, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AutoscalerList.
func (in *AutoscalerList) DeepCopy() *AutoscalerList {
if in == nil {
return nil
}
out := new(AutoscalerList)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *AutoscalerList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *AutoscalerSpec) DeepCopyInto(out *AutoscalerSpec) {
*out = *in
if in.MinReplicas != nil {
in, out := &in.MinReplicas, &out.MinReplicas
*out = new(int32)
**out = **in
}
if in.MaxReplicas != nil {
in, out := &in.MaxReplicas, &out.MaxReplicas
*out = new(int32)
**out = **in
}
if in.Triggers != nil {
in, out := &in.Triggers, &out.Triggers
*out = make([]Trigger, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
out.TargetWorkload = in.TargetWorkload
out.WorkloadReference = in.WorkloadReference
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AutoscalerSpec.
func (in *AutoscalerSpec) DeepCopy() *AutoscalerSpec {
if in == nil {
return nil
}
out := new(AutoscalerSpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *AutoscalerStatus) DeepCopyInto(out *AutoscalerStatus) {
*out = *in
in.ConditionedStatus.DeepCopyInto(&out.ConditionedStatus)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AutoscalerStatus.
func (in *AutoscalerStatus) DeepCopy() *AutoscalerStatus {
if in == nil {
return nil
}
out := new(AutoscalerStatus)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Backend) DeepCopyInto(out *Backend) {
*out = *in
@@ -141,10 +250,13 @@ func (in *MetricsTraitSpec) DeepCopy() *MetricsTraitSpec {
func (in *MetricsTraitStatus) DeepCopyInto(out *MetricsTraitStatus) {
*out = *in
in.ConditionedStatus.DeepCopyInto(&out.ConditionedStatus)
if in.ServiceMonitorNames != nil {
in, out := &in.ServiceMonitorNames, &out.ServiceMonitorNames
*out = make([]string, len(*in))
copy(*out, *in)
out.Port = in.Port
if in.SelectorLabels != nil {
in, out := &in.SelectorLabels, &out.SelectorLabels
*out = make(map[string]string, len(*in))
for key, val := range *in {
(*out)[key] = val
}
}
}
@@ -446,3 +558,40 @@ func (in *TLS) DeepCopy() *TLS {
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *TargetWorkload) DeepCopyInto(out *TargetWorkload) {
*out = *in
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TargetWorkload.
func (in *TargetWorkload) DeepCopy() *TargetWorkload {
if in == nil {
return nil
}
out := new(TargetWorkload)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Trigger) DeepCopyInto(out *Trigger) {
*out = *in
if in.Condition != nil {
in, out := &in.Condition, &out.Condition
*out = make(map[string]string, len(*in))
for key, val := range *in {
(*out)[key] = val
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Trigger.
func (in *Trigger) DeepCopy() *Trigger {
if in == nil {
return nil
}
out := new(Trigger)
in.DeepCopyInto(out)
return out
}

View File

@@ -1,16 +1,3 @@
# Copyright YEAR The Jetstack cert-manager contributors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
@@ -25238,5 +25225,4 @@ status:
kind: ""
plural: ""
conditions: []
storedVersions: []
storedVersions: []

View File

@@ -0,0 +1,155 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.2.5
creationTimestamp: null
name: autoscalers.standard.oam.dev
spec:
group: standard.oam.dev
names:
categories:
- oam
kind: Autoscaler
listKind: AutoscalerList
plural: autoscalers
singular: autoscaler
scope: Namespaced
versions:
- name: v1alpha1
schema:
openAPIV3Schema:
description: Autoscaler is the Schema for the autoscalers API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: AutoscalerSpec defines the desired state of Autoscaler
properties:
maxReplicas:
description: MinReplicas is the maximal replicas
format: int32
type: integer
minReplicas:
description: MinReplicas is the minimal replicas
format: int32
type: integer
targetWorkload:
description: TargetWorkload specify the workload which is going to
be scaled, it could be WorkloadReference or the child resource of
it
properties:
apiVersion:
type: string
kind:
type: string
name:
type: string
required:
- name
type: object
triggers:
description: Triggers lists all triggers
items:
description: Trigger defines the trigger of Autoscaler
properties:
condition:
additionalProperties:
type: string
description: Condition set the condition when to trigger scaling
type: object
name:
description: Name is the trigger name, if not set, it will be
automatically generated and make it globally unique
type: string
type:
description: Type allows value in [cpu/memory/storage/ephemeral-storage、cron、pps、qps/rps、custom]
type: string
required:
- condition
- type
type: object
type: array
workloadRef:
description: WorkloadReference marks the owner of the workload
properties:
apiVersion:
description: APIVersion of the referenced object.
type: string
kind:
description: Kind of the referenced object.
type: string
name:
description: Name of the referenced object.
type: string
uid:
description: UID of the referenced object.
type: string
required:
- apiVersion
- kind
- name
type: object
required:
- triggers
type: object
status:
description: AutoscalerStatus defines the observed state of Autoscaler
properties:
conditions:
description: Conditions of the resource.
items:
description: A Condition that may apply to a resource.
properties:
lastTransitionTime:
description: LastTransitionTime is the last time this condition
transitioned from one status to another.
format: date-time
type: string
message:
description: A Message containing details about this condition's
last transition from one status to another, if any.
type: string
reason:
description: A Reason for this condition's last transition from
one status to another.
type: string
status:
description: Status of this condition; is it currently True,
False, or Unknown?
type: string
type:
description: Type of this condition. At most one of each condition
type may apply to a resource at any point in time.
type: string
required:
- lastTransitionTime
- reason
- status
- type
type: object
type: array
type: object
required:
- spec
type: object
served: true
storage: true
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []

View File

@@ -56,9 +56,9 @@ spec:
- type: integer
- type: string
description: Number or name of the port to access on the pods
targeted by the service. When this field has value implies that
we need to create a service for the workload Mutually exclusive
with port.
targeted by the service. The default is discovered automatically
from podTemplate, metricTrait will create a service for the
workload
x-kubernetes-int-or-string: true
scheme:
description: Scheme at which metrics should be scraped The default
@@ -68,8 +68,9 @@ spec:
additionalProperties:
type: string
description: Route service traffic to pods with label keys and
values matching this The default is the labels in the workload
Mutually exclusive with port.
values matching this The default is discovered automatically
from podTemplate. If no podTemplate, use the labels specified
here, or use the labels of the workload
type: object
type: object
workloadRef:
@@ -132,11 +133,20 @@ spec:
- type
type: object
type: array
serviceMonitorName:
description: ServiceMonitorNames managed by this trait
items:
port:
anyOf:
- type: integer
- type: string
description: Port is the real port monitoring
x-kubernetes-int-or-string: true
selectorLabels:
additionalProperties:
type: string
type: array
description: SelectorLabels is the real labels selected
type: object
serviceMonitorName:
description: ServiceMonitorName managed by this trait
type: string
type: object
required:
- spec

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
@@ -5691,7 +5694,6 @@ spec:
type: integer
required:
- podSpec
- replicas
type: object
status:
description: PodSpecWorkloadStatus defines the observed state of PodSpecWorkload

View File

@@ -241,6 +241,8 @@ spec:
- kind
- name
type: object
status:
type: string
type: object
type: object
served: true

File diff suppressed because it is too large Load Diff

View File

@@ -1,39 +0,0 @@
apiVersion: core.oam.dev/v1alpha2
kind: WorkloadDefinition
metadata:
name: backend
annotations:
definition.oam.dev/apiVersion: "standard.oam.dev/v1alpha1"
definition.oam.dev/kind: "PodSpecWorkload"
definition.oam.dev/description: "Backend worker without ports exposed"
spec:
definitionRef:
name: podspecworkload.standard.oam.dev
childResourceKinds:
- apiVersion: apps/v1
kind: Deployment
extension:
template: |
output: {
apiVersion: "standard.oam.dev/v1alpha1"
kind: "PodSpecWorkload"
metadata:
name: parameter.name
spec: {
replicas: 1
podSpec: {
containers: [{
image: parameter.image
name: parameter.name
}]
}
}
}
#backend: {
name: string
// +usage=specify app image
// +short=i
image: string
}
parameter: #backend

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

@@ -1,53 +0,0 @@
---
apiVersion: v1
kind: Namespace
metadata:
labels:
mornitoring: oam
name: monitoring
---
apiVersion: core.oam.dev/v1alpha2
kind: TraitDefinition
metadata:
name: metric
namespace: default
annotations:
definition.oam.dev/apiVersion: standard.oam.dev/v1alpha1
definition.oam.dev/kind: MetricsTrait
definition.oam.dev/description: "Add metric monitoring for workload"
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
extension:
template: |-
#metrics: {
// +usage=format of the metrics, default as prometheus
// +short=f
format: *"prometheus" | string
path: *"/metrics" | string
scheme: *"http" | string
enabled: *true | bool
port: *8080 | >=1024 & uint16
// +usage= the label selector for the pods, default is the workload labels
selector?: [string]: string
}
spec: {
apiVersion: "standard.oam.dev/v1alpha1"
kind: "MetricsTrait"
spec: {
scrapeService: parameter
}
}
parameter: #metrics
output: {}

View File

@@ -1,48 +0,0 @@
apiVersion: core.oam.dev/v1alpha2
kind: WorkloadDefinition
metadata:
name: podspecworkloads.standard.oam.dev
annotations:
definition.oam.dev/apiVersion: "standard.oam.dev/v1alpha1"
definition.oam.dev/kind: "PodSpecWorkload"
spec:
definitionRef:
name: podspecworkloads.standard.oam.dev
childResourceKinds:
- apiVersion: apps/v1
kind: Deployment
- apiVersion: v1
kind: Service
extension:
template: |
output: {
apiVersion: "standard.oam.dev/v1alpha1"
kind: "PodSpecWorkload"
metadata:
name: parameter.name
spec: {
replicas: 1
podSpec: {
containers: [{
image: parameter.image
name: parameter.name
ports: [{
containerPort: parameter.port
protocol: "TCP"
name: "default"
}]
}]
}
}
}
#webservice: {
name: string
// +usage=specify app image
// +short=i
image: string
// +usage=specify port for container
// +short=p
port: *6379 | int
}
parameter: #webservice

View File

@@ -1,35 +0,0 @@
apiVersion: core.oam.dev/v1alpha2
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"
spec:
appliesToWorkloads:
- core.oam.dev/v1alpha2.ContainerizedWorkload
- standard.oam.dev/v1alpha1.PodSpecWorkload
- deployments.apps
- webservice
workloadRefPath: spec.workloadRef
definitionRef:
name: routes.standard.oam.dev
extension:
template: |
output: {
apiVersion: "standard.oam.dev/v1alpha1"
kind: "Route"
spec: {
host: parameter.domain
tls: {
issuerName: parameter.issuer
}
}
}
#route: {
domain: *"" | string
issuer: *"" | string
}
parameter: #route

View File

@@ -1,49 +0,0 @@
apiVersion: core.oam.dev/v1alpha2
kind: WorkloadDefinition
metadata:
name: task
annotations:
definition.oam.dev/apiVersion: "v1"
definition.oam.dev/kind: "Job"
definition.oam.dev/description: "One-time off task or job"
spec:
definitionRef:
name: jobs
extension:
defaultTraits:
- monitor
- logging
template: |
output: {
apiVersion: "v1"
kind: "Job"
metadata: name: parameter.name
spec: {
parallelism: parameter.count
completions: parameter.count
template:
spec:
containers: [{
image: parameter.image
name: parameter.name
ports: [{
containerPort: parameter.port
protocol: "TCP"
name: "default"
}]
}]
}
}
#task: {
// +usage=specify number of tasks to run in parallel
// +short=c
count: *1 | int
name: string
// +usage=specify app image
// +short=i
image: string
// +usage=specify port for container
// +short=p
port: *6379 | int
}
parameter: #task

View File

@@ -1,48 +0,0 @@
apiVersion: core.oam.dev/v1alpha2
kind: WorkloadDefinition
metadata:
name: webservice
annotations:
definition.oam.dev/apiVersion: "standard.oam.dev/v1alpha1"
definition.oam.dev/kind: "PodSpecWorkload"
definition.oam.dev/description: "Long running service with ports exposed"
spec:
definitionRef:
name: podspecworkloads.standard.oam.dev
childResourceKinds:
- apiVersion: apps/v1
kind: Deployment
- apiVersion: v1
kind: Service
extension:
template: |
output: {
apiVersion: "standard.oam.dev/v1alpha1"
kind: "PodSpecWorkload"
metadata:
name: parameter.name
spec: {
replicas: 1
podSpec: {
containers: [{
image: parameter.image
name: parameter.name
ports: [{
containerPort: parameter.port
protocol: "TCP"
name: "default"
}]
}]
}
}
}
#webservice: {
name: string
// +usage=specify app image
// +short=i
image: string
// +usage=specify port for container
// +short=p
port: *6379 | int
}
parameter: #webservice

View File

@@ -0,0 +1,82 @@
apiVersion: core.oam.dev/v1alpha2
kind: TraitDefinition
metadata:
name: autoscale
annotations:
definition.oam.dev/description: "Automatically scale the app following certain triggers or metrics"
spec:
appliesToWorkloads:
- webservice
- 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["cpuPercent"] != _|_ && parameter["cron"] != _|_ {
triggers: [cpuScaler, cronScaler]
}
if parameter["cpuPercent"] != _|_ && parameter["cron"] == _|_ {
triggers: [cpuScaler]
}
if parameter["cpuPercent"] == _|_ && parameter["cron"] != _|_ {
triggers: [cronScaler]
}
}
}
cpuScaler: {
type: "cpu"
condition: {
type: "Utilization"
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"] != _|_ && 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
}
}
}
parameter: {
// +usage=minimal replicas of the workload
min: int
// +usage=maximal replicas of the workload
max: int
// +usage=specify the value for CPU utilization, like 80, which means 80%
// +alias=cpu-percent
cpuPercent?: int
// +usage=just for `appfile`, not available for Cli usage
cron?: {
// +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
// +usage=the target replicas to be scaled to
replicas: int
// +usage=timezone, like "America/Los_Angeles"
timezone: string
}
}

View File

@@ -2,16 +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
namespace: default
spec:
appliesToWorkloads:
- core.oam.dev/v1alpha2.ContainerizedWorkload
- apps/v1.Deployment
- webservice
- worker
definitionRef:
name: manualscalertraits.core.oam.dev
workloadRefPath: spec.workloadRef
@@ -21,11 +17,11 @@ spec:
apiVersion: "core.oam.dev/v1alpha2"
kind: "ManualScalerTrait"
spec: {
replicaCount: parameter.replica
replicaCount: parameter.replicas
}
}
#scale: {
parameter: {
//+short=r
replica: *2 | int
replicas: *1 | int
}
parameter: #scale

View File

@@ -0,0 +1,37 @@
apiVersion: core.oam.dev/v1alpha2
kind: TraitDefinition
metadata:
name: metrics
annotations:
definition.oam.dev/description: "Configure metrics targets to be monitored for the app"
spec:
appliesToWorkloads:
- webservice
- backend
- task
definitionRef:
name: metricstraits.standard.oam.dev
workloadRefPath: spec.workloadRef
extension:
template: |-
output: {
apiVersion: "standard.oam.dev/v1alpha1"
kind: "MetricsTrait"
spec: {
scrapeService: parameter
}
}
parameter: {
// +usage=format of the metrics, default as prometheus
// +short=f
format: *"prometheus" | string
// +usage= the metrics path of the service
path: *"/metrics" | string
scheme: *"http" | string
enabled: *true | bool
// +usage= the port for metrics, will discovery automatically by default
port: *0 | >=1024 & <=65535 & int
// +usage= the label selector for the pods, will discovery automatically by default
selector?: [string]: string
}

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

@@ -0,0 +1,40 @@
apiVersion: core.oam.dev/v1alpha2
kind: TraitDefinition
metadata:
name: route
annotations:
definition.oam.dev/description: "Configure route policy to the app"
spec:
appliesToWorkloads:
- webservice
workloadRefPath: spec.workloadRef
definitionRef:
name: routes.standard.oam.dev
extension:
template: |
output: {
apiVersion: "standard.oam.dev/v1alpha1"
kind: "Route"
spec: {
host: parameter.domain
if parameter.issuer != "" {
tls: {
issuerName: parameter.issuer
}
}
if parameter["rules"] != _|_ {
rules: parameter.rules
}
}
}
parameter: {
domain: *"" | string
issuer: *"" | string
rules?: [...{
path: string
rewriteTarget: *"" | string
}]
}

View File

@@ -0,0 +1,41 @@
apiVersion: core.oam.dev/v1alpha2
kind: WorkloadDefinition
metadata:
name: task
annotations:
definition.oam.dev/description: "One-off task to run a piece of code or script to completion"
spec:
definitionRef:
name: jobs
extension:
template: |
output: {
apiVersion: "v1"
kind: "Job"
spec: {
parallelism: parameter.count
completions: parameter.count
template: spec: {
containers: [{
name: context.name
image: parameter.image
if parameter["cmd"] != _|_ {
command: parameter.cmd
}
}]
}
}
}
parameter: {
// +usage=specify number of tasks to run in parallel
// +short=c
count: *1 | int
// +usage=Which image would you like to use for your service
// +short=i
image: string
cmd?: [...string]
}

View File

@@ -0,0 +1,83 @@
apiVersion: core.oam.dev/v1alpha2
kind: WorkloadDefinition
metadata:
name: webservice
annotations:
definition.oam.dev/description: "Long-running scalable service with stable endpoint to receive external traffic"
spec:
definitionRef:
name: deployments.apps
extension:
template: |
output: {
apiVersion: "apps/v1"
kind: "Deployment"
spec: {
selector: matchLabels: {
"app.oam.dev/component": context.name
}
template: {
metadata: labels: {
"app.oam.dev/component": context.name
}
spec: {
containers: [{
name: context.name
image: parameter.image
if parameter["cmd"] != _|_ {
command: parameter.cmd
}
if parameter["env"] != _|_ {
env: parameter.env
}
if context["config"] != _|_ {
env: context.config
}
ports: [{
containerPort: parameter.port
}]
if parameter["cpu"] != _|_ {
resources: {
limits:
cpu: parameter.cpu
requests:
cpu: parameter.cpu
}
}
}]
}
}
}
}
parameter: {
// +usage=Which image would you like to use for your service
// +short=i
image: string
cmd?: [...string]
// +usage=Which port do you want customer traffic sent to
// +short=p
port: *80 | int
env?: [...{
name: string
value?: string
valueFrom?: {
secretKeyRef: {
name: string
key: string
}
}
}]
// +usage=Number of CPU units for the service, like `0.5` (0.5 CPU core), `1` (1 CPU core)
cpu?: string
}

View File

@@ -0,0 +1,50 @@
apiVersion: core.oam.dev/v1alpha2
kind: WorkloadDefinition
metadata:
name: worker
annotations:
definition.oam.dev/description: "Long-running scalable backend worker without network endpoint"
spec:
definitionRef:
name: deployments.apps
extension:
template: |
output: {
apiVersion: "apps/v1"
kind: "Deployment"
spec: {
selector: matchLabels: {
"app.oam.dev/component": context.name
}
template: {
metadata: labels: {
"app.oam.dev/component": context.name
}
spec: {
containers: [{
name: context.name
image: parameter.image
if parameter["cmd"] != _|_ {
command: parameter.cmd
}
}]
}
}
selector:
matchLabels:
"app.oam.dev/component": context.name
}
}
parameter: {
// +usage=Which image would you like to use for your service
// +short=i
image: string
cmd?: [...string]
}

View File

@@ -2,16 +2,9 @@ apiVersion: v1
kind: ConfigMap
metadata:
name: vela-config
namespace: {{ .Release.Namespace }}
# TODO: Currently namespace MUST be vela-system
namespace: vela-system
data:
certificates.cert-manager.io: |
{
"repo": "jetstack",
"urL": "https://charts.jetstack.io",
"name": "cert-manager",
"namespace": "cert-manager",
"version": "1.0.3"
}
servicemonitors.monitoring.coreos.com: |
{
"repo": "prometheus-community",
@@ -19,4 +12,20 @@ data:
"name": "kube-prometheus-stack",
"namespace": "monitoring",
"version": "9.4.4"
}
flagger.app: |
{
"repo": "oam-flagger",
"urL": "https://oam.dev/flagger/archives/",
"name": "flagger",
"namespace": "vela-system",
"version": "1.1.0"
}
keda: |
{
"repo": "kedacore",
"urL": "https://kedacore.github.io/charts",
"name": "keda",
"namespace": "keda",
"version": "2.0.0-rc3"
}

View File

@@ -7,7 +7,7 @@ useWebhook: true
image:
repository: oamdev/vela-core
tag: latest
pullPolicy: Always
pullPolicy: IfNotPresent
imagePullSecrets: []
nameOverride: ""

View File

@@ -6,8 +6,10 @@ import (
"fmt"
"io"
"os"
"os/signal"
"path/filepath"
"strconv"
"syscall"
"time"
monitoring "github.com/coreos/prometheus-operator/pkg/apis/monitoring/v1"
@@ -16,11 +18,13 @@ import (
oamcontroller "github.com/crossplane/oam-kubernetes-runtime/pkg/controller"
oamv1alpha2 "github.com/crossplane/oam-kubernetes-runtime/pkg/controller/v1alpha2"
oamwebhook "github.com/crossplane/oam-kubernetes-runtime/pkg/webhook/v1alpha2"
"github.com/go-logr/logr"
injectorv1alpha1 "github.com/oam-dev/trait-injector/api/v1alpha1"
injectorcontroller "github.com/oam-dev/trait-injector/controllers"
"github.com/oam-dev/trait-injector/pkg/injector"
"github.com/oam-dev/trait-injector/pkg/plugin"
certmanager "github.com/wonderflow/cert-manager-api/pkg/apis/certmanager/v1"
kedav1alpha1 "github.com/wonderflow/keda-api/api/v1alpha1"
"go.uber.org/zap/zapcore"
"gopkg.in/natefinch/lumberjack.v2"
crdv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
@@ -58,7 +62,7 @@ func init() {
_ = velacoreoamdev.AddToScheme(scheme)
_ = injectorv1alpha1.AddToScheme(scheme)
_ = certmanager.AddToScheme(scheme)
_ = kedav1alpha1.AddToScheme(scheme)
// +kubebuilder:scaffold:scheme
}
@@ -110,10 +114,7 @@ func main() {
setupLog.Error(err, "unable to create a kubernetes client")
os.Exit(1)
}
if err = dependency.Install(k8sClient); err != nil {
setupLog.Error(err, "unable to install the dependency")
os.Exit(1)
}
go dependency.Install(k8sClient)
mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{
Scheme: scheme,
@@ -136,7 +137,10 @@ func main() {
if useWebhook {
setupLog.Info("vela webhook enabled, will serving at :" + strconv.Itoa(webhookPort))
oamwebhook.Add(mgr)
if err = oamwebhook.Add(mgr); err != nil {
setupLog.Error(err, "unable to setup oam runtime webhook")
os.Exit(1)
}
velawebhook.Register(mgr)
if err := waitWebhookSecretVolume(certDir, waitSecretTimeout, waitSecretInterval); err != nil {
setupLog.Error(err, "unable to get webhook secret")
@@ -173,10 +177,11 @@ func main() {
}
setupLog.Info("starting the vela controller manager")
if err := mgr.Start(ctrl.SetupSignalHandler()); err != nil {
if err := mgr.Start(makeSignalHandler(setupLog, k8sClient)); err != nil {
setupLog.Error(err, "problem running manager")
os.Exit(1)
}
setupLog.Info("program safely stops...")
}
// registerHealthChecks is used to create readiness&liveness probes
@@ -203,25 +208,57 @@ func waitWebhookSecretVolume(certDir string, timeout, interval time.Duration) er
setupLog.Info(fmt.Sprintf("waiting webhook secret, time consumed: %d/%d seconds ...",
int64(time.Since(start).Seconds()), int64(timeout.Seconds())))
if _, err := os.Stat(certDir); !os.IsNotExist(err) {
f, _ := os.Open(certDir)
defer f.Close()
// check if dir is empty
if _, err := f.Readdir(1); err == io.EOF {
continue
}
// check if secret files are empty
err := filepath.Walk(certDir, func(path string, info os.FileInfo, err error) error {
// even Cert dir is created, cert files are still empty for a while
if info.Size() == 0 {
return errors.New("secret is not ready")
ready := func() bool {
f, err := os.Open(filepath.Clean(certDir))
if err != nil {
return false
}
return nil
})
if err == nil {
setupLog.Info(fmt.Sprintf("webhook secret is ready (time consumed: %d seconds)",
int64(time.Since(start).Seconds())))
// nolint
defer f.Close()
// check if dir is empty
if _, err := f.Readdir(1); err == io.EOF {
return false
}
// check if secret files are empty
err = filepath.Walk(certDir, func(path string, info os.FileInfo, err error) error {
// even Cert dir is created, cert files are still empty for a while
if info.Size() == 0 {
return errors.New("secret is not ready")
}
return nil
})
if err == nil {
setupLog.Info(fmt.Sprintf("webhook secret is ready (time consumed: %d seconds)",
int64(time.Since(start).Seconds())))
return true
}
return false
}()
if ready {
return nil
}
}
}
}
func makeSignalHandler(log logr.Logger, kubecli client.Client) (stopCh <-chan struct{}) {
stop := make(chan struct{})
c := make(chan os.Signal, 2)
signal.Notify(c, os.Interrupt, syscall.SIGTERM)
go func() {
<-c
// Do not uninstall when vela-core terminating.
// When running on K8s, old pod will terminate after new pod running, it will cause charts uninstalled.
// https://github.com/oam-dev/kubevela/issues/499
// dependency.Uninstall(kubecli)
close(stop)
// second signal. Exit directly.
<-c
os.Exit(1)
}()
return stop
}

3
codecov.yml Normal file
View File

@@ -0,0 +1,3 @@
coverage:
status:
patch: off

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:
@@ -86,8 +86,7 @@ spec:
name: deployments.apps
extension:
template: |
parameter: #webservice
#webservice: {
parameter: {
// +vela:cli:enabled=true
// +vela:cli:usage=specify commands to run in container
// +vela:cli:short=c
@@ -141,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:
@@ -152,7 +151,7 @@ kind: WorkloadDefinition | TraitDefinition
spec:
extension:
template: |
parameter: #webservice
parameter: {
...
```
@@ -167,8 +166,7 @@ Vela allows platform builders to write bespoke templates to extend Appfile confi
A template starts with `parameter` and its definition:
```yaml
parameter: #webservice
#webservice: {
parameter: {
// +vela:cli:enabled=true
// +vela:cli:usage=specify commands to run in container
// +vela:cli:short=c
@@ -178,7 +176,6 @@ parameter: #webservice
Here is the takeout:
* The `parameter` defines the user input fields and is used to render final output with user input values. These fields will be exposed to users in Appfile.
* The definition `#webservice` is used to tell the name of the template. This name is used to correlate workload and trait types to fields in Appfile.
Note that there is difference in how Workload and Trait expose parameters.
@@ -278,7 +275,7 @@ Here is the takeout:
### `vela up`
The vela-cli will have an `up` command to provide seamless workflow experience. Provide an `vela.yml` Appfile in the same directory that you will run `vela up` and it is good to go. There is an example under `examples/testapp/` .
The vela-cli will have an `up` command to provide seamless workflow experience. Provide an `vela.yaml` Appfile in the same directory that you will run `vela up` and it is good to go. There is an example under `examples/testapp/` .
## Examples
@@ -359,4 +356,4 @@ spec:
}]
}
}
```
```

View File

@@ -96,7 +96,7 @@ you to give a specified ingress controller type. Currently, only nginx-ingress i
The `tls` field allow you to specify a TLS for this route with an IssuerName, the IssuerName pointing to an Issuer Object
created by cert-manager. Cert-manager and ingress controller will handle certificate creation and binding.
If not specified, a selfsigned issuer will be created.
If not specified, mTLS was disabled and you can only visit by http.
If no rule specified, route trait will create one rule automatically and match with the port.

0
docs/.nojekyll Normal file
View File

1
docs/CNAME Normal file
View File

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

31
docs/README.md Normal file
View File

@@ -0,0 +1,31 @@
# KubeVela Website
[kubevela.io](https://kubevela.io)
## Contributing
- Fork and clone
```
$ git clone git@github.com:oam-dev/kubevela.git
$ cd kubevela/docs
```
- Install docsify-cli
```
$ npm i docsify-cli -g
```
- Make your changes
- 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)

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)

49
docs/en/cli/vela.md Normal file
View File

@@ -0,0 +1,49 @@
## vela
### Synopsis
```
vela [flags]
```
### Options
```
-e, --env string specify environment name for application
-h, --help help for vela
```
### SEE ALSO
* [vela autoscale](vela_autoscale.md) - Attach autoscale trait to an app
* [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 configurations
* [vela dashboard](vela_dashboard.md) - Setup API Server and launch Dashboard
* [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 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) - 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
* [vela traits](vela_traits.md) - List traits
* [vela up](vela_up.md) - Apply an appfile
* [vela version](vela_version.md) - Prints out build version information
* [vela workloads](vela_workloads.md) - List workloads
###### Auto generated by spf13/cobra on 16-Nov-2020

View File

@@ -0,0 +1,41 @@
## vela autoscale
Attach autoscale trait to an app
### Synopsis
Attach autoscale trait to an app
```
vela autoscale <appname> [args]
```
### Examples
```
vela autoscale frontend
```
### Options
```
--cpu-percent int specify the value for CPU utilization, like 80, which means 80%
--detach detach trait from service
-h, --help help for autoscale
--max int maximal replicas of the workload
--min int minimal replicas of the workload
-s, --staging only save changes locally without real update application
--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

29
docs/en/cli/vela_cap.md Normal file
View File

@@ -0,0 +1,29 @@
## vela cap
Manage capability centers and installing/uninstalling capabilities
### Synopsis
Manage capability centers and installing/uninstalling capabilities
### Options
```
-h, --help help for cap
```
### Options inherited from parent commands
```
-e, --env string specify environment name for application
```
### SEE ALSO
* [vela](vela.md) -
* [vela cap center](vela_cap_center.md) - Manage Capability Center
* [vela cap install](vela_cap_install.md) - Install capability into cluster
* [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 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 center config](vela_cap_center_config.md) - Configure or add the capability center, default is local (built-in capabilities)
* [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 20-Oct-2020
###### Auto generated by spf13/cobra on 16-Nov-2020

View File

@@ -1,10 +1,10 @@
## vela cap center config
Configure or add the capability center, default is local (built-in capabilities)
Configure (add if not exist) a capability center, default is local (built-in capabilities)
### Synopsis
Configure or add the capability center, default is local (built-in capabilities)
Configure (add if not exist) a capability center, default is local (built-in capabilities)
```
vela cap center config <centerName> <centerURL> [flags]
@@ -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 20-Oct-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 20-Oct-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 20-Oct-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 20-Oct-2020
###### Auto generated by spf13/cobra on 16-Nov-2020

View File

@@ -0,0 +1,36 @@
## vela cap install
Install capability into cluster
### Synopsis
Install capability into cluster
```
vela cap install <center>/<name> [flags]
```
### Examples
```
vela cap install mycenter/route
```
### Options
```
-h, --help help for install
-t, --token string Github Repo token
```
### Options inherited from parent commands
```
-e, --env string specify environment name for application
```
### SEE ALSO
* [vela cap](vela_cap.md) - Manage capability centers and installing/uninstalling capabilities
###### Auto generated by spf13/cobra on 16-Nov-2020

View File

@@ -1,13 +1,13 @@
## vela cap ls
List all capabilities in center
List capabilities from cap-center
### Synopsis
List all capabilities in center
List capabilities from cap-center
```
vela cap ls [centerName] [flags]
vela cap ls [cap-center] [flags]
```
### Examples
@@ -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 20-Oct-2020
###### Auto generated by spf13/cobra on 16-Nov-2020

View File

@@ -0,0 +1,36 @@
## vela cap uninstall
Uninstall capability from cluster
### Synopsis
Uninstall capability from cluster
```
vela cap uninstall <name> [flags]
```
### Examples
```
vela cap uninstall route
```
### Options
```
-h, --help help for uninstall
-t, --token string Github Repo token
```
### Options inherited from parent commands
```
-e, --env string specify environment name for application
```
### SEE ALSO
* [vela cap](vela_cap.md) - Manage capability centers and installing/uninstalling capabilities
###### 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 20-Oct-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 20-Oct-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 20-Oct-2020
###### Auto generated by spf13/cobra on 16-Nov-2020

View File

@@ -0,0 +1,29 @@
## vela config
Manage configurations
### Synopsis
Manage configurations
### Options
```
-h, --help help for config
```
### Options inherited from parent commands
```
-e, --env string specify environment name for application
```
### SEE ALSO
* [vela](vela.md) -
* [vela config del](vela_config_del.md) - Delete config
* [vela config get](vela_config_get.md) - Get data for a config
* [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 16-Nov-2020

View File

@@ -0,0 +1,35 @@
## vela config del
Delete config
### Synopsis
Delete config
```
vela config del
```
### Examples
```
vela config del <config-name>
```
### Options
```
-h, --help help for del
```
### Options inherited from parent commands
```
-e, --env string specify environment name for application
```
### SEE ALSO
* [vela config](vela_config.md) - Manage configurations
###### Auto generated by spf13/cobra on 16-Nov-2020

View File

@@ -0,0 +1,35 @@
## vela config get
Get data for a config
### Synopsis
Get data for a config
```
vela config get
```
### Examples
```
vela config get <config-name>
```
### Options
```
-h, --help help for get
```
### Options inherited from parent commands
```
-e, --env string specify environment name for application
```
### SEE ALSO
* [vela config](vela_config.md) - Manage configurations
###### Auto generated by spf13/cobra on 16-Nov-2020

View File

@@ -0,0 +1,35 @@
## vela config ls
List configs
### Synopsis
List all configs
```
vela config ls
```
### Examples
```
vela config ls
```
### Options
```
-h, --help help for ls
```
### Options inherited from parent commands
```
-e, --env string specify environment name for application
```
### SEE ALSO
* [vela config](vela_config.md) - Manage configurations
###### Auto generated by spf13/cobra on 16-Nov-2020

View File

@@ -0,0 +1,35 @@
## vela config set
Set data for a config
### Synopsis
Set data for a config
```
vela config set
```
### Examples
```
vela config set <config-name> KEY=VALUE K2=V2
```
### Options
```
-h, --help help for set
```
### Options inherited from parent commands
```
-e, --env string specify environment name for application
```
### SEE ALSO
* [vela config](vela_config.md) - Manage configurations
###### 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 20-Oct-2020
###### Auto generated by spf13/cobra on 16-Nov-2020

View File

@@ -0,0 +1,36 @@
## vela delete
Delete an application
### Synopsis
Delete an application
```
vela delete APP_NAME
```
### Examples
```
vela delete frontend
```
### Options
```
-h, --help help for delete
--svc string delete only the specified service in this app
```
### 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

@@ -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 20-Oct-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 20-Oct-2020
###### Auto generated by spf13/cobra on 16-Nov-2020

View File

@@ -22,7 +22,8 @@ vela env init test --namespace test --email my@email.com
--domain string specify domain your applications
--email string specify email for production TLS Certificate notification
-h, --help help for init
--namespace string specify K8s namespace for env (default "default")
--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 20-Oct-2020
###### Auto generated by spf13/cobra on 16-Nov-2020

View File

@@ -13,7 +13,7 @@ vela env ls
### Examples
```
vela env list [env-name]
vela env ls [env-name]
```
### Options
@@ -30,6 +30,6 @@ vela env list [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 20-Oct-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 20-Oct-2020
###### Auto generated by spf13/cobra on 16-Nov-2020

32
docs/en/cli/vela_exec.md Normal file
View File

@@ -0,0 +1,32 @@
## vela exec
Execute command in a container
### Synopsis
Execute command in a container
```
vela exec [flags] APP_NAME -- COMMAND [args...]
```
### Options
```
-h, --help help for exec
--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)
-i, --stdin Pass stdin to the container (default true)
-t, --tty Stdin is a TTY (default true)
```
### 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

@@ -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
@@ -19,7 +19,8 @@ vela init
### Options
```
-h, --help help for init
-h, --help help for init
--render-only Rendering vela.yaml in current dir and do not deploy
```
### Options inherited from parent commands
@@ -32,4 +33,4 @@ vela init
* [vela](vela.md) -
###### Auto generated by spf13/cobra on 20-Oct-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]
@@ -14,10 +14,11 @@ vela install [flags]
```
-h, --help help for install
--image-pull-policy string vela core image pull policy, this will align to chart value image.pullPolicy (default "Always")
--image-pull-policy string vela core image pull policy, this will align to chart value image.pullPolicy (default "IfNotPresent")
--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 string wait until vela-core is ready to serve, default will not wait (default "0s")
```
### Options inherited from parent commands
@@ -30,4 +31,4 @@ vela install [flags]
* [vela](vela.md) -
###### Auto generated by spf13/cobra on 20-Oct-2020
###### Auto generated by spf13/cobra on 16-Nov-2020

30
docs/en/cli/vela_logs.md Normal file
View File

@@ -0,0 +1,30 @@
## vela logs
Tail logs for application
### Synopsis
Tail logs for application
```
vela logs [flags]
```
### Options
```
-h, --help help for logs
-o, --output string output format for logs, support: [default, raw, json] (default "default")
```
### 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

36
docs/en/cli/vela_ls.md Normal file
View File

@@ -0,0 +1,36 @@
## vela ls
List services
### Synopsis
List services of all applications
```
vela ls
```
### Examples
```
vela ls
```
### Options
```
--app string specify the name of application
-h, --help help for ls
```
### 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

@@ -19,15 +19,15 @@ vela metrics frontend
### Options
```
-a, --app string create or add into an existing application group
--detach detach trait from component
--detach detach trait from service
--enabled (default true)
-f, --format string format of the metrics, default as prometheus (default "prometheus")
-h, --help help for metrics
--path string (default "/metrics")
--port int (default 8080)
--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
--svc string specify one service belonging to the application
```
### Options inherited from parent commands
@@ -40,4 +40,4 @@ vela metrics frontend
* [vela](vela.md) -
###### Auto generated by spf13/cobra on 20-Oct-2020
###### Auto generated by spf13/cobra on 16-Nov-2020

View File

@@ -0,0 +1,32 @@
## vela port-forward
Forward local ports to services in an application
### Synopsis
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]
```
### Options
```
--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
```
-e, --env string specify environment name for application
```
### SEE ALSO
* [vela](vela.md) -
###### 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

@@ -19,14 +19,12 @@ vela route frontend
### Options
```
-a, --app string create or add into an existing application group
--detach detach trait from component
--detach detach trait from service
--domain string
-h, --help help for route
--issuer string
--path string
--port int (default 443)
-s, --staging only save changes locally without real update application
--svc string specify one service belonging to the application
```
### Options inherited from parent commands
@@ -39,4 +37,4 @@ vela route frontend
* [vela](vela.md) -
###### Auto generated by spf13/cobra on 20-Oct-2020
###### Auto generated by spf13/cobra on 16-Nov-2020

View File

@@ -0,0 +1,39 @@
## vela scaler
Attach scaler trait to an app
### Synopsis
Attach scaler trait to an app
```
vela scaler <appname> [args]
```
### Examples
```
vela scaler frontend
```
### Options
```
--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
```
-e, --env string specify environment name for application
```
### SEE ALSO
* [vela](vela.md) -
###### Auto generated by spf13/cobra on 16-Nov-2020

36
docs/en/cli/vela_show.md Normal file
View File

@@ -0,0 +1,36 @@
## vela show
Show details of an application
### Synopsis
Show details of an application
```
vela show APP_NAME [flags]
```
### Examples
```
vela show APP_NAME
```
### Options
```
-h, --help help for show
-s, --svc string service name
```
### 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

@@ -0,0 +1,36 @@
## vela status
Show status of an application
### Synopsis
Show status of an application, including workloads and traits of each service.
```
vela status APP_NAME [flags]
```
### Examples
```
vela status APP_NAME
```
### Options
```
-h, --help help for status
-s, --svc string service name
```
### 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

27
docs/en/cli/vela_svc.md Normal file
View File

@@ -0,0 +1,27 @@
## vela svc
Manage services
### Synopsis
Manage services
### Options
```
-a, --app string specify the name of application containing the services
-h, --help help for svc
```
### Options inherited from parent commands
```
-e, --env string specify environment name for application
```
### SEE ALSO
* [vela](vela.md) -
* [vela svc deploy](vela_svc_deploy.md) - Initialize and run a service
###### 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