Compare commits

...

1280 Commits

Author SHA1 Message Date
Zheng Xi Zhou
3800a700b0 Add parameters comments for crossplane definitions (#1515)
* Add parameters commetns for crossplane definitions

Added parameter comments for ComponentDefinition alibaba-oss
alibaba-rds and TraitDefinition service-binding

* add the result of vela show
2021-04-16 22:24:50 +08:00
Jianbo Sun
75f081f248 Add More End User Docs (#1511)
* update docs

* update docs

* refine cloud resource docs

* update install guidegst
2021-04-16 21:46:44 +08:00
yangsoon
fb6d505e6e fix kubectl vela -h (#1512) 2021-04-16 20:43:26 +08:00
yangsoon
1a267bc6d1 add end-user/sidecar (#1513) 2021-04-16 20:42:41 +08:00
Zheng Xi Zhou
8643558f6b Add cloud service docs for end-users (#1510)
* Add cloud service docs for end-users

Split cloud service into two section, one for platform engineers,
and the other for end-users

* correct titles

* adjust componentdefinition and traitdefinition order

* address comments
2021-04-16 18:13:54 +08:00
yangsoon
d063cd3b78 rm printcolumn AGE in crd (#1509) 2021-04-16 17:35:08 +08:00
yangsoon
c4fa81b703 add kubectl vela show in docs (#1508) 2021-04-16 17:27:05 +08:00
wyike
ebc8476a31 garbage collection mechanism for AppRevision (#1501)
* WIP refactor gc func

WIP write gc code

WIP update chart,cmd args

add cleanupRevison func into garbageCollection

add more test

finish unit-test

refactor use func implements

Complete e2e test

WIP rewrite some logic

add func test and rewirte context pointing to func

fix cilint

refactor some function

fix typo

fix ci error

change gc logic

after change gc number, fix all test

add check appRevision collection

WIP finish most code

* add rollout batch to fix rollout e2e-tet

* fix component name in rollout

* ignore gc error, just log the error
2021-04-16 16:46:41 +08:00
Zheng Xi Zhou
0333b9e891 Refactor template_test.go to make it readable (#1507)
Some tests are not named which make it difficult to
read test cases and add more
2021-04-16 15:39:05 +08:00
yangsoon
3be63bba91 add end-user/labels.md (#1505) 2021-04-16 13:58:42 +08:00
woshicai
f9f2c3b119 update: try to add workloadDefinitionRef to application status (#1471)
* add workloadDef in application status' services

* Update pkg/controller/core.oam.dev/v1alpha2/application/apply.go

* fix: go fmt

Co-authored-by: charles <charles.cai@sap.com>
Co-authored-by: Jianbo Sun <wonderflow.sun@gmail.com>
2021-04-16 13:21:52 +08:00
xiqiu618
34684650c3 fix appContext update failed error (#1500)
* fix appContext update failed error

* Update pkg/controller/core.oam.dev/v1alpha2/applicationcontext/applicationcontext_controller.go

Co-authored-by: Jianbo Sun <wonderflow.sun@gmail.com>

* gofmt comments

Co-authored-by: Jianbo Sun <wonderflow.sun@gmail.com>
2021-04-16 13:05:09 +08:00
Ryan Zhang
e76992df87 randomize port to listen to separate tests (#1497)
* randomize the port

* make all tests sequential
2021-04-16 10:16:20 +08:00
yangsoon
3a68ec77fd fix CI: add action to release kubectl-vela binary file (#1503)
* add kubectl-vela release

* add docs
2021-04-15 22:54:31 +08:00
yangsoon
199e747865 Introduce vela as a kubectl plugin (#1485)
* add kubectl plugin

* add vela show

* add test
2021-04-15 18:25:46 +08:00
Jianbo Sun
c6b65cbd5b fix flaky test (#1498)
* fix flaky test

* fix flaky check apprevision created more than one

* remove unused annottaion
2021-04-15 18:25:17 +08:00
xiqiu618
9fa237721e add app name as label for AppRevision (#1488) 2021-04-15 15:41:53 +08:00
yangsoon
b90fffad43 fix action (#1496) 2021-04-15 10:06:29 +08:00
Lei Zhang (Harry)
1ad6dcc1a7 Modify doc title of keda trait (#1494) 2021-04-15 08:54:27 +08:00
yangsoon
1659528015 fix-resources-url (#1492) 2021-04-14 23:50:07 +08:00
Jianbo Sun
ce20f55382 add an overview for end user guide (#1469)
* add an overview for end user guide

end user guide

* add explore section

* finish scale section

* add expose section

* remove trait already contains as built-in feature

* try fix flaky test
2021-04-14 21:38:04 +08:00
Zheng Xi Zhou
384c5ab6a9 Remove trait-injector from controller options (#1490)
As trait injector isn't used, so removed it.
2021-04-14 18:54:02 +08:00
wyike
a7bfb2fb6f refactor appRevison extract func to utils (#1481)
* refactor appRevison extract func to utils

* add some corener case check

* add more checks
2021-04-14 15:48:23 +08:00
C.YAO
8703950da6 Fix helm install error when disable webhook patch (#1483) 2021-04-14 12:51:16 +08:00
Ryan Zhang
f7cfe6fbae improve cloneset integration test suite (#1482) 2021-04-14 12:29:28 +08:00
Shiwen Cheng
e8ed4d78cf Keep docker binary command due to the issue #416 (#1478) 2021-04-14 11:26:35 +08:00
Gallardot
0c8e22ef4d fix tiny typo (#1480)
Signed-off-by: Gallardot <tttick@163.com>
2021-04-14 10:56:33 +08:00
Lei Zhang (Harry)
e9004d7478 Fix introduction (#1479) 2021-04-14 10:55:31 +08:00
Serhat Şevki Dinçer
282efa2893 Create codeql-analysis.yml (#1470)
* Create codeql-analysis.yml

* rm schedule from codeql

* codeql: master & release branches only on push

* codeql: use release-* pattern

Co-authored-by: Jianbo Sun <wonderflow.sun@gmail.com>

Co-authored-by: Jianbo Sun <wonderflow.sun@gmail.com>
2021-04-14 10:54:08 +08:00
yangsoon
580157df6a refactor vela cli (#1475) 2021-04-13 20:13:07 +08:00
yangsoon
6ecb0567f5 change email (#1477) 2021-04-13 20:11:41 +08:00
Yue Wang
dcf79a9b57 fix falky unit test (#1474)
Signed-off-by: roy wang <seiwy2010@gmail.com>
2021-04-13 20:01:47 +08:00
Yue Wang
b411d79ed0 add webhook validation on CUE template outputs name (#1460)
add hooks for process.Context to do validation

add unit test

Signed-off-by: roy wang <seiwy2010@gmail.com>
2021-04-13 19:18:15 +08:00
Lei Zhang (Harry)
d8eb7d687c Add user docs (#1472) 2021-04-13 15:20:39 +08:00
Yue Wang
63b348f4d8 implement cli vela system live-diff (#1419)
move dry-run and live-diff into an independent pkg

WIP add sample and doc

WIP unit test for live-diff

add unit test

Signed-off-by: roy wang <seiwy2010@gmail.com>
2021-04-13 12:29:25 +08:00
Ryan Zhang
2e43a6dc78 make sure we don't create more pods (#1452) 2021-04-12 15:48:20 -07:00
Jianbo Sun
26163aacdc fix flaky test (#1467) 2021-04-12 16:51:06 +08:00
yangsoon
5164efeb4a add context.appRevisionNum (#1466) 2021-04-12 15:36:19 +08:00
wyike
2254777523 ignore error not found when deleting resourceTracker (#1462)
* ingore error not found when delete resourceTracker

* ignore error not found
2021-04-12 10:57:16 +08:00
LeoLiuYan
389722a94e Remove duplicated logic (#1465)
Signed-off-by: LeoLiuYan <929908264@qq.com>
2021-04-12 10:24:34 +08:00
Shiwen Cheng
4b86689d63 Update copyright year (#1464)
* Update copyright year to 2021 for The KubeVela Authors

* Update copyright year to 2021 for other project authors
2021-04-11 21:00:14 +08:00
Shiwen Cheng
2b07ec49d4 [Improvement-1457] Use kind cmd code to load docker image instead of local kind binary (#1458)
* [Improvement-1457] Use kind cmd code to load docker image instead of local kind binary

* [Improvement-1457] Update copyright year and kind repo declaration
2021-04-11 20:59:21 +08:00
Yue Wang
7edfbde2f5 skip applying helm-release if app spec not change (#1461)
Signed-off-by: roywang <seiwy2010@gmail.com>
2021-04-11 15:47:00 +08:00
Yue Wang
bc6a60dde2 add volumes definition in worker/webservice (#1459)
Signed-off-by: roywang <seiwy2010@gmail.com>
2021-04-11 14:18:48 +08:00
Lei Zhang (Harry)
1407fc5125 Update readme for 1.0 (#1453) 2021-04-11 14:11:03 +08:00
Yue Wang
2d6f2083db refactor pkg/appfile (#1447)
Signed-off-by: roy wang <seiwy2010@gmail.com>
2021-04-11 14:10:16 +08:00
yangsoon
c619b7b290 fix bug which Component/TraitDefinition won't work when contains "_|_" in value (#1450) 2021-04-09 21:46:04 +08:00
wyike
bc6000f794 fix flaky appcontext e2e-test (#1449) 2021-04-09 21:42:17 +08:00
yangsoon
2e92a66fa5 fix data race (#1446) 2021-04-09 20:15:02 +08:00
Shiwen Cheng
e5a9be8de9 Improve makefile and dockerfile (#1445)
* Improve makefile and dockerfile

* Add entrypoint.sh to support entrypoint and debugging

* Add docker base image discussion issue #1448 in dockerfile
2021-04-09 20:12:57 +08:00
Jianbo Sun
5d40f121ea add release docs when have tag (#1444) 2021-04-09 16:50:59 +08:00
woshicai
58c3283411 update: run helm lint & test after e2e-setup (#1415)
Co-authored-by: charles <charles.cai@sap.com>
2021-04-09 14:13:59 +08:00
Ryan Zhang
6d65169449 fix webhooks and try to fix e2e (#1441)
* fix webhooks and try to fix e2e

* address comments
2021-04-09 13:27:16 +08:00
yangsoon
9bf6cc2659 update version (#1442) 2021-04-09 12:28:04 +08:00
Lei Zhang (Harry)
ecbb5f56ca Update doc (#1440) 2021-04-09 11:10:03 +08:00
yangsoon
7ede0746c1 add clean-image action (#1436) 2021-04-09 10:17:21 +08:00
Zheng Xi Zhou
e8e45dd7d3 Add unit-tests for ApplicationRollout related packages (#1413)
* Add unit-tests for ApplicationRollout related packages

Part I: pkg/controller/common/rollout

* Add more unittets

* add unit tests for cloneset controller

* fix test issue

* add more unit-tests for cloneset_controller and deployment_controller

* fix rebase issues
2021-04-08 14:08:48 -07:00
yangsoon
08a1dc5a22 Add package discover refresh when component/trait definition are registered (#1402)
* add discover refresh

* add test

* fix store openapi schema

* fix discovermapper
2021-04-08 20:35:21 +08:00
Jianbo Sun
d2a46322c0 Merge pull request #1434 from chengshiwen/add-short-name
Add short name for crds
2021-04-08 20:15:22 +08:00
chengshiwen
7d31d84ec3 Remove redundant and ambiguous short names 2021-04-08 19:49:28 +08:00
chengshiwen
f59341f667 Add short name for crds 2021-04-08 19:49:23 +08:00
Jian.Li
a446aab46b Fix Bug: strategyUnify not work with close call (#1430) 2021-04-08 18:41:04 +08:00
Shiming Zhang
f2de6de6f8 Remove useless code (#1433)
Signed-off-by: Shiming Zhang <wzshiming@foxmail.com>
2021-04-08 18:39:42 +08:00
guoxudong
0f23f6eb09 stop zh-CN docs sync (#1431)
Co-authored-by: guoxudong <guoxudong.dev@gmial.com>
2021-04-08 17:23:45 +08:00
Lei Zhang (Harry)
473164efbd Finalize the message (#1426) 2021-04-08 15:54:40 +08:00
yangsoon
7dec0afc16 vela-cli support use "vela system cue-packages" to list cue-package (#1417)
* support list cue-package

* add test kube package doc

* refine words

* fix workflow

* fix the docs

Co-authored-by: 天元 <jianbo.sjb@alibaba-inc.com>
2021-04-08 15:54:25 +08:00
Jianbo Sun
a44257e153 fix flaky test (#1427) 2021-04-08 14:34:36 +08:00
yangsoon
1261e2678f add podDisruptive to traitdefinition (#1192)
* add podDisruptive to traitdefinition

* fix docs & example

* fix diff and add docs

* use bool type for podDisruptive

Co-authored-by: 天元 <jianbo.sjb@alibaba-inc.com>
2021-04-08 13:39:03 +08:00
Ryan Zhang
325a4cdb0e Add a new cloneset scale controller (#1301)
* add scale implementation

* fine tune the logic and adjust e2e test

* fix tests and fine tune logic

* try to fix flaky verification

* allow zero size step

* fix scale down check
2021-04-07 11:14:46 -07:00
wyike
b33b6fbead garbage collection for cross-namespace workloads and traits in application layer (#1421)
* add logic for gc cross ns resources

WIP regenerate api and charts

rewrite handle resourceTracker logic

WIP add e2e test logic

add more e2e  test

* WIP refactor sevral funs name and add comments for code

* WIP add more corener case e2e test

* add unit test and fix bug

* WIP refactor handleResouceTracker  logic

* refactor func name aglin with others and add comments

* make generate to fix check-diff ci error

* change resourceTracker status as a subresource
2021-04-07 21:34:48 +08:00
Jian.Li
15b1bd2660 Fix the bug that the registered k8s built-in gvk does not exist (#1414)
* fix bug for method exist(gvk)

* check that all built-in k8s resource are registered
2021-04-07 13:06:19 +08:00
yangsoon
8c73ea5d8a fix keda.md (#1420) 2021-04-06 16:07:22 +08:00
Jian.Li
4b25ed4ba1 fix import inner package in the format of third party package path and split test cases (#1412)
* test third party path in cue

* fix typo

* fix pkg mount bug

Co-authored-by: 天元 <jianbo.sjb@alibaba-inc.com>
2021-04-02 13:04:52 +08:00
Jianbo Sun
f47ca0f4da remove no used ingress notes in charts (#1405)
* remove no used ingress notes in charts

* remove helm repo update
2021-04-02 10:58:07 +08:00
Herman Zhu
5b1b054cca refactor(workload) remove all the duplicate fields (#1410)
remove all the duplicate fields in parser above as template contains

fix #1388

Signed-off-by: zhuhuijun <zhuhuijunzhj@gmail.com>
2021-04-02 10:24:27 +08:00
Lei Zhang (Harry)
35376bd396 Reword readme for clearer message (#1408)
Rewording the readme
2021-04-02 09:41:23 +08:00
Lei Zhang (Harry)
06069d3580 Update docs to reflect app delivery idea (#1401) 2021-04-01 15:26:25 +08:00
yangsoon
43057161bf update contributing guide (#1398) 2021-04-01 13:54:56 +08:00
woshicai
50ded65805 Fix: update homebrew before install kubevela client (#1395)
Co-authored-by: charles <charles.cai@sap.com>
2021-04-01 12:45:40 +08:00
Stupig
1444376b0c newline is missing for BaseContextFile (#1396) 2021-04-01 12:07:27 +08:00
yangsoon
04486f89bb fix crd: add additional print column and short Name for CRD (#1377)
* add additional print column

* add shortname

* fix printcolumn & test
2021-04-01 11:51:43 +08:00
Zheng Xi Zhou
d6d19a7c5a Remove outputSecretName in cloud service provisoing and consuming (#1393)
Refer to the reason https://github.com/oam-dev/kubevela/issues/1128#issuecomment-811590631
2021-04-01 11:13:19 +08:00
Jianbo Sun
6b8875012d use shell instead action to sync website && don't sync index.js and config.js (#1386)
* use shell instead action to sync website && don't sync index.js and config.js

* update test website build

* use bash instead sh
2021-04-01 10:06:34 +08:00
joelhy
7ae6a148a0 Fix grammar error: changed "an success story" to "a success story" (#1385) 2021-03-31 23:33:00 +08:00
Jianbo Sun
bbea29c8e5 fix kube-webhook-certgen to patch CRD conversation && remove cert-manager in CI e2e test && remove issuer create from CLI env (#1267)
* remove cert-manager in CI e2e test and remove issuer create from CLI env

* update job patch image(https://github.com/wonderflow/kube-webhook-certgen)
2021-03-31 21:21:28 +08:00
Robin Brämer
6e6c4c76a6 fix docs typo (#1384) 2021-03-31 19:56:36 +08:00
wyike
1bf673c3c1 upgrade webhook configuration to v1 (#1383) 2021-03-31 19:56:09 +08:00
yangsoon
352fe1ba5b remove useless script & update install.mdx (#1382) 2021-03-31 18:40:34 +08:00
Yue Wang
3bdf7a044f fix generate schema for helm values (#1375)
Signed-off-by: roy wang <seiwy2010@gmail.com>
2021-03-31 17:31:54 +08:00
yangsoon
3cb9fa79bf fix index.js (#1380) 2021-03-31 16:01:53 +08:00
wyike
20f6e0ab02 skip check cross ns resource owner, add tests (#1374) 2021-03-31 15:00:16 +08:00
Kinso
438ab96f95 fix: add "system-definition-namespace" flag to container args (#1371)
Co-authored-by: kinsolee <lijingzhao@forchange.tech>
2021-03-31 14:41:07 +08:00
yangsoon
b5bf7a4f62 fix siderbar (#1373) 2021-03-31 14:39:09 +08:00
Lei Zhang (Harry)
d473e41f20 Update readme and doc (#1376) 2021-03-31 14:38:46 +08:00
Jianbo Sun
96c1d0786a the application context should not own application object (#1370)
* the application context should not own application object

* add time for flaky test
2021-03-31 13:55:57 +08:00
yangsoon
f7196e10ca fix upgrade in install.mdx (#1364) 2021-03-30 21:37:48 +08:00
yangsoon
a2997a070d fix vela show (#1366) 2021-03-30 21:36:28 +08:00
Ryan Zhang
0629049e1f add initial finalizer and abandon support (#1362)
* add initial finalizer and abandon support

* fix lint
2021-03-30 02:04:38 -07:00
yangsoon
553b5d19eb add docs readme (#1359) 2021-03-30 16:37:46 +08:00
Jianbo Sun
07c8c23884 minor fix for docs (#1356)
* minor fix for docs

* minor fix for docs

* remove blog
2021-03-30 08:47:20 +08:00
Hongchao Deng
d5d0cd1878 Add AppRevision option in webservice template and refine website doc (#1355) 2021-03-30 07:22:35 +08:00
Hongchao Deng
1d315aa045 Merge pull request #1354 from wonderflow/fixowner
use ApplicationContext as the owner of all the resources if it controlled by Application
2021-03-29 09:56:24 -07:00
天元
74a95133b2 fix log 2021-03-30 00:39:18 +08:00
天元
78ed5cade0 minor fix 2021-03-30 00:24:10 +08:00
天元
72f533e5eb use AppContext as the ownerRef 2021-03-30 00:21:17 +08:00
天元
4918b5cee7 fix test 2021-03-29 23:48:51 +08:00
天元
0d8f656cdb fix some tests 2021-03-29 23:45:29 +08:00
天元
ffe08904f0 add a todo for fix by the ownerRef change 2021-03-29 23:31:52 +08:00
wyike
eb4efc960f add demo for app doc (#1349)
* add demo for app doc

* Update docs/en/application.md

Co-authored-by: Jianbo Sun <wonderflow.sun@gmail.com>
2021-03-29 23:25:43 +08:00
天元
4729c8af80 use Application as the owner if it exists 2021-03-29 23:10:59 +08:00
Hongchao Deng
2d95800618 Merge pull request #1352 from wonderflow/hongchaodeng-revlabel
add AppRevision label to cuetemplate
2021-03-29 05:26:52 -07:00
Jian.Li
567fc46642 fix unstable test case for crd package (#1341)
* check crd openapi exist

* space

* fmt

* remove space

* space

* remove space

* space

* test +1

* test +2

* test +3

* rebase master
2021-03-29 20:02:39 +08:00
天元
de798f3c8a add docs about revision and context 2021-03-29 20:01:58 +08:00
天元
b5cbc75734 add FinalizeAppRevision 2021-03-29 19:50:40 +08:00
天元
8ef3a37c50 :evert "add AppRevision label to cuetemplate"
This reverts commit 49f16274c9.
2021-03-29 19:46:56 +08:00
天元
05c0fb8f9a fix test 2021-03-29 19:45:29 +08:00
yangsoon
14caa9cb70 fix docs: change restful-api url refer to static resource (#1346)
* change restful-api refer to static resource

* fix vela-cli install cmd in windows
2021-03-29 18:46:12 +08:00
Zheng Xi Zhou
f58b68205b Add cloud service doc in official site (#1348) 2021-03-29 18:34:33 +08:00
Jianbo Sun
bba5de9a8c update TOC (#1347)
* update TOC

* Update docs/sidebars.js
2021-03-29 18:33:00 +08:00
yangsoon
f762a1279e add docs check (#1340) 2021-03-29 18:28:05 +08:00
天元
26b9db6322 Merge branch 'revlabel' of git://github.com/hongchaodeng/kubevela into hongchaodeng-revlabel 2021-03-29 17:35:36 +08:00
Zheng Xi Zhou
9e40b77b60 Support cloud resource provisiong and consuming (#1264)
* Support cloud resource provisioning and consuming (Crossplane)

Provided a way to store secret for cloud resource generated by
Crossplane and to consume the secret

Refer to #1128

* Separate cloud resource producer and consumer in two applications

* add unit test to check whether application can consume cloud resource secret

* update Cloud Resource doc

* Provisioning and consuming cloud resource in different applications v1 (one cloud resource)

* one component consumes two cloud resources

Co-authored-by: Jianbo Sun <wonderflow.sun@gmail.com>
2021-03-29 17:20:33 +08:00
guoxudong
14635b6f2d fix docs build (#1344)
Co-authored-by: guoxudong <guoxudong.dev@gmial.com>
2021-03-29 16:45:40 +08:00
yangsoon
ba78ea7f0e fix link & add upgrade step in installation (#1345) 2021-03-29 16:12:15 +08:00
Hongchao Deng
02976bea67 fix common labels 2021-03-29 01:35:40 -04:00
guoxudong
ce5f345fc4 fix (#1336)
Co-authored-by: guoxudong <guoxudong.dev@gmial.com>
2021-03-29 12:17:56 +08:00
yangsoon
284cd8aa72 fix docs (#1338) 2021-03-29 11:20:37 +08:00
Hongchao Deng
49f16274c9 add AppRevision label to cuetemplate 2021-03-28 22:21:29 -04:00
LeoLiuYan
c4cf704eea Fix revision hash compute (#1335)
Signed-off-by: LeoLiuYan <929908264@qq.com>
2021-03-29 10:02:55 +08:00
Hongchao Deng
66bcb612ef add appdeployment control logic (#1320)
* add appdeployment control logic

* fix check

* fix test

* add test

* comment
2021-03-28 18:18:47 -07:00
yangsoon
ea60117ba5 remove useless files (#1333) 2021-03-29 08:20:46 +08:00
Jianbo Sun
2dfc653ef0 add gitub action to sync docs to website (#1331)
* action for auto docs

* test

* fix

* merge action file

* update

* test

* update

* update

* update

* bump github action

* test

* bump action to 0.2.3

* add ignore file

* revert empty line

Co-authored-by: guoxudong <guoxudong.dev@gmail.com>
2021-03-28 18:29:28 +08:00
Jian.Li
cfabcee181 Import kube package(cue) by GroupVersion (#1309)
* package upgrade

* package import

* Classified by groupversion

* fix test cases

* add test cases

* check diff

* lint code

* fix test

* add pacakge reference

* VersionKind

* package upgrade

package import

Classified by groupversion

fix test cases

add test cases

check diff

lint code

fix test

add pacakge reference

VersionKind

fix ci
2021-03-28 18:08:31 +08:00
yangsoon
aa548ab3d4 fix action (#1332) 2021-03-28 17:18:21 +08:00
yangsoon
52c88ec6c5 Update docs for the format of the new website (#1330)
* update docs

* fix toc

* add zh-CN
2021-03-28 16:37:35 +08:00
yangsoon
c71b5a20b6 fix error links. (#1329) 2021-03-28 14:03:21 +08:00
yangsoon
c4512decf1 fix vela show (#1327) 2021-03-28 10:37:31 +08:00
wyike
4540270813 Support create resources (workloads/traits) in different namespace with application (#1197)
[WIP]create tracker if needed and update components

[WIP] add finalizer code and add logic for ac controller

[WIP] refactor handle  func to app handler

[WIP] support helm cross namespace

[WIP] rewrite application  controller logic

rebase master and solve conflict

WIP add base cross namespace workload and fix some bugs

add more e2e-test and fix some bugs

rebase master and resolve confilict

move resourceTracker to v1beta1

add v1beta1 to test scheme to  fix test

modify e2e test, change v1alpha2 application to v1beta1

delete resourceTracker crossplane catagory

add controller logic test

add unittest for finalizer related func

add more unit test

neet order import

walk around check-diff error

add docs

add some comments in AC controller

as review said modify some issues
2021-03-27 15:19:43 +08:00
Ryan Zhang
95622cafa4 add rollout doc (#1324)
* add rollout doc

* fix doc
2021-03-27 15:10:51 +08:00
Lei Zhang (Harry)
cbc866ccae Rewrite the doc (#1322) 2021-03-27 15:02:23 +08:00
Jianbo Sun
68a0e40db4 propagate AppRevision Into context.AppRevision (#1323)
* refactor: calculate revision first before render AC and Components

* fix flaky e2e case

* add e2e test
2021-03-26 21:12:44 -07:00
yangsoon
6469d538be update docs & fix vela cap uninstall. (#1319) 2021-03-27 10:59:23 +08:00
Yue Wang
aa21bfcb60 fix e2e test of kube schematic (#1321)
* fix kube schematic

Signed-off-by: roywang <seiwy2010@gmail.com>

* fix e2e test

Signed-off-by: roywang <seiwy2010@gmail.com>
2021-03-27 10:15:57 +08:00
Yue Wang
baa8d87e71 implemente kube schematic (#1298)
* implemente kube schematic

generate schema for kube schematic parameters

add e2e test

Signed-off-by: roywang <seiwy2010@gmail.com>

* add unit test

Signed-off-by: roy wang <seiwy2010@gmail.com>

* add doc

Signed-off-by: roy wang <seiwy2010@gmail.com>
2021-03-26 23:02:58 +08:00
Jianbo Sun
1c89435515 fix app upgrade without rollout and rollout plan will create multiple version resources (#1315)
* fix app upgrade without rollout and rollout plan will create multiple version resources

* add and enhance tests

* fix test
2021-03-26 22:20:55 +08:00
Jianbo Sun
8e8ec58b97 merge e2e in one to save time (#1318) 2021-03-26 20:40:19 +08:00
Yue Wang
30baeabadc fix CI (#1317)
Signed-off-by: roywang <seiwy2010@gmail.com>
2021-03-26 19:34:00 +08:00
yangsoon
2c68c0e6d4 fix docs example (#1316) 2021-03-26 19:14:07 +08:00
wyike
0e9a3ceb3b fix unstable appcontext test (#1312) 2021-03-26 15:46:01 +08:00
wyike
74a82e0397 add header-check.sh (#1310)
add ci workflow

update scripts

add missed licence  header for all files
2021-03-26 15:24:19 +08:00
Jianbo Sun
20a31d4554 add cloud resource story doc (#1306) 2021-03-26 11:46:00 +08:00
yangsoon
31af7b780f fix vela components/workloads and vela cap (#1307)
* fix vela repeat get workloads list.

* fix vela cap
2021-03-26 11:23:27 +08:00
Ryan Zhang
0926469541 fix appRollout CRD version (#1303)
* fix appRollout CRD version

* make rollout e2e more robust
2021-03-26 08:23:10 +08:00
Jianbo Sun
94b7cbff21 better docs for build trait and use parameters (#1304) 2021-03-26 07:04:52 +08:00
Lei Zhang (Harry)
ec7eed3e37 Minor fix for docs (#1302) 2021-03-26 04:26:12 +08:00
Lei Zhang (Harry)
db8aee17f0 Merge pull request #1300 from resouer/fix
Fix GitHub readme issue
2021-03-25 11:34:32 -07:00
Lei Zhang
26f0db3d30 Fix GitHub readme issue 2021-03-25 11:18:22 -07:00
Jianbo Sun
d042c0c7ec add extend component definition in KubeVela (#1297)
* update docs

* refactor docs
2021-03-25 23:26:32 +08:00
Yue Wang
06a099f540 fix isControlledByApp in AC controller (#1294)
fix component_version e2e

Signed-off-by: roywang <seiwy2010@gmail.com>
2021-03-25 21:19:07 +08:00
Ryan Zhang
efa5078d81 fix appRevision label getting overridden (#1293)
* fix lable getting overidden

* randomize namespace
2021-03-25 17:28:17 +08:00
Jianbo Sun
b726481e7a update the docs v1alpha2->v1beta1 (#1292)
* fix example

* update the docs v1alpha2->v1beta1

* add more dependency for build runner
2021-03-25 16:44:47 +08:00
Ryan Zhang
c5d81c975a add abandoning state to the rollout (#1290)
* add abandoning state

* fine tunee2e timing and improve logging

* add back one application UT and fine tune timing in e2e and improve test robustness
2021-03-25 14:04:06 +08:00
yangsoon
33dae5e36e convert v1alpha2 to v1beta1 (#1289) 2021-03-25 10:55:54 +08:00
Jianbo Sun
53ae9aaa40 add webhook convert. (#1282)
fix diff

update example and test data version

fix convert function

fix e2e for helm

clean up creationTimestamp in a hack way

fix ci

pending package suit test

fix group version

fix ci

fix ut

rename type to kind

fix example

fix conflicts

Co-authored-by: yangsoon <yangsoonlx@gmail.com>
2021-03-24 17:15:20 -07:00
Ryan Zhang
a4fda31829 Restore rollout after the change to point to appRevision (#1271)
* modify appRollout to reference appRevision

* fine tune rollout e2e tests
2021-03-24 14:09:40 -07:00
yangsoon
e8a8981ef5 delay controller sync time (#1285) 2021-03-24 21:23:49 +08:00
yangsoon
fc55b65aad Compatible with Application containing WorkloadDefinition type helm moudle (#1261)
* add workloaddef ref to helm.

* fix package_suit_test

* show git diff result.
2021-03-24 21:22:29 +08:00
Jianbo Sun
9366c6e0b4 add hpa trait and fix template without params (#1279) 2021-03-24 16:18:58 +08:00
Yue Wang
b6218bf67d re-open e2e-test for helm schematic (#1277)
Signed-off-by: roy wang <seiwy2010@gmail.com>
2021-03-24 15:19:50 +08:00
yangsoon
4b9e933ca5 add v1beta1 types (#1268) 2021-03-24 13:27:29 +08:00
Hongchao Deng
ab7ccb7499 Merge pull request #1272 from hongchaodeng/appd-1
AppDeployment: Add definitions and utilities code
2021-03-23 20:52:02 -07:00
Jianbo Sun
4c392d263a fix ci (#1276) 2021-03-24 11:28:27 +08:00
Hongchao Deng
7fab96d363 fix mod 2021-03-23 23:12:52 -04:00
Jianbo Sun
320651c80d add doc for cue development guide (#1269)
* create toc

* add CUE development-guide

* fix dry-run description

* Update docs/en/cue/development-guide.md

* finish the guide

* fix ci and sidebar

Co-authored-by: yangsoon <yangsoonlx@gmail.com>
2021-03-24 11:08:09 +08:00
Hongchao Deng
c59c760ed5 comment 2021-03-23 22:40:45 -04:00
Hongchao Deng
6e73038f92 fix lint 2021-03-23 22:33:54 -04:00
Hongchao Deng
baff3d77c4 AppDeployment: Add API types, necessary labels, and utilities 2021-03-23 22:33:54 -04:00
guoxudong
94068571c5 fix the website (#1273)
Co-authored-by: guoxudong <guoxudong.dev@gmial.com>
2021-03-24 10:25:39 +08:00
Lei Zhang (Harry)
a96225a12b Merge pull request #1270 from resouer/readme
Add more details in readme
2021-03-23 15:46:21 -07:00
Lei Zhang
086effa141 Add more details in readme 2021-03-23 15:38:54 -07:00
Jianbo Sun
acf497b1c7 make CUE inner kube package as a standalone package && clean code (#1263) 2021-03-23 16:30:49 +08:00
Jianbo Sun
30f30d9c93 update to the website (#1259)
* add more info into readme

* update readme to add more details
2021-03-23 12:04:00 +08:00
Yue Wang
f554523196 generate OpenAPI schema for Helm schematic compDef (#1250)
* get JSON schema for Helm schematic ComponentDefinition

Signed-off-by: roy wang <seiwy2010@gmail.com>

* add e2e test

update doc

add unit tests

Signed-off-by: roywang <seiwy2010@gmail.com>
2021-03-23 00:16:17 +08:00
wyike
dbc4593b23 Add e2e test for App Context (#1240)
* add e2e test for context

add workload check

should not create AC

add test  trait render

update e2e-test logic

add switching context write status back to AppRevision logic

add create and pull apprevision test

quick fix for appContext ownerReference problem

add more tests

fix test

* add boilerplate

* rebase master fix issue

* rebase master and fix test

* fix check  interval time
2021-03-22 01:36:37 -07:00
Ryan Zhang
11bc937f62 temporaily disable rollout e2e test (#1260) 2021-03-22 13:17:31 +08:00
Hongchao Deng
75c123df2f fix metadata missing in AppRevision spec data (#1257)
* fix metadata missing in AppRevision spec data

* fix test
2021-03-22 11:29:25 +08:00
Jianbo Sun
0b72c7ce34 Merge pull request #1258 from Ghostbaby/rollout_status
docs(rollout) add rollout state transition graph
2021-03-22 10:30:35 +08:00
zhuhuijun
a856499c3f docs(rollout) add rollout state transition graph
Signed-off-by: zhuhuijun <zhuhuijunzhj@gmail.com>
2021-03-22 09:41:08 +08:00
Jianbo Sun
395f7d6849 Merge pull request #1256 from unknwon/patch-1
docs: minor fixes on introduction and concepts
2021-03-21 21:44:49 +08:00
ᴜɴᴋɴᴡᴏɴ
98bf8e6b86 Update concepts.md 2021-03-21 21:30:19 +08:00
ᴜɴᴋɴᴡᴏɴ
628f2e1fdb Update introduction.md 2021-03-21 21:09:52 +08:00
Jianbo Sun
eea2fd4c35 Merge pull request #1252 from LeoLiuYan/feat/remove_duplicated_logic
Remove duplicated logic of reset appRollout status
2021-03-21 09:18:26 +08:00
LeoLiuYan
48e8c24ad1 Remove duplicated logic of reset appRollout status
Signed-off-by: LeoLiuYan <929908264@qq.com>
2021-03-20 22:24:36 +08:00
Jianbo Sun
379e143222 Merge pull request #1251 from wonderflow/fix2
remove dashboard and migrate to velacp(fix release pipeline)
2021-03-20 20:11:46 +08:00
天元
d4705380a8 remove dashboard related code 2021-03-20 18:36:51 +08:00
天元
15ffac9a46 migrate dashboard to velacp(https://github.com/oam-dev/velacp/pull/73) 2021-03-20 17:11:33 +08:00
Jianbo Sun
ddcbb9aefd Merge pull request #1249 from wonderflow/fix2
fix generate dashboard source
2021-03-20 16:36:49 +08:00
天元
8666b6b6e9 fix generate dashboard source 2021-03-20 16:05:32 +08:00
Jianbo Sun
fe1c319f06 Merge pull request #1248 from wonderflow/fix2
fix release pipeline
2021-03-20 15:59:14 +08:00
天元
868530316c fix release pipeline 2021-03-20 15:44:06 +08:00
Ryan Zhang
135282834d swap appConfig with appContext (#1245)
* swap appConfig with appContext

* fix e2e test

* fix e2e test

* surpress helm test
2021-03-20 00:02:58 -07:00
Jianbo Sun
d6dc946998 Merge pull request #1247 from resouer/sidebar
Make sidebar even better
2021-03-20 13:08:19 +08:00
Jianbo Sun
f43db50af2 Merge pull request #1246 from wonderflow/docs
more useful vela system dry-run
2021-03-20 13:04:42 +08:00
天元
7931e2a0a5 more useful vela system dry-run 2021-03-20 12:51:00 +08:00
Lei Zhang
3f28a6d917 Make sidebar even better 2021-03-19 21:31:22 -07:00
Jianbo Sun
1c126c5a26 Merge pull request #1244 from wonderflow/docs
clean up docs
2021-03-20 09:14:43 +08:00
天元
0bc7454b79 delete no used project file 2021-03-20 08:56:54 +08:00
天元
f4c20d4459 update faq 2021-03-20 08:50:24 +08:00
天元
63d965d381 update vela cli docs and remove the deleted command docs 2021-03-20 08:45:39 +08:00
天元
d750cf2657 merge config/samples into docs/examples 2021-03-20 08:37:00 +08:00
天元
d253b84161 delete unused configs 2021-03-20 08:34:46 +08:00
天元
c6b477e1ca migrate demos to catalog https://github.com/oam-dev/catalog/pull/91 2021-03-20 08:32:16 +08:00
Jianbo Sun
243fba3b23 Merge pull request #1242 from resouer/doc
Fix message in doc readme
2021-03-20 08:15:06 +08:00
Lei Zhang
485cdff57a Fix message in doc readme 2021-03-19 16:07:13 -07:00
Lei Zhang (Harry)
bd00d2fc51 Merge pull request #1234 from resouer/doc
Fix sidebar and 404
2021-03-19 16:05:47 -07:00
Lei Zhang
d09531b343 Fix sidecar to 2 layers 2021-03-19 16:01:23 -07:00
Jianbo Sun
a3ecf7c510 Merge pull request #1241 from kushthedude/use_debug_flag
feat: add debug-flag for enabling logs in core-run
2021-03-20 06:20:57 +08:00
Jianbo Sun
657baf9f15 init applicationRevision Object as revision of Application (#1210)
* generate appRevision and create AC with the same name

* Update pkg/controller/core.oam.dev/v1alpha2/application/application_controller_test.go

* fix ci

Co-authored-by: Ryan Zhang <yangzhangrice@hotmail.com>
2021-03-19 12:30:31 -07:00
kushthedude
e978e26c25 feat: add debug-flag for enabling logs in core-run
Signed-off-by: kushthedude <kushthedude@gmail.com>
2021-03-19 22:29:29 +05:30
Jianbo Sun
3a2208f0d2 Merge pull request #1238 from mengjiao-liu/fix-dup-string
Fix duplicated string literals
2021-03-19 16:25:29 +08:00
Jianbo Sun
99e8ff648e Merge pull request #1237 from mengjiao-liu/format-code
Code normalization
2021-03-19 16:07:16 +08:00
Jianbo Sun
8e7d8a46e7 Merge pull request #1239 from mengjiao-liu/clean-up-dup-flag
Clean up code duplicate
2021-03-19 16:06:16 +08:00
wyike
4903eb7cb2 refactor ac reconcile so that we can reuse it in new AC (#1236)
* refactor ac reconcile so that it returns the status

* add appContext to reuse appconfig reconcile logic

* fix lint

* update makefile for verbose info

* fix appcontext register error

* fix application configuration finalizer bug

Co-authored-by: Ryan Zhang <yangzhangrice@hotmail.com>
2021-03-19 00:04:01 -07:00
mengjiao.liu
3742b98636 Clean up code duplicate 2021-03-19 15:00:18 +08:00
mengjiao.liu
72cdc3ec74 Fix duplicated string literals 2021-03-19 14:25:29 +08:00
Jian.Li
e4a5b17e90 Support import K8s native API and CRD in definition (#1211)
* vela builtin package

* add test cases

* add gvk test cases

* lint

* testEnv

* lint

* check-diff

* Optimized code

* test case split

* add docs
2021-03-18 22:22:40 -07:00
Jianbo Sun
276d544766 Merge pull request #1226 from oam-dev/fix-rollout
allow state transition to be modified at any state
2021-03-19 12:23:22 +08:00
Jianbo Sun
2084ac6e3d Merge pull request #1230 from mengjiao-liu/normalize-function-name
Fix the function and method names that does not conform to the naming convention
2021-03-19 12:22:59 +08:00
mengjiao.liu
fdefd614cf Code normalization 2021-03-19 10:46:01 +08:00
Lei Zhang
540d826295 Fix sidecar and 404 2021-03-18 17:23:21 -07:00
Lei Zhang (Harry)
ae5b8ff4af Revert "refactor docs into 2 layers" (#1232) 2021-03-18 12:06:12 -07:00
Jianbo Sun
25a2a8a60c Merge pull request #1231 from yangsoon/compatible-workloaddef
Compatible with WorkloadDefinition for Application
2021-03-18 23:42:54 +08:00
yangsoon
f51a07c802 add related test 2021-03-18 21:05:35 +08:00
mengjiao.liu
f4223ebc1a Fix the function and method names that does not conform to the naming convention 2021-03-18 20:09:36 +08:00
yangsoon
7b1037ccad application-controller compatible workloaddef. 2021-03-18 19:36:55 +08:00
Jianbo Sun
cafc8c5e5e Merge pull request #1229 from wonderflow/fixrace
fix data race in component definition test
2021-03-18 19:11:38 +08:00
天元
0161b082b6 fix data race 2021-03-18 17:56:22 +08:00
Jianbo Sun
837d6708e8 Merge pull request #1132 from kinsolee/fix/list-application
fix(api-server): application meta list reads from application crd
2021-03-18 17:39:13 +08:00
Jianbo Sun
ec27850e65 Merge pull request #1228 from captainroy-hy/modify-image-policy
modify image pull policy
2021-03-18 17:37:04 +08:00
roy wang
aaf0a37c4a modify image pull policy
Signed-off-by: roy wang <seiwy2010@gmail.com>
2021-03-18 17:24:49 +09:00
kinsolee
5acc5a9015 fix(api-server): application meta list reads from application crd 2021-03-18 15:57:44 +08:00
Jianbo Sun
857f382c7e Merge pull request #1225 from wonderflow/docs
refactor docs into 2 layers
2021-03-18 15:40:05 +08:00
Ryan Zhang
b0bf9b1d96 allow state transition to be modified at any state 2021-03-18 00:39:02 -07:00
天元
fdeedb31be refactor docs into 2 layers 2021-03-18 15:37:57 +08:00
Jianbo Sun
bdd2916972 Merge pull request #1224 from mason1kwok/add-skip-condition
add skip condition on e2e-rollout CI
2021-03-18 15:22:27 +08:00
mason1kwok
d6cb52d73a add skip condition on e2e-rollout CI 2021-03-18 14:54:37 +08:00
Jianbo Sun
ee649d9592 Merge pull request #1218 from resouer/fix-doc
Revise the doc site with recent features
2021-03-18 14:11:03 +08:00
Sichen Zhao
54339f7c05 add design.md (#1190)
* add design.md

* edit CONTRIBUTING.md: add link for desigin.md

Co-authored-by: Sichen Zhao <sichen.zhao@shopee.com>
2021-03-18 13:34:45 +08:00
Jianbo Sun
d0026839f4 Merge pull request #1201 from yangsoon/add-componentdef
Rename WorkloadDefinition to ComponentDefinion for Application
2021-03-18 13:25:52 +08:00
Lei Zhang
7bddeff93d Revise the doc site with recent features 2021-03-17 21:48:35 -07:00
Jianbo Sun
23a0da27d2 Merge pull request #1217 from oam-dev/revert-1209-testci
Revert "test run e2e on github native action runner"
2021-03-18 12:30:19 +08:00
yangsoon
6a96062464 add related test. 2021-03-18 12:12:09 +08:00
yangsoon
b788401920 fix e2e_test 2021-03-18 12:12:08 +08:00
yangsoon
c678247211 fix unit_test. 2021-03-18 12:12:08 +08:00
yangsoon
3345846f78 add help_test & fix componentdef-controller 2021-03-18 12:12:08 +08:00
yangsoon
c349c94181 fix app_controller & helm related tests. 2021-03-18 12:12:08 +08:00
yangsoon
7328e572e5 replace workloaddef with componentdef in app_controller 2021-03-18 12:12:08 +08:00
Jianbo Sun
019d8719a3 Revert "test run e2e on github native action runner (#1209)"
This reverts commit 86b363c56c.
2021-03-18 12:09:56 +08:00
Jianbo Sun
e335707ab0 Merge pull request #1216 from Ghostbaby/spelling_mistake
fix spelling mistake
2021-03-18 11:57:07 +08:00
Herman Zhu
dc89cfafa4 fix spelling mistake
Signed-off-by: Herman Zhu <zhuhuijunzhj@gmail.com>
2021-03-18 11:16:20 +08:00
Ryan Zhang
7e22c19383 move out rollout e2e (#1205)
* move out rollout e2e

* fix go workflow
2021-03-17 19:13:24 -07:00
Jianbo Sun
5b2b27e6a4 init ApplicationRevision CRD Object as revision of Application (#1214) 2021-03-17 18:34:10 -07:00
Jianbo Sun
86b363c56c test run e2e on github native action runner (#1209)
* test run e2e on github native action runner

* add ginkgo

Co-authored-by: Ryan Zhang <yangzhangrice@hotmail.com>
2021-03-17 17:45:10 -07:00
Yue Wang
b216c0a636 move test/integration (#1212)
Signed-off-by: roywang <seiwy2010@gmail.com>
2021-03-17 17:25:22 -07:00
Ryan Zhang
d4c2b7cb5a Refactor appConfig Controller to make it reusable and rename appDeployment to appRollout (#1208)
* temp

* rename appDeploy and refactor AC controller
2021-03-16 22:46:38 -07:00
Jianbo Sun
be03c788be Merge pull request #1203 from captainroy-hy/fix-unstable-e2e
fix unstable e2e test
2021-03-16 17:41:16 +08:00
roy wang
4c762ebf83 fix unstable e2e test
Signed-off-by: roy wang <seiwy2010@gmail.com>
2021-03-16 17:31:12 +09:00
Jianbo Sun
cbc7a3855e Merge pull request #1202 from wonderflow/upgradeci
upgrade golang ci lint to 1.38.0 and fix lint error
2021-03-16 16:07:19 +08:00
Jianbo Sun
abde9e789d Merge pull request #1047 from captainroy-hy/doc-trait-definition
add doc about definition and template
2021-03-16 16:05:00 +08:00
Jianbo Sun
6145e6edc2 Merge pull request #1204 from wonderflow/skipdupci
configure ci to skip duplicate job
2021-03-16 16:04:18 +08:00
天元
711a4a9d7a configure ci to skip duplicate job 2021-03-16 15:35:13 +08:00
天元
d7dbcfc1cc fix more lint error in deployment controller 2021-03-16 15:09:18 +08:00
天元
1cdcf2ab48 upgrade golang ci lint to 1.38.0 and fix lint error 2021-03-16 15:06:48 +08:00
Jianbo Sun
f589471640 Merge pull request #1183 from ryanzhang-oss/add-failure-rollback
Add deployment controller
2021-03-16 15:03:58 +08:00
Yue Wang
a76f847668 update doc about Helm schematic workload (#1198)
* update doc about Helm schemantic

Signed-off-by: roy wang <seiwy2010@gmail.com>

* update doc

Signed-off-by: roy wang <seiwy2010@gmail.com>

* Update docs/en/helm/known-issues.md

* Update docs/en/helm/known-issues.md

Co-authored-by: Jianbo Sun <wonderflow.sun@gmail.com>
2021-03-16 13:39:46 +08:00
roy wang
33df4d9dea add doc about defition and template
Signed-off-by: roy wang <seiwy2010@gmail.com>
2021-03-16 14:30:45 +09:00
Ryan Zhang
14b3a4d6cb refine the user experience by waiting for the AC to be templated 2021-03-15 22:03:23 -07:00
Ryan Zhang
e61cba4add add deployment demo 2021-03-15 20:40:02 -07:00
Ryan Zhang
7bd96bb324 implement deployment controller 2021-03-15 20:40:02 -07:00
Ryan Zhang
c34c5a9a6c finalize controller interface 2021-03-15 20:40:02 -07:00
Ryan Zhang
96d9287525 add deployment rollout demo 2021-03-15 20:39:55 -07:00
boris
6c0141a62d fix: check if namespace exists (#1187)
* fix: check if namespace exists

* Update pkg/utils/env/env.go

* Update pkg/utils/env/env.go

Co-authored-by: Jianbo Sun <wonderflow.sun@gmail.com>
2021-03-15 15:58:07 +08:00
Yue Wang
1652b4cf0c init Helm module (#1131)
use settings from App to override Values

add discovery util to get workload created by helm module

add helm typed structs into workloadDef and traitDef

update doc & refine code

add e2e test for helm module application

use oam.dev/catalog as helm repo

Signed-off-by: roywang <seiwy2010@gmail.com>
2021-03-15 00:54:43 -07:00
South China University
dd0979b912 Use ‘Ubuntu’ as default base image instead of 'Distroless' for debug convenience (#1186)
* use ubuntu as default base image

* Apply suggestions from code review

Co-authored-by: Jianbo Sun <wonderflow.sun@gmail.com>

Co-authored-by: Jianbo Sun <wonderflow.sun@gmail.com>
2021-03-15 12:24:12 +08:00
yangsoon
60df873b93 Store ComponentDefinition capability schema in configMap (#1180)
* store componentdefinition capability  schema in configMap

* fix componenetdef & traitdef controller test.

* change some componentdefinition field

* fix unit test error

* fix some code bug

* fix some yaml file error.

* fix copyright error
2021-03-15 11:08:46 +08:00
Jianbo Sun
52657ac7ba Merge pull request #1174 from wonderflow/cli
align cli to the application object
2021-03-12 16:42:06 +08:00
Jianbo Sun
99b8e4aba3 add license checker into CI (#1182) 2021-03-12 00:34:51 -08:00
wyike
ccc5826616 Remove 3 standard controller (route autoscaler metrics ) (#1172)
* delete 4 standard controllers related  code

delete related yaml

delete setup controller

add back podspecworkload controller

try to fix e2e

update related docs

fix failed test

fix docs problem

remove useless scheme

up timeout for e2e-test

change doc  structure

* fix go mod
2021-03-12 14:57:59 +08:00
天元
2d7cbf9467 faster vela traits/workloads 2021-03-12 14:02:45 +08:00
Jianbo Sun
cc044b0de5 Merge pull request #1181 from ryanzhang-oss/add-failure-rollback
enable rollout fail revert e2e test
2021-03-12 11:35:18 +08:00
天元
9d5b31be2b remove local files, diretly use Definition/Application in Cluster 2021-03-12 10:59:24 +08:00
Ryan Zhang
b64009c02d rollback after rollout failure 2021-03-11 18:31:41 -08:00
Ryan Zhang
2cebad6ff4 Enable more rollout e2e tests (#1176)
* enable a few CI tests

* fix webhook related test failure
2021-03-11 17:35:22 -08:00
天元
d84ebd3ae9 vela ls will list applications 2021-03-11 17:17:05 +08:00
Ryan Zhang
1048b399fd rename appRollout and add more fine tune tests (#1166)
* rename appRollout and add more fine tune tests

* improve rollout

* do not advance AC if we are not rolling

* fix e2e test bug

* fix the test
2021-03-11 15:56:38 +08:00
wangyike
c47dd8c16b fix dryrun use namespace 2021-03-11 15:47:15 +08:00
天元
bdf239f1ae delete health scope when delete app 2021-03-11 15:34:38 +08:00
Jianbo Sun
66c111be6c add appRevision into context (#1165) 2021-03-10 00:47:17 -08:00
Jianbo Sun
76f7f7e7a5 Merge pull request #1168 from zzxwill/definition-controller-copyright
Add or update copyright for workload/trait definition controllers
2021-03-10 16:11:47 +08:00
Jianbo Sun
7f8e53b29d Merge pull request #1103 from wonderflow/docs
add quick start for application CRD
2021-03-10 15:15:36 +08:00
zzxwill
9afe577087 Add or update copyright for workload/trait definition controllers
Added or updated copyright in newly added files for
orkloaddefinition and traitdefinition controllers and
its dependencies
2021-03-10 14:18:57 +08:00
天元
339889813b add quick start for application CRD
add quick start for application CRD

Update docs/en/quick-start.md

Co-authored-by: Hongchao Deng <hongchaodeng1@gmail.com>

Update docs/en/quick-start.md

Co-authored-by: Hongchao Deng <hongchaodeng1@gmail.com>
2021-03-10 10:57:26 +08:00
Zheng Xi Zhou
c2b6e6efdd Store capability OpenAPI V3 JSON schema in ConfigMap (#1106)
* Store capability OpenAPI V3 JSON schema in ConfigMap

Store the OpenAPI v3 JSON Schema generated from the parameters of
a capability which could be used by api server

To fix #899

address comments
try to fix data race issue

Co-authored-by: Jianbo Sun <wonderflow.sun@gmail.com>

* address comments: generate cue instance from cue json instead of local file

* update ConfigMap data at any time

* add more unit-test

* fix conflicts

* adapt to new spec.schematic.cue.template

* adapt to new spec.schematic.cue.template for controller unittest cases

* fix ci issues

* adapt to namespaced scope definition

* add more testcases on namespaced definitions with and without namespaces

Co-authored-by: Jianbo Sun <wonderflow.sun@gmail.com>
2021-03-10 10:44:58 +08:00
yangsoon
f60d6820d9 doc: add demo for webserver workload (#1153)
* add demo for webserver workload

* fix some fmt error
2021-03-09 16:47:07 +08:00
Jianbo Sun
dbc9523728 Merge pull request #1158 from captainroy-hy/rfc-log-1
use klog/v2 as logger in util/apply
2021-03-09 10:34:08 +08:00
roywang
6bf85f6f6e use klog/v2 as logger in util/applicator
Signed-off-by: roywang <seiwy2010@gmail.com>
2021-03-08 21:15:56 +09:00
Jianbo Sun
31b1490359 Merge pull request #1150 from Cweiping/fix/improve_install_doc_command_style
improve install doc command style
2021-03-08 11:17:14 +08:00
Jianbo Sun
8bbf62b8fe Merge pull request #1148 from Cweiping/fix/fix_vela_svc_ls_error
fix vela svc ls error
2021-03-07 16:02:19 +08:00
Weiping Cai
0c1b9eba35 improve install doc command style
Signed-off-by: Weiping Cai <weiping.cai@daocloud.io>
2021-03-06 21:05:55 +08:00
Weiping Cai
f17d3feb06 fix vela svc ls error
Signed-off-by: Weiping Cai <weiping.cai@daocloud.io>
2021-03-06 15:27:52 +08:00
Ryan Zhang
28fce2d7de rename applicationDeployment to appRollout (#1146)
* rename applicationDeployment to appRollout

* Update test/e2e-test/rollout_plan_test.go

Co-authored-by: Jianbo Sun <wonderflow.sun@gmail.com>

Co-authored-by: Jianbo Sun <wonderflow.sun@gmail.com>
2021-03-05 14:28:53 -08:00
WYike
994ef23c0c modify controller,webhook,api,chart (#1085)
solve failed test

add compatibility test for old crd

add app ns for cli

modify compatibility test

solve compatibility problem

add testing for  GetDefinition func with cluster scope CRD

generate code for compatibility-test

move testdata generate to makefile

optimize ci pipeline for compatibility-test
2021-03-04 23:14:18 -08:00
Jianbo Sun
784fc0b402 Merge pull request #1143 from yangsoon/workflow
fix #1140 delete image after e2e test
2021-03-05 12:56:12 +08:00
Jianbo Sun
68d5e6cdcc Merge pull request #1142 from ryanzhang-oss/e2e-test
add rollout cloneset based rudimentory e2e test
2021-03-05 12:15:49 +08:00
yangsoon
6c794bda08 fix issue #1140 delete image after e2e test 2021-03-05 12:04:07 +08:00
Ryan Zhang
1976a0fa64 removing the definitions by removing their CRDs 2021-03-04 19:56:54 -08:00
Ryan Zhang
c121d33b2c fix webhook nil pointer 2021-03-04 19:20:02 -08:00
Jianbo Sun
198c836849 cherry-pick(#1136) fix revision enable workload check and prevent GC if replica>0 (#1141)
* fix revision enable workload check and prevent GC if replica>0

* fix ci and vet
2021-03-04 18:52:48 -08:00
Ryan Zhang
6b73436362 add first rollout e2e test 2021-03-04 18:25:30 -08:00
Jianbo Sun
d938b9ee9e Merge pull request #1137 from ryanzhang-oss/fix-rolling
fix rolling with manual annotation and improve the demo a bit
2021-03-04 21:29:04 +08:00
Ryan Zhang
c520a24423 fix rolling with manaul annotation and improve the demo a bit 2021-03-04 00:34:09 -08:00
Ryan Zhang
eac2d37551 add webhook and kruise (#1135) 2021-03-03 23:21:02 -08:00
Jianbo Sun
570cf01949 Merge pull request #1117 from wonderflow/cap
align workload/trait definition schema with v0.2.2 spec
2021-03-04 11:55:08 +08:00
Jianbo Sun
a39c429020 Merge pull request #1133 from zzxwill/broken-link
Fix broken link
2021-03-04 11:11:14 +08:00
Jianbo Sun
003db753aa Merge pull request #1134 from Cweiping/fix/fix/arm_build_error
fix arm64 build failed and block our release pipeline
2021-03-04 11:10:19 +08:00
Weiping Cai
2fb2306117 fix arm64 build failed and block our release pipeline
Signed-off-by: Weiping Cai <weiping.cai@daocloud.io>
2021-03-04 09:59:43 +08:00
Zheng Xi Zhou
e5240932a7 Fix broken link
`E2E test` link in README.md is broken
2021-03-03 22:40:55 +08:00
天元
8c8ca60756 align workload/trait definition schema with v0.2.2 spec 2021-03-02 17:35:58 +08:00
Ryan Zhang
7207819080 fine tune rollout experience with demo (#1119)
* fine tune rollout experience with demo

* fix test
2021-03-02 17:24:12 +08:00
Jianbo Sun
48ee5a1d1c Merge pull request #1115 from wonderflow/cp1109
cherry-pick(1109 and 1114)
2021-03-02 16:35:16 +08:00
Jianbo Sun
84f34e3f01 Merge pull request #1118 from yangsoon/fixdoc
fix:fix doc, error link and format
2021-03-02 13:37:23 +08:00
天元
66177ddd13 update CRD and fix workload not create first time 2021-03-02 10:13:54 +08:00
Jianbo Sun
b4b3a8ab69 parent override child when annotation/labels conflicts && one revision will apply once only in force mode && AC.status CRD updated (#1109)
* when annotation/labels passthrough from parent to child conflicts, the parent will override the child.
e.g. 1) AC will override its component/workload; 2) workload will override child-resource; 3) AC will override its trait

* apply once only force will block workload apply when revision not changed even ac generation updated
2021-03-02 10:13:54 +08:00
yangsoon
488341398a fix:fix doc 2021-03-01 20:25:18 +08:00
Jianbo Sun
a8337921bc Merge pull request #1112 from ryanzhang-oss/rollout-e2e
Rollout e2e demo
2021-03-01 19:25:40 +08:00
Ryan Zhang
abf9270473 manual e2e test example with bug fixes 2021-03-01 01:00:27 -08:00
Holger Protzek
d6f28bfd9e Removed prometheus and certmanager crd's (#1005)
* Removed prometheus and certmanager crd's, use cert-manager helm chart dependency instead

* Fixed unit and 2e2 tests. Added servicemonitors and certmanager crd dependencies for tests as testdata.

* Run `helm dependency update`

* Delete kubevela helm release and namespace if existing

* WIP - Bad hack to add the certmanager crds before installing kubevela with cert-manager as dependency. The cert-manager crds are not available, when kubevela Issuer are installed otherwise.

* WIP Added admission patch for webhook

* WIP Refactored secrets config

* WIP Fixed helm chart

* WIP Disabled metrics cap, due missing prometheus dependency by default

* WIP Added certmanager for e2e tests

* WIP Added certmanager for e2e tests

* WIP cleanup

* Updated docs

* Re-added certificate mount path
2021-02-26 16:46:01 +08:00
Jianbo Sun
abaac1de2b Merge pull request #1108 from ryanzhang-oss/fix-appcontroller-loop
fix application controller loop
2021-02-26 11:21:09 +08:00
Jianbo Sun
e25f7598ca Merge pull request #1107 from captainroy-hy/chp-1099
cherry-pick(#1099) add unit test
2021-02-26 11:03:29 +08:00
Ryan Zhang
d4a47f733f fix application controller loop 2021-02-25 18:59:54 -08:00
roywang
171e20a7d6 add unit test
Signed-off-by: roywang <seiwy2010@gmail.com>
2021-02-26 11:36:37 +09:00
Jianbo Sun
9bf008aa3f Merge pull request #1102 from ryanzhang-oss/appConfig-init
Complete the app rollout implementation
2021-02-25 20:54:35 +08:00
Ryan Zhang
2b24bad2b8 appConfig prepare for workload rollout for the first time and complete the stand alone rollout logic 2021-02-25 00:58:17 -08:00
Jianbo Sun
97eac314de cherry-pick(#1101) fix component custom revison loop infinitely create revision (#1104)
* fix component custom revison loop infinitely create revision

* use accurate compare function for revision to componentName
2021-02-25 00:52:28 -08:00
Jianbo Sun
3270bfc0da Merge pull request #1092 from wonderflow/outputs
output not allowed in traitdefinition, should use outputs
2021-02-24 19:39:01 +08:00
天元
6eeb98870f fix doc and test 2021-02-24 18:59:36 +08:00
Jianbo Sun
4eb290a1d2 Merge pull request #1098 from wonderflow/chp
cherry-pick(#1094) fix apply only once observedGeneration should mark after meet all dependency requirements
2021-02-24 18:54:52 +08:00
天元
580110ed44 fix apply only once observedGeneration should mark after meet all dependency requirements && add log for apply only once 2021-02-24 17:31:31 +08:00
Jianbo Sun
309786338a Merge pull request #1097 from wonderflow/cc
enable CI for release-*
2021-02-23 20:09:47 +08:00
Jianbo Sun
816ea76bd5 Merge pull request #1090 from WangYikewyk/fix-raw-print
fix issue#1057
2021-02-23 19:40:58 +08:00
天元
d7a12ac5fd enable CI for release-* 2021-02-23 19:13:18 +08:00
wangyike
b399f34c71 fix issue#1057 2021-02-23 18:17:18 +08:00
天元
98b059c0ae output not allowed in traitdefinition, should use outputs:<resource>:<full object> 2021-02-23 16:20:30 +08:00
Jianbo Sun
9bb996e9d5 Merge pull request #1091 from ryanzhang-oss/render-workload-name
render the workload and trait name differently
2021-02-23 15:51:35 +08:00
Jian.Li
95cd9bb198 Use "context.outputs" to reference auxiliary objects defined in the definition template (#1087)
* refer outputs

* add docs

* update docs

* rename object
2021-02-22 21:36:57 -08:00
Ryan Zhang
dee442eb3d render the workload and trait name differntly 2021-02-22 21:22:54 -08:00
Jianbo Sun
dd222ac876 refactor cli/dashboard/apiserver to reference folder (#1084)
* refactor cli/dashboard/apiserver to reference folder

* address comments
2021-02-23 13:03:38 +08:00
Jianbo Sun
13a70e6819 Merge pull request #1089 from dylandee/fix-unreachable-error
fix: remove unreachable error judgement
2021-02-22 16:59:59 +08:00
Dylan
6e0b6092a5 fix: remove unreachable error judgement 2021-02-22 16:32:30 +08:00
Jianbo Sun
efb24d5b4c Merge pull request #1088 from dylandee/more-readable-exec-hint
improvement: specify 'vela exec' error hint
2021-02-22 16:11:27 +08:00
Dylan
dc5694bdc4 improvement: specify 'vela exec' error hint 2021-02-22 15:46:30 +08:00
Jianbo Sun
ee93efc154 Merge pull request #1078 from dylandee/reduce-io-operation
improvement: reduce io operation when load appfile
2021-02-22 15:07:39 +08:00
Ryan Zhang
073f3bc0c7 add hashtag and consolidate libs (#1082)
* add hashtag and consolidate libs

* fix CI
2021-02-20 23:10:15 -08:00
just-do1
1c91d46ce3 Fix remove the parameter "--sync" (#1083)
* [#929] Modification to comand vela show WORKLOAD_TYPE or TRAIT

* update the describetion of --web

* [#929] update --web describtion

* update the doc of check-ref-doc.md

* remove --sync parameter
2021-02-20 16:09:10 +08:00
Jianbo Sun
5ad5c2fd69 Merge pull request #1081 from wonderflow/depend
remove go-header package dependency
2021-02-20 15:01:20 +08:00
Jian.Li
8f83e3dd98 Use context.output instead of context.input to refer to the output object defined in the WorkloadDefinition (#1076)
* use output instead of input to reference workload

* const
2021-02-20 13:29:48 +08:00
天元
9444124c3b remove go-header package dependency 2021-02-20 13:22:52 +08:00
Dylan
d7f64725d6 improvement: reduce io operation when load appfile 2021-02-20 11:36:39 +08:00
majian
d54a9bda05 1.Create app impl (#1072)
2.Polling waiting for the app to be deleted
2021-02-20 10:56:01 +08:00
Jianbo Sun
f285490da9 Merge pull request #1075 from kinsolee/master
Fix make core-install error
2021-02-20 10:02:45 +08:00
Lei Zhang (Harry)
6419b8ff57 Merge pull request #1066 from resouer/doc
Fix readme in doc site
2021-02-19 15:07:19 -08:00
Ryan Zhang
d3511415c2 add webhooks to the rollout plan and use AC as App snapshot (#1031)
* add webhooks

* app controller change

* add component revision and appconfig revision and test

* solidify the component revision logic and fix component revisoin bugs

* fix command cli e2e failure

* fix the bug caused by rawExtention

* fix UT test

* retry on component not found

* lint

* revert component revision create order
2021-02-19 12:11:26 -08:00
kinsolee
05bd7a3ab2 fix: remove lagacy command of 'make core-install' 2021-02-19 22:26:33 +08:00
Kinso
9f38b02b1c fix: esbuild runs on mac m1 silicon (#1049)
Co-authored-by: lijingzhao <lijingzhao@forchange.tech>
2021-02-19 10:36:22 +08:00
Jianbo Sun
645312a129 Merge pull request #1067 from zzxwill/init-container-trait
Check whether parameter.command is nill for init-container trait
2021-02-19 10:06:34 +08:00
Jianbo Sun
e48515850d Merge pull request #1058 from vnzongzna/docs-update
Add sync capability section in install doc
2021-02-19 09:58:47 +08:00
majian
df89d247cf 1.set applications as homepage (#1073)
2.path use lowercase
2021-02-19 00:11:46 +08:00
guoxudong
f81e265877 [Dashboard] Add KubeVela Dashboard logo (#1071)
Fix #1043
2021-02-18 17:01:36 +08:00
majian
2aebcf014a 1.Organize the menu (#1068)
2.Add application menu locales
3.Fix create application button style
4.Add FormRender d.ts
2021-02-18 16:03:52 +08:00
guoxudong
6dc70be801 update favicon (#1042)
* update favicon
* fix
2021-02-18 16:01:43 +08:00
zzxwill
936dc4100d Check whether parameter.command is nill for init-container trait
Check whether parameter.command is nill before setting the value of
spec.template.spec.initContainers.command
Fix #1062
2021-02-18 14:58:25 +08:00
Harry Zhang
5c9e396e5c Fix typo in vela appfile doc 2021-02-17 21:55:21 -08:00
Lei Zhang (Harry)
bb7033b1e6 Fix typo in vela appfile doc (#1065) 2021-02-17 19:53:15 -08:00
Lei Zhang (Harry)
9c41d3f212 Merge pull request #1055 from resouer/doc
Move appfile doc to DevExp folder
2021-02-17 19:03:58 -08:00
Harry Zhang
7db9b93e1a Move appfile doc to ref dir 2021-02-17 17:32:49 -08:00
vnzongzna
8554fb1a2d add sync capability section in install doc 2021-02-17 01:13:33 +05:30
Jianbo Sun
aac0df2de6 Merge pull request #1052 from captainroy-hy/scope-block-finalizer
ScopeDefinition not found should not block finalizer
2021-02-11 09:20:54 +08:00
Lei Zhang (Harry)
1f0af863ef Fix quick start and concept based on app crd (#1051) 2021-02-10 13:28:49 -08:00
roy wang
062df46e47 fix ScopeDefinition not found blocking finalizer
Signed-off-by: roy wang <seiwy2010@gmail.com>
2021-02-10 15:50:06 +09:00
Lei Zhang (Harry)
9d47a85f80 Fix link in cap docs (#1050) 2021-02-09 15:51:06 -08:00
Jianbo Sun
1d38d6ea18 Merge pull request #1002 from Cweiping/feature/clairly_vele_help
fix vele help cli
2021-02-09 22:11:27 +08:00
Jianbo Sun
52c243d338 Merge pull request #1046 from resouer/doc
Revise the doc site and app crd doc
2021-02-09 22:07:12 +08:00
Weiping Cai
ce6e92e660 clair vele help cli
Signed-off-by: Weiping Cai <weiping.cai@daocloud.io>
2021-02-09 16:46:33 +08:00
Harry Zhang
101ac18836 Revise the app crd doc 2021-02-08 22:14:47 -08:00
Jianbo Sun
8c7a0ab19f Merge pull request #1045 from captainroy-hy/update-doc
update doc about traitDef definitionRef
2021-02-08 22:39:14 +08:00
WYike
bcb761d5d5 fix "cap show" cannot print keyValue type bug (#1044)
* fix key-value print bug

* fix clint problem

* delete test code

* Update pkg/plugins/references.go

Co-authored-by: Zheng Xi Zhou <zzxwill@gmail.com>

Co-authored-by: Zheng Xi Zhou <zzxwill@gmail.com>
2021-02-08 22:33:44 +08:00
Jianbo Sun
1fdc137f8b Merge pull request #1040 from zzxwill/submit-application-creation-form
[Dashboard] Create application (without trait)
2021-02-08 22:28:38 +08:00
roy wang
67adafce1b update doc about traitDef definitionRef
Signed-off-by: roy wang <seiwy2010@gmail.com>
2021-02-08 20:34:47 +09:00
zzxwill
8a3b8a29a7 don't set empty key into to Appfile 2021-02-08 19:29:29 +08:00
Jianbo Sun
7ee298ba77 Merge pull request #1027 from wonderflow/doc
add more docs about apllication and CUE
2021-02-08 17:48:46 +08:00
Jianbo Sun
be59d70018 Merge pull request #1041 from captainroy-hy/fix-unstable-ut-5
fix unstable unit test
2021-02-08 17:44:10 +08:00
天元
a4da93877d add status loop back doc 2021-02-08 17:30:52 +08:00
天元
87fca7b22a add trait with CUE 2021-02-08 16:47:45 +08:00
zzxwill
d404ae9459 build with npm instead of yarn 2021-02-08 16:18:22 +08:00
天元
fa053a53d0 add workload type with CUE 2021-02-08 16:10:47 +08:00
天元
b8ee8e879f advanced cue grammar 2021-02-08 16:10:47 +08:00
天元
cd6d0a5787 add basic CUE 2021-02-08 16:10:47 +08:00
天元
52e3bacfae add application CRD introduction 2021-02-08 16:10:47 +08:00
zzxwill
a605198863 Creat application (without trait)
Submit application creation form to create an application, currently
only creating workloads is supported.
To partly implement #1039
2021-02-08 16:10:41 +08:00
roy wang
e7396ae9ab fix unstable unit test
Signed-off-by: roy wang <seiwy2010@gmail.com>
2021-02-08 17:01:39 +09:00
Jianbo Sun
da52367897 Merge pull request #1036 from captainroy-hy/fix-unstable-ut
quick fix unstable unit test
2021-02-08 10:04:16 +08:00
Jianbo Sun
6532bc4573 Merge pull request #1013 from hoopoe61/master
sync oam-k8s-runtime data passing enhancement into kubevela
2021-02-08 09:58:12 +08:00
roywang
c908d8e1e7 quick fix unstable unit test
Signed-off-by: roywang <seiwy2010@gmail.com>
2021-02-07 22:35:59 +09:00
WYike
5e9d49e139 fix vela traits not compatible with installed capability (#1033)
* fix issue 1029

* add test case

* fix check diff

Co-authored-by: 王易可 <wangyike@B-V1QHML7L-1909.local>
2021-02-07 19:31:42 +08:00
Zheng Xi Zhou
3ee746ae17 Add latest release tag to be the prefix of latest version of Chart (#1007)
* Add latest release tag to be the prefix of latest version of Chart

Currently the latest chart is vela-core:latest, which could
not be supported by Artifacthub, add latest tag and make the
latest chart version as `vx.y.z-latest`

* calculate the next tag to be the latest master chart version

Co-authored-by: Jianbo Sun <wonderflow.sun@gmail.com>
2021-02-07 17:55:34 +08:00
Jianbo Sun
f6d2e76102 Merge pull request #1032 from wangkai1994/fix/cap_error_message
fix cap error message
2021-02-07 17:30:27 +08:00
wangkai1994
58bd00f137 fix cap error message, 2021-02-07 17:09:36 +08:00
zhinong.gt
994c194d0f add data passing mechanism in kubevela 2021-02-07 16:43:13 +08:00
Dylan
abe01d2add fix: update CR's status with retry.RetryOnConflict (#1015) 2021-02-06 23:08:22 -08:00
Jianbo Sun
aabd1e399a Merge pull request #1020 from zzxwill/app-creation-ui
Implement application creation page
2021-02-07 10:27:53 +08:00
Jianbo Sun
12cc22b5c4 Merge pull request #838 from captainroy-hy/force-apply-once-only
implement ApplyOnceOnlyForce
2021-02-06 13:14:23 +08:00
roy wang
47ab481eee implement ApplyOnceOnlyForce
add unit test

Signed-off-by: roy wang <seiwy2010@gmail.com>
2021-02-06 12:58:32 +09:00
Ryan Zhang
b564e0ef26 add more code to complete the rollout plan (#1024) 2021-02-05 12:08:19 -08:00
zzxwill
1119d1b529 fix lint issue 2021-02-05 17:55:16 +08:00
zzxwill
8af08075df Implement application creation page
To fix #680
2021-02-05 17:48:27 +08:00
Jianbo Sun
4b06961e6f Merge pull request #1014 from wonderflow/definition
move template out from extension to spec.template
2021-02-05 15:51:44 +08:00
天元
96a589b098 move template out from extension 2021-02-05 14:45:30 +08:00
Jianbo Sun
258bdd7b76 Merge pull request #1017 from resouer/doc
Update the details of the doc
2021-02-05 13:49:57 +08:00
Jianbo Sun
1f5223267b Merge pull request #1021 from zzxwill/dashboard-build
Revert package management and build tool to npm
2021-02-05 12:21:11 +08:00
Jianbo Sun
c24169e42d Merge pull request #1000 from ryanzhang-oss/rollout-controller
Cloneset rollout
2021-02-05 12:06:22 +08:00
zzxwill
9230e5c181 Revert package management and build tool to npm
As yarn failed to build and start the dashboard most
of time, revert the tool to npm
2021-02-05 11:31:37 +08:00
Ryan Zhang
10bf5739ca fix lint 2021-02-04 17:11:04 -08:00
Ryan Zhang
15020660c9 cloneset controller draft 2021-02-04 17:01:22 -08:00
Harry Zhang
cd971063f8 Update the details of the doc 2021-02-04 14:26:21 -08:00
Jianbo Sun
b6f10bb1fa Merge pull request #975 from leejanee/app-status
display trait status information with customized style
2021-02-04 20:22:19 +08:00
天元
868e0925d4 move health check and status out of extention 2021-02-04 17:56:20 +08:00
Jianbo Sun
f2bd881d27 Merge pull request #1012 from dylandee/fix-redundant-docker-image-push
remove redundant image push operation
2021-02-04 16:37:57 +08:00
Dylan
ea306dac5e remove redundant image push operation 2021-02-04 16:15:43 +08:00
Jianbo Sun
a761e75c01 Merge pull request #994 from zzxwill/fix-openAPIV3Schema-validatation
Fix openAPIV3Schema validation issue
2021-02-04 14:15:45 +08:00
天元
87e52bb349 add demo, test and refine code 2021-02-04 14:14:52 +08:00
Jianbo Sun
dc8358f910 Merge pull request #1008 from resouer/doc
Fix doc detail
2021-02-04 08:46:23 +08:00
Jianbo Sun
26a7e57d6e Merge pull request #1009 from vnzongzna/patch-1
Fix link in APIServer-Catalog Examples
2021-02-04 08:45:27 +08:00
Vaibhav Kaushik
026d5f6446 Minor fix for APIServe-Catalog Doc 2021-02-04 02:26:54 +05:30
Vaibhav Kaushik
26aa3eceae Fix link in APIServer-Catalog Examples 2021-02-04 02:13:25 +05:30
Harry Zhang
966a773195 Fix doc detail 2021-02-03 10:04:43 -08:00
zzxwill
5aea4c4baa Fix openAPIV3Schema validatation issue
Legacy crd charts/vela-core/crds/standard.oam.dev_routes.yaml could not
be applied to old Kubernetes clusters like 1.15.12.
Fix #993
2021-02-03 22:20:39 +08:00
Zheng Xi Zhou
51860cf11a Fix wrong target directory name for artifathub.io (#1004) 2021-02-03 19:51:34 +08:00
Jianbo Sun
90d82c38e9 Merge pull request #1001 from captainroy-hy/sync-cap-bug-fix
fix cannot sync trait without definitionRef
2021-02-03 19:47:27 +08:00
roy wang
2375e019bd fix cannot sync trait without definitionRef
Signed-off-by: roy wang <seiwy2010@gmail.com>
2021-02-03 20:29:11 +09:00
Zheng Xi Zhou
fb15b43914 Fix issue: artifacthub-repo.yml not uploaded to repo (#1003)
* Fix issue: artifacthub-repo.yml not uploaded to repo

* Update .github/workflows/registry.yml

Co-authored-by: Jianbo Sun <wonderflow.sun@gmail.com>
2021-02-03 19:03:08 +08:00
天元
829d230427 remove unused client side trait checker 2021-02-03 18:19:51 +08:00
天元
f310665fe0 implement vela status in application CRD controller and refactor the health check code 2021-02-03 18:13:47 +08:00
Kai
dafbbbb606 mark vela install as deprecated (#989)
* mark `vela install` as deprecated

* refactor vela install to helm install

* refactor vela install to helm install

fix

* Update pkg/commands/system.go

Co-authored-by: Jianbo Sun <wonderflow.sun@gmail.com>

* Update pkg/commands/system.go

Co-authored-by: Jianbo Sun <wonderflow.sun@gmail.com>

* Update README.md

* Update CONTRIBUTING.md

Co-authored-by: Jianbo Sun <wonderflow.sun@gmail.com>

* Update _sidebar.md

* Update README.md

* revert

Co-authored-by: Jianbo Sun <wonderflow.sun@gmail.com>
2021-02-03 16:14:58 +08:00
Jianbo Sun
2524a3e5fb Merge pull request #943 from captainroy-hy/webhook-no-traitdef
validating webhook for TraitDefinition
2021-02-03 14:50:17 +08:00
Zheng Xi Zhou
dd04402a28 Build KubeVela legacy chart (#983)
* Build KubeVela legacy chart

Also pushed it to oss bucket
fix #528

* remvoe flag `--devel`

* make it explictly to modify values.yaml for legacy chart
2021-02-03 14:27:04 +08:00
roy wang
62611896e1 validating webhook for TraitDefinition
add unit test

fix lint issues

Signed-off-by: roy wang <seiwy2010@gmail.com>
2021-02-03 14:46:24 +09:00
Jianbo Sun
8186b174ba Merge pull request #991 from captainroy-hy/ac-webhook-td
use dummy trait definition in appconfig webhook
2021-02-03 09:58:47 +08:00
Lei Zhang (Harry)
b99a4b619c Merge pull request #960 from resouer/dev
Explain KubeVela
2021-02-02 11:33:30 -08:00
Lei Zhang (Harry)
5ae47074d1 Update docs/en/platform-engineers/overview.md
Co-authored-by: Jianbo Sun <wonderflow.sun@gmail.com>
2021-02-02 10:32:01 -08:00
Lei Zhang (Harry)
5a2305b83e Update docs/en/platform-engineers/overview.md
Co-authored-by: Jianbo Sun <wonderflow.sun@gmail.com>
2021-02-02 10:31:50 -08:00
Lei Zhang (Harry)
78a145fa74 Update docs/en/platform-engineers/overview.md
Co-authored-by: Jianbo Sun <wonderflow.sun@gmail.com>
2021-02-02 10:31:30 -08:00
roywang
02f214b766 use dummy trait definition in appconfig webhook
Signed-off-by: roywang <seiwy2010@gmail.com>
2021-02-02 22:58:16 +09:00
lj176172
dd6810314e status app 2021-02-02 21:23:01 +08:00
Jianbo Sun
2efeec8a8e Merge pull request #990 from 96RadhikaJadhav/fixing-wrong-chart-name
Fixed wrong chart name
2021-02-02 17:41:44 +08:00
96RadhikaJadhav
671c73a070 Fixed wrong chart name 2021-02-02 14:20:11 +05:30
Zheng Xi Zhou
942115a1c3 Set KubeVela as verified publisher of ArtifactHub (#986)
* Set KubeVeal as verified publisher of ArtifactHub

Set KubeVela team as a verified publisher of Artifacthub,
Add README to the repo and add helm badge in github readme

To impleted #977

* Update hack/artifacthub/artifacthub-repo.yml

Co-authored-by: Ryan Zhang <yangzhangrice@hotmail.com>

* Update hack/artifacthub/artifacthub-repo.yml

Co-authored-by: Jianbo Sun <wonderflow.sun@gmail.com>

* add more owners

* add README to chart

Co-authored-by: Jianbo Sun <wonderflow.sun@gmail.com>
Co-authored-by: Ryan Zhang <yangzhangrice@hotmail.com>
2021-02-02 15:37:40 +08:00
Holger Protzek
f737379738 Added ingressClass to route trait (#947)
* Added ingressClass to route trait

* typo

Co-authored-by: Jianbo Sun <wonderflow.sun@gmail.com>

* run make reviewable

* fixed ingress test

Co-authored-by: Jianbo Sun <wonderflow.sun@gmail.com>
2021-02-02 09:52:20 +08:00
Jianbo Sun
e5a9721fa5 Merge pull request #985 from zzxwill/capability-show
Change "vela show" function name
2021-02-02 09:51:23 +08:00
zzxwill
86db8de125 Change "vela show" function name
Also updated help vela help message
2021-02-01 19:48:34 +08:00
Ryan Zhang
7f64974701 This PR spells out the rollout states (#972)
* add rollout state transition:

* address comments
2021-02-01 17:40:59 +08:00
Hongchao Deng
18f184d57c Merge pull request #981 from wonderflow/fix
fix pull image error
2021-01-31 21:57:37 -08:00
天元
b80bacf65d fix version 2021-02-01 13:19:33 +08:00
Jianbo Sun
c96a92475d Merge pull request #974 from wonderflow/reg
minor change for CI name
2021-01-29 18:40:21 +08:00
天元
316b438674 minor change for CI name 2021-01-29 18:24:38 +08:00
Jianbo Sun
104f0827dc Merge pull request #958 from captainroy-hy/static-check-action
add staticcheck CI action
2021-01-29 18:14:56 +08:00
Jianbo Sun
0a81696315 Merge pull request #973 from wonderflow/testmaster
manually create release and automatically upload artifacts
2021-01-29 17:44:33 +08:00
roy wang
93ae8a9099 fix staticcheck issues
add staticcheck CI action

add staticcheck in Makefile

Signed-off-by: roywang <seiwy2010@gmail.com>
2021-01-29 18:42:03 +09:00
天元
ed436d4e6d merge chart and docker publish into registry 2021-01-29 17:12:18 +08:00
天元
e5e71dbc25 change from create release by github robot to manuelly
automatically upload artifacts after manually released
2021-01-29 17:11:58 +08:00
Jianbo Sun
af61a81828 Merge pull request #971 from wonderflow/fixc
fix inner containerizedworkload not work
2021-01-29 16:28:52 +08:00
天元
b88309a333 fix inner containerizedworkload not work 2021-01-29 15:51:29 +08:00
Jianbo Sun
c41bd241ce update kubevela installation guide (#955)
* update kubevela installation guide

* adress comments

* Update docs/en/install.md

Co-authored-by: Hongchao Deng <hongchaodeng1@gmail.com>

* Update docs/en/install.md

Co-authored-by: Hongchao Deng <hongchaodeng1@gmail.com>

* remove line

* address comments

Co-authored-by: Hongchao Deng <hongchaodeng1@gmail.com>
2021-01-29 15:46:58 +08:00
Jianbo Sun
5c188dd9cc Merge pull request #952 from wonderflow/removecode
remove unused dependency installation
2021-01-29 14:58:57 +08:00
Jianbo Sun
66fb99954e fix quick start guide as we don't have route trait installed as default (#954)
* fix quick start guide as we don't have route trait installed as default

* add a description for ingress trait
2021-01-29 14:56:38 +08:00
Jianbo Sun
f39660c286 Merge pull request #953 from wonderflow/svcd
deprecate unused vela commands
2021-01-29 13:48:31 +08:00
Jianbo Sun
07e16d9f8a Merge pull request #967 from wonderflow/arm64
build linux/arm64 cli command
2021-01-29 13:47:27 +08:00
Jianbo Sun
2abcb44ee2 Merge pull request #937 from wonderflow/outputs
allow multiple outputs for workloaddefintion
2021-01-29 12:39:36 +08:00
天元
d2ce5856a6 adress comment 2021-01-29 12:38:23 +08:00
天元
bed609e192 build linux/arm64 cli command 2021-01-29 12:18:38 +08:00
天元
6922f7cfab fix ci 2021-01-29 11:39:44 +08:00
天元
aed2494875 allow multiple outputs for workloaddefintion 2021-01-29 11:39:44 +08:00
天元
10076f8516 trait name should not contain dummy when traitdefinition not found 2021-01-29 11:39:44 +08:00
Jianbo Sun
a8b4004e3b Merge pull request #965 from captainroy-hy/not-depend-defref
allow traitDefinition to omit definitionRef
2021-01-29 11:36:22 +08:00
Lei Zhang (Harry)
d1c93ed90c Update docs/en/platform-engineers/overview.md
Co-authored-by: Zheng Xi Zhou <zzxwill@gmail.com>
2021-01-28 19:22:08 -08:00
Jianbo Sun
a042b6b43d Merge pull request #963 from ryanzhang-oss/appDeployment-structure
further develop appDeployment controller
2021-01-29 11:19:59 +08:00
Jianbo Sun
130827629b Merge pull request #962 from allenhaozi/feat/update-del-app-prompt-msg
update delete app prompt information
2021-01-29 11:18:23 +08:00
mahao
82cdb615c0 update delete app prompt information
Signed-off-by: mahao <allenhaozi@gmail.com>
2021-01-29 11:00:44 +08:00
roy wang
7629399683 allow traitDefinition to omit definitionRef
Signed-off-by: roy wang <seiwy2010@gmail.com>
2021-01-29 11:31:03 +09:00
Ryan Zhang
ad496b132a further develop appDeployment controller 2021-01-28 17:59:31 -08:00
Harry Zhang
ef5d3c35c6 Explain KubeVela 2021-01-28 12:30:25 -08:00
Zheng Xi Zhou
2a943c9429 Using Terraform as IaC module in KubeVela (#863)
* Integrate Terraform into KubeVela

Integrated Terrafrom into KubeVela to enable it to deploy
infrastruce resouces by `vela up`

* extend Terraform modules/files as WorkloadDefinition

stop printing terraform log to console

Support one workload consumes two cloud services

Refactor Terraform plugin based on Application Object

add testcase

* refactor code per reviewer's comments

fix rebase issue

* find lost code back

* refactor code to make the modification as little as to that of branch master

* remove blank lines from imports
2021-01-28 18:36:52 +08:00
天元
52aed26b96 update docs 2021-01-28 15:21:04 +08:00
天元
61c256a97c remove unused dependency installation as we have reduce 3rd party dependency , they will be installed as capability from registry 2021-01-28 14:55:25 +08:00
天元
8dbad9e8c1 remove relevant test code 2021-01-28 14:54:09 +08:00
天元
3e8f0b3299 remove vela <trait> command 2021-01-28 14:45:55 +08:00
天元
c1a14a70f5 remove vela comp deploy 2021-01-28 14:41:41 +08:00
just-do1
0a6065d7d0 [#929] Modification to comand vela show WORKLOAD_TYPE or TRAIT (#948)
* [#929] Modification to comand vela show WORKLOAD_TYPE or TRAIT

* update the describetion of --web

* [#929] update --web describtion

* update the doc of check-ref-doc.md
2021-01-28 12:28:47 +08:00
Jianbo Sun
fa58501a97 remove 3rd party dependency from default installation (#946)
* remove 3rd party dependency from default installation

* fix CI
2021-01-27 18:29:42 -08:00
Zheng Xi Zhou
aa03e9c9d4 OpenAPI: Application creation based on Application object (#924)
* OpenAPI: Application creation based on Application object

Implemented Application creation OpenAPI based on new Application object
To #913

* fix e2e problems

* fix import issue
2021-01-28 10:15:26 +08:00
Jaime Zhang
4d00ad78ae #884 #830 complete the trait info when it is applied to * (#890)
* #884 complete the trait info when it is applied to *

* add unit test for trait print which applied to *

* code optimization

* code optimization to go standard

* summarize all 'applies to' content to *
2021-01-27 19:57:47 +08:00
Ryan Zhang
5b26575c16 Merge pull request #945 from wonderflow/charts
Upload vela core chart to alibaba cloud oss for every release and master commit
2021-01-27 01:24:13 -08:00
天元
cf60e72fe9 use the number version 2021-01-27 17:02:10 +08:00
天元
a2707395e9 force push to cloud 2021-01-27 16:37:16 +08:00
天元
a420785dc2 add repo url 2021-01-27 16:32:58 +08:00
天元
ccf47a2189 fix no config 2021-01-27 16:20:55 +08:00
天元
3d98b94fd8 upload charts to alibaba cloud oss bucket 2021-01-27 16:17:23 +08:00
Ryan Zhang
6adb91fb50 Merge pull request #940 from ryanzhang-oss/appDeployment
Add rollout annotation logic in application
2021-01-27 00:14:40 -08:00
Jianbo Sun
d27aa77753 Merge pull request #938 from wonderflow/updatedep
upgrade github.com/stretchr/testify try fix CI
2021-01-27 15:06:58 +08:00
Ryan Zhang
462be588af address comments and fix CI 2021-01-26 20:47:56 -08:00
Ryan Zhang
c85bbe1ae2 add rolling annotation to the application 2021-01-26 00:29:49 -08:00
Ryan Zhang
a257f6e60c application controller ignore annotation 2021-01-26 00:03:53 -08:00
Ryan Zhang
0e987a08b6 Merge pull request #934 from wonderflow/cert-manager
support vela install with helm args and make cert-manager optional
2021-01-25 23:35:56 -08:00
Jianbo Sun
206d343785 Merge pull request #927 from ryanzhang-oss/appdeployment-controller
some initial code for app deployment controller/webhook
2021-01-26 15:24:00 +08:00
天元
1cf1e6c064 upgrade github.com/stretchr/testify try fix CI 2021-01-26 15:00:43 +08:00
Jianbo Sun
c1f50d622b Merge pull request #936 from kqzh/master
fix condition err always nil
2021-01-26 14:49:29 +08:00
Ryan Zhang
e664831ff6 application deployment 2021-01-25 22:17:35 -08:00
kqzh
3a73221661 fix err always nil 2021-01-26 13:58:10 +08:00
Jianbo Sun
97f45ae859 code refactor (#935)
* code refactor

* update boilerplate.go.txt
2021-01-26 10:26:41 +08:00
天元
4cd9a70cfe support vela install with helm args and make cert-manager optional 2021-01-25 19:16:18 +08:00
Weiping Cai
75ecf2f301 support env and config storage driver (#850)
* support env and config storage driver

Signed-off-by: Weiping Cai <weiping.cai@daocloud.io>

* use driver.LocalDriverName to replace  str

Signed-off-by: Weiping Cai <weiping.cai@daocloud.io>
2021-01-25 16:26:42 +08:00
Hongchao Deng
77642f069a Merge pull request #926 from hongchaodeng/design-update
* update APIServer + Catalog design

- add application creation workflow
- make application adaptable to multiple env and clusters
- add module into catalog package format and adapt to helm/terraform
2021-01-24 19:32:23 -08:00
Hongchao Deng
2720028e2a comment 2021-01-24 19:11:36 -08:00
Jianbo Sun
72ee26dbb4 add advanced trait tutorial (#921)
* add advanced trait tutorial

* add more intersiting trait

* init container and patch

* add more traits

* node affinity

* addressing comment
2021-01-25 10:53:36 +08:00
Jianbo Sun
9173ff828f Merge pull request #930 from leejanee/dry-run
Add dry-run command
2021-01-23 12:28:03 +08:00
Hongchao Deng
62ec540fcf update 2021-01-22 13:35:54 -08:00
lj176172
f6a3ade584 lint 2021-01-22 19:17:49 +08:00
lj176172
be49ea092b application dry-run 2021-01-22 19:05:55 +08:00
Hongchao Deng
b173224212 update APIServer + Catalog design
- add application creation workflow
- make application adaptable to multiple env and clusters
- add module into catalog package format and adapt to helm/terraform
2021-01-22 00:24:30 -08:00
Jianbo Sun
c71eea7f90 Merge pull request #923 from zeed-w-beez/master
happy new year
2021-01-22 12:37:08 +08:00
zeed-w-beez
5b1a55b58b happy new year
Use variable-year in copyrights.
2021-01-22 11:25:21 +08:00
Zheng Xi Zhou
eba7049f39 Add Getdefinition OpenAPI in Restful-api docs (#917)
Added Getdefinition api docs and update email contact
2021-01-22 10:20:22 +08:00
Jianbo Sun
65706f401b Merge pull request #857 from captainroy-hy/refactor-apply
using 3-way-merge-patch instead of "json merge patch for workload" and "update for trait"
2021-01-21 18:42:00 +08:00
roywang
59a6ef5140 implement util/apply with three-way diff
add/fix unit tests

fix e2e tests

update doc & add unit test

Signed-off-by: roy wang <seiwy2010@gmail.com>
2021-01-21 18:05:29 +09:00
Jianbo Sun
1fcd4ca55e Merge pull request #920 from ryanzhang-oss/app-deployment-controller
refactor application controller
2021-01-21 16:52:00 +08:00
Ryan Zhang
d74dbb4fda refactor application controller 2021-01-21 00:34:04 -08:00
Jianbo Sun
b6edd4bc7e Merge pull request #916 from resouer/dev
Fix ref doc guide
2021-01-21 14:04:18 +08:00
Harry Zhang
879c6c8878 Fix ref doc guide 2021-01-20 21:22:49 -08:00
Hongchao Deng
c722f561b0 Merge pull request #901 from zzxwill/ref-docs
Add `Writing Appfile` based on capability references docs
2021-01-20 19:20:32 -08:00
Jianbo Sun
0b5052ad91 Merge pull request #912 from resouer/dev
Update the concept doc to reflect app crd
2021-01-21 10:52:04 +08:00
Jianbo Sun
4661297ca5 Merge pull request #902 from ryanzhang-oss/rollout-structure
Rollout code framework
2021-01-21 10:02:37 +08:00
Harry Zhang
87cc86dde2 Update the concept doc to reflect app crd 2021-01-20 17:33:20 -08:00
Ryan Zhang
adbe1f9368 add the rollout code framework 2021-01-20 13:08:00 -08:00
Zheng Xi Zhou
f0d8bd078b address comments
Co-authored-by: Jianbo Sun <wonderflow.sun@gmail.com>
2021-01-20 15:56:20 +08:00
zzxwill
78b86d84b6 Add Writing Appfile based on capability references docs
Introduced `vela show` with and without flag `--no-website`, and
official site to help setting properties for workload types and
traits.
2021-01-20 15:56:20 +08:00
Jianbo Sun
ba4374dc27 Merge pull request #900 from sunny0826/docs
update docs
2021-01-20 15:35:13 +08:00
guoxudong
806c396264 update docs 2021-01-20 13:37:43 +08:00
Jianbo Sun
721ca9ff92 Merge pull request #886 from zzxwill/ref-docs
Generate the reference doc for a workload type or trait in the local host website and in a table style on Cli console
2021-01-20 10:34:03 +08:00
Ryan Zhang
023d24d392 draft 2021-01-19 15:50:38 -08:00
zzxwill
a674174cda add more unittest 2021-01-19 21:56:26 +08:00
zzxwill
48f3ed94b7 convert configuration files to variables
open the exact reference doc link for a capability

add option `--no-website` to support display reference docs on console
2021-01-19 15:16:40 +08:00
Jianbo Sun
47f35e6d62 Merge pull request #861 from rain18/health
feature: add healthcheck policy for workload and trait by cue template
2021-01-19 13:23:58 +08:00
zhangrun.zr
f55dd467b9 feature: add healthcheck policy for workload and trait by cue template
Signed-off-by: zhangrun.zr <zhangrun.zr@alibaba-inc.com>
2021-01-19 13:03:05 +08:00
Ryan Zhang
7524aeee31 Merge pull request #852 from rain18/task
feature: add http task for application cue template
2021-01-18 20:11:59 -08:00
Hongchao Deng
cb368c2f8c roadmap: add template, rewrite 2020 winter, add 2021 spring (#891)
* roadmap: add template, rewrite 2020 winter, add 2021 spring

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

* Update docs/en/roadmap/2020-12-roadmap.md

Co-authored-by: Zheng Xi Zhou <zzxwill@gmail.com>

* update

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

Co-authored-by: Zheng Xi Zhou <zzxwill@gmail.com>
2021-01-19 09:57:27 +08:00
Jianbo Sun
64c560583e Merge pull request #894 from captainroy-hy/fix-unstable-ut-4
fix unstable unit test
2021-01-19 09:55:33 +08:00
roy wang
580056b209 fix unstable unit test
Signed-off-by: roy wang <seiwy2010@gmail.com>
2021-01-18 18:59:58 +09:00
zhangrun.zr
2706e63743 fix: use httptest instead of echo and rename context
Signed-off-by: zhangrun.zr <zhangrun.zr@alibaba-inc.com>
2021-01-18 15:52:22 +08:00
zzxwill
3546001bf6 Generate a local site to host all reference docs
By Cli `vela reference` to generate reference docs for all workload
types and traits, and host them in a local website.

To fix #880
2021-01-18 12:18:15 +08:00
Jianbo Sun
40aa97363e Merge pull request #787 from ryanzhang-oss/rollout
rollout CRD API Spec
2021-01-18 11:01:59 +08:00
Ryan Zhang
f6345534e6 fix field name 2021-01-15 19:19:32 -08:00
Ryan Zhang
df32d4b1ba update rollout CRD spec 2021-01-15 19:19:32 -08:00
Hongchao Deng
a10dccf5bd Vela APIServer and Catalog Design (#881)
* APIServer + Catalog Architecture Design

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

* update
2021-01-15 11:22:59 -08:00
Jianbo Sun
f40a41dbc1 Merge pull request #888 from resouer/fix-msg
Add more details for platform builder
2021-01-15 19:51:28 +08:00
zhangrun.zr
732d8f76d3 feature: add http task for application cue template
Signed-off-by: zhangrun.zr <zhangrun.zr@alibaba-inc.com>
2021-01-15 19:20:39 +08:00
Jianbo Sun
4732bd943d Update docs/en/concepts.md
Co-authored-by: Zheng Xi Zhou <zzxwill@gmail.com>
2021-01-15 19:05:40 +08:00
Jianbo Sun
89863b30e8 fix ci and refactor code (#887)
* adjust CI scripts

* fix go ci order

* try fix

* use appfile to update trait

* fix vela status

* use assert.ObjectAreEqual to check diff for map case

* remove application controller own AC and Components

* tune place

* fix lint

* update

* remove error check of vela init test

Co-authored-by: Ryan Zhang <yangzhangrice@hotmail.com>
2021-01-15 19:04:12 +08:00
Harry Zhang
00ba0697dc Update concepts and readme to reflect recent change 2021-01-14 22:14:57 -08:00
Harry Zhang
30585f80e6 Init platform builder doc 2021-01-14 21:38:03 -08:00
Zheng Xi Zhou
83ce5ec724 Add ConflictsWith and more sections for Rollout (#869)
Added `ConflictsWith` and `How Rollout Works` section to Rollout Reference Docs.
To fix #777
2021-01-14 17:22:55 +08:00
Jianbo Sun
4467084c0e Merge pull request #875 from wonderflow/vela-up
add tests for application controller
2021-01-11 21:23:41 +08:00
天元
1f1f3af7b7 refacter and add tests 2021-01-11 20:48:17 +08:00
Ryan Zhang
d38c08af56 Merge pull request #846 from leejanee/vela-up
vela up generate application object instead of AC and Component
2021-01-10 22:10:39 -08:00
天元
2761e7afb9 use map[string]string for scope 2021-01-11 10:54:57 +08:00
天元
8410f03eb0 addressing comments 2021-01-11 10:45:13 +08:00
Jianbo Sun
e51c283c1d Merge pull request #868 from zzxwill/apischema
Add unit-test for generateOpenAPISchema
2021-01-09 21:48:33 +08:00
天元
f694d1ad5d add tests 2021-01-08 18:16:03 +08:00
zzxwill
674408784b address comments and add one more testcase 2021-01-08 15:46:30 +08:00
majian
19e8aa2af6 Dashboard fix (#871)
* 1.fix repeated click does not show component bug
2.typed
3.fix locales

* capability rename

Co-authored-by: Zheng Xi Zhou <zzxwill@gmail.com>
2021-01-08 10:54:15 +08:00
天元
3dd954541e add tests 2021-01-07 20:24:25 +08:00
天元
ba614da809 fix ci 2021-01-07 19:40:32 +08:00
天元
b92e2a92fc try test again 2021-01-07 19:28:19 +08:00
天元
718a4b1999 fix ci 2021-01-07 17:52:15 +08:00
天元
de83320306 remove unused code 2021-01-07 13:07:28 +08:00
天元
4cfee561b9 refactor and add scope to application 2021-01-07 13:07:12 +08:00
Jianbo Sun
6b78945c18 Merge pull request #858 from Incubator4th/route-provider
Add provider parameter to route trait
2021-01-07 11:49:41 +08:00
incubator4th
72d6981628 set provider can be empty 2021-01-06 17:22:16 +08:00
zzxwill
2243632d0c Add unit-test for generateOpenAPISchema
Added title for all fields and added unit-test for generateOpenAPISchema FixOpenSchema,
2021-01-06 14:36:36 +08:00
Jianbo Sun
775991cfaa Merge pull request #784 from zzxwill/form-render
Implement API for generating OpenAPI schema for definition
2021-01-06 11:58:20 +08:00
Zheng Xi Zhou
da097989f8 Update pkg/appfile/service.go
Co-authored-by: Hongchao Deng <hongchaodeng1@gmail.com>
2021-01-06 11:05:37 +08:00
zzxwill
53164a4d2f Implement API for generating OpenAPI schema for definition
Fetched cue parameters from workloaddefinition/traitdefinition, generated
OpenAPI v3 schema, fixed problems of tainted `description` filed, added filed
"title" required by form-render component, added it in API server router

To fix #680
2021-01-05 21:57:38 +08:00
天元
3d3b3239d8 add trait type 2021-01-05 21:18:27 +08:00
天元
b1a97b08ec add workload type to label 2021-01-05 21:08:41 +08:00
incubator4th
72663f68cb add provider to route.cue 2021-01-05 21:06:55 +08:00
天元
8c7db9b0e0 larger time 2021-01-05 19:31:11 +08:00
天元
c72941f916 check application 2021-01-05 19:18:48 +08:00
天元
cc590d7c42 using vela up to deploy 2021-01-05 18:10:22 +08:00
天元
5e06e41477 try fix ci 2021-01-05 17:15:55 +08:00
天元
6e658d1ea8 Merge branch 'master' into vela-up 2021-01-05 17:15:03 +08:00
Jianbo Sun
4832d95506 Merge pull request #854 from wonderflow/contribute
refine contributing doc
2021-01-05 13:33:46 +08:00
Jianbo Sun
61b9816296 Merge pull request #853 from wonderflow/tests
add test for component revision hook
2021-01-05 12:09:57 +08:00
天元
9a613da8c5 refine contributing doc 2021-01-05 12:09:23 +08:00
guoxudong
72ee5db872 Fix `each child in a list should have a unique "key" prop.' (#844)
* fix capability

* fix
2021-01-04 13:30:59 -08:00
lj176172
cb68136f93 remove 2021-01-04 17:26:34 +08:00
lj176172
a181ff46b6 extend exec-timeout period 2021-01-04 16:28:38 +08:00
lj176172
2e1433c366 extend exec-timeout period 2021-01-04 16:04:54 +08:00
lj176172
bac35a425f extend exec-timeout period 2021-01-04 15:53:03 +08:00
lj176172
08d0b4830a recover 2020-12-31 18:41:46 +08:00
lj176172
a1d9b3d032 remove trait attach 2020-12-31 18:31:24 +08:00
Jianbo Sun
8d0595ed4e Update cmd/core/main.go 2020-12-31 17:13:13 +08:00
天元
01bd05d0a5 add test for component revision hook 2020-12-31 16:41:55 +08:00
lj176172
76d585795b fix ls command 2020-12-31 16:18:37 +08:00
lj176172
4088a20252 ApplyApp 2020-12-31 12:26:05 +08:00
Jianbo Sun
810cbcaae4 Merge pull request #841 from zzxwill/issue-trait-no-definition
Allow trait to work without TraitDefinition
2020-12-31 10:52:01 +08:00
zzxwill
dfdb833abe Check trait CR is created and update ApplicationConfiguration 2020-12-31 09:16:56 +08:00
Jianbo Sun
f10e53c1eb Merge pull request #847 from wonderflow/application
refine error message: trait definition not found
2020-12-30 19:01:05 +08:00
lj176172
a88d0a5660 lint code 2020-12-30 18:26:31 +08:00
天元
02bb9a1dc1 refine error message: trait definition not found 2020-12-30 18:25:30 +08:00
lj176172
950238aa11 export scopes 2020-12-30 18:19:38 +08:00
lj176172
b52fc09fd6 lint code 2020-12-30 14:13:27 +08:00
lj176172
062c906e95 rebase master 2020-12-30 14:08:54 +08:00
Jianbo Sun
69e860a1e8 Merge pull request #843 from zzxwill/dashboard-start
Refine Dashboard README
2020-12-30 13:11:54 +08:00
zzxwill
0bd85d359a Refine Dashboard README
Refined dashboard readme with all-in-one start command
2020-12-30 11:06:51 +08:00
Jianbo Sun
1abbe1f7cf Merge pull request #842 from ryanzhang-oss/minor-improve
Use the correct cue parse api
2020-12-30 10:19:06 +08:00
Jianbo Sun
88143ae64a Merge pull request #834 from zzxwill/workload
Add description field for Capability/Workloads list
2020-12-30 10:08:13 +08:00
Ryan Zhang
b25e911a74 use the correct cue parse api 2020-12-29 13:24:04 -08:00
zzxwill
d8d891f6c9 Allow trait to work without TraitDefinition
Fix the issue of applying trait if its traitdefinition
doesn't exits.

To fix issue #839
2020-12-30 00:14:26 +08:00
Jianbo Sun
a7f823940c Merge pull request #832 from wonderflow/application
refactor application object to have basic schema
2020-12-29 17:11:35 +08:00
天元
3a47d5de73 refactor application object to have more strict schema 2020-12-29 15:48:32 +08:00
zzxwill
eb2501f644 fix lint issue 2020-12-29 10:58:07 +08:00
zzxwill
abce944aad Add description field for Capability/Workloads list
Added `description` field for workloads.

To fix #821
2020-12-29 10:43:05 +08:00
Jianbo Sun
386d5dd0ee Merge pull request #833 from zzxwill/workload
Expend column width for "vela workloads/traits"
2020-12-28 22:00:59 +08:00
zzxwill
509895511b Expend column width for "vela workloads/traits"
Expended column width for `vela workloads/traits` and also
shortened the description for all workloads and traits.
Fixed a tiny issue in hack/reference/generate.go

To fix issue #827
2020-12-28 20:57:22 +08:00
Weiping Cai
c0ebe8dc62 support mutli storage resources,define storage interface and implemen… (#776)
* support mutli storage resources,define storage interface and implement local storage

Signed-off-by: Weiping Cai <weiping.cai@daocloud.io>

* support mutli storage resources,define storage interface and implement local storage

Signed-off-by: Weiping Cai <weiping.cai@daocloud.io>

* support mutli storage resources,define storage interface and implement local storage

Signed-off-by: Weiping Cai <weiping.cai@daocloud.io>

* support mutli storage resources,define storage interface and implement local storage

Signed-off-by: Weiping Cai <weiping.cai@daocloud.io>

* move application/Application to storage/driver pkg

Signed-off-by: Weiping Cai <weiping.cai@daocloud.io>

* update storage import format

Signed-off-by: Weiping Cai <weiping.cai@daocloud.io>
2020-12-28 18:39:58 +08:00
Jianbo Sun
ebf1b51d58 Merge pull request #831 from zzxwill/mutation-webhook-conflicts
Add "How to fix issue: MutatingWebhookConfiguration mutating-webhook-configuration exists?"
2020-12-28 18:39:17 +08:00
zzxwill
4b27f9b4e2 Add "How to fix issue: MutatingWebhookConfiguration mutating-webhook-configuration exists?"
Added another question.

To cover issue #794
2020-12-28 17:44:58 +08:00
Jianbo Sun
8f6d0fded8 Merge pull request #825 from wonderflow/fix1
run CI check for all PR including docs/ and *md
2020-12-28 13:38:41 +08:00
Jianbo Sun
e8cabdc13c Merge pull request #824 from zzxwill/issue-workloads
Add "description" field for each workload from ListWorkloads API
2020-12-28 10:02:01 +08:00
Jianbo Sun
a03d9f2626 Merge pull request #828 from zzxwill/issue-vela-workloads
Refine error message for trait without `spec.extension.template`
2020-12-27 11:06:50 +08:00
zzxwill
37cb5ccb51 Add "description" field for each workload from ListWorkloads API
Workload item doesn't have descriptin property, added it to help display
the description in capability list on Dashboard
2020-12-25 19:04:54 +08:00
zzxwill
4c34048186 Refine error message for trait without spec.extension.template
Error message of trait without `spec.extension.template`
adheres with normal message when executing "vela workloads".

To fix #826
2020-12-25 18:25:19 +08:00
天元
76e0bbcabd run CI check for all PR including docs/ and *md 2020-12-25 17:53:04 +08:00
Jianbo Sun
32bc74456a Merge pull request #810 from Cweiping/fix/fix_promethus_typo_error_2
fix typo error of promethus
2020-12-25 17:39:22 +08:00
Jianbo Sun
82df7c3a71 Merge pull request #811 from captainroy-hy/fix-integration-test
fix unstable integration test
2020-12-25 17:38:21 +08:00
majian
c06aca6f60 add dashboard lint check (#815) and remove unused ref 2020-12-25 14:24:06 +08:00
Jianbo Sun
69dcf2fc5a Merge pull request #807 from wonderflow/datainput
support strategy patch datainput merge for slice case
2020-12-25 12:42:13 +08:00
Yang Liu
04c9af5c81 Merge pull request #812 from wonderflow/revision
support custom component revision hook
2020-12-25 11:51:02 +08:00
guoxudong
1e6248d189 [Dashboard] Capabilities page (#803)
* add capabilities (workloads and traits)

* yarn prettier
2020-12-25 11:13:08 +08:00
天元
e3b4bcd2ca support custom component revision 2020-12-25 09:40:54 +08:00
roywang
9730cb438d fix unstable integration test
Signed-off-by: roywang <seiwy2010@gmail.com>
2020-12-24 18:22:27 +09:00
Jianbo Sun
a8f48eb140 Merge pull request #809 from hongchaodeng/owner
add sunny0826 (Xudong Guo) as reviewer
2020-12-24 14:20:59 +08:00
Weiping Cai
ab6a170c1d fix typo error of promethus
Signed-off-by: Weiping Cai <weiping.cai@daocloud.io>
2020-12-24 14:00:17 +08:00
Hongchao Deng
dc9b1eb6fc add sunny0826 (Xudong Guo) as reviewer 2020-12-23 21:55:04 -08:00
Hongchao Deng
629bf00b63 update owner file (#808)
Signed-off-by: Hongchao Deng <hongchaodeng1@gmail.com>
2020-12-23 21:51:31 -08:00
Jian.Li
1f2c38d3c7 supports strategy patch for definition template (#798)
* supports strategy patch for definition template

* strategy unify

* lint code

* test cases

* add docs

* add test cases

* lint code

* add test cases for walk

* fix close fun

* lint code

* const variable for patchKey

* lint code

* interceptor for ast.Node

* add test cases

* check diff

* strategyUnify

* listMergeByKey

* prompts
2020-12-24 13:35:34 +08:00
Hongchao Deng
b129637cf2 add Community doc to clarify membership ladder (#805)
* add Community doc to clarify membership ladder

* update
2020-12-23 11:07:06 -08:00
Yue Wang
630f1e48bc enable webhooks for AppConfig/Comp (#781)
rename webhooks

fix e2e tests

Signed-off-by: roywang <seiwy2010@gmail.com>
2020-12-23 11:02:06 -08:00
天元
4bed55b400 support strategy patch datainput merge for slice case 2020-12-23 21:53:05 +08:00
Jianbo Sun
54ca5c115f Merge pull request #774 from captainroy-hy/trait-conflict-validation
implement conflictsWtih feature in trait definition
2020-12-23 13:32:38 +08:00
Zheng Xi Zhou
ddba62fba0 Generate restful api based on Swagger (#765)
* Generate restful api based on Swagger

As OpenAPI has to be quickly developped to support front-end developement, so
did the restufl api docs. Based on swagger, generate the docs automatically

* fix conflicts and add application list annotation
2020-12-22 16:35:26 -08:00
guoxudong
15a24c65b9 fix toc (#802) 2020-12-22 16:32:48 -08:00
guoxudong
56285ca540 add restful api docs (#801) 2020-12-22 15:16:56 +08:00
Jianbo Sun
b1c3f593db Merge pull request #800 from sunny0826/brew-install
docs add brew
2020-12-22 14:53:45 +08:00
guoxudong
e23f6b3866 docs add brew 2020-12-22 14:47:54 +08:00
Jianbo Sun
2943bc7ce1 Merge pull request #797 from wonderflow/fixrevision
fix workload reconcile error when revision enable trait is attached
2020-12-21 22:27:47 +08:00
Jianbo Sun
da0f8916aa Merge pull request #790 from zzxwill/issue-vela-install
Refine error message for vela installation
2020-12-21 21:15:21 +08:00
天元
7609da212f fix workload can not be update when revision enable trait is attached 2020-12-21 21:12:19 +08:00
Zheng Xi Zhou
7f87a47832 Update pkg/commands/system.go
Co-authored-by: Jianbo Sun <wonderflow.sun@gmail.com>
2020-12-21 18:05:42 +08:00
Jianbo Sun
04868d217b Merge pull request #791 from zzxwill/autoscale-metrics-server
Add "Autoscale: how to enable metrics server in various Kubernetes clusters?" in FAQ
2020-12-21 14:35:42 +08:00
zzxwill
56aa3c24d7 Add "Autoscale: how to enable metrics server in various Kubernetes clusters?" in FAQ
Also linked the FAQ in set-autoscale.md
2020-12-18 21:02:11 +08:00
zzxwill
a54ba9bb54 Refine error message for vela installation
Refined error message for vela installation and increase
timeout to 5 minutes from 2 minutes. And did some code
refactoring

To fix issue #783
2020-12-18 19:41:38 +08:00
Jianbo Sun
fbe93dc847 Merge pull request #771 from wonderflow/blog
add blog about how to extend kubevela by cuelang
2020-12-18 19:33:59 +08:00
天元
dbd855cc25 address comments 2020-12-18 19:11:57 +08:00
Hongchao Deng
7f136159c0 fix inconsistency for dev proxy config (#786) 2020-12-17 20:39:27 -08:00
Hongchao Deng
af61b59c5e return go time in Format RFC3339 to match js Date (#785)
Signed-off-by: Hongchao Deng <hongchaodeng1@gmail.com>
2020-12-17 20:11:18 -08:00
majian
c09e4df452 1.add application list page (#779)
2.ignore the deleted applicationconfig resource instead return nil
3.code style fix
2020-12-17 09:22:38 -08:00
Jianbo Sun
1694980eba Update docs/blog/zh/extend-kubevela-by-cuelang-in-20-mins.md
Co-authored-by: Lei Zhang (Harry) <resouer@gmail.com>
2020-12-17 09:54:46 +08:00
Jianbo Sun
feee1306fd Update docs/blog/zh/extend-kubevela-by-cuelang-in-20-mins.md
Co-authored-by: Lei Zhang (Harry) <resouer@gmail.com>
2020-12-17 09:54:30 +08:00
Jianbo Sun
0d56da4ab8 Update docs/blog/zh/extend-kubevela-by-cuelang-in-20-mins.md
Co-authored-by: Lei Zhang (Harry) <resouer@gmail.com>
2020-12-17 09:53:28 +08:00
roywang
582c3788c4 implement TraitConflict check in webhook
add unit tests

Signed-off-by: roy wang <seiwy2010@gmail.com>
2020-12-16 18:01:44 +09:00
天元
b8fd6f9823 add blog about how to extend kubevela by cuelang 2020-12-15 20:14:50 +08:00
Jianbo Sun
0fab691ba3 Merge pull request #773 from wonderflow/fiximports
minor fix
2020-12-15 15:56:23 +08:00
天元
3cb172f7ff minor fix 2020-12-15 13:55:36 +08:00
Jian.Li
e882a650ae Extend application's capabilities by trait definition (#742)
* add dsl pkg

* realize context capabilities for application

* fix golint

* fix check-diff

* upgrade vela server sample

* comment group

* Definition Reference be Optional & fix  three-part trait crd apply without namespace

* Improve samples
2020-12-13 20:00:06 -08:00
Jianbo Sun
ef9c26ffec Merge pull request #686 from majian159/hotfix-notfound-error
application not found return error. fix #685
2020-12-14 10:41:14 +08:00
majian
cf2a57c96a Integrate swagger and add env api (#764)
* 1.swagger integrate
2.add env swagger comment

Signed-off-by: majian <majian159@live.com>

* use swagger.json

Signed-off-by: majian <majian159@live.com>
2020-12-12 08:54:33 -08:00
majian
7acc52ebdb 1.use yarn (#769)
2.reinstall package

Signed-off-by: majian <majian159@live.com>
2020-12-11 10:28:08 -08:00
Jianbo Sun
3c35d9dadc Merge pull request #684 from majian159/feature-exec-svc
add svc flag for exec command.
2020-12-11 20:53:41 +08:00
majian
07742b6349 application not found return error. fix #685 and fix unit tests
Signed-off-by: majian <majian159@live.com>
2020-12-11 19:54:18 +08:00
majian
d45d086efb add svc flag for exec command and add unit test
Signed-off-by: majian <majian159@live.com>
2020-12-11 19:32:50 +08:00
Jianbo Sun
a31a316171 Merge pull request #767 from sunny0826/brew
Adapted for brew installation
2020-12-11 13:54:50 +08:00
guoxudong
ec287a181f Adapted for brew installation 2020-12-11 10:20:53 +08:00
Zheng Xi Zhou
50f4d10b00 Add make target to start both OpenAPI server and dashboard (#766)
Start up dashboard all in one
2020-12-10 11:10:10 -08:00
majian
9f27f70da8 1.migrate-env (#757)
2.add lockfile to version control
3.update packages
2020-12-10 15:05:33 +08:00
Jianbo Sun
3df55a92f3 Merge pull request #762 from resouer/dev
Update slack channel link
2020-12-10 12:08:04 +08:00
Harry Zhang
fd65c27ecb Update slack channel link 2020-12-09 19:49:15 -08:00
Jianbo Sun
576d928a83 Merge pull request #761 from captainroy-hy/fix-golint-1
fix golint issues
2020-12-10 11:39:20 +08:00
roywang
d14558a227 fix golint issues
Signed-off-by: roywang <seiwy2010@gmail.com>
2020-12-10 12:10:52 +09:00
Jianbo Sun
f48aba6f66 Merge pull request #743 from captainroy-hy/faster-refresh
faster refresh capabilities
2020-12-10 10:16:52 +08:00
Zheng Xi Zhou
f51dccf956 Minor updates on docs (#758)
Updated reference docs for autoscale and task, updated
cli docs
2020-12-09 10:35:59 -08:00
roywang
a961b002c2 faster refresh capabilities
Signed-off-by: roywang <seiwy2010@gmail.com>
2020-12-09 23:51:04 +09:00
Jianbo Sun
bffd43fa2c Merge pull request #754 from zzxwill/disscussion
Remove "Question" issue template
2020-12-09 22:14:47 +08:00
Jianbo Sun
2a88f9221f Merge pull request #728 from captainroy-hy/fix-uitable-wrap
fix cmd uitable wrap issue
2020-12-09 22:14:05 +08:00
Jianbo Sun
efdef27d0a Merge pull request #756 from zzxwill/extending-docs
Minor docs fix
2020-12-09 22:12:10 +08:00
roy wang
58bef9791f fix cmd uitable wrap issue
Signed-off-by: roy wang <seiwy2010@gmail.com>
2020-12-09 19:48:17 +09:00
zzxwill
c1de71d122 Minor docs fix
In extending trait docs, correct heading level for "Step 3"
2020-12-09 17:06:14 +08:00
majian
f8e320b97c Feature dashboard scaffold init. (#747)
* ant design pro5 init.

* scaffold init

Signed-off-by: majian <majian159@live.com>
2020-12-09 16:48:48 +08:00
zzxwill
f69476df37 Remove "question" issue template
Removed "Question" issue as we enable Github "Discussion" #744
2020-12-09 14:50:29 +08:00
Jianbo Sun
922892a909 Merge pull request #753 from zzxwill/faq
Add `what's the difference between Kubevela and helm` in FAQ
2020-12-09 14:35:43 +08:00
zzxwill
f36f7296fd Add what's the difference between Kubevela and helm in FAQ
Added the question from #704 in FAQ
2020-12-09 14:32:30 +08:00
Jianbo Sun
eff9d5f6e9 Merge pull request #752 from ElementakGod/fix-rds
Fixed the problem that the rds crd name is incorrect
2020-12-09 13:55:13 +08:00
Jianbo Sun
a75f32857a Merge pull request #750 from sunny0826/docs
Toc adapts to narrow screens
2020-12-09 13:41:19 +08:00
guoxudong
f011fe14bc fix 2020-12-09 13:40:04 +08:00
陈浩
7889a8c467 change the name of rds crd 2020-12-09 13:37:48 +08:00
guoxudong
f37cb3a1a7 Toc adapts to narrow screens 2020-12-09 13:01:35 +08:00
Jianbo Sun
bb6b050d15 Merge pull request #745 from ryanzhang-oss/ack-cleanup
make Vela work with ACK and clean up imports and scripts
2020-12-09 11:59:35 +08:00
Jianbo Sun
ec8427c419 Merge pull request #746 from ryan4yin/fix-appfile
fix: load appfile
2020-12-09 11:55:16 +08:00
ryan
3211c89610 fix: load appfile 2020-12-09 11:33:26 +08:00
Ryan Zhang
92f31a100e make vela work with ACK and clean up 2020-12-08 17:33:27 -08:00
guoxudong
960322c21f Docs update (#741)
* update docs

* add blog

* fix
2020-12-08 10:17:24 -08:00
912988434
f0596c4914 fix task( k8s job ) restartpolicy default Always (#723)
* fix task( k8s job ) restrtpolicy default Always

* Update the parameter policy to  restartPolicy

* Update the parameter restartPolicy to restart

* Update charts/vela-core/templates/defwithtemplate/task.yaml

Co-authored-by: Ryan Zhang <yangzhangrice@hotmail.com>

* Update hack/vela-templates/cue/task.cue

Co-authored-by: 李帅 <lishuai@MacBook-Pro.local>
Co-authored-by: Katacoda Scenario <scenario@katacoda.com>
Co-authored-by: Jianbo Sun <wonderflow.sun@gmail.com>
Co-authored-by: Ryan Zhang <yangzhangrice@hotmail.com>
2020-12-08 16:04:06 +08:00
Jianbo Sun
4ff9639daa Merge pull request #737 from wonderflow/addrelease
add release version into README
2020-12-08 10:06:53 +08:00
Jianbo Sun
8513c40b62 Merge pull request #738 from wonderflow/updateo
update owners file
2020-12-07 21:08:26 +08:00
天元
9224e8eb47 fix CI 2020-12-07 20:15:40 +08:00
天元
ee547ec441 add release version into README 2020-12-07 15:30:39 +08:00
天元
dc4071d0bc update owners file 2020-12-07 15:22:26 +08:00
Jianbo Sun
1ec07b0198 Merge pull request #722 from wonderflow/doc
add some detail for route design
2020-12-07 11:29:13 +08:00
Jianbo Sun
a848dd1bf3 Merge pull request #732 from zzxwill/design-docs
Fix broken link
2020-12-07 09:48:29 +08:00
zzxwill
901b1ef83e Fix broken link
Fixed broken link for `Capability Oriented` in appfile-design.md
2020-12-05 23:50:09 +08:00
Jianbo Sun
79c2209d19 Merge pull request #729 from wonderflow/setup
fix build issue
2020-12-05 16:00:04 +08:00
天元
c018b4e722 fix log 2020-12-05 15:15:02 +08:00
Jianbo Sun
28ede4adca Merge pull request #726 from LeoLiuYan/fix_restapi
Fix function `GetCapabilityDir` error handler and variable `env` typo
2020-12-05 10:39:18 +08:00
liuyan
c61efb1352 Fix function GetCapabilityDir error handler and variable env typo 2020-12-05 09:26:35 +08:00
lllwan
b36bfa02a6 Add JSON format appfile support (#691)
* Add JSON format appfile support

Co-authored-by: 摩羯 <wangxun@cai-inc.com>
Co-authored-by: wangxun <wangxun@zcydeMBP.lan>
2020-12-05 08:06:25 +08:00
Hongchao Deng
6f9d49be52 Merge pull request #717 from wonderflow/lockversion
build version into vela-core and lock helm version on release
2020-12-04 16:04:10 -08:00
Jianbo Sun
f702b845be Merge pull request #711 from zzxwill/faq
Add "warning: Namespace cert-manager exists" in FAQ
2020-12-04 18:37:54 +08:00
Jianbo Sun
2a2bc40282 Merge pull request #725 from Cweiping/feature/fix_port_forword_long_text
fix long text port forword
2020-12-04 18:26:02 +08:00
Weiping Cai
305360b755 fix long text port forword 2020-12-04 18:06:25 +08:00
天元
799bcf9cef add some detail for route design 2020-12-04 17:27:41 +08:00
天元
21cae61f93 build version into vela-core and lock helm version on release 2020-12-04 16:45:37 +08:00
Jianbo Sun
89507ec8ef Merge pull request #716 from zzxwill/official-site
Fix Webservice/worker reference link 404 and add Scaler link
2020-12-04 16:23:32 +08:00
zzxwill
2bd0e0af81 Fix Webservice/worker reference link 404 and add Scaler link
To fix 404 issue https://kubevela.io/#/en/developers/references/workload-types/web-service
and add manualscalertrait link
2020-12-04 16:11:57 +08:00
Hongchao Deng
169b02f965 Merge pull request #713 from wonderflow/fixjob
fix task(k8s job) definition
2020-12-03 20:10:33 -08:00
天元
9f44bb128f fix job definition 2020-12-04 11:52:13 +08:00
zzxwill
b7d16f7188 Add "warning: Namespace cert-manager exists" in FAQ
Added another case in FAQ.
Fix #701
2020-12-04 10:57:14 +08:00
Zheng Xi Zhou
06585fea92 Support disable installation of builtin capabilities (#687)
* Support disable installation of builtin capabilities

Added vela core bootstrap flag `--enable-caps` to support no
installation for builtin capabiliteis

Feature #658

* revert flag to "disable-cpas"

Co-authored-by: Jianbo Sun <wonderflow.sun@gmail.com>

* Address comments

Co-authored-by: Jianbo Sun <wonderflow.sun@gmail.com>
2020-12-04 10:03:25 +08:00
Jianbo Sun
7d3397ac31 Merge pull request #673 from zzxwill/docs-reference
Auto-generate reference docs
2020-12-03 18:11:49 +08:00
Jianbo Sun
8f9104387e Merge pull request #706 from zzxwill/faq
FAQ
2020-12-03 17:51:37 +08:00
zzxwill
2c3c97560d FAQ
Add FAQ on installation related questions in `Reference` section of
the official site
2020-12-03 17:17:11 +08:00
Jian.Li
ee906dbd5a Using CUE to implement OAM model on Kubernetes server side (#669)
Init: Using CUE to implement OAM model on Kubernetes server side
* vela server

* fix refator

* lint code

* vela server

* fix refator

* lint code

* rebase upstream

* remove lister

* add vela-server sample

* fix lint error

* fix lint error

* fix check-diff error

* add test case

* add test case for application controller

* add reconciler test with ginkgo

* remove make server

* remove the kustomize scripts

* fix units test bug

* config direct

* suite test

* add application validater

Co-authored-by: lj176172 <lj176172@alibaba-inc.com>
2020-12-03 17:09:55 +08:00
Jianbo Sun
a4e68dd604 add doc for users to migrate from oam-runtime to kubevela (#697)
* add doc for users to migrate from oam-runtime to kubevela

* Update design/vela-core/migrate-from-oam-runtime.md

Co-authored-by: Zheng Xi Zhou <zzxwill@gmail.com>

* Update design/vela-core/migrate-from-oam-runtime.md

Co-authored-by: Zheng Xi Zhou <zzxwill@gmail.com>

* Update design/vela-core/migrate-from-oam-runtime.md

Co-authored-by: Zheng Xi Zhou <zzxwill@gmail.com>

* Update design/vela-core/migrate-from-oam-runtime.md

Co-authored-by: Zheng Xi Zhou <zzxwill@gmail.com>

* Update design/vela-core/migrate-from-oam-runtime.md

Co-authored-by: Zheng Xi Zhou <zzxwill@gmail.com>

* Update design/vela-core/migrate-from-oam-runtime.md

Co-authored-by: Zheng Xi Zhou <zzxwill@gmail.com>

* Update design/vela-core/migrate-from-oam-runtime.md

Co-authored-by: Lei Zhang (Harry) <resouer@gmail.com>

* Update design/vela-core/migrate-from-oam-runtime.md

Co-authored-by: Lei Zhang (Harry) <resouer@gmail.com>

* add disable webhook

* Update design/vela-core/migrate-from-oam-runtime.md

Co-authored-by: Lei Zhang (Harry) <resouer@gmail.com>

* Update design/vela-core/migrate-from-oam-runtime.md

Co-authored-by: Lei Zhang (Harry) <resouer@gmail.com>

* Update design/vela-core/migrate-from-oam-runtime.md

Co-authored-by: Lei Zhang (Harry) <resouer@gmail.com>

* Update design/vela-core/migrate-from-oam-runtime.md

Co-authored-by: Lei Zhang (Harry) <resouer@gmail.com>

* address comments

* Update design/vela-core/migrate-from-oam-runtime.md

Co-authored-by: Lei Zhang (Harry) <resouer@gmail.com>

* Update design/vela-core/migrate-from-oam-runtime.md

Co-authored-by: Hongchao Deng <hongchaodeng1@gmail.com>

Co-authored-by: Zheng Xi Zhou <zzxwill@gmail.com>
Co-authored-by: Lei Zhang (Harry) <resouer@gmail.com>
Co-authored-by: Hongchao Deng <hongchaodeng1@gmail.com>
2020-12-03 15:29:56 +08:00
Jianbo Sun
b45b9dd6c7 Merge pull request #703 from hongchaodeng/export
add export command and argo gitops sample
2020-12-03 15:17:10 +08:00
Hongchao Deng
c52847eaaa add codecov threshold 2020-12-02 22:33:13 -08:00
Hongchao Deng
306b21459e add export command and argo gitops sample
Signed-off-by: Hongchao Deng <hongchaodeng1@gmail.com>
2020-12-02 22:25:57 -08:00
Jianbo Sun
af5bdd713f Merge pull request #702 from zzxwill/issue-template
Remove automatically prefixed "[BUG]" in the issue title
2020-12-03 12:10:58 +08:00
zzxwill
2bd770d88d Remove automatically prefixed "[BUG]" in the issue title
Remove "[BUG]" from the default issue as maintainers can
use labeling mechanism to tell whether it is
2020-12-03 11:54:02 +08:00
zzxwill
39db378bcd Put error as return for sub-functions and update description for definitions 2020-12-02 15:29:20 +08:00
Jianbo Sun
0c22a4c72e Merge pull request #690 from wonderflow/tip
add a tip for make diff fail
2020-12-02 14:49:23 +08:00
天元
1a37228e03 add a tip for make diff fail
Signed-off-by: 天元 <jianbo.sjb@alibaba-inc.com>
2020-12-02 13:54:19 +08:00
Jianbo Sun
c02e1eae9e Merge pull request #689 from horis233/move-GetConfig
Move GetConfig into specific commands
2020-12-02 13:51:14 +08:00
Jiaming Hu
014513d55e Add unit test for PersistentPreRunE 2020-12-01 22:49:03 -05:00
Jiaming Hu
5e4f270b1e move GetConfig function into specific commands 2020-12-01 21:44:06 -05:00
Jianbo Sun
ec388b11bb Merge pull request #683 from hongchaodeng/contrib
CONTRIBUTING: add merge regulations
2020-12-01 15:13:24 +08:00
Hongchao Deng
fb40432309 CONTRIBUTING: add merge regulations 2020-11-30 23:10:53 -08:00
Jianbo Sun
e7ab480e40 Merge pull request #678 from wonderflow/fixroute
fix route reconcile too frequency and replace oam-runtime imports
2020-12-01 15:01:45 +08:00
天元
9aae23e163 fix route reconcile too frequency and replace oam-runtime imports
Signed-off-by: 天元 <jianbo.sjb@alibaba-inc.com>
2020-12-01 14:05:12 +08:00
zzxwill
f7718b4c08 Auto-generate reference docs
Automatically generate reference docs for all workloads and traits.
1) moved design part from hack/references/configurations/rollout.yaml to design/vela-core/rollout.md
2) added usages for all workloads/traits, except route (#672)
3) renamed some reference docs

Attention: atuo-generation of specifications for all parameters has NOT been implemented, they are generated
based on files under `hack/references/configurations`

Co-authored-by: Jianbo Sun <wonderflow.sun@gmail.com>
2020-12-01 13:56:24 +08:00
Jianbo Sun
6ef0605542 Merge pull request #670 from captainroy-hy/fix-webhook-applyto
fix webhook about Trait-Applyto
2020-11-30 15:49:18 +08:00
roy wang
12a2eb8491 fix minor lint issues
add unit tests

Signed-off-by: roy wang <seiwy2010@gmail.com>
2020-11-30 16:11:48 +09:00
roy wang
8b27ade1cb fix validating-webhook about Trait-ApplyTo feature
Signed-off-by: roy wang <seiwy2010@gmail.com>
2020-11-30 15:23:07 +09:00
Jianbo Sun
b8f18153b3 Merge pull request #667 from zzxwill/install
Install KubeVela Cli by script
2020-11-30 13:26:20 +08:00
zzxwill
7658a05b84 indicates the source from 2020-11-30 11:42:57 +08:00
Jianbo Sun
ba2d945079 Merge pull request #663 from wonderflow/mergecode
Merging oam-runtime into vela-core
2020-11-27 20:24:06 +08:00
天元
6b931d9b32 fix unstable test as workload changed by reconcile
Signed-off-by: 天元 <jianbo.sjb@alibaba-inc.com>
2020-11-27 20:11:26 +08:00
天元
43754e89b6 merge CI and makefile
Signed-off-by: 天元 <jianbo.sjb@alibaba-inc.com>
2020-11-27 12:16:36 +08:00
天元
26b4e3c2d5 merge main.go
Signed-off-by: 天元 <jianbo.sjb@alibaba-inc.com>
2020-11-27 11:08:58 +08:00
天元
cfadfd8763 merge tests and run on CI
Signed-off-by: 天元 <jianbo.sjb@alibaba-inc.com>
2020-11-27 11:08:58 +08:00
天元
6480873e81 change import headers
Signed-off-by: 天元 <jianbo.sjb@alibaba-inc.com>
2020-11-27 11:08:54 +08:00
天元
2e975e678c merge code: apis,pkg all moved
Signed-off-by: 天元 <jianbo.sjb@alibaba-inc.com>
2020-11-27 11:07:50 +08:00
Jianbo Sun
fa7b6fa85f Merge pull request #664 from captainroy-hy/fix-lint-pkg-controller
fix lint issues
2020-11-27 11:07:20 +08:00
zzxwill
d31a983c7e Install KubeVela Cli by script
Supported macOS/Linux/Windows platform
2020-11-26 19:22:29 +08:00
roy wang
6303d311c8 fix lint issues in /pkg/*
fix lint issues in /cmd/*

Signed-off-by: roy wang <seiwy2010@gmail.com>
2020-11-26 17:18:54 +09:00
roy wang
bfb0f94b82 fix lint issues in /pkg/controller
fix lint issues in /apis

Signed-off-by: roy wang <seiwy2010@gmail.com>
2020-11-26 16:12:03 +09:00
Yue Wang
855f194228 doc for apply-once-only (#649)
* doc for apply-once-only

Signed-off-by: roy wang <seiwy2010@gmail.com>

* Update design/vela-core/apply-once-only.md

Co-authored-by: Jianbo Sun <wonderflow.sun@gmail.com>
2020-11-26 10:29:52 +08:00
Hongchao Deng
db03c6e291 Merge pull request #660 from wonderflow/refactor
Refactor standardize project structure
2020-11-25 18:27:39 -08:00
天元
be8403dc0d standardize project structure: move v1alpha1 into standard.oam.dev group
Signed-off-by: 天元 <jianbo.sjb@alibaba-inc.com>
2020-11-25 21:46:31 +08:00
Jianbo Sun
edaac86304 Merge pull request #659 from captainroy-hy/fix-lint
fix lint issues in /pkg/commands
2020-11-25 17:33:24 +08:00
天元
fc805214c7 standardize project structure: change api to apis
Signed-off-by: 天元 <jianbo.sjb@alibaba-inc.com>
2020-11-25 17:28:09 +08:00
roy wang
ee9b44fa80 fix lint issues in /pkg/commands
Signed-off-by: roy wang <seiwy2010@gmail.com>
2020-11-25 18:01:31 +09:00
Jianbo Sun
aa5a11bcdd Merge pull request #653 from laojianzi/fix-lint
fix lints for pkg/commands/init.go and pkg/server/util/middleware.go
2020-11-24 21:15:42 +08:00
laojianzi
80d4a8bfd1 fix lints in pkg/server/util/middleware.go 2020-11-24 20:56:20 +08:00
laojianzi
31e5eb05c5 fix lints in pkg/commands/init.go 2020-11-24 20:40:23 +08:00
Jianbo Sun
615f81c251 Merge pull request #650 from fengxsong/patch-1
correct usage of flag 'log-file-path'
2020-11-24 16:11:51 +08:00
fengxsong
899e7e1647 correct usage of flag 'log-file-path' 2020-11-24 15:34:55 +08:00
Jianbo Sun
c7bb52a4d4 Merge pull request #648 from horis233/fix-lints-in-appHandlers.go
Fix lints in appHandlers.go
2020-11-24 15:00:07 +08:00
Jiaming Hu
31012bc7e5 Fix lints in appHandlers.go 2020-11-23 23:51:52 -05:00
Jianbo Sun
03259630c2 Merge pull request #614 from wonderflow/golanci
add more strict golangci check
2020-11-23 19:06:13 +08:00
天元
2876d2f921 fix more golints and leave TODOs for no fixed package or files 2020-11-23 18:21:43 +08:00
天元
ba7a4a33fc add more strict golangci check
Signed-off-by: 天元 <jianbo.sjb@alibaba-inc.com>

add description for export const variable and function, fix golint

Signed-off-by: 天元 <jianbo.sjb@alibaba-inc.com>
2020-11-23 16:19:20 +08:00
Jianbo Sun
e6397723db Merge pull request #643 from wonderflow/fixlint
part of lint fixes detected by #614
2020-11-23 16:18:46 +08:00
Jianbo Sun
2165624ba8 Merge pull request #642 from morlay/master
Version tags should handle in workflow docker.yml
2020-11-23 15:58:39 +08:00
天元
3c233d3a9b fix lint 2020-11-23 15:55:46 +08:00
Morlay
ecae9e4785 version tags should in workflow docker.yml too 2020-11-23 14:55:10 +08:00
Jianbo Sun
32921796e8 Merge pull request #631 from morlay/master
multi-arch images support
2020-11-23 11:48:57 +08:00
Zheng Xi Zhou
83ed11e254 ComponentTrait composing and trait CR naming design (#628)
* Componenttrait composing and trait CR naming design

Add the design docs for OAM Kubernetes Runtime PR
https://github.com/crossplane/oam-kubernetes-runtime/pull/305

Co-authored-by: Jianbo Sun <wonderflow.sun@gmail.com>

* Update design/vela-core/componenttrait-composing-and-trait-CR-naming.md

* Update design/vela-core/componenttrait-composing-and-trait-CR-naming.md

* Update design/vela-core/componenttrait-composing-and-trait-CR-naming.md

Co-authored-by: Jianbo Sun <wonderflow.sun@gmail.com>
2020-11-23 11:13:07 +08:00
Jianbo Sun
461968ab5c Merge pull request #640 from weibaohui/master
support contour ingress controller
2020-11-23 10:28:52 +08:00
weibaohui
d42aff9fb2 support contour ingress controller 2020-11-21 16:50:39 +08:00
Jianbo Sun
5a6cfa401c Merge pull request #639 from leonrodenburg/patch-1
Fix typo in 'Setting Routes' doc
2020-11-21 11:01:50 +08:00
Léon Rodenburg
9027a78c4f Fix typo in 'Setting Routes' doc 2020-11-20 09:44:34 +01:00
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
Morlay
7457c39f48 multi-arch images support
Signed-off-by: Morlay <morlay.null@gmail.com>
2020-11-19 14:16:17 +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
Jianbo Sun
204a578aaa Merge pull request #401 from captainroy-hy/check-oam-pod
wait until runtime ready during vela install
2020-10-21 17:42:54 +08:00
roy wang
de28c06af5 wait until runtime ready during vela install
check runtime ready before vela dashboard

Signed-off-by: roy wang <seiwy2010@gmail.com>
2020-10-21 17:43:24 +09:00
Hongchao Deng
20a5457d5f refactor pkg/application to use Appfile (#402)
* refactor pkg/application to use Appfile

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

* fix build

* fix workload

* refactor pkg/application to use Appfile

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

* rebase

* fix

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

* e2e

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

* update design

* add test coverage for appfile

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

* comment

Signed-off-by: Hongchao Deng <hongchaodeng1@gmail.com>
2020-10-21 13:01:46 +08:00
Hongchao Deng
fa575a0103 Merge pull request #414 from wonderflow/logs
support vela logs
2020-10-20 08:45:29 -07:00
Hongchao Deng
841ce47ecd Merge pull request #415 from wonderflow/fixroutedef
fix route trait definition
2020-10-20 08:44:10 -07:00
Jianbo Sun
df495d9c04 Update pkg/commands/logs.go
Co-authored-by: Ryan Zhang <yangzhangrice@hotmail.com>
2020-10-20 23:24:47 +08:00
天元
5f755d4ec9 fix route trait definition 2020-10-20 20:58:36 +08:00
天元
a195d25546 support vela logs 2020-10-20 20:45:28 +08:00
Jianbo Sun
177e89a399 Merge pull request #410 from wonderflow/docgen
refactor command and add vela generate-doc for cli
2020-10-20 15:13:48 +08:00
天元
04fcad21d4 refactor command and add vela generate-doc for cli 2020-10-20 14:54:02 +08:00
Zheng Xi Zhou
13dea58e35 Refine help and error message (#345)
* Refine help and error message

refined error message for `vela app run`
and correct help message for `vela comp ls`

To fix #320

* fix make issue
2020-10-20 14:34:19 +08:00
Hongchao Deng
38dc6fe73e fix bugs on pkg/appfile (#409)
* fix bugs on pkg/appfile

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

* fix
2020-10-20 13:55:57 +08:00
Jianbo Sun
33c9a1dade Merge pull request #408 from ryanzhang-oss/fix-local
fix local dev environment
2020-10-20 11:46:53 +08:00
Ryan Zhang
b13677363f install CRD manually 2020-10-20 11:30:34 +08:00
Ryan Zhang
50e5c6a25c Merge pull request #403 from wonderflow/fixrace
fix race and update oam-runtime dependency
2020-10-19 13:41:13 +08:00
天元
3812ed2488 fix race and update oam-runtime dependency 2020-10-19 13:19:08 +08:00
Jianbo Sun
1cc8a3980c Merge pull request #387 from wonderflow/route1
give route trait new discovery port way with podspecable design
2020-10-18 11:24:38 +08:00
Hongchao Deng
b08c6b9441 Appfile: Extensible, User-friendly Application Config Format (#390)
* design doc

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

* Support deployment via appfile

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

* design update

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

* comments

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

* update

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

* refactor

* add multi services example in design doc
2020-10-18 11:22:17 +08:00
Ryan Zhang
8de3ee27f4 Merge pull request #392 from oam-dev/rollout-design
rollout trait high level design
2020-10-17 19:52:33 +08:00
Hongchao Deng
82714d163d Merge pull request #398 from hongchaodeng/codecov
move codecov upload to github workflow
2020-10-16 16:58:15 -07:00
Hongchao Deng
4fa3fb6486 move codecov upload to github workflow 2020-10-16 16:44:35 -07:00
Hongchao Deng
62de2e4d50 test codecov 2020-10-16 16:19:40 -07:00
Hongchao Deng
146dcb5e41 Merge pull request #397 from hongchaodeng/codecov
Setup codecov
2020-10-16 16:18:52 -07:00
Hongchao Deng
4889e458d4 add token 2020-10-16 16:07:47 -07:00
Hongchao Deng
8f4d9b37d2 fix 2020-10-16 15:24:59 -07:00
Hongchao Deng
0e83ff303c add codecov 2020-10-16 15:16:58 -07:00
天元
3d2bd9a898 add a design doc for route trait, along with fix and tests 2020-10-16 20:50:08 +08:00
Ryan Zhang
96f6a38869 rough rollout trait design 2020-10-15 21:06:50 +08:00
Jianbo Sun
4ef766c05d Merge pull request #395 from wonderflow/definition
move definition files to a separate dir
2020-10-15 17:30:05 +08:00
天元
2c721e5177 move definition files to a separate dir 2020-10-15 16:40:00 +08:00
Jianbo Sun
f58617f733 Merge pull request #394 from wonderflow/fixcert
covert certmanager to v1 and use wonderflow/cert-manager-api to reduce dependency collision
2020-10-15 12:13:50 +08:00
天元
1166c5b526 covert certmanager to v1 and use wonderflow/cert-manager-api to reduce dependency collision 2020-10-15 11:52:40 +08:00
Jianbo Sun
a5cacbe383 Merge pull request #393 from wonderflow/fix
add args for vela install and fix E2E with fresh image build
2020-10-14 23:41:33 +08:00
天元
d9302ff982 add args for vela install and fix E2E with fresh image build 2020-10-14 23:22:15 +08:00
Jianbo Sun
3751b98e7a Merge pull request #389 from wonderflow/initappdeploy
bootstrap application deployment for app level rollout/traffic management
2020-10-14 12:49:16 +08:00
天元
a66938eee8 add more to contributing guide 2020-10-14 12:01:52 +08:00
Ryan Zhang
529d150737 add an example on how to use flagger and fix some minor bugs (#381) 2020-10-14 11:43:57 +08:00
天元
395e2d55f7 bootstrap application deployment for app level rollout/traffic management 2020-10-14 11:41:31 +08:00
Jianbo Sun
4cb677418f Merge pull request #388 from captainroy-hy/fix-e2e-setup-2
revert commented e2e cases
2020-10-14 10:05:56 +08:00
roy wang
ad819b354a fix e2e-setup
revert commented e2e cases

Signed-off-by: roy wang <seiwy2010@gmail.com>
2020-10-13 21:56:44 +09:00
Jianbo Sun
48404bde98 Merge pull request #386 from wonderflow/fixconfig
fix make core-run panic
2020-10-13 19:57:22 +08:00
Jianbo Sun
a36e6fc14b Merge pull request #379 from captainroy-hy/add-probes
add liveness & readiness probes
2020-10-13 19:46:44 +08:00
天元
f3eed5f283 fix make core-run panic 2020-10-13 19:35:01 +08:00
roy wang
53fc9e5b71 add ready/health probes
add waiting for webhook secret ready

add unit tests

Signed-off-by: roy wang <seiwy2010@gmail.com>
2020-10-13 18:57:58 +09:00
Jianbo Sun
1479109324 move chart build to source file, allow chart CRD switching to V1 of cert-manager (#382)
* add chart_source

* generate chart to fake file

* switching to V1 of cert-manager

make exec time longer
2020-10-13 17:20:59 +08:00
Hongchao Deng
f106752b48 Merge pull request #385 from wonderflow/route
align to oam-k8s-runtime v0.3.0-rc1 and its CRD file
2020-10-12 21:20:59 -07:00
Hongchao Deng
467d3ab59c Merge pull request #384 from hongchaodeng/data
cue: rename 'data' to 'output'
2020-10-12 21:12:26 -07:00
天元
6076516c24 align to oam-k8s-runtime v0.3.0-rc1 and its CRD file 2020-10-13 12:11:55 +08:00
Hongchao Deng
af91fdf21e cue: rename 'data' to 'output' 2020-10-12 21:02:33 -07:00
Jianbo Sun
4bb8492f43 Merge pull request #383 from captainroy-hy/fix-block-e2e
comment out e2e blocking cases
2020-10-13 11:41:55 +08:00
roy wang
4428a6e738 remove e2e blocking cases
Signed-off-by: roy wang <seiwy2010@gmail.com>
2020-10-13 12:12:17 +09:00
silenceper
1f3548eee4 fix check resource exists (#373)
* fix check resource exists

* fix go lint

* add tests, fix DoesCRDExist

* remove init func

* fix should return err
2020-10-13 07:54:19 +08:00
Jianbo Sun
64d77656cf Merge pull request #380 from zzxwill/env-args
Update env init API doc
2020-10-12 15:46:43 +08:00
zzxwill
21f191b889 Update env init API doc 2020-10-12 15:32:07 +08:00
Jianbo Sun
60402414f1 Merge pull request #372 from zzxwill/fix-link
Fix code of conduct link
2020-10-10 18:28:35 +08:00
zzxwill
6fb9d02e8d Fix code of conduct link
renamed:    CODE_OF_CONDUCT.md  -> CODE_OF_CONDUCT.md
2020-10-10 17:35:16 +08:00
Jianbo Sun
eaac01b58c Merge pull request #366 from wonderflow/descirption
add description for workload and trait
2020-10-10 14:47:45 +08:00
Zheng Xi Zhou
af724ad58a Update appliesToWorkloads field in traitdefinition (#368)
* Update appliesToWorkloads field in traitdefintion

updated appliesToWorkloads fileds in traitdefinition
for three workloads, webservice, task and backend.
fix issue #346

* remove duplication
2020-10-10 14:27:34 +08:00
天元
590918af32 add description for workload and trait 2020-10-10 10:15:30 +08:00
Jianbo Sun
0b59db8fb0 Merge pull request #367 from resouer/fix-typo
Fix typos in design doc [part 2]
2020-10-10 09:59:38 +08:00
Harry Zhang
04deadd684 Fix typos in design doc [part 2] 2020-10-09 10:45:19 -07:00
Jianbo Sun
dd08aa4d45 Merge pull request #329 from captainroy-hy/track-comp-status
track status changing in vela init
2020-10-09 19:12:35 +08:00
roy wang
8b3bda82f7 add e2e test for vela init
modify e2e setup to wait oam-runtime pod running

add k8sclient in e2e test

refine tracking status of vela init

Signed-off-by: roy wang <seiwy2010@gmail.com>
2020-10-09 19:36:33 +09:00
roy wang
6aafb90acd track status changing in vela init
fix e2e-test

update oam-k8s-runtime dependency to latest tag

Signed-off-by: roy wang <seiwy2010@gmail.com>
2020-10-09 18:41:53 +09:00
Jianbo Sun
a0e12b84c7 Merge pull request #364 from resouer/update-project
Add design doc to kubevela and update readme
2020-10-09 14:48:55 +08:00
Harry Zhang
e56eb2fa67 Complete detailed design (part 1) 2020-10-08 22:38:08 -07:00
Jianbo Sun
28e75551ed Merge pull request #363 from hanxie-crypto/feature07
bug fix
2020-10-09 10:10:30 +08:00
hanxie
045a4aae2d bug fix 2020-10-09 09:58:48 +08:00
Jianbo Sun
53a9e9284d Merge pull request #359 from wonderflow/fixroute
Some fixes
2020-10-09 08:31:37 +08:00
天元
189175c4db using Environment intead of ENV fixes #350 2020-10-09 08:21:31 +08:00
Jianbo Sun
aa9c96d0b5 Merge pull request #360 from captainroy-hy/fix-hack-generate
fix minor bug in generate.go
2020-10-08 19:32:32 +08:00
roy wang
ceaf6db82c fix minor bugs in generate.go
Signed-off-by: roy wang <seiwy2010@gmail.com>
2020-10-08 19:09:22 +09:00
天元
e4570e22ae fix podspec workload not create service anymore 2020-10-08 16:09:04 +08:00
天元
c9a28309b2 fix trait detach not work 2020-10-08 16:08:42 +08:00
天元
6d50eed4f9 fix temparory chart dir created when develop locally 2020-10-08 15:58:43 +08:00
天元
e922666d5f rename 'vela comp run' to 'vela comp deploy' 2020-10-08 15:46:30 +08:00
天元
43223f0759 fix helm chart release name to kubevela 2020-10-08 15:31:05 +08:00
Harry Zhang
2641630b97 Init commit on design doc 2020-10-07 10:31:55 -07:00
Ryan Zhang
f4d5a13934 Merge pull request #356 from oam-dev/rename
rename containerized to podspecworkload
2020-10-06 10:13:54 -07:00
Ryan Zhang
61544a0be6 rename containerized to podspecworkload 2020-10-06 00:25:16 -07:00
Ryan Zhang
e422d0ba86 Merge pull request #352 from oam-dev/install-helm
Hack the Helm install client and improve the helm chart
2020-10-02 23:14:12 -07:00
Ryan Zhang
d0d8d77337 fix the test 2020-10-02 20:26:50 -07:00
Ryan Zhang
3f468e4752 improve helm install 2020-10-02 19:29:31 -07:00
Jianbo Sun
3b6ced2a58 Merge pull request #351 from resouer/readme
Add details for the project
2020-10-02 11:47:05 +08:00
Harry Zhang
f29bb26880 Add details for the project 2020-10-01 19:22:15 -07:00
Jianbo Sun
6ede8601b4 Merge pull request #343 from zzxwill/api
Refine and fix API
2020-09-30 14:44:38 +08:00
zzxwill
8a15d19348 Refine and fix API
- fixed trait attach issue
- allow leaving out `/` to make API more friendly
- merge similar struct
2020-09-29 19:30:52 +08:00
Zheng Xi Zhou
e0b4e5f76f Merge pull request #342 from hanxie-crypto/feature06
update applist
2020-09-29 19:27:30 +08:00
hanxie
6c04af02cb update applist 2020-09-29 19:08:04 +08:00
Zheng Xi Zhou
351049b74f Merge pull request #337 from hanxie-crypto/feature05
Component module related
2020-09-29 16:58:07 +08:00
hanxie
30127f8a3e Component module related 2020-09-28 19:37:33 +08:00
Ryan Zhang
6863ac02a1 add back the test after the cue templates are updated (#328)
* add back the test

* enhance e2e test
2020-09-28 17:51:06 +08:00
silenceper
24c30e65fb Determine whether it is necessary to create a service (#333)
* Determine whether it is necessary to create a service

* add checkContainerPortsSpecified func

* add check workload is nil
2020-09-28 10:08:51 +08:00
silenceper
c4dd02761a support delete multi env (#331)
* support delete multi env

* fix golint
2020-09-27 15:44:46 +08:00
Hongchao Deng
72b7a89e9a Merge pull request #332 from silenceper/fix-break
use return instead of break
2020-09-26 23:41:37 -07:00
silenceper
453976e28f use return instead of break 2020-09-27 14:31:03 +08:00
Jianbo Sun
914fa61819 Merge pull request #325 from zzxwill/component-api
Implemente Component api
2020-09-27 12:19:52 +08:00
zzxwill
e1a2edb604 fix naming issue 2020-09-27 11:35:46 +08:00
zzxwill
d245f3f939 implemented component delete API 2020-09-26 21:43:32 +08:00
zzxwill
433296d718 Update trait attach/detach with the introduction of component 2020-09-26 21:43:32 +08:00
zzxwill
28c3c683a0 Implement component related API
Update app list/show, implmented
component show
2020-09-26 21:41:15 +08:00
Jianbo Sun
50ba36eb1e Merge pull request #319 from oam-dev/cue-improve
Tweak the cue template format
2020-09-26 13:12:08 +08:00
Ryan Zhang
c69c809264 improve CUE format 2020-09-25 21:58:30 -07:00
Sun Jianbo
fac05a3bd1 Merge pull request #326 from zzxwill/naming
Fix naming in `json` of struct fields
2020-09-25 15:39:43 +08:00
zzxwill
60e34d5b03 Fix naming in json of struct fields
almost all of names in `json` of struct fileds
should be in `lowerUpper` format
2020-09-25 14:55:24 +08:00
Hongchao Deng
8b480df72d Merge pull request #318 from hongchaodeng/gomod
fixed dep should be put under 'replace'
2020-09-23 21:00:44 -07:00
Sun Jianbo
5deef1c098 Merge pull request #314 from captainroy-hy/fix-comp-status
fix bug: handle exception cases in `vela comp status`
2020-09-24 10:15:59 +08:00
roy wang
11d4fcd56f handle exception cases of vela comp status
Signed-off-by: roy wang <seiwy2010@gmail.com>
2020-09-24 10:59:53 +09:00
Hongchao Deng
d78648b73c fixed dep should be put under 'replace' 2020-09-23 09:12:09 -07:00
Sun Jianbo
525c228bd7 Merge pull request #311 from wonderflow/fix
fix env exist but issuer not exist
2020-09-23 11:22:11 +08:00
天元
ba6a53c6f5 fix env exist but issuer not exist 2020-09-23 10:38:59 +08:00
Sun Jianbo
0d1dd62b8a Merge pull request #308 from wonderflow/init
vela init to create and run application in one command
2020-09-22 20:23:41 +08:00
天元
5ac7265474 vela init to create and run application in one command 2020-09-22 20:07:53 +08:00
Zheng Xi Zhou
08701568a1 Fix OpenAPIV3Schema Validation Issue (#300)
* Fix OpenAPIV3Schema Validation Issue

Temporarily corrects spec.validation.openAPIV3Schema issue, and it would be removed
after this issue was fixed https://github.com/oam-dev/kubevela/issues/284.

* fix vela install issue

* return error during fixing APIV3SchemaValidation issue
2020-09-22 15:51:38 +08:00
roy wang
faedce906a fix #128 | sync deleted workload locally
Signed-off-by: roy wang <seiwy2010@gmail.com>

fix & add unit tests

Signed-off-by: roy wang <seiwy2010@gmail.com>

fix info output & unit test

Signed-off-by: roy wang <seiwy2010@gmail.com>

fix e2e-test

Signed-off-by: roy wang <seiwy2010@gmail.com>
2020-09-21 19:22:34 +08:00
Sun Jianbo
f5908741d3 Update pkg/commands/system.go 2020-09-21 19:22:34 +08:00
mosesyou
5414cc1f86 fix duplicate vela system info failure message 2020-09-21 19:22:34 +08:00
天元
371a989f9b add move readme 2020-09-21 19:22:34 +08:00
天元
8b3af3be93 temporarily add containerized to chart 2020-09-21 19:22:34 +08:00
hanxie
d6e519f1c4 Components static page,bugfix,capability delete 2020-09-21 19:22:34 +08:00
Sun Jianbo
90fd0a5055 Merge pull request #295 from wonderflow/production-issuer
add production certificate issuer and fix route trait
2020-09-18 21:45:14 +08:00
天元
3af41f6515 add production certificate issuer and fix route trait 2020-09-18 19:06:51 +08:00
Yue Wang
ee39054537 get cue temp from remote through URI (#287)
* get cue template of capabilities from remote by URI

Signed-off-by: roy wang <seiwy2010@gmail.com>

* add e2e tests

Signed-off-by: roy wang <seiwy2010@gmail.com>

* fix type conversion

Signed-off-by: roy wang <seiwy2010@gmail.com>
2020-09-18 15:59:36 +08:00
Ryan Zhang
b5218d371a Merge pull request #293 from wonderflow/iamge
use image from docker hub instead of quay.io
2020-09-17 19:23:41 -07:00
天元
7f5298a802 use image from docker hub instead of quay.io 2020-09-17 17:30:33 +08:00
1136 changed files with 136397 additions and 50197 deletions

View File

@@ -1,7 +1,7 @@
---
name: Bug report
name: "\U0001F41B Bug report"
about: Create a report to help us improve
title: "[BUG]"
title: ""
labels: kind/bug
assignees: ''

View File

@@ -1,5 +1,5 @@
---
name: Feature request
name: "\U0001F680 Feature request"
about: Suggest an idea for this project
title: "[Feature]"
labels: kind/feature

View File

@@ -1,12 +0,0 @@
---
name: Question
about: Help wanted.
title: "[Question]"
labels: help wanted
assignees: ''
---
<!--
Please write your questions.
-->

15
.github/how-to.md vendored Normal file
View File

@@ -0,0 +1,15 @@
# Github Utilities
## How to add a custom runner
1. Create an ECS that can connect github. Create a normal user(DON'T use `root`).
2. Install Dependencies:
- Kind
- Docker `apt install docker.io`, and the user to docker group(`usermod -aG docker <user>`)
- Kubectl
- Go(1.14 for now, must align with CI)
- Helm v3
- ginkgo
- Add all these dependencies to $PATH.
3. Install Custom runner agent https://docs.github.com/en/actions/hosting-your-own-runners/adding-self-hosted-runners
4. Run the runner as service https://docs.github.com/en/actions/hosting-your-own-runners/configuring-the-self-hosted-runner-application-as-a-service

21
.github/workflows/check-docs.yml vendored Normal file
View File

@@ -0,0 +1,21 @@
name: check-docs
on:
pull_request:
paths:
- 'docs/**'
branches:
- master
- release-*
jobs:
format-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: '12.x'
- name: Test Build
env:
VERSION: ${{ github.ref }}
run: |
bash ./hack/website/test-build.sh

30
.github/workflows/codeql-analysis.yml vendored Normal file
View File

@@ -0,0 +1,30 @@
name: "CodeQL"
on:
push:
branches: [ master, release-* ]
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
language: [ 'go' ]
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
- name: Autobuild
uses: github/codeql-action/autobuild@v1
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1

View File

@@ -1,25 +0,0 @@
name: Dashboard
on:
push:
branches: [ master ]
pull_request:
defaults:
run:
working-directory: ./dashboard
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [10.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm run build

View File

@@ -1,25 +0,0 @@
name: Publish to Registry
on:
push:
branches:
- master
jobs:
update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Publish to Github Docker Package Registry
uses: elgohr/Publish-Docker-Github-Action@2.21
with:
name: oam-dev/kubevela/vela-core
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: docker.pkg.github.com
tags: "latest"
- name: Publish to Docker Hub Registry
uses: elgohr/Publish-Docker-Github-Action@2.21
with:
name: oamdev/vela-core
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
tags: "latest"

View File

@@ -1,51 +0,0 @@
name: E2E
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
build:
name: Build
runs-on: ubuntu-latest
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
- name: Get dependencies
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
with:
version: "v0.7.0"
- name: install Kubebuilder
uses: RyanSiu1995/kubebuilder-action@v1
- name: Run Make
run: make
- name: Run Make Manager
run: make manager
- name: Run e2e tests
run: |
make e2e-setup
make e2e-test
make e2e-api-test
make e2e-cleanup

View File

@@ -2,36 +2,281 @@ name: Go
on:
push:
branches: [master]
branches:
- master
- release-*
workflow_dispatch: {}
pull_request:
branches: [master]
branches:
- master
- release-*
env:
# Common versions
GO_VERSION: '1.14'
GOLANGCI_VERSION: 'v1.38'
KIND_VERSION: 'v0.7.0'
jobs:
build:
name: Build
runs-on: ubuntu-latest
detect-noop:
runs-on: ubuntu-20.04
outputs:
noop: ${{ steps.noop.outputs.should_skip }}
steps:
- name: Set up Go 1.13
- name: Detect No-op Changes
id: noop
uses: fkirc/skip-duplicate-actions@v3.3.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
paths_ignore: '["**.md", "**.mdx", "**.png", "**.jpg"]'
do_not_skip: '["workflow_dispatch", "schedule", "push"]'
concurrent_skipping: false
unit-tests:
runs-on: ubuntu-20.04
needs: detect-noop
if: needs.detect-noop.outputs.noop != 'true'
steps:
- name: Set up Go 1.14
uses: actions/setup-go@v1
with:
go-version: 1.13
go-version: ${{ env.GO_VERSION }}
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v2
with:
submodules: true
- name: Cache Go Dependencies
uses: actions/cache@v2
with:
path: .work/pkg
key: ${{ runner.os }}-pkg-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-pkg-
- 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"
version: ${{ env.KIND_VERSION }}
- name: install Kubebuilder
uses: RyanSiu1995/kubebuilder-action@v1
uses: wonderflow/kubebuilder-action@v1.1
- name: Run Make test
run: make test
- name: Upload coverage report
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.txt
flags: unittests
name: codecov-umbrella
compatibility-test:
runs-on: ubuntu-20.04
needs: detect-noop
if: needs.detect-noop.outputs.noop != 'true'
steps:
- name: Set up Go 1.14
uses: actions/setup-go@v1
with:
go-version: ${{ env.GO_VERSION }}
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v2
with:
submodules: true
- name: Cache Go Dependencies
uses: actions/cache@v2
with:
path: .work/pkg
key: ${{ runner.os }}-pkg-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-pkg-
- name: Install ginkgo
run: |
sudo apt-get install -y golang-ginkgo-dev
- name: Setup Kind Cluster
uses: engineerd/setup-kind@v0.5.0
with:
version: ${{ env.KIND_VERSION }}
- name: install Kubebuilder
uses: wonderflow/kubebuilder-action@v1.1
- name: Run Make compatibility-test
run: make compatibility-test
- name: Clean up testdata
run: make compatibility-testdata-cleanup
e2e-tests:
runs-on: aliyun
needs: detect-noop
if: needs.detect-noop.outputs.noop != 'true'
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}
- name: Get dependencies
run: |
go get -v -t -d ./...
- name: Setup Kind
uses: engineerd/setup-kind@v0.5.0
with:
version: ${{ env.KIND_VERSION }}
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: Run Make
run: make
- name: Run Make Manager
run: make manager
- name: Prepare for e2e tests
run: |
make e2e-cleanup
make e2e-setup
helm lint ./charts/vela-core
helm test -n vela-system kubevela --timeout 5m
- name: Wait for e2e preparation ready
run: |
timeout 60 bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:38081/api/components)" != "200" ]]; do sleep 5; done' || false
- name: Run api e2e tests
run: make e2e-api-test
- name: Run e2e tests
run: make e2e-test
- name: Cleanup image
if: ${{ always() }}
run: make image-cleanup
staticcheck:
runs-on: ubuntu-20.04
needs: detect-noop
if: needs.detect-noop.outputs.noop != 'true'
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: true
- name: Cache Go Dependencies
uses: actions/cache@v2
with:
path: .work/pkg
key: ${{ runner.os }}-pkg-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-pkg-
- name: Static Check
run: go run honnef.co/go/tools/cmd/staticcheck -- ./...
- name: License Header Check
run: make check-license-header
lint:
runs-on: ubuntu-20.04
needs: detect-noop
if: needs.detect-noop.outputs.noop != 'true'
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: true
- name: Cache Go Dependencies
uses: actions/cache@v2
with:
path: .work/pkg
key: ${{ runner.os }}-pkg-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-pkg-
# This action uses its own setup-go, which always seems to use the latest
# stable version of Go. We could run 'make lint' to ensure our desired Go
# version, but we prefer this action because it leaves 'annotations' (i.e.
# it comments on PRs to point out linter violations).
- name: Lint
uses: golangci/golangci-lint-action@v2
with:
version: ${{ env.GOLANGCI_VERSION }}
check-diff:
runs-on: ubuntu-20.04
needs: detect-noop
if: needs.detect-noop.outputs.noop != 'true'
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: true
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}
- name: Cache Go Dependencies
uses: actions/cache@v2
with:
path: .work/pkg
key: ${{ runner.os }}-pkg-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-pkg-
- name: Check code formatting
run: go install golang.org/x/tools/cmd/goimports && make fmt
- name: Check Diff
run: make check-diff
build-cli:
runs-on: ubuntu-latest
needs: detect-noop
if: needs.detect-noop.outputs.noop != 'true'
steps:
- name: Set up Go 1.14
uses: actions/setup-go@v1
with:
go-version: 1.14
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Run cross-build
run: make cross-build
- name: Run compress binary
run: make compress

26
.github/workflows/license.yml vendored Normal file
View File

@@ -0,0 +1,26 @@
name: license
on:
push:
branches:
- master
- release-*
workflow_dispatch: {}
pull_request:
branches:
- master
- release-*
jobs:
license_check:
runs-on: ubuntu-latest
name: Check for unapproved licenses
steps:
- uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6
- name: Install dependencies
run: gem install license_finder
- name: Run tests
run: license_finder --decisions_file .license/dependency_decisions.yml

130
.github/workflows/registry.yml vendored Normal file
View File

@@ -0,0 +1,130 @@
name: Registry
on:
push:
branches:
- master
tags:
- "v*"
workflow_dispatch: {}
env:
BUCKET: kubevelacharts
ENDPOINT: oss-cn-hangzhou.aliyuncs.com
ACCESS_KEY: ${{ secrets.OSS_ACCESS_KEY }}
ACCESS_KEY_SECRET: ${{ secrets.OSS_ACCESS_KEY_SECRET }}
ARTIFACT_HUB_REPOSITORY_ID: ${{ secrets.ARTIFACT_HUB_REPOSITORY_ID }}
jobs:
publish-images:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Get the version
id: get_version
run: |
VERSION=${GITHUB_REF#refs/tags/}
if [[ ${GITHUB_REF} == "refs/heads/master" ]]; then
VERSION=latest
fi
echo ::set-output name=VERSION::${VERSION}
- name: Get git revision
id: vars
shell: bash
run: |
echo "::set-output name=git_revision::$(git rev-parse --short HEAD)"
- name: Login ghcr.io
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.CR_PAT }}
- name: Login docker.io
uses: docker/login-action@v1
with:
registry: docker.io
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- uses: docker/setup-qemu-action@v1
- uses: docker/setup-buildx-action@v1
- uses: docker/build-push-action@v2
name: Build & Pushing
with:
context: .
file: Dockerfile
labels: |-
org.opencontainers.image.source=https://github.com/${{ github.repository }}
org.opencontainers.image.revision=${{ github.sha }}
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
build-args: |
GITVERSION=git-${{ steps.vars.outputs.git_revision }}
VERSION=${{ steps.get_version.outputs.VERSION }}
tags: |-
ghcr.io/${{ github.repository }}/vela-core:${{ steps.get_version.outputs.VERSION }}
docker.io/oamdev/vela-core:${{ steps.get_version.outputs.VERSION }}
publish-charts:
env:
HELM_CHARTS_DIR: charts
HELM_CHART: charts/vela-core
LEGACY_HELM_CHART: legacy/charts/vela-core-legacy
LOCAL_OSS_DIRECTORY: .oss/
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@master
- name: Get git revision
id: vars
shell: bash
run: |
echo "::set-output name=git_revision::$(git rev-parse --short HEAD)"
- name: Install Helm
uses: azure/setup-helm@v1
with:
version: v3.4.0
- name: Prepare legacy chart
run: |
rsync -r $LEGACY_HELM_CHART $HELM_CHARTS_DIR
rsync -r $HELM_CHART/* $LEGACY_HELM_CHART --exclude=Chart.yaml --exclude=crds
- uses: oprypin/find-latest-tag@v1
with:
repository: oam-dev/kubevela
releases-only: true
id: latest_tag
- name: Tag helm chart image
run: |
latest_repo_tag=${{ steps.latest_tag.outputs.tag }}
sub="."
major="$(cut -d"$sub" -f1 <<<"$latest_repo_tag")"
minor="$(cut -d"$sub" -f2 <<<"$latest_repo_tag")"
patch="0"
next_repo_tag="$major.$(($minor + 1)).$patch"
image_tag=${GITHUB_REF#refs/tags/}
chart_version=$latest_repo_tag
if [[ ${GITHUB_REF} == "refs/heads/master" ]]; then
image_tag=latest
chart_version=${next_repo_tag}-rc-master
fi
sed -i "s/latest/${image_tag}/g" $HELM_CHART/values.yaml
sed -i "s/latest/image_tag/g" $LEGACY_HELM_CHART/values.yaml
chart_smever=${chart_version#"v"}
sed -i "s/0.1.0/$chart_smever/g" $HELM_CHART/Chart.yaml
sed -i "s/0.1.0/$chart_smever/g" $LEGACY_HELM_CHART/Chart.yaml
- name: Install ossutil
run: wget http://gosspublic.alicdn.com/ossutil/1.7.0/ossutil64 && chmod +x ossutil64 && mv ossutil64 ossutil
- name: Configure Alibaba Cloud OSSUTIL
run: ./ossutil --config-file .ossutilconfig config -i ${ACCESS_KEY} -k ${ACCESS_KEY_SECRET} -e ${ENDPOINT} -c .ossutilconfig
- name: sync cloud to local
run: ./ossutil --config-file .ossutilconfig sync oss://$BUCKET/core $LOCAL_OSS_DIRECTORY
- name: add artifacthub stuff to the repo
run: |
rsync README.md $HELM_CHART/README.md
rsync README.md $LEGACY_HELM_CHART/README.md
sed -i "s/ARTIFACT_HUB_REPOSITORY_ID/$ARTIFACT_HUB_REPOSITORY_ID/g" hack/artifacthub/artifacthub-repo.yml
rsync hack/artifacthub/artifacthub-repo.yml $LOCAL_OSS_DIRECTORY
- name: Package helm charts
run: |
helm package $HELM_CHART --destination $LOCAL_OSS_DIRECTORY
helm package $LEGACY_HELM_CHART --destination $LOCAL_OSS_DIRECTORY
helm repo index --url https://$BUCKET.$ENDPOINT/core $LOCAL_OSS_DIRECTORY
- name: sync local to cloud
run: ./ossutil --config-file .ossutilconfig sync $LOCAL_OSS_DIRECTORY oss://$BUCKET/core -f

23
.github/workflows/release-docs.yaml vendored Normal file
View File

@@ -0,0 +1,23 @@
name: docs
on:
push:
paths:
- 'docs/**'
branches:
- master
- release-*
jobs:
release-website:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: '12.x'
- name: Sync to kubevela.io Repo
env:
SSH_DEPLOY_KEY: ${{ secrets.GH_PAGES_DEPLOY }}
VERSION: ${{ github.ref }}
COMMIT_ID: ${{ github.sha }}
run: |
bash ./hack/website/release.sh

View File

@@ -4,106 +4,134 @@ on:
push:
tags:
- "v*"
workflow_dispatch: {}
jobs:
build:
name: Build
publish-cli:
runs-on: ubuntu-latest
env:
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
- name: Use Node.js 10.x
uses: actions/setup-node@v1
with:
node-version: 10.x
- name: Run npm install
run: make npm-install
- name: Run npm build
run: make npm-build
- name: Run generate-source
run: make generate-source
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/}
- name: Tag helm chart image
run: |
sed -i 's/latest/${{ steps.get_version.outputs.VERSION }}/g' charts/vela-core/values.yaml
sed -i 's/0.1.0/${{ steps.get_version.outputs.VERSION }}/g' charts/vela-core/Chart.yaml
- name: Run cross-build
run: make cross-build
- name: Run compress binary
run: make compress
- name: Create Release
id: create_release
uses: actions/create-release@v1
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/}
- name: Upload Linux tar.gz
- name: Get release
id: get_release
uses: bruceadams/get-release@v1.2.2
- name: Upload Vela Linux amd64 tar.gz
uses: actions/upload-release-asset@v1.0.2
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./_bin/vela-linux-amd64.tar.gz
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./_bin/vela/vela-linux-amd64.tar.gz
asset_name: vela-${{ steps.get_version.outputs.VERSION }}-linux-amd64.tar.gz
asset_content_type: binary/octet-stream
- name: Upload Linux zip
- name: Upload Vela Linux amd64 zip
uses: actions/upload-release-asset@v1.0.2
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./_bin/vela-linux-amd64.zip
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./_bin/vela/vela-linux-amd64.zip
asset_name: vela-${{ steps.get_version.outputs.VERSION }}-linux-amd64.zip
asset_content_type: binary/octet-stream
- name: Upload MacOS tar.gz
- name: Upload Vela MacOS tar.gz
uses: actions/upload-release-asset@v1.0.2
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./_bin/vela-darwin-amd64.tar.gz
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./_bin/vela/vela-darwin-amd64.tar.gz
asset_name: vela-${{ steps.get_version.outputs.VERSION }}-darwin-amd64.tar.gz
asset_content_type: binary/octet-stream
- name: Upload MacOS zip
- name: Upload Vela MacOS zip
uses: actions/upload-release-asset@v1.0.2
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./_bin/vela-darwin-amd64.zip
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./_bin/vela/vela-darwin-amd64.zip
asset_name: vela-${{ steps.get_version.outputs.VERSION }}-darwin-amd64.zip
asset_content_type: binary/octet-stream
- name: Upload Windows tar.gz
- name: Upload Vela Windows tar.gz
uses: actions/upload-release-asset@v1.0.2
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./_bin/vela-windows-amd64.tar.gz
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./_bin/vela/vela-windows-amd64.tar.gz
asset_name: vela-${{ steps.get_version.outputs.VERSION }}-windows-amd64.tar.gz
asset_content_type: binary/octet-stream
- name: Upload Windows zip
- name: Upload Vela Windows zip
uses: actions/upload-release-asset@v1.0.2
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./_bin/vela-windows-amd64.zip
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./_bin/vela/vela-windows-amd64.zip
asset_name: vela-${{ steps.get_version.outputs.VERSION }}-windows-amd64.zip
asset_content_type: binary/octet-stream
- name: Upload Kubectl-Vela Linux amd64 tar.gz
uses: actions/upload-release-asset@v1.0.2
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./_bin/kubectl-vela/kubectl-vela-linux-amd64.tar.gz
asset_name: kubectl-vela-${{ steps.get_version.outputs.VERSION }}-linux-amd64.tar.gz
asset_content_type: binary/octet-stream
- name: Upload Kubectl-Vela Linux amd64 zip
uses: actions/upload-release-asset@v1.0.2
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./_bin/kubectl-vela/kubectl-vela-linux-amd64.zip
asset_name: kubectl-vela-${{ steps.get_version.outputs.VERSION }}-linux-amd64.zip
asset_content_type: binary/octet-stream
- name: Upload Kubectl-Vela MacOS tar.gz
uses: actions/upload-release-asset@v1.0.2
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./_bin/kubectl-vela/kubectl-vela-darwin-amd64.tar.gz
asset_name: kubectl-vela-${{ steps.get_version.outputs.VERSION }}-darwin-amd64.tar.gz
asset_content_type: binary/octet-stream
- name: Upload Kubectl-Vela MacOS zip
uses: actions/upload-release-asset@v1.0.2
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./_bin/kubectl-vela/kubectl-vela-darwin-amd64.zip
asset_name: kubectl-vela-${{ steps.get_version.outputs.VERSION }}-darwin-amd64.zip
asset_content_type: binary/octet-stream
- name: Upload Kubectl-Vela Windows tar.gz
uses: actions/upload-release-asset@v1.0.2
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./_bin/kubectl-vela/kubectl-vela-windows-amd64.tar.gz
asset_name: kubectl-vela-${{ steps.get_version.outputs.VERSION }}-windows-amd64.tar.gz
asset_content_type: binary/octet-stream
- name: Upload Kubectl-Vela Windows zip
uses: actions/upload-release-asset@v1.0.2
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./_bin/kubectl-vela/kubectl-vela-windows-amd64.zip
asset_name: kubectl-vela-${{ steps.get_version.outputs.VERSION }}-windows-amd64.zip
asset_content_type: binary/octet-stream
- name: Upload Checksums
uses: actions/upload-release-asset@v1.0.2
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./_bin/sha256sums.txt
asset_name: sha256sums.txt
asset_content_type: text/plain
- name: Publish to Github Docker Package Registry
uses: elgohr/Publish-Docker-Github-Action@2.21
- uses: actions/setup-node@v1
with:
name: oam-dev/kubevela/vela-core
username: $GITHUB_ACTOR
password: ${{ secrets.GITHUB_TOKEN }}
registry: docker.pkg.github.com
tags: "${{ steps.get_version.outputs.VERSION }}"
- name: Publish to Docker Hub Registry
uses: elgohr/Publish-Docker-Github-Action@2.21
with:
name: oamdev/vela-core
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
tags: "${{ steps.get_version.outputs.VERSION }}"
node-version: '12.x'
- name: Sync release to kubevela.io Repo
env:
SSH_DEPLOY_KEY: ${{ secrets.GH_PAGES_DEPLOY }}
VERSION: ${{ steps.get_version.outputs.VERSION }}
COMMIT_ID: ${{ github.sha }}
run: |
bash ./hack/website/release.sh

10
.github/workflows/timed-task.yml vendored Normal file
View File

@@ -0,0 +1,10 @@
name: Timed Task
on:
schedule:
- cron: '0 16 * * *'
jobs:
clean-image:
runs-on: aliyun
steps:
- name: Cleanup image
run: docker image prune -f

26
.gitignore vendored
View File

@@ -13,6 +13,7 @@ e2e/vela
# Output of the go coverage tool, specifically when used with LiteIDE
*.out
coverage.txt
# Kubernetes Generated files - skip generated files, except for vendored files
@@ -24,6 +25,7 @@ e2e/vela
*.swo
*~
.DS_Store
_.yaml
# Dependency directories (remove the comment below to include it)
vendor/
@@ -33,16 +35,26 @@ vendor/
pkg/test/vela
config/crd/bases
tmp/
_tmp/
cmd/vela/fake/source.go
references/cmd/cli/fake/source.go
references/cmd/cli/fake/chart_source.go
charts/vela-core/crds/_.yaml
.test_vela
.vela/
# Dashboard
dashboard/node_modules/
node_modules/
.eslintcache
dashboard/dist/
dashboard/package-lock.json
dashboard/src/.umi/
references/dashboard/dist/
references/dashboard/package-lock.json
references/dashboard/src/.umi/
package-lock.json
dashboard/src/.umi-production/
references/dashboard/src/.umi-production/
# Swagger: generate Restful API
references/apiserver/docs/index.html
# check docs
git-page/

209
.golangci.yml Normal file
View File

@@ -0,0 +1,209 @@
run:
timeout: 10m
skip-files:
- "zz_generated\\..+\\.go$"
- ".*_test.go$"
skip-dirs:
- "hack"
- "e2e"
output:
# colored-line-number|line-number|json|tab|checkstyle|code-climate, default is "colored-line-number"
format: colored-line-number
linters-settings:
errcheck:
# report about not checking of errors in type assetions: `a := b.(MyStruct)`;
# default is false: such cases aren't reported by default.
check-type-assertions: false
# report about assignment of errors to blank identifier: `num, _ := strconv.Atoi(numStr)`;
# default is false: such cases aren't reported by default.
check-blank: false
# [deprecated] comma-separated list of pairs of the form pkg:regex
# the regex is used to ignore names within pkg. (default "fmt:.*").
# see https://github.com/kisielk/errcheck#the-deprecated-method for details
ignore: fmt:.*,io/ioutil:^Read.*
exhaustive:
# indicates that switch statements are to be considered exhaustive if a
# 'default' case is present, even if all enum members aren't listed in the
# switch
default-signifies-exhaustive: true
govet:
# report about shadowed variables
check-shadowing: false
golint:
# minimal confidence for issues, default is 0.8
min-confidence: 0.8
gofmt:
# simplify code: gofmt with `-s` option, true by default
simplify: true
goimports:
# put imports beginning with prefix after 3rd-party packages;
# it's a comma-separated list of prefixes
local-prefixes: github.com/oam-dev/kubevela
gocyclo:
# minimal code complexity to report, 30 by default (but we recommend 10-20)
min-complexity: 30
maligned:
# print struct with more effective memory layout or not, false by default
suggest-new: true
dupl:
# tokens count to trigger issue, 150 by default
threshold: 100
goconst:
# minimal length of string constant, 3 by default
min-len: 3
# minimal occurrences count to trigger, 3 by default
min-occurrences: 5
lll:
# tab width in spaces. Default to 1.
tab-width: 1
unused:
# treat code as a program (not a library) and report unused exported identifiers; default is false.
# XXX: if you enable this setting, unused will report a lot of false-positives in text editors:
# if it's called for subdir of a project it can't find funcs usages. All text editor integrations
# with golangci-lint call it on a directory with the changed file.
check-exported: false
unparam:
# Inspect exported functions, default is false. Set to true if no external program/library imports your code.
# XXX: if you enable this setting, unparam will report a lot of false-positives in text editors:
# if it's called for subdir of a project it can't find external interfaces. All text editor integrations
# with golangci-lint call it on a directory with the changed file.
check-exported: false
nakedret:
# make an issue if func has more lines of code than this setting and it has naked returns; default is 30
max-func-lines: 30
gocritic:
# Enable multiple checks by tags, run `GL_DEBUG=gocritic golangci-lint` run to see all tags and checks.
# Empty list by default. See https://github.com/go-critic/go-critic#usage -> section "Tags".
enabled-tags:
- performance
settings: # settings passed to gocritic
captLocal: # must be valid enabled check name
paramsOnly: true
rangeValCopy:
sizeThreshold: 32
makezero:
# Allow only slices initialized with a length of zero. Default is false.
always: false
linters:
enable:
- megacheck
- govet
- gocyclo
- gocritic
- goconst
- goimports
- gofmt # We enable this as well as goimports for its simplify mode.
- golint
- unconvert
- misspell
- nakedret
presets:
- bugs
- unused
fast: false
issues:
# Excluding configuration per-path and per-linter
exclude-rules:
# Exclude some linters from running on tests files.
- path: _test(ing)?\.go
linters:
- gocyclo
- errcheck
- dupl
- gosec
- scopelint
- unparam
# Ease some gocritic warnings on test files.
- path: _test\.go
text: "(unnamedResult|exitAfterDefer)"
linters:
- gocritic
# These are performance optimisations rather than style issues per se.
# They warn when function arguments or range values copy a lot of memory
# rather than using a pointer.
- text: "(hugeParam|rangeValCopy):"
linters:
- gocritic
# This "TestMain should call os.Exit to set exit code" warning is not clever
# enough to notice that we call a helper method that calls os.Exit.
- text: "SA3000:"
linters:
- staticcheck
- text: "k8s.io/api/core/v1"
linters:
- goimports
# This is a "potential hardcoded credentials" warning. It's triggered by
# any variable with 'secret' in the same, and thus hits a lot of false
# positives in Kubernetes land where a Secret is an object type.
- text: "G101:"
linters:
- gosec
- gas
# This is an 'errors unhandled' warning that duplicates errcheck.
- text: "G104:"
linters:
- gosec
- gas
# The Azure AddToUserAgent method appends to the existing user agent string.
# It returns an error if you pass it an empty string lettinga you know the
# user agent did not change, making it more of a warning.
- text: \.AddToUserAgent
linters:
- errcheck
- text: "don't use an underscore"
linters:
- golint
# Independently from option `exclude` we use default exclude patterns,
# it can be disabled by this option. To list all
# excluded by default patterns execute `golangci-lint run --help`.
# Default value for this option is true.
exclude-use-default: false
# Show only new issues: if there are unstaged changes or untracked files,
# only those changes are analyzed, else only changes in HEAD~ are analyzed.
# It's a super-useful option for integration of golangci-lint into existing
# large codebase. It's not practical to fix all existing issues at the moment
# of integration: much better don't allow issues in new code.
# Default is false.
new: false
# Maximum issues count per one linter. Set to 0 to disable. Default is 50.
max-per-linter: 0
# Maximum count of issues with the same text. Set to 0 to disable. Default is 3.
max-same-issues: 0

19
.license/README.md Normal file
View File

@@ -0,0 +1,19 @@
# License Checker
Our license checker CI rely on https://github.com/pivotal/LicenseFinder.
## How to add a new license?
LicenseFinder is a ruby project, so make sure you have ruby installed.
### Install the tool
```shell
gem install license_finder
```
### Add a license
```shell
license_finder permitted_licenses add MIT --decisions_file .license/dependency_decisions.yml
```

View File

@@ -0,0 +1,43 @@
---
- - :permit
- MIT
- :who:
:why:
:versions: []
:when: 2021-03-12 07:35:34.645031000 Z
- - :permit
- Apache 2.0
- :who:
:why:
:versions: []
:when: 2021-03-12 07:19:18.243194000 Z
- - :permit
- New BSD
- :who:
:why:
:versions: []
:when: 2021-03-12 07:19:28.540675000 Z
- - :permit
- Simplified BSD
- :who:
:why:
:versions: []
:when: 2021-03-12 07:20:01.774212000 Z
- - :permit
- Mozilla Public License 2.0
- :who:
:why:
:versions: []
:when: 2021-03-12 07:21:05.194536000 Z
- - :permit
- unknown
- :who:
:why:
:versions: []
:when: 2021-03-12 07:21:43.379269000 Z
- - :permit
- ISC
- :who:
:why:
:versions: []
:when: 2021-03-12 07:22:07.265966000 Z

3
CODE_OF_CONDUCT.md Normal file
View File

@@ -0,0 +1,3 @@
# Code of Conduct
KubeVela follows the [CNCF Code of Conduct](https://github.com/cncf/foundation/blob/master/code-of-conduct.md).

View File

@@ -1,115 +1,149 @@
# CONTRIBUTING
# CONTRIBUTING Guide
## 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 an open governance since the very beginning and donate the project to neutral foundation as soon as it's released.
This doc explains how to set up a development environment, so you can get started
contributing to `kubevela` or build a PoC (Proof of Concept).
## Prerequisites
1. Golang version 1.12+
2. Kubernetes version v1.15+ with `~/.kube/config` configured.
3. OAM Kubernetes Runtime installed.
4. Kustomize version 3.8+
5. ginkgo 1.14.0+ (just for [E2E test](https://github.com/oam-dev/kubevela/blob/master/DEVELOPMENT.md#e2e-test))
6. 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.
## Development
### Prerequisites
1. Golang version 1.13+
2. Kubernetes version v1.16+ with `~/.kube/config` configured.
3. ginkgo 1.14.0+ (just for [E2E test](./CONTRIBUTING.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](https://kubevela.io/docs/concepts) before dive into its code.
### Build
## Build
* Clone this project
```shell script
git clone git@github.com:oam-dev/kubevela.git
```
* Install Template CRD into your cluster
KubeVela includes two parts, `vela core` and `vela cli`.
- The `vela core` is actually a K8s controller, it will watch OAM Spec CRD and deploy resources.
- The `vela cli` is a command line tool that can build, run apps(with the help of `vela core`).
For local development, we probably need to build both of them.
* Build Vela CLI
```shell script
make install
make
```
* Install template object
After the vela cli built successfully, `make` command will create `vela` binary to `bin/` under the project.
* Configure `vela` binary to System PATH
```shell script
kubectl apply -f config/samples/
export PATH=$PATH:/your/path/to/project/kubevela/bin
```
## Develop & Debug
If you change Template CRD, remember to rerun `make install`.
Then you can use `vela` command directly.
Use the following command to develop and debug.
* Build Vela Core
```shell script
$ cd cmd/vela
$ go run main.go COMMAND [FLAG]
make manager
```
For example, use the following command to create and run an application.
* Run Vela Core
Firstly make sure your cluster has CRDs, below is the command that can help install all CRDs.
```shell script
$ go run main.go run containerized app2057 nginx:1.9.4
Creating AppConfig app2057
SUCCEED
$ kubectl get oam
NAME WORKLOAD-KIND
component.core.oam.dev/app2057 ContainerizedWorkload
NAME AGE
containerizedworkload.core.oam.dev/poc 53m
NAME AGE
applicationconfiguration.core.oam.dev/app2057 69s
NAME DEFINITION-NAME
traitdefinition.core.oam.dev/simplerollouttraits.extend.oam.dev simplerollouttraits.extend.oam.dev
NAME DEFINITION-NAME
workloaddefinition.core.oam.dev/containerizedworkloads.core.oam.dev containerizedworkloads.core.oam.dev
workloaddefinition.core.oam.dev/deployments.apps deployments.apps
workloaddefinition.core.oam.dev/statefulsets.apps statefulsets.apps
make core-install
```
## E2E test
```
$ make e2e-test
Running Suite: Trait Suite
==========================
Random Seed: 1596559178
Will run 5 of 5 specs
Run locally:
Trait env init
should print env initiation successful message
kubevela/e2e/commonContext.go:14
Create env succeed, current env is default
------------------------------
Trait env set
should show env set message
kubevela/e2e/commonContext.go:40
Set env succeed, current env is default
------------------------------
Trait run
should print successful creation information
kubevela/e2e/commonContext.go:76
Creating AppConfig app-trait-basic
SUCCEED
------------------------------
Trait kubevela attach trait
should print successful attached information
kubevela/e2e/trait/trait_test.go:24
Applying trait for app
Succeeded!
------------------------------
Trait delete
should print successful deletion information
kubevela/e2e/commonContext.go:85
Deleting AppConfig "app-trait-basic"
DELETE SUCCEED
Ran 5 of 5 Specs in 9.717 seconds
SUCCESS! -- 5 Passed | 0 Failed | 0 Pending | 0 Skipped
PASS
```shell script
make core-run
```
This command will run controller locally, it will use your local KubeConfig which means you need to have a k8s cluster
locally. If you don't have a one, we suggest that you could setup up a cluster with [kind](https://kind.sigs.k8s.io/).
When you're developing `vela-core`, make sure the controller installed by helm chart is not running.
Otherwise, it will conflict with your local running controller.
You can check and uninstall it by using helm.
```shell script
helm list -A
helm uninstall -n vela-system kubevela
```
### Use
You can try use your local built binaries follow [the documentation](https://kubevela.io/docs/quick-start).
## Testing
### Unit test
```shell script
make test
```
### E2E test
**Before e2e test start, make sure you have vela-core running.**
```shell script
make core-run
```
Start to test.
```
make e2e-test
```
### Contribute Docs
Please read [the documentation](https://github.com/oam-dev/kubevela/tree/master/docs/README.md) before contributing to the docs.
- Build docs
```shell script
make docs-build
```
- Local development and preview
```shell script
make docs-start
```
## Make a pull request
Remember to write unit-test and e2e test before making a pull request.
Remember to write unit-test and e2e-test after you have finished your code.
Run following checks before making a pull request.
```shell script
make reviewable
```
The command will do some lint checks and clean code.
After that, check in all changes and send a pull request.
## Merge Regulations
Before merging, the pull request should obey the following rules:
- The commit title and message should be clear about what this PR does.
- All test CI should pass green.
- The `codecov/project` should pass. This means the coverage should not drop. See [Codecov commit status](https://docs.codecov.io/docs/commit-status#project-status).

View File

@@ -1,5 +1,5 @@
# Build the manager binary
FROM golang:1.13 as builder
FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.14-alpine as builder
WORKDIR /workspace
# Copy the Go Modules manifests
@@ -11,18 +11,34 @@ RUN go mod download
# Copy the go source
COPY cmd/core/main.go main.go
COPY api/ api/
COPY apis/ apis/
COPY pkg/ pkg/
COPY version/ version/
# Build
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -o manager main.go
ARG TARGETARCH
ARG VERSION
ARG GITVERSION
RUN GO111MODULE=on CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} \
go build -a -ldflags "-s -w -X github.com/oam-dev/kubevela/version.VelaVersion=${VERSION:-undefined} -X github.com/oam-dev/kubevela/version.GitRevision=${GITVERSION:-undefined}" \
-o manager-${TARGETARCH} main.go
# Use distroless as minimal base image to package the manager binary
# Use alpine as base image due to the discussion in issue #1448
# You can replace distroless as minimal base image to package the manager binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details
# oamdev/gcr.io-distroless-static:nonroot is syncd from gcr.io/distroless/static:nonroot as somewhere can't reach gcr.io
FROM oamdev/gcr.io-distroless-static:nonroot
WORKDIR /
COPY --from=builder /workspace/manager .
USER nonroot:nonroot
# Overwrite `BASE_IMAGE` by passing `--build-arg=BASE_IMAGE=gcr.io/distroless/static:nonroot`
ARG BASE_IMAGE
FROM ${BASE_IMAGE:-alpine:latest}
# This is required by daemon connnecting with cri
RUN apk add --no-cache ca-certificates bash
ENTRYPOINT ["/manager"]
WORKDIR /
ARG TARGETARCH
COPY --from=builder /workspace/manager-${TARGETARCH} /usr/local/bin/manager
COPY entrypoint.sh /usr/local/bin/
ENTRYPOINT ["entrypoint.sh"]
CMD ["manager"]

328
Makefile
View File

@@ -1,14 +1,32 @@
# Vela version
VELA_VERSION ?= 0.1.0
VELA_VERSION ?= master
# Repo info
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) -X main.chartTGZSource=$$(cat -) -s -w"
GIT_COMMIT ?= git-$(shell git rev-parse --short HEAD)
GIT_COMMIT_LONG ?= $(shell git rev-parse HEAD)
VELA_VERSION_KEY := github.com/oam-dev/kubevela/version.VelaVersion
VELA_GITVERSION_KEY := github.com/oam-dev/kubevela/version.GitRevision
LDFLAGS ?= "-s -w -X $(VELA_VERSION_KEY)=$(VELA_VERSION) -X $(VELA_GITVERSION_KEY)=$(GIT_COMMIT)"
GOX = go run github.com/mitchellh/gox
TARGETS := darwin/amd64 linux/amd64 windows/amd64
DIST_DIRS := find * -type d -exec
GOBUILD_ENV = GO111MODULE=on CGO_ENABLED=0
GOX = go run github.com/mitchellh/gox
TARGETS := darwin/amd64 linux/amd64 windows/amd64
DIST_DIRS := find * -type d -exec
TIME_LONG = `date +%Y-%m-%d' '%H:%M:%S`
TIME_SHORT = `date +%H:%M:%S`
TIME = $(TIME_SHORT)
BLUE := $(shell printf "\033[34m")
YELLOW := $(shell printf "\033[33m")
RED := $(shell printf "\033[31m")
GREEN := $(shell printf "\033[32m")
CNone := $(shell printf "\033[0m")
INFO = echo ${TIME} ${BLUE}[ .. ]${CNone}
WARN = echo ${TIME} ${YELLOW}[WARN]${CNone}
ERR = echo ${TIME} ${RED}[FAIL]${CNone}
OK = echo ${TIME} ${GREEN}[ OK ]${CNone}
FAIL = (echo ${TIME} ${RED}[FAIL]${CNone} && false)
# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
@@ -17,36 +35,85 @@ else
GOBIN=$(shell go env GOBIN)
endif
# Image URL to use all building/pushing image targets
VELA_CORE_IMAGE ?= vela-core:latest
VELA_CORE_TEST_IMAGE ?= vela-core-test:$(GIT_COMMIT)
all: build
# Run tests
test: fmt vet lint
go test ./pkg/... -coverprofile cover.out
test: vet lint staticcheck
go test -race -coverprofile=coverage.txt -covermode=atomic ./pkg/... ./cmd/...
go test -race -covermode=atomic ./references/apiserver/... ./references/appfile/... ./references/cli/... ./references/common/... ./references/plugins/...
@$(OK) unit-tests pass
# Build manager binary
build: fmt vet lint
go run hack/chart/generate.go | go build -o bin/vela -ldflags ${LDFLAGS} cmd/vela/main.go
# Build vela cli binary
build: fmt vet lint staticcheck vela-cli kubectl-vela
@$(OK) build succeed
npm-build:
cd dashboard && npm run build && cd ./..
vela-cli:
go run hack/chart/generate.go
$(GOBUILD_ENV) go build -o bin/vela -a -ldflags $(LDFLAGS) ./references/cmd/cli/main.go
git checkout references/cmd/cli/fake/chart_source.go
npm-install:
cd dashboard && npm install && cd ./..
kubectl-vela:
$(GOBUILD_ENV) go build -o bin/kubectl-vela -a -ldflags $(LDFLAGS) ./cmd/plugin/main.go
dashboard-build:
cd references/dashboard && npm install && cd ..
doc-gen:
rm -r docs/en/cli/*
go run hack/docgen/gen.go
go run hack/references/generate.go
docs-build:
ifneq ($(wildcard git-page),)
rm -rf git-page
endif
sh ./hack/website/test-build.sh
docs-start:
ifeq ($(wildcard git-page),)
git clone --single-branch --depth 1 https://github.com/oam-dev/kubevela.io.git git-page
endif
rm -r git-page/docs
rm git-page/sidebars.js
cat docs/sidebars.js > git-page/sidebars.js
cp -R docs/en git-page/docs
cd git-page && yarn install && yarn start
api-gen:
swag init -g references/apiserver/route.go --output references/apiserver/docs
swagger-codegen generate -l html2 -i references/apiserver/docs/swagger.yaml -o references/apiserver/docs
mv references/apiserver/docs/index.html docs/en/developers/references/restful-api/
generate-source:
go run hack/frontend/source.go
cross-build:
go run hack/chart/generate.go | GO111MODULE=on CGO_ENABLED=0 $(GOX) -ldflags $(LDFLAGS) -parallel=3 -output="_bin/{{.OS}}-{{.Arch}}/vela" -osarch='$(TARGETS)' ./cmd/vela/
rm -rf _bin
go run hack/chart/generate.go
$(GOBUILD_ENV) $(GOX) -ldflags $(LDFLAGS) -parallel=2 -output="_bin/vela/{{.OS}}-{{.Arch}}/vela" -osarch='$(TARGETS)' ./references/cmd/cli
$(GOBUILD_ENV) $(GOX) -ldflags $(LDFLAGS) -parallel=2 -output="_bin/kubectl-vela/{{.OS}}-{{.Arch}}/kubectl-vela" -osarch='$(TARGETS)' ./cmd/plugin
git checkout references/cmd/cli/fake/chart_source.go
compress:
( \
cd _bin && \
$(DIST_DIRS) cp ../LICENSE {} \; && \
$(DIST_DIRS) cp ../README.md {} \; && \
echo "\n## Release Info\nVERSION: $(VELA_VERSION)" >> README.md && \
echo "GIT_COMMIT: $(GIT_COMMIT_LONG)\n" >> README.md && \
cd _bin/vela && \
$(DIST_DIRS) cp ../../LICENSE {} \; && \
$(DIST_DIRS) cp ../../README.md {} \; && \
$(DIST_DIRS) tar -zcf vela-{}.tar.gz {} \; && \
$(DIST_DIRS) zip -r vela-{}.zip {} \; && \
sha256sum vela-* > sha256sums.txt \
cd ../kubectl-vela && \
$(DIST_DIRS) cp ../../LICENSE {} \; && \
$(DIST_DIRS) cp ../../README.md {} \; && \
$(DIST_DIRS) tar -zcf kubectl-vela-{}.tar.gz {} \; && \
$(DIST_DIRS) zip -r kubectl-vela-{}.zip {} \; && \
cd .. && \
sha256sum vela/vela-* kubectl-vela/kubectl-vela-* > sha256sums.txt \
)
# Run against the configured Kubernetes cluster in ~/.kube/config
@@ -54,97 +121,123 @@ run: fmt vet
go run ./cmd/core/main.go
# Run go fmt against code
fmt:
fmt: goimports installcue
go fmt ./...
$(GOIMPORTS) -local github.com/oam-dev/kubevela -w ./pkg ./cmd
$(CUE) fmt ./hack/vela-templates/cue/*
# Run go vet against code
vet:
go vet ./...
staticcheck: staticchecktool
$(STATICCHECK) ./...
lint: golangci
$(GOLANGCILINT) run --timeout 10m -E golint,goimports ./...
$(GOLANGCILINT) run ./...
reviewable: manifests fmt vet lint staticcheck
go mod tidy
# Execute auto-gen code commands and ensure branch is clean.
check-diff: reviewable
git --no-pager diff
git diff --quiet || ($(ERR) please run 'make reviewable' to include all changes && false)
@$(OK) branch is clean
# Build the docker image
docker-build: test
docker build . -t ${IMG}
docker-build:
docker build --build-arg=VERSION=$(VELA_VERSION) --build-arg=GITVERSION=$(GIT_COMMIT) -t $(VELA_CORE_IMAGE) .
# Push the docker image
docker-push:
docker push ${IMG}
docker push $(VELA_CORE_IMAGE)
e2e-setup:
helm install --create-namespace -n flux-system helm-flux http://oam.dev/catalog/helm-flux2-0.1.0.tgz
helm install kruise https://github.com/openkruise/kruise/releases/download/v0.7.0/kruise-chart.tgz
helm upgrade --install --create-namespace --namespace vela-system --set image.pullPolicy=IfNotPresent --set image.repository=vela-core-test --set applicationRevisionLimit=5 --set image.tag=$(GIT_COMMIT) --wait kubevela ./charts/vela-core
ginkgo version
ginkgo -v -r e2e/setup
kubectl wait --for=condition=Ready pod -l app.kubernetes.io/name=vela-core,app.kubernetes.io/instance=kubevela -n vela-system --timeout=600s
kubectl wait --for=condition=Ready pod -l app=source-controller -n flux-system --timeout=600s
kubectl wait --for=condition=Ready pod -l app=helm-controller -n flux-system --timeout=600s
bin/vela dashboard &
e2e-test:
# Run e2e test
ginkgo -v -skipPackage setup,apiserver -r e2e
e2e-api-test:
# Run e2e test
ginkgo -v -skipPackage capability,setup,apiserver,application -r e2e
ginkgo -v -r e2e/apiserver
ginkgo -v -r e2e/application
e2e-test:
# Run e2e test
ginkgo -v ./test/e2e-test
@$(OK) tests pass
compatibility-test: vet lint staticcheck generate-compatibility-testdata
# Run compatibility test with old crd
COMPATIBILITY_TEST=TRUE go test -race ./pkg/...
@$(OK) compatibility-test pass
generate-compatibility-testdata:
mkdir -p ./test/compatibility-test/testdata
go run ./test/compatibility-test/convert/main.go ./charts/vela-core/crds ./test/compatibility-test/testdata
compatibility-testdata-cleanup:
rm -f ./test/compatibility-test/testdata/*
e2e-cleanup:
# Clean up
rm -rf ~/.vela
# Image URL to use all building/pushing image targets
IMG ?= vela-core:latest
# Produce CRDs that work back to Kubernetes 1.11 (no version conversion)
CRD_OPTIONS ?= "crd:crdVersions=v1"
# Run tests
core-test: generate fmt vet manifests
go test ./pkg/... -coverprofile cover.out
# Build manager binary
manager: generate fmt vet lint manifests
go build -o bin/manager ./cmd/core/main.go
# Run against the configured Kubernetes cluster in ~/.kube/config
core-run: generate fmt vet manifests
go run ./cmd/core/main.go
# Install CRDs into a cluster
core-install: manifests
kustomize build config/crd | kubectl apply -f -
# Uninstall CRDs from a cluster
core-uninstall: manifests
kustomize build config/crd | kubectl delete -f -
# Deploy controller in the configured Kubernetes cluster in ~/.kube/config
core-deploy: manifests
cd config/manager && kustomize edit set image controller=${IMG}
kustomize build config/default | kubectl apply -f -
# 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
# Generate code
generate: controller-gen
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./..."
# find or download controller-gen
# download controller-gen if necessary
controller-gen:
ifeq (, $(shell which controller-gen))
@{ \
set -e ;\
CONTROLLER_GEN_TMP_DIR=$$(mktemp -d) ;\
cd $$CONTROLLER_GEN_TMP_DIR ;\
go mod init tmp ;\
go get sigs.k8s.io/controller-tools/cmd/controller-gen@v0.2.5 ;\
rm -rf $$CONTROLLER_GEN_TMP_DIR ;\
}
CONTROLLER_GEN=$(GOBIN)/controller-gen
else
CONTROLLER_GEN=$(shell which controller-gen)
image-cleanup:
# Delete Docker image
ifneq ($(shell docker images -q $(VELA_CORE_TEST_IMAGE)),)
docker rmi -f $(VELA_CORE_TEST_IMAGE)
endif
GOLANGCILINT_VERSION ?= v1.29.0
# load docker image to the kind cluster
kind-load:
docker build -t $(VELA_CORE_TEST_IMAGE) .
kind load docker-image $(VELA_CORE_TEST_IMAGE) || { echo >&2 "kind not installed or error loading image: $(VELA_CORE_TEST_IMAGE)"; exit 1; }
# Run tests
core-test: fmt vet manifests
go test ./pkg/... -coverprofile cover.out
# Build vela core manager binary
manager: fmt vet lint manifests
$(GOBUILD_ENV) go build -o bin/manager -a -ldflags $(LDFLAGS) ./cmd/core/main.go
# Run against the configured Kubernetes cluster in ~/.kube/config
core-run: fmt vet manifests
go run ./cmd/core/main.go
# Run against the configured Kubernetes cluster in ~/.kube/config with debug logs
core-debug-run: fmt vet manifests
go run ./cmd/core/main.go --log-debug=true
# 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/
@$(OK) install succeed
# 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/
# Generate manifests e.g. CRD, RBAC etc.
manifests: kustomize
go generate $(foreach t,pkg apis,./$(t)/...)
# TODO(yangsoon): kustomize will merge all CRD into a whole file, it may not work if we want patch more than one CRD in this way
$(KUSTOMIZE) build config/crd -o config/crd/base/core.oam.dev_applications.yaml
mv config/crd/base/* charts/vela-core/crds
./hack/vela-templates/gen_definitions.sh
./hack/crd/cleanup.sh
GOLANGCILINT_VERSION ?= v1.31.0
HOSTOS := $(shell uname -s | tr '[:upper:]' '[:lower:]')
HOSTARCH := $(shell uname -m)
ifeq ($(HOSTARCH),x86_64)
@@ -163,3 +256,66 @@ GOLANGCILINT=$(GOBIN)/golangci-lint
else
GOLANGCILINT=$(shell which golangci-lint)
endif
.PHONY: staticchecktool
staticchecktool:
ifeq (, $(shell which staticcheck))
@{ \
set -e ;\
echo 'installing honnef.co/go/tools/cmd/staticcheck ' ;\
GO111MODULE=off go get honnef.co/go/tools/cmd/staticcheck ;\
}
STATICCHECK=$(GOBIN)/staticcheck
else
STATICCHECK=$(shell which staticcheck)
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
.PHONY: installcue
installcue:
ifeq (, $(shell which cue))
@{ \
set -e ;\
GO111MODULE=off go get -u cuelang.org/go/cmd/cue ;\
}
CUE=$(GOBIN)/cue
else
CUE=$(shell which cue)
endif
KUSTOMIZE_VERSION ?= 3.8.2
.PHONY: kustomize
kustomize:
ifeq (, $(shell kustomize version | grep $(KUSTOMIZE_VERSION)))
@{ \
set -e ;\
echo 'installing kustomize-v$(KUSTOMIZE_VERSION) into $(GOBIN)' ;\
curl -s https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh | bash -s $(KUSTOMIZE_VERSION) $(GOBIN);\
echo 'Install succeed' ;\
}
KUSTOMIZE=$(GOBIN)/kustomize
else
KUSTOMIZE=$(shell which kustomize)
endif
start-dashboard:
go run references/cmd/apiserver/main.go &
cd references/dashboard && npm install && npm start && cd ..
swagger-gen:
$(GOBIN)/swag init -g apiserver/route.go -d pkg/ -o references/apiserver/docs/
check-license-header:
./hack/licence/header-check.sh

12
OWNERS Normal file
View File

@@ -0,0 +1,12 @@
approvers:
- kubevela-controller
- kubevela-devex
- kubevela-dashboard-approver
reviewers:
- kubevela-controller
- oam-spec
- kubevela-dashboard-reviewer
members:
- community-collaborators

44
OWNERS_ALIASES Normal file
View File

@@ -0,0 +1,44 @@
aliases:
kubevela-devex:
- hongchaodeng
- wonderflow
kubevela-dashboard-approver:
- zzxwill
- hongchaodeng
kubevela-dashboard-reviewer:
- sunny0826
- hanxie-crypto
kubevela-controller:
- resouer
- wonderflow
- hongchaodeng
- zzxwill
- ryanzhang-oss
- captainroy-hy
oam-spec: # inherit from https://github.com/oam-dev/spec/blob/master/OWNERS.md
- hongchaodeng
- resouer
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

View File

@@ -1,7 +0,0 @@
domain: oam.dev
repo: github.com/oam-dev/kubevela
resources:
- group: standard
kind: Route
version: v1alpha1
version: "2"

141
README.md
View File

@@ -1,110 +1,71 @@
![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)
[![Artifact HUB](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/kubevela)](https://artifacthub.io/packages/search?repo=kubevela)
![alt](docs/resources/KubeVela-03.png)
*Make shipping applications more enjoyable.*
# KubeVela
The Open Application Platform based on Kubernetes and OAM.
KubeVela is a modern application engine that adapts to your application's needs, not the other way around.
:rotating_light: **Warning: The project is still under heavy development, its UI/UX is also for demo purpose, please don't look inside unless you know what you are doing** Please contact @wonderflow if you are interested in its full story or becoming one of the boostrap contributors/maintainers. :rotating_light:
## Community
## Install
- Slack: [CNCF Slack](https://slack.cncf.io/) #kubevela channel
- Gitter: [Discussion](https://gitter.im/oam-dev/community)
- Bi-weekly Community Call: [Meeting Notes](https://docs.google.com/document/d/1nqdFEyULekyksFHtFvgvFAYE-0AMHKoS3RMnaKsarjs)
### Prerequisites
- Kubernetes cluster running Kubernetes v1.15.0 or greater
- kubectl current context is configured for the target cluster install
- ```kubectl config current-context```
## Introduction
### Get the Vela CLI
*Developers simply want to deploy.*
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.
Traditional Platform-as-a-Service (PaaS) systems enable easy application deployments, but this happiness disappears when your application outgrows the capabilities of your platform. This is inevitable regardless of your PaaS is built on Kubernetes or not - the root cause is its inflexibility.
```shell
sudo mv ./vela /usr/local/bin/vela
```
KubeVela is a modern application deployment system that adapts to your needs. Essentially, KubeVela enables you to define platform capabilities (such as workloads, operational behaviors, and cloud services) as reusable [CUE](https://cuelang.org/) or [Helm](https://helm.sh) components, per needs of your application deployment. And when your needs grow, your platform capabilities expand naturally in a programmable approach.
### Install Vela Core
Perfect in flexibility though, X-as-Code tends to lead to configuration drift. That's why KubeVela is fully built as a [Kubernetes Controller](https://kubernetes.io/docs/concepts/architecture/controller/) instead of a client-side tool, i.e. all its capabilities are modeled as code but enforced with battle tested reconciling loops which will never leave inconsistency in your clusters. Think about *Platform-as-Code* enabled by Kubernetes, CUE and Helm.
```shell script
$ vela install
```
With developer experience in mind, KubeVela exposes those programmable platform capabilities as application-centric API shown as below:
- Components - deployable/provisionable entities that composed your application deployment
- e.g. a Kubernetes workload, a MySQL database, or a AWS OSS bucket
- Traits - attachable operational features per your needs
- e.g. autoscaling rules, rollout strategies, ingress rules, sidecars, security policies etc
- Application - full description of your application deployment assembled with components and traits.
This command will install vela core controller into your K8s cluster, along with built-in workloads and traits.
## Getting Started
## Demos
- [Installation](https://kubevela.io/docs/install)
- [Quick start](https://kubevela.io/docs/quick-start)
- [How it works](https://kubevela.io/docs/concepts)
#### Check workloads
## Features
```
$ vela workloads
NAME DEFINITION
backend containerizeds.standard.oam.dev
task jobs
webservice containerizeds.standard.oam.dev
```
- **Zero-restriction application deployment system** - design and express platform capabilities with CUE and Helm per needs of your application, and let Kubernetes controller guarantee the determinism in the application deployment. GUI forms are automatically generated for capabilities so even your dashboard are fully extensible.
- **Generic progressive rollout framework** - built-in rollout framework and strategies to upgrade your microservice regardless of its workload type (e.g. stateless, stateful, or even custom operators etc).
- **Multi-cluster multi-revision application deployment** - built-in model to deploy or rollout your apps across hybrid infrastructures, with Service Mesh for traffic shifting.
- **Simple and native** - KubeVela is a just simple Kubernetes custom controller, all its capabilities are defined as [Custom Resources](https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/) so they naturally work with any CI/CD or GitOps tools which work with Kubernetes.
#### workload run
```shell script
$ vela comp run -t webservice app123 -p 80 --image nginx:1.9.4
Creating AppConfig app123
SUCCEED
## Documentation
$ vela comp status app123
Visit the [KubeVela documentation site](https://kubevela.io/) to find *Installation Instruction*, *Platform Builder Guide* and *Developer Experience Guide*.
$ vela comp ls
NAME APP WORKLOAD TRAITS STATUS CREATED-TIME
app123 app123 deployment Deployed 2020-08-27 10:56:41 +0800 CST
```
## Talks and Conferences
#### app
| Engagement | Link |
|:-----------|:------------|
| 🎤 Talks | - [KubeVela - The Modern App Delivery System in Alibaba](https://docs.google.com/presentation/d/1CWCLcsKpDQB3bBDTfdv2BZ8ilGGJv2E8L-iOA5HMrV0/edit?usp=sharing) |
| 🌎 KubeCon | - [ [NA 2020] Standardizing Cloud Native Application Delivery Across Different Clouds](https://www.youtube.com/watch?v=0yhVuBIbHcI) <br> - [ [EU 2021] Zero Pain Microservice Development and Deployment with Dapr and KubeVela](https://sched.co/iE4S) |
| 📺 Conferences | - [Dapr, Rudr, OAM: Mark Russinovich presents next gen app development & deployment](https://www.youtube.com/watch?v=eJCu6a-x9uo) <br> - [Mark Russinovich presents "The Future of Cloud Native Applications with OAM and Dapr"](https://myignite.techcommunity.microsoft.com/sessions/82059)|
```
$ vela app ls
app123
$ vela app delete app123
Deleting AppConfig "app123"
DELETE SUCCEED
```
#### Auto-Completion
##### bash
```shell script
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
```shell script
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
```shell script
$ helm uninstall vela-core -n oam-system
release "vela-core" uninstalled
```
```shell script
$ kubectl delete crd workloaddefinitions.core.oam.dev traitdefinitions.core.oam.dev
customresourcedefinition.apiextensions.k8s.io "workloaddefinitions.core.oam.dev" deleted
customresourcedefinition.apiextensions.k8s.io "traitdefinitions.core.oam.dev" deleted
```
```shell script
$ rm -r ~/.vela
```
## CONTRIBUTING
Check out [CONTRIBUTING.md](./CONTRIBUTING.md) to see how to develop with KubeVela.
## Contributing
Check out [CONTRIBUTING](./CONTRIBUTING.md) to see how to develop with KubeVela.
## Code of Conduct
KubeVela adopts [CNCF Code of Conduct](https://github.com/cncf/foundation/blob/master/code-of-conduct.md).

View File

@@ -1,11 +0,0 @@
package types
import (
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/client-go/rest"
)
type Args struct {
Config *rest.Config
Schema *runtime.Scheme
}

View File

@@ -1,137 +0,0 @@
/*
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 types
import (
"encoding/json"
"fmt"
"cuelang.org/go/cue"
"github.com/spf13/pflag"
"k8s.io/apimachinery/pkg/runtime"
)
type Source struct {
RepoName string `json:"repoName"`
ChartName string `json:"chartName,omitempty"`
}
type CrdInfo struct {
APIVersion string `json:"apiVersion"`
Kind string `json:"kind"`
}
// Capability defines the content of a capability
type Capability struct {
Name string `json:"name"`
Type CapType `json:"type"`
CueTemplate string `json:"template,omitempty"`
Parameters []Parameter `json:"parameters,omitempty"`
DefinitionPath string `json:"definition"`
CrdName string `json:"crdName,omitempty"`
Center string `json:"center,omitempty"`
Status string `json:"status,omitempty"`
//trait only
AppliesTo []string `json:"appliesTo,omitempty"`
// Plugin Source
Source *Source `json:"source,omitempty"`
Install *Installation `json:"install,omitempty"`
CrdInfo *CrdInfo `json:"crdInfo,omitempty"`
}
type Chart struct {
Repo string `json:"repo"`
URL string `json:"url"`
Name string `json:"name"`
Namespace string `json:"namespace,omitempty"`
Version string `json:"version"`
}
type Installation struct {
Helm Chart `json:"helm"`
}
type CapType string
const (
TypeWorkload CapType = "workload"
TypeTrait CapType = "trait"
TypeScope CapType = "scope"
)
type Parameter struct {
Name string `json:"name"`
Short string `json:"short,omitempty"`
Required bool `json:"required,omitempty"`
Default interface{} `json:"default,omitempty"`
Usage string `json:"usage,omitempty"`
Type cue.Kind `json:"type,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")
}
err := json.Unmarshal(in.Raw, &extension)
if err == nil {
t = extension
}
return t, err
}
func SetFlagBy(flags *pflag.FlagSet, v Parameter) {
switch v.Type {
case cue.IntKind:
var vv int64
switch val := v.Default.(type) {
case int64:
vv = val
case json.Number:
vv, _ = val.Int64()
case int:
vv = int64(val)
case float64:
vv = int64(val)
}
flags.Int64P(v.Name, v.Short, vv, v.Usage)
case cue.StringKind:
flags.StringP(v.Name, v.Short, v.Default.(string), v.Usage)
case cue.BoolKind:
flags.BoolP(v.Name, v.Short, v.Default.(bool), v.Usage)
case cue.NumberKind, cue.FloatKind:
var vv float64
switch val := v.Default.(type) {
case int64:
vv = float64(val)
case json.Number:
vv, _ = val.Float64()
case int:
vv = float64(val)
case float64:
vv = val
}
flags.Float64P(v.Name, v.Short, vv, v.Usage)
}
}

View File

@@ -1,43 +0,0 @@
package types
const (
DefaultOAMNS = "oam-system"
DefaultOAMReleaseName = "vela-core"
DefaultOAMRuntimeChartName = "vela-core"
DefaultOAMVersion = ">0.0.0-0"
DefaultEnvName = "default"
DefaultAppNamespace = "default"
)
const (
AnnAPIVersion = "definition.oam.dev/apiVersion"
AnnKind = "definition.oam.dev/kind"
// Indicate which workloadDefinition generate from
AnnWorkloadDef = "workload.oam.dev/name"
// Indicate which traitDefinition generate from
AnnTraitDef = "trait.oam.dev/name"
)
const (
StatusDeployed = "Deployed"
StatusStaging = "Staging"
)
type EnvMeta struct {
Name string `json:"name"`
Current string `json:"current,omitempty"`
Namespace string `json:"namespace"`
}
const (
TagCommandType = "commandType"
TypeStart = "Getting Started"
TypeApp = "Applications"
TypeTraits = "Traits"
TypeRelease = "Release"
TypeOthers = "Others"
TypeSystem = "System"
)

View File

@@ -1,114 +0,0 @@
/*
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 (
runtimev1alpha1 "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1"
"github.com/crossplane/oam-kubernetes-runtime/pkg/oam"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/intstr"
)
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
// MetricsTraitSpec defines the desired state of MetricsTrait
type MetricsTraitSpec struct {
// An endpoint to be monitored by a ServiceMonitor.
ScrapeService ScapeServiceEndPoint `json:"scrapeService"`
// WorkloadReference to the workload whose metrics needs to be exposed
WorkloadReference runtimev1alpha1.TypedReference `json:"workloadRef,omitempty"`
}
// ScapeServiceEndPoint defines a scrapeable endpoint serving Prometheus metrics.
type ScapeServiceEndPoint struct {
// The format of the metrics data,
// 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.
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.
TargetSelector map[string]string `json:"selector,omitempty"`
// HTTP path to scrape for metrics.
// default is /metrics
// +optional
Path string `json:"path,omitempty"`
// Scheme at which metrics should be scraped
// The default and only supported scheme is "http"
// +optional
Scheme string `json:"scheme,omitempty"`
// The default is true
// +optional
Enabled *bool `json:"enabled,omitempty"`
}
// MetricsTraitStatus defines the observed state of MetricsTrait
type MetricsTraitStatus struct {
runtimev1alpha1.ConditionedStatus `json:",inline"`
// ServiceMonitorNames managed by this trait
ServiceMonitorNames []string `json:"serviceMonitorName,omitempty"`
}
// +kubebuilder:object:root=true
// MetricsTrait is the Schema for the metricstraits API
// +kubebuilder:resource:categories={oam}
// +kubebuilder:subresource:status
type MetricsTrait struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec MetricsTraitSpec `json:"spec"`
Status MetricsTraitStatus `json:"status,omitempty"`
}
// +kubebuilder:object:root=true
// MetricsTraitList contains a list of MetricsTrait
type MetricsTraitList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []MetricsTrait `json:"items"`
}
func init() {
SchemeBuilder.Register(&MetricsTrait{}, &MetricsTraitList{})
}
var _ oam.Trait = &MetricsTrait{}
func (tr *MetricsTrait) SetConditions(c ...runtimev1alpha1.Condition) {
tr.Status.SetConditions(c...)
}
func (tr *MetricsTrait) GetCondition(c runtimev1alpha1.ConditionType) runtimev1alpha1.Condition {
return tr.Status.GetCondition(c)
}
// GetWorkloadReference of this ManualScalerTrait.
func (tr *MetricsTrait) GetWorkloadReference() runtimev1alpha1.TypedReference {
return tr.Spec.WorkloadReference
}
// SetWorkloadReference of this ManualScalerTrait.
func (tr *MetricsTrait) SetWorkloadReference(r runtimev1alpha1.TypedReference) {
tr.Spec.WorkloadReference = r
}

View File

@@ -1,138 +0,0 @@
/*
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 (
runtimev1alpha1 "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1"
"github.com/crossplane/oam-kubernetes-runtime/pkg/oam"
"k8s.io/api/networking/v1beta1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/intstr"
)
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
// RouteSpec defines the desired state of Route
type RouteSpec struct {
// WorkloadReference to the workload whose metrics needs to be exposed
WorkloadReference runtimev1alpha1.TypedReference `json:"workloadRef,omitempty"`
// Host is the host of the route
Host string `json:"host"`
// Path is location Path, default for "/"
Path string `json:"path,omitempty"`
// TLS indicate route trait will create SSL secret using cert-manager with specified issuer
// If this is nil, route trait will use a selfsigned issuer
TLS *TLS `json:"tls,omitempty"`
// DefaultBackend uses serviceName
DefaultBackend *v1beta1.IngressBackend `json:"defaultBackend,omitempty"`
// RewriteTarget will rewrite request from Path to RewriteTarget path.
RewriteTarget string `json:"rewriteTarget,omitempty"`
// CustomHeaders pass a custom list of headers to the backend service.
CustomHeaders map[string]string `json:"customHeaders,omitempty"`
// Backend indicate how to connect backend service
// If it's nil, will auto discovery
Backend *Backend `json:"backend,omitempty"`
}
type TLS struct {
IssuerName string `json:"issuerName,omitempty"`
// Type indicate the issuer is ClusterIssuer or NamespaceIssuer
Type IssuerType `json:"type,omitempty"`
}
type IssuerType string
const (
ClusterIssuer IssuerType = "ClusterIssuer"
NamespaceIssuer IssuerType = "Issuer"
)
// Route will automatically discover podTemplate for Port and SelectLabels if they are not set.
// If Port and SelectLabels are already set, discovery won't work.
// If Port is not set, the first port discovered will be set.
// If SelectLabels are not set, all selectorLabels discovered will be set.
type Backend struct {
// Protocol means backend-protocol, HTTP, HTTPS, GRPC, GRPCS, AJP and FCGI, By default uses HTTP
Protocol string `json:"protocol,omitempty"`
// ReadTimeout used for setting read timeout duration for backend service, the unit is second.
ReadTimeout int `json:"readTimeout,omitempty"`
// SendTimeout used for setting send timeout duration for backend service, the unit is second.
SendTimeout int `json:"sendTimeout,omitempty"`
// Port points to backend service port.
Port intstr.IntOrString `json:"port,omitempty"`
// SelectLabels for backend service.
SelectLabels map[string]string `json:"selectLabels,omitempty"`
}
// RouteStatus defines the observed state of Route
type RouteStatus struct {
Ingress *runtimev1alpha1.TypedReference `json:"ingress,omitempty"`
Service *runtimev1alpha1.TypedReference `json:"service,omitempty"`
runtimev1alpha1.ConditionedStatus `json:",inline"`
}
// +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"`
Spec RouteSpec `json:"spec,omitempty"`
Status RouteStatus `json:"status,omitempty"`
}
// +kubebuilder:object:root=true
// RouteList contains a list of Route
type RouteList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []Route `json:"items"`
}
func init() {
SchemeBuilder.Register(&Route{}, &RouteList{})
}
var _ oam.Trait = &Route{}
func (r *Route) SetConditions(c ...runtimev1alpha1.Condition) {
r.Status.SetConditions(c...)
}
func (r *Route) GetCondition(c runtimev1alpha1.ConditionType) runtimev1alpha1.Condition {
return r.Status.GetCondition(c)
}
// GetWorkloadReference of this ManualScalerTrait.
func (r *Route) GetWorkloadReference() runtimev1alpha1.TypedReference {
return r.Spec.WorkloadReference
}
// SetWorkloadReference of this ManualScalerTrait.
func (r *Route) SetWorkloadReference(rt runtimev1alpha1.TypedReference) {
r.Spec.WorkloadReference = rt
}

18
apis/apis.go Normal file
View File

@@ -0,0 +1,18 @@
/*
Copyright 2021 The KubeVela Authors.
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 apis contains all api types of KubeVela
package apis

View File

@@ -0,0 +1,19 @@
/*
Copyright 2021 The KubeVela Authors.
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 common contains types required for both v1alpha2 and v1beta1
// +kubebuilder:object:generate=true
package common

View File

@@ -0,0 +1,214 @@
/*
Copyright 2021 The KubeVela Authors.
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 common
import (
v1alpha12 "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1"
"k8s.io/apimachinery/pkg/runtime"
"github.com/oam-dev/kubevela/apis/standard.oam.dev/v1alpha1"
)
// Kube defines the encapsulation in raw Kubernetes resource format
type Kube struct {
// Template defines the raw Kubernetes resource
// +kubebuilder:pruning:PreserveUnknownFields
Template runtime.RawExtension `json:"template"`
// Parameters defines configurable parameters
Parameters []KubeParameter `json:"parameters,omitempty"`
}
// ParameterValueType refers to a data type of parameter
type ParameterValueType string
// data types of parameter value
const (
StringType ParameterValueType = "string"
NumberType ParameterValueType = "number"
BooleanType ParameterValueType = "boolean"
)
// A KubeParameter defines a configurable parameter of a component.
type KubeParameter struct {
// Name of this parameter
Name string `json:"name"`
// +kubebuilder:validation:Enum:=string;number;boolean
// ValueType indicates the type of the parameter value, and
// only supports basic data types: string, number, boolean.
ValueType ParameterValueType `json:"type"`
// FieldPaths specifies an array of fields within this workload that will be
// overwritten by the value of this parameter. All fields must be of the
// same type. Fields are specified as JSON field paths without a leading
// dot, for example 'spec.replicas'.
FieldPaths []string `json:"fieldPaths"`
// +kubebuilder:default:=false
// Required specifies whether or not a value for this parameter must be
// supplied when authoring an Application.
Required *bool `json:"required,omitempty"`
// Description of this parameter.
Description *string `json:"description,omitempty"`
}
// CUE defines the encapsulation in CUE format
type CUE struct {
// Template defines the abstraction template data of the capability, it will replace the old CUE template in extension field.
// Template is a required field if CUE is defined in Capability Definition.
Template string `json:"template"`
}
// Schematic defines the encapsulation of this capability(workload/trait/scope),
// the encapsulation can be defined in different ways, e.g. CUE/HCL(terraform)/KUBE(K8s Object)/HELM, etc...
type Schematic struct {
KUBE *Kube `json:"kube,omitempty"`
CUE *CUE `json:"cue,omitempty"`
HELM *Helm `json:"helm,omitempty"`
// TODO(wonderflow): support HCL(terraform)here.
}
// A Helm represents resources used by a Helm module
type Helm struct {
// Release records a Helm release used by a Helm module workload.
// +kubebuilder:pruning:PreserveUnknownFields
Release runtime.RawExtension `json:"release"`
// HelmRelease records a Helm repository used by a Helm module workload.
// +kubebuilder:pruning:PreserveUnknownFields
Repository runtime.RawExtension `json:"repository"`
}
// A WorkloadTypeDescriptor refer to a Workload Type
type WorkloadTypeDescriptor struct {
// Type ref to a WorkloadDefinition via name
Type string `json:"type,omitempty"`
// Definition mutually exclusive to workload.type, a embedded WorkloadDefinition
Definition WorkloadGVK `json:"definition,omitempty"`
}
// WorkloadGVK refer to a Workload Type
type WorkloadGVK struct {
APIVersion string `json:"apiVersion"`
Kind string `json:"kind"`
}
// A DefinitionReference refers to a CustomResourceDefinition by name.
type DefinitionReference struct {
// Name of the referenced CustomResourceDefinition.
Name string `json:"name"`
// Version indicate which version should be used if CRD has multiple versions
// by default it will use the first one if not specified
Version string `json:"version,omitempty"`
}
// A ChildResourceKind defines a child Kubernetes resource kind with a selector
type ChildResourceKind struct {
// APIVersion of the child resource
APIVersion string `json:"apiVersion"`
// Kind of the child resource
Kind string `json:"kind"`
// Selector to select the child resources that the workload wants to expose to traits
Selector map[string]string `json:"selector,omitempty"`
}
// Status defines the loop back status of the abstraction by using CUE template
type Status struct {
// CustomStatus defines the custom status message that could display to user
// +optional
CustomStatus string `json:"customStatus,omitempty"`
// HealthPolicy defines the health check policy for the abstraction
// +optional
HealthPolicy string `json:"healthPolicy,omitempty"`
}
// ApplicationPhase is a label for the condition of a application at the current time
type ApplicationPhase string
const (
// ApplicationRollingOut means the app is in the middle of rolling out
ApplicationRollingOut ApplicationPhase = "rollingOut"
// ApplicationRendering means the app is rendering
ApplicationRendering ApplicationPhase = "rendering"
// ApplicationRunning means the app finished rendering and applied result to the cluster
ApplicationRunning ApplicationPhase = "running"
// ApplicationHealthChecking means the app finished rendering and applied result to the cluster, but still unhealthy
ApplicationHealthChecking ApplicationPhase = "healthChecking"
)
// ApplicationComponentStatus record the health status of App component
type ApplicationComponentStatus struct {
Name string `json:"name"`
// WorkloadDefinition is the definition of a WorkloadDefinition, such as deployments/apps.v1
WorkloadDefinition WorkloadGVK `json:"workloadDefinition,omitempty"`
Healthy bool `json:"healthy"`
Message string `json:"message,omitempty"`
Traits []ApplicationTraitStatus `json:"traits,omitempty"`
}
// ApplicationTraitStatus records the trait health status
type ApplicationTraitStatus struct {
Type string `json:"type"`
Healthy bool `json:"healthy"`
Message string `json:"message,omitempty"`
}
// Revision has name and revision number
type Revision struct {
Name string `json:"name"`
Revision int64 `json:"revision"`
// RevisionHash record the hash value of the spec of ApplicationRevision object.
RevisionHash string `json:"revisionHash,omitempty"`
}
// RawComponent record raw component
type RawComponent struct {
// +kubebuilder:validation:EmbeddedResource
// +kubebuilder:pruning:PreserveUnknownFields
Raw runtime.RawExtension `json:"raw"`
}
// AppStatus defines the observed state of Application
type AppStatus struct {
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
// Important: Run "make" to regenerate code after modifying this file
v1alpha1.RolloutStatus `json:",inline"`
Phase ApplicationPhase `json:"status,omitempty"`
// Components record the related Components created by Application Controller
Components []v1alpha12.TypedReference `json:"components,omitempty"`
// Services record the status of the application services
Services []ApplicationComponentStatus `json:"services,omitempty"`
// ResourceTracker record the status of the ResourceTracker
ResourceTracker *v1alpha12.TypedReference `json:"resourceTracker,omitempty"`
// LatestRevision of the application configuration it generates
// +optional
LatestRevision *Revision `json:"latestRevision,omitempty"`
}

View File

@@ -0,0 +1,328 @@
// +build !ignore_autogenerated
/*
Copyright 2021 The KubeVela Authors.
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.
*/
// Code generated by controller-gen. DO NOT EDIT.
package common
import (
"github.com/crossplane/crossplane-runtime/apis/core/v1alpha1"
)
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *AppStatus) DeepCopyInto(out *AppStatus) {
*out = *in
in.RolloutStatus.DeepCopyInto(&out.RolloutStatus)
if in.Components != nil {
in, out := &in.Components, &out.Components
*out = make([]v1alpha1.TypedReference, len(*in))
copy(*out, *in)
}
if in.Services != nil {
in, out := &in.Services, &out.Services
*out = make([]ApplicationComponentStatus, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
if in.ResourceTracker != nil {
in, out := &in.ResourceTracker, &out.ResourceTracker
*out = new(v1alpha1.TypedReference)
**out = **in
}
if in.LatestRevision != nil {
in, out := &in.LatestRevision, &out.LatestRevision
*out = new(Revision)
**out = **in
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppStatus.
func (in *AppStatus) DeepCopy() *AppStatus {
if in == nil {
return nil
}
out := new(AppStatus)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ApplicationComponentStatus) DeepCopyInto(out *ApplicationComponentStatus) {
*out = *in
out.WorkloadDefinition = in.WorkloadDefinition
if in.Traits != nil {
in, out := &in.Traits, &out.Traits
*out = make([]ApplicationTraitStatus, len(*in))
copy(*out, *in)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApplicationComponentStatus.
func (in *ApplicationComponentStatus) DeepCopy() *ApplicationComponentStatus {
if in == nil {
return nil
}
out := new(ApplicationComponentStatus)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ApplicationTraitStatus) DeepCopyInto(out *ApplicationTraitStatus) {
*out = *in
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApplicationTraitStatus.
func (in *ApplicationTraitStatus) DeepCopy() *ApplicationTraitStatus {
if in == nil {
return nil
}
out := new(ApplicationTraitStatus)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *CUE) DeepCopyInto(out *CUE) {
*out = *in
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CUE.
func (in *CUE) DeepCopy() *CUE {
if in == nil {
return nil
}
out := new(CUE)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ChildResourceKind) DeepCopyInto(out *ChildResourceKind) {
*out = *in
if in.Selector != nil {
in, out := &in.Selector, &out.Selector
*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 ChildResourceKind.
func (in *ChildResourceKind) DeepCopy() *ChildResourceKind {
if in == nil {
return nil
}
out := new(ChildResourceKind)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *DefinitionReference) DeepCopyInto(out *DefinitionReference) {
*out = *in
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DefinitionReference.
func (in *DefinitionReference) DeepCopy() *DefinitionReference {
if in == nil {
return nil
}
out := new(DefinitionReference)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Helm) DeepCopyInto(out *Helm) {
*out = *in
in.Release.DeepCopyInto(&out.Release)
in.Repository.DeepCopyInto(&out.Repository)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Helm.
func (in *Helm) DeepCopy() *Helm {
if in == nil {
return nil
}
out := new(Helm)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Kube) DeepCopyInto(out *Kube) {
*out = *in
in.Template.DeepCopyInto(&out.Template)
if in.Parameters != nil {
in, out := &in.Parameters, &out.Parameters
*out = make([]KubeParameter, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Kube.
func (in *Kube) DeepCopy() *Kube {
if in == nil {
return nil
}
out := new(Kube)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *KubeParameter) DeepCopyInto(out *KubeParameter) {
*out = *in
if in.FieldPaths != nil {
in, out := &in.FieldPaths, &out.FieldPaths
*out = make([]string, len(*in))
copy(*out, *in)
}
if in.Required != nil {
in, out := &in.Required, &out.Required
*out = new(bool)
**out = **in
}
if in.Description != nil {
in, out := &in.Description, &out.Description
*out = new(string)
**out = **in
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubeParameter.
func (in *KubeParameter) DeepCopy() *KubeParameter {
if in == nil {
return nil
}
out := new(KubeParameter)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *RawComponent) DeepCopyInto(out *RawComponent) {
*out = *in
in.Raw.DeepCopyInto(&out.Raw)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RawComponent.
func (in *RawComponent) DeepCopy() *RawComponent {
if in == nil {
return nil
}
out := new(RawComponent)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Revision) DeepCopyInto(out *Revision) {
*out = *in
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Revision.
func (in *Revision) DeepCopy() *Revision {
if in == nil {
return nil
}
out := new(Revision)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Schematic) DeepCopyInto(out *Schematic) {
*out = *in
if in.KUBE != nil {
in, out := &in.KUBE, &out.KUBE
*out = new(Kube)
(*in).DeepCopyInto(*out)
}
if in.CUE != nil {
in, out := &in.CUE, &out.CUE
*out = new(CUE)
**out = **in
}
if in.HELM != nil {
in, out := &in.HELM, &out.HELM
*out = new(Helm)
(*in).DeepCopyInto(*out)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Schematic.
func (in *Schematic) DeepCopy() *Schematic {
if in == nil {
return nil
}
out := new(Schematic)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Status) DeepCopyInto(out *Status) {
*out = *in
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Status.
func (in *Status) DeepCopy() *Status {
if in == nil {
return nil
}
out := new(Status)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *WorkloadGVK) DeepCopyInto(out *WorkloadGVK) {
*out = *in
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkloadGVK.
func (in *WorkloadGVK) DeepCopy() *WorkloadGVK {
if in == nil {
return nil
}
out := new(WorkloadGVK)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *WorkloadTypeDescriptor) DeepCopyInto(out *WorkloadTypeDescriptor) {
*out = *in
out.Definition = in.Definition
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkloadTypeDescriptor.
func (in *WorkloadTypeDescriptor) DeepCopy() *WorkloadTypeDescriptor {
if in == nil {
return nil
}
out := new(WorkloadTypeDescriptor)
in.DeepCopyInto(out)
return out
}

View File

@@ -0,0 +1,38 @@
/*
Copyright 2021 The KubeVela Authors.
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 core_oam_dev contains API Schema definitions for the core.oam.dev v1alpha2 API group
package core_oam_dev
import (
"k8s.io/apimachinery/pkg/runtime"
"github.com/oam-dev/kubevela/apis/core.oam.dev/v1alpha2"
"github.com/oam-dev/kubevela/apis/core.oam.dev/v1beta1"
)
func init() {
// Register the types with the Scheme so the resources can map objects to GroupVersionKinds and back
AddToSchemes = append(AddToSchemes, v1alpha2.SchemeBuilder.AddToScheme, v1beta1.SchemeBuilder.AddToScheme)
}
// AddToSchemes may be used to add all resources defined in the project to a Scheme
var AddToSchemes runtime.SchemeBuilder
// AddToScheme adds all Resources to the Scheme
func AddToScheme(s *runtime.Scheme) error {
return AddToSchemes.AddToScheme(s)
}

View File

@@ -0,0 +1,124 @@
/*
Copyright 2021 The KubeVela Authors.
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 v1alpha2
import (
"k8s.io/apimachinery/pkg/runtime"
runtimev1alpha1 "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
"github.com/oam-dev/kubevela/apis/standard.oam.dev/v1alpha1"
)
// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
// AppStatus defines the observed state of Application
type AppStatus struct {
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
// Important: Run "make" to regenerate code after modifying this file
v1alpha1.RolloutStatus `json:",inline"`
Phase common.ApplicationPhase `json:"status,omitempty"`
// Components record the related Components created by Application Controller
Components []runtimev1alpha1.TypedReference `json:"components,omitempty"`
// Services record the status of the application services
Services []common.ApplicationComponentStatus `json:"services,omitempty"`
// ResourceTracker record the status of the ResourceTracker
ResourceTracker *runtimev1alpha1.TypedReference `json:"resourceTracker,omitempty"`
// LatestRevision of the application configuration it generates
// +optional
LatestRevision *common.Revision `json:"latestRevision,omitempty"`
}
// ApplicationTrait defines the trait of application
type ApplicationTrait struct {
Name string `json:"name"`
// +kubebuilder:pruning:PreserveUnknownFields
Properties runtime.RawExtension `json:"properties,omitempty"`
}
// ApplicationComponent describe the component of application
type ApplicationComponent struct {
Name string `json:"name"`
WorkloadType string `json:"type"`
// +kubebuilder:pruning:PreserveUnknownFields
Settings runtime.RawExtension `json:"settings,omitempty"`
// Traits define the trait of one component, the type must be array to keep the order.
Traits []ApplicationTrait `json:"traits,omitempty"`
// +kubebuilder:pruning:PreserveUnknownFields
// scopes in ApplicationComponent defines the component-level scopes
// the format is <scope-type:scope-instance-name> pairs, the key represents type of `ScopeDefinition` while the value represent the name of scope instance.
Scopes map[string]string `json:"scopes,omitempty"`
}
// ApplicationSpec is the spec of Application
type ApplicationSpec struct {
Components []ApplicationComponent `json:"components"`
// TODO(wonderflow): we should have application level scopes supported here
// RolloutPlan is the details on how to rollout the resources
// The controller simply replace the old resources with the new one if there is no rollout plan involved
// +optional
RolloutPlan *v1alpha1.RolloutPlan `json:"rolloutPlan,omitempty"`
}
// Application is the Schema for the applications API
// +kubebuilder:object:root=true
// +kubebuilder:resource:categories={oam},shortName=app
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name="COMPONENT",type=string,JSONPath=`.spec.components[*].name`
// +kubebuilder:printcolumn:name="TYPE",type=string,JSONPath=`.spec.components[*].type`
// +kubebuilder:printcolumn:name="PHASE",type=string,JSONPath=`.status.status`
// +kubebuilder:printcolumn:name="HEALTHY",type=boolean,JSONPath=`.status.services[*].healthy`
// +kubebuilder:printcolumn:name="STATUS",type=string,JSONPath=`.status.services[*].message`
// +kubebuilder:printcolumn:name="AGE",type=date,JSONPath=".metadata.creationTimestamp"
type Application struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec ApplicationSpec `json:"spec,omitempty"`
Status common.AppStatus `json:"status,omitempty"`
}
// +kubebuilder:object:root=true
// ApplicationList contains a list of Application
type ApplicationList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []Application `json:"items"`
}
// GetComponent get the component from the application based on its workload type
func (app *Application) GetComponent(workloadType string) *ApplicationComponent {
for _, c := range app.Spec.Components {
if c.WorkloadType == workloadType {
return &c
}
}
return nil
}

View File

@@ -0,0 +1,68 @@
/*
Copyright 2021 The KubeVela Authors.
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 v1alpha2
import (
"reflect"
"testing"
)
func TestApplicationGetComponent(t *testing.T) {
ac1 := ApplicationComponent{
Name: "ac1",
WorkloadType: "type1",
}
ac2 := ApplicationComponent{
Name: "ac2",
WorkloadType: "type2",
}
tests := map[string]struct {
app *Application
componentName string
want *ApplicationComponent
}{
"test get one": {
app: &Application{
Spec: ApplicationSpec{
Components: []ApplicationComponent{
ac1, ac2,
},
},
},
componentName: ac1.WorkloadType,
want: &ac1,
},
"test get none": {
app: &Application{
Spec: ApplicationSpec{
Components: []ApplicationComponent{
ac2,
},
},
},
componentName: ac1.WorkloadType,
want: nil,
},
}
for name, tt := range tests {
t.Run(name, func(t *testing.T) {
if got := tt.app.GetComponent(tt.componentName); !reflect.DeepEqual(got, tt.want) {
t.Errorf("GetComponent() = %v, want %v", got, tt.want)
}
})
}
}

View File

@@ -0,0 +1,48 @@
/*
Copyright 2021 The KubeVela Authors.
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 v1alpha2
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// ApplicationContextSpec is the spec of ApplicationContext
type ApplicationContextSpec struct {
// ApplicationRevisionName points to the snapshot of an Application with all its closure
ApplicationRevisionName string `json:"applicationRevisionName"`
}
// ApplicationContext is the Schema for the ApplicationContext API
// +kubebuilder:object:root=true
// +kubebuilder:resource:shortName=appcontext,categories={oam}
// +kubebuilder:subresource:status
type ApplicationContext struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec ApplicationContextSpec `json:"spec,omitempty"`
// we need to reuse the AC status
Status ApplicationConfigurationStatus `json:"status,omitempty"`
}
// ApplicationContextList contains a list of ApplicationContext
// +kubebuilder:object:root=true
type ApplicationContextList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []ApplicationContext `json:"items"`
}

View File

@@ -0,0 +1,73 @@
/*
Copyright 2021 The KubeVela Authors.
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 v1alpha2
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
)
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
// ApplicationRevisionSpec is the spec of ApplicationRevision
type ApplicationRevisionSpec struct {
// Application records the snapshot of the created/modified Application
Application Application `json:"application"`
// ComponentDefinitions records the snapshot of the componentDefinitions related with the created/modified Application
ComponentDefinitions map[string]ComponentDefinition `json:"componentDefinitions,omitempty"`
// WorkloadDefinitions records the snapshot of the workloadDefinitions related with the created/modified Application
WorkloadDefinitions map[string]WorkloadDefinition `json:"workloadDefinitions,omitempty"`
// TraitDefinitions records the snapshot of the traitDefinitions related with the created/modified Application
TraitDefinitions map[string]TraitDefinition `json:"traitDefinitions,omitempty"`
// ScopeDefinitions records the snapshot of the scopeDefinitions related with the created/modified Application
ScopeDefinitions map[string]ScopeDefinition `json:"scopeDefinitions,omitempty"`
// Components records the rendered components from Application, it will contains the whole K8s CR of workload in it.
Components []common.RawComponent `json:"components,omitempty"`
// ApplicationConfiguration records the rendered applicationConfiguration from Application,
// it will contains the whole K8s CR of trait and the reference component in it.
// +kubebuilder:validation:EmbeddedResource
// +kubebuilder:pruning:PreserveUnknownFields
ApplicationConfiguration runtime.RawExtension `json:"applicationConfiguration"`
}
// ApplicationRevision is the Schema for the ApplicationRevision API
// +kubebuilder:object:root=true
// +kubebuilder:resource:categories={oam},shortName=apprev
// +kubebuilder:printcolumn:name="AGE",type=date,JSONPath=".metadata.creationTimestamp"
type ApplicationRevision struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec ApplicationRevisionSpec `json:"spec,omitempty"`
}
// ApplicationRevisionList contains a list of ApplicationRevision
// +kubebuilder:object:root=true
type ApplicationRevisionList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []ApplicationRevision `json:"items"`
}

View File

@@ -0,0 +1,86 @@
/*
Copyright 2021 The KubeVela Authors.
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 v1alpha2
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"github.com/oam-dev/kubevela/apis/standard.oam.dev/v1alpha1"
)
// AppRolloutSpec defines how to describe an upgrade between different apps
type AppRolloutSpec struct {
// TargetAppRevisionName contains the name of the applicationRevision that we need to upgrade to.
TargetAppRevisionName string `json:"targetAppRevisionName"`
// SourceAppRevisionName contains the name of the applicationRevision that we need to upgrade from.
// it can be empty only when the rolling is only a scale event
SourceAppRevisionName string `json:"sourceAppRevisionName,omitempty"`
// The list of component to upgrade in the application.
// We only support single component application so far
// TODO: (RZ) Support multiple components in an application
// +optional
ComponentList []string `json:"componentList,omitempty"`
// RolloutPlan is the details on how to rollout the resources
RolloutPlan v1alpha1.RolloutPlan `json:"rolloutPlan"`
// RevertOnDelete revert the rollout when the rollout CR is deleted
// It will remove the target app from the kubernetes if it's set to true
// +optional
RevertOnDelete *bool `json:"revertOnDelete,omitempty"`
}
// AppRolloutStatus defines the observed state of AppRollout
type AppRolloutStatus struct {
v1alpha1.RolloutStatus `json:",inline"`
// LastUpgradedTargetAppRevision contains the name of the app that we upgraded to
// We will restart the rollout if this is not the same as the spec
LastUpgradedTargetAppRevision string `json:"lastTargetAppRevision"`
// LastSourceAppRevision contains the name of the app that we need to upgrade from.
// We will restart the rollout if this is not the same as the spec
LastSourceAppRevision string `json:"LastSourceAppRevision,omitempty"`
}
// AppRollout is the Schema for the AppRollout API
// +kubebuilder:object:root=true
// +kubebuilder:resource:categories={oam},shortName=approllout
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name="TARGET",type=string,JSONPath=`.status.rolloutStatus.rolloutTargetSize`
// +kubebuilder:printcolumn:name="UPGRADED",type=string,JSONPath=`.status.rolloutStatus.upgradedReplicas`
// +kubebuilder:printcolumn:name="READY",type=string,JSONPath=`.status.rolloutStatus.upgradedReadyReplicas`
// +kubebuilder:printcolumn:name="BATCH-STATE",type=string,JSONPath=`.status.rolloutStatus.batchRollingState`
// +kubebuilder:printcolumn:name="ROLLING-STATE",type=string,JSONPath=`.status.rolloutStatus.rollingState`
// +kubebuilder:printcolumn:name="AGE",type=date,JSONPath=".metadata.creationTimestamp"
type AppRollout struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec AppRolloutSpec `json:"spec,omitempty"`
Status AppRolloutStatus `json:"status,omitempty"`
}
// AppRolloutList contains a list of AppRollout
// +kubebuilder:object:root=true
type AppRolloutList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []AppRollout `json:"items"`
}

View File

@@ -0,0 +1,99 @@
/*
Copyright 2021 The KubeVela Authors.
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 v1alpha2
import (
runtimev1alpha1 "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
)
// ComponentDefinitionSpec defines the desired state of ComponentDefinition
type ComponentDefinitionSpec struct {
// Workload is a workload type descriptor
Workload common.WorkloadTypeDescriptor `json:"workload"`
// ChildResourceKinds are the list of GVK of the child resources this workload generates
ChildResourceKinds []common.ChildResourceKind `json:"childResourceKinds,omitempty"`
// RevisionLabel indicates which label for underlying resources(e.g. pods) of this workload
// can be used by trait to create resource selectors(e.g. label selector for pods).
// +optional
RevisionLabel string `json:"revisionLabel,omitempty"`
// PodSpecPath indicates where/if this workload has K8s podSpec field
// if one workload has podSpec, trait can do lot's of assumption such as port, env, volume fields.
// +optional
PodSpecPath string `json:"podSpecPath,omitempty"`
// Status defines the custom health policy and status message for workload
// +optional
Status *common.Status `json:"status,omitempty"`
// Schematic defines the data format and template of the encapsulation of the workload
// +optional
Schematic *common.Schematic `json:"schematic,omitempty"`
// Extension is used for extension needs by OAM platform builders
// +optional
// +kubebuilder:pruning:PreserveUnknownFields
Extension *runtime.RawExtension `json:"extension,omitempty"`
}
// ComponentDefinitionStatus is the status of ComponentDefinition
type ComponentDefinitionStatus struct {
// ConditionedStatus reflects the observed status of a resource
runtimev1alpha1.ConditionedStatus `json:",inline"`
// ConfigMapRef refer to a ConfigMap which contains OpenAPI V3 JSON schema of Component parameters.
ConfigMapRef string `json:"configMapRef,omitempty"`
}
// +kubebuilder:object:root=true
// ComponentDefinition is the Schema for the componentdefinitions API
// +kubebuilder:resource:scope=Namespaced,categories={oam},shortName=comp
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name="WORKLOAD-KIND",type=string,JSONPath=".spec.workload.definition.kind"
// +kubebuilder:printcolumn:name="DESCRIPTION",type=string,JSONPath=".metadata.annotations.definition\\.oam\\.dev/description"
type ComponentDefinition struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec ComponentDefinitionSpec `json:"spec,omitempty"`
Status ComponentDefinitionStatus `json:"status,omitempty"`
}
// SetConditions set condition for WorkloadDefinition
func (cd *ComponentDefinition) SetConditions(c ...runtimev1alpha1.Condition) {
cd.Status.SetConditions(c...)
}
// GetCondition gets condition from WorkloadDefinition
func (cd *ComponentDefinition) GetCondition(conditionType runtimev1alpha1.ConditionType) runtimev1alpha1.Condition {
return cd.Status.GetCondition(conditionType)
}
// +kubebuilder:object:root=true
// ComponentDefinitionList contains a list of ComponentDefinition
type ComponentDefinitionList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []ComponentDefinition `json:"items"`
}

View File

@@ -0,0 +1,134 @@
/*
Copyright 2021 The KubeVela Authors.
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 v1alpha2
import (
"fmt"
"reflect"
"k8s.io/klog/v2"
"sigs.k8s.io/controller-runtime/pkg/conversion"
"github.com/oam-dev/kubevela/apis/core.oam.dev/v1beta1"
)
// ApplicationV1alpha2ToV1beta1 will convert v1alpha2 to v1beta1
func ApplicationV1alpha2ToV1beta1(v1a2 *Application, v1b1 *v1beta1.Application) {
// 1) convert metav1.TypeMeta
// apiVersion and Kind automatically converted
// 2) convert metav1.ObjectMeta
v1b1.ObjectMeta = *v1a2.ObjectMeta.DeepCopy()
// 3) convert Spec ApplicationSpec
// 3.1) convert Spec.Components
for _, comp := range v1a2.Spec.Components {
// convert trait, especially for `.name` -> `.type`
var traits = make([]v1beta1.ApplicationTrait, len(comp.Traits))
for j, trait := range comp.Traits {
traits[j] = v1beta1.ApplicationTrait{
Type: trait.Name,
Properties: *trait.Properties.DeepCopy(),
}
}
// deep copy scopes
scopes := make(map[string]string)
for k, v := range comp.Scopes {
scopes[k] = v
}
// convert component
// `.settings` -> `.properties`
v1b1.Spec.Components = append(v1b1.Spec.Components, v1beta1.ApplicationComponent{
Name: comp.Name,
Type: comp.WorkloadType,
Properties: *comp.Settings.DeepCopy(),
Traits: traits,
Scopes: scopes,
})
}
// 3.2) convert Spec.RolloutPlan
v1b1.Spec.RolloutPlan = v1a2.Spec.RolloutPlan.DeepCopy()
// 4) convert Status common.AppStatus
v1b1.Status = *v1a2.Status.DeepCopy()
}
// ConvertTo converts this Application to the Hub version (v1beta1 only for now).
func (app *Application) ConvertTo(dst conversion.Hub) error {
switch convertedApp := dst.(type) {
case *v1beta1.Application:
klog.Infof("convert *v1alpha2.Application [%s] to *v1beta1.Application", app.Name)
ApplicationV1alpha2ToV1beta1(app, convertedApp)
return nil
default:
}
return fmt.Errorf("unsupported convertTo object %v", reflect.TypeOf(dst))
}
// ConvertFrom converts from the Hub version (v1beta1) to this version (v1alpha2).
func (app *Application) ConvertFrom(src conversion.Hub) error {
switch sourceApp := src.(type) {
case *v1beta1.Application:
klog.Infof("convert *v1alpha2.Application from *v1beta1.Application [%s]", sourceApp.Name)
// 1) convert metav1.TypeMeta
// apiVersion and Kind automatically converted
// 2) convert metav1.ObjectMeta
app.ObjectMeta = *sourceApp.ObjectMeta.DeepCopy()
// 3) convert Spec ApplicationSpec
// 3.1) convert Spec.Components
for _, comp := range sourceApp.Spec.Components {
// convert trait, especially for `.type` -> `.name`
var traits = make([]ApplicationTrait, len(comp.Traits))
for j, trait := range comp.Traits {
traits[j] = ApplicationTrait{
Name: trait.Type,
Properties: *trait.Properties.DeepCopy(),
}
}
// deep copy scopes
scopes := make(map[string]string)
for k, v := range comp.Scopes {
scopes[k] = v
}
// convert component
// `.properties` -> `.settings`
app.Spec.Components = append(app.Spec.Components, ApplicationComponent{
Name: comp.Name,
WorkloadType: comp.Type,
Settings: *comp.Properties.DeepCopy(),
Traits: traits,
Scopes: scopes,
})
}
// 3.2) convert Spec.RolloutPlan
app.Spec.RolloutPlan = sourceApp.Spec.RolloutPlan.DeepCopy()
// 4) convert Status common.AppStatus
app.Status = *sourceApp.Status.DeepCopy()
return nil
default:
}
return fmt.Errorf("unsupported ConvertFrom object %v", reflect.TypeOf(src))
}

View File

@@ -0,0 +1,104 @@
/*
Copyright 2021 The KubeVela Authors.
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 v1alpha2
import (
runtimev1alpha1 "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"github.com/oam-dev/kubevela/pkg/oam"
)
// HealthStatus represents health status strings.
type HealthStatus string
const (
// StatusHealthy represents healthy status.
StatusHealthy HealthStatus = "HEALTHY"
// StatusUnhealthy represents unhealthy status.
StatusUnhealthy = "UNHEALTHY"
// StatusUnknown represents unknown status.
StatusUnknown = "UNKNOWN"
)
var _ oam.Scope = &HealthScope{}
// A HealthScopeSpec defines the desired state of a HealthScope.
type HealthScopeSpec struct {
// ProbeTimeout is the amount of time in seconds to wait when receiving a response before marked failure.
ProbeTimeout *int32 `json:"probe-timeout,omitempty"`
// ProbeInterval is the amount of time in seconds between probing tries.
ProbeInterval *int32 `json:"probe-interval,omitempty"`
// WorkloadReferences to the workloads that are in this scope.
WorkloadReferences []runtimev1alpha1.TypedReference `json:"workloadRefs"`
}
// A HealthScopeStatus represents the observed state of a HealthScope.
type HealthScopeStatus struct {
runtimev1alpha1.ConditionedStatus `json:",inline"`
// ScopeHealthCondition represents health condition summary of the scope
ScopeHealthCondition ScopeHealthCondition `json:"scopeHealthCondition"`
// WorkloadHealthConditions represents health condition of workloads in the scope
WorkloadHealthConditions []*WorkloadHealthCondition `json:"healthConditions,omitempty"`
}
// ScopeHealthCondition represents health condition summary of a scope.
type ScopeHealthCondition struct {
HealthStatus HealthStatus `json:"healthStatus"`
Total int64 `json:"total,omitempty"`
HealthyWorkloads int64 `json:"healthyWorkloads,omitempty"`
UnhealthyWorkloads int64 `json:"unhealthyWorkloads,omitempty"`
UnknownWorkloads int64 `json:"unknownWorkloads,omitempty"`
}
// WorkloadHealthCondition represents informative health condition.
type WorkloadHealthCondition struct {
// ComponentName represents the component name if target is a workload
ComponentName string `json:"componentName,omitempty"`
TargetWorkload runtimev1alpha1.TypedReference `json:"targetWorkload,omitempty"`
HealthStatus HealthStatus `json:"healthStatus"`
Diagnosis string `json:"diagnosis,omitempty"`
// WorkloadStatus represents status of workloads whose HealthStatus is UNKNOWN.
WorkloadStatus string `json:"workloadStatus,omitempty"`
}
// +kubebuilder:object:root=true
// A HealthScope determines an aggregate health status based of the health of components.
// +kubebuilder:resource:categories={oam}
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:JSONPath=".status.health",name=HEALTH,type=string
type HealthScope struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec HealthScopeSpec `json:"spec,omitempty"`
Status HealthScopeStatus `json:"status,omitempty"`
}
// +kubebuilder:object:root=true
// HealthScopeList contains a list of HealthScope.
type HealthScopeList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []HealthScope `json:"items"`
}

View File

@@ -0,0 +1,63 @@
/*
Copyright 2021 The KubeVela Authors.
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 v1alpha2
import (
runtimev1alpha1 "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"github.com/oam-dev/kubevela/pkg/oam"
)
var _ oam.Trait = &ManualScalerTrait{}
// A ManualScalerTraitSpec defines the desired state of a ManualScalerTrait.
type ManualScalerTraitSpec struct {
// ReplicaCount of the workload this trait applies to.
ReplicaCount int32 `json:"replicaCount"`
// WorkloadReference to the workload this trait applies to.
WorkloadReference runtimev1alpha1.TypedReference `json:"workloadRef"`
}
// A ManualScalerTraitStatus represents the observed state of a
// ManualScalerTrait.
type ManualScalerTraitStatus struct {
runtimev1alpha1.ConditionedStatus `json:",inline"`
}
// +kubebuilder:object:root=true
// A ManualScalerTrait determines how many replicas a workload should have.
// +kubebuilder:resource:categories={oam}
// +kubebuilder:subresource:status
type ManualScalerTrait struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec ManualScalerTraitSpec `json:"spec,omitempty"`
Status ManualScalerTraitStatus `json:"status,omitempty"`
}
// +kubebuilder:object:root=true
// ManualScalerTraitList contains a list of ManualScalerTrait.
type ManualScalerTraitList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []ManualScalerTrait `json:"items"`
}

View File

@@ -0,0 +1,668 @@
/*
Copyright 2021 The KubeVela Authors.
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 v1alpha2
import (
runtimev1alpha1 "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/util/intstr"
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
"github.com/oam-dev/kubevela/apis/types"
)
// A WorkloadDefinitionSpec defines the desired state of a WorkloadDefinition.
type WorkloadDefinitionSpec struct {
// Reference to the CustomResourceDefinition that defines this workload kind.
Reference common.DefinitionReference `json:"definitionRef"`
// ChildResourceKinds are the list of GVK of the child resources this workload generates
ChildResourceKinds []common.ChildResourceKind `json:"childResourceKinds,omitempty"`
// RevisionLabel indicates which label for underlying resources(e.g. pods) of this workload
// can be used by trait to create resource selectors(e.g. label selector for pods).
// +optional
RevisionLabel string `json:"revisionLabel,omitempty"`
// PodSpecPath indicates where/if this workload has K8s podSpec field
// if one workload has podSpec, trait can do lot's of assumption such as port, env, volume fields.
// +optional
PodSpecPath string `json:"podSpecPath,omitempty"`
// Status defines the custom health policy and status message for workload
// +optional
Status *common.Status `json:"status,omitempty"`
// Schematic defines the data format and template of the encapsulation of the workload
// +optional
Schematic *common.Schematic `json:"schematic,omitempty"`
// Extension is used for extension needs by OAM platform builders
// +optional
// +kubebuilder:pruning:PreserveUnknownFields
Extension *runtime.RawExtension `json:"extension,omitempty"`
}
// WorkloadDefinitionStatus is the status of WorkloadDefinition
type WorkloadDefinitionStatus struct {
runtimev1alpha1.ConditionedStatus `json:",inline"`
}
// +kubebuilder:object:root=true
// A WorkloadDefinition registers a kind of Kubernetes custom resource as a
// valid OAM workload kind by referencing its CustomResourceDefinition. The CRD
// is used to validate the schema of the workload when it is embedded in an OAM
// Component.
// +kubebuilder:resource:scope=Namespaced,categories={oam},shortName=workload
// +kubebuilder:printcolumn:name="DEFINITION-NAME",type=string,JSONPath=".spec.definitionRef.name"
type WorkloadDefinition struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec WorkloadDefinitionSpec `json:"spec,omitempty"`
Status WorkloadDefinitionStatus `json:"status,omitempty"`
}
// SetConditions set condition for WorkloadDefinition
func (wd *WorkloadDefinition) SetConditions(c ...runtimev1alpha1.Condition) {
wd.Status.SetConditions(c...)
}
// GetCondition gets condition from WorkloadDefinition
func (wd *WorkloadDefinition) GetCondition(conditionType runtimev1alpha1.ConditionType) runtimev1alpha1.Condition {
return wd.Status.GetCondition(conditionType)
}
// +kubebuilder:object:root=true
// WorkloadDefinitionList contains a list of WorkloadDefinition.
type WorkloadDefinitionList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []WorkloadDefinition `json:"items"`
}
// A TraitDefinitionSpec defines the desired state of a TraitDefinition.
type TraitDefinitionSpec struct {
// Reference to the CustomResourceDefinition that defines this trait kind.
Reference common.DefinitionReference `json:"definitionRef,omitempty"`
// Revision indicates whether a trait is aware of component revision
// +optional
RevisionEnabled bool `json:"revisionEnabled,omitempty"`
// WorkloadRefPath indicates where/if a trait accepts a workloadRef object
// +optional
WorkloadRefPath string `json:"workloadRefPath,omitempty"`
// PodDisruptive specifies whether using the trait will cause the pod to restart or not.
// +optional
PodDisruptive bool `json:"podDisruptive,omitempty"`
// AppliesToWorkloads specifies the list of workload kinds this trait
// applies to. Workload kinds are specified in kind.group/version format,
// e.g. server.core.oam.dev/v1alpha2. Traits that omit this field apply to
// all workload kinds.
// +optional
AppliesToWorkloads []string `json:"appliesToWorkloads,omitempty"`
// ConflictsWith specifies the list of traits(CRD name, Definition name, CRD group)
// which could not apply to the same workloads with this trait.
// Traits that omit this field can work with any other traits.
// Example rules:
// "service" # Trait definition name
// "services.k8s.io" # API resource/crd name
// "*.networking.k8s.io" # API group
// "labelSelector:foo=bar" # label selector
// labelSelector format: https://pkg.go.dev/k8s.io/apimachinery/pkg/labels#Parse
// +optional
ConflictsWith []string `json:"conflictsWith,omitempty"`
// Schematic defines the data format and template of the encapsulation of the trait
// +optional
Schematic *common.Schematic `json:"schematic,omitempty"`
// Status defines the custom health policy and status message for trait
// +optional
Status *common.Status `json:"status,omitempty"`
// Extension is used for extension needs by OAM platform builders
// +optional
// +kubebuilder:pruning:PreserveUnknownFields
Extension *runtime.RawExtension `json:"extension,omitempty"`
}
// TraitDefinitionStatus is the status of TraitDefinition
type TraitDefinitionStatus struct {
// ConditionedStatus reflects the observed status of a resource
runtimev1alpha1.ConditionedStatus `json:",inline"`
// ConfigMapRef refer to a ConfigMap which contains OpenAPI V3 JSON schema of Component parameters.
ConfigMapRef string `json:"configMapRef,omitempty"`
}
// +kubebuilder:object:root=true
// A TraitDefinition registers a kind of Kubernetes custom resource as a valid
// OAM trait kind by referencing its CustomResourceDefinition. The CRD is used
// to validate the schema of the trait when it is embedded in an OAM
// ApplicationConfiguration.
// +kubebuilder:resource:scope=Namespaced,categories={oam},shortName=trait
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name="APPLIES-TO",type=string,JSONPath=".spec.appliesToWorkloads"
// +kubebuilder:printcolumn:name="DESCRIPTION",type=string,JSONPath=".metadata.annotations.definition\\.oam\\.dev/description"
type TraitDefinition struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec TraitDefinitionSpec `json:"spec,omitempty"`
Status TraitDefinitionStatus `json:"status,omitempty"`
}
// SetConditions set condition for TraitDefinition
func (td *TraitDefinition) SetConditions(c ...runtimev1alpha1.Condition) {
td.Status.SetConditions(c...)
}
// GetCondition gets condition from TraitDefinition
func (td *TraitDefinition) GetCondition(conditionType runtimev1alpha1.ConditionType) runtimev1alpha1.Condition {
return td.Status.GetCondition(conditionType)
}
// +kubebuilder:object:root=true
// TraitDefinitionList contains a list of TraitDefinition.
type TraitDefinitionList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []TraitDefinition `json:"items"`
}
// A ScopeDefinitionSpec defines the desired state of a ScopeDefinition.
type ScopeDefinitionSpec struct {
// Reference to the CustomResourceDefinition that defines this scope kind.
Reference common.DefinitionReference `json:"definitionRef"`
// WorkloadRefsPath indicates if/where a scope accepts workloadRef objects
WorkloadRefsPath string `json:"workloadRefsPath,omitempty"`
// AllowComponentOverlap specifies whether an OAM component may exist in
// multiple instances of this kind of scope.
AllowComponentOverlap bool `json:"allowComponentOverlap"`
// Extension is used for extension needs by OAM platform builders
// +optional
// +kubebuilder:pruning:PreserveUnknownFields
Extension *runtime.RawExtension `json:"extension,omitempty"`
}
// +kubebuilder:object:root=true
// A ScopeDefinition registers a kind of Kubernetes custom resource as a valid
// OAM scope kind by referencing its CustomResourceDefinition. The CRD is used
// to validate the schema of the scope when it is embedded in an OAM
// ApplicationConfiguration.
// +kubebuilder:printcolumn:JSONPath=".spec.definitionRef.name",name=DEFINITION-NAME,type=string
// +kubebuilder:resource:scope=Namespaced,categories={oam},shortName=scope
type ScopeDefinition struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec ScopeDefinitionSpec `json:"spec,omitempty"`
}
// +kubebuilder:object:root=true
// ScopeDefinitionList contains a list of ScopeDefinition.
type ScopeDefinitionList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []ScopeDefinition `json:"items"`
}
// A ComponentParameter defines a configurable parameter of a component.
type ComponentParameter struct {
// Name of this parameter. OAM ApplicationConfigurations will specify
// parameter values using this name.
Name string `json:"name"`
// FieldPaths specifies an array of fields within this Component's workload
// that will be overwritten by the value of this parameter. The type of the
// parameter (e.g. int, string) is inferred from the type of these fields;
// All fields must be of the same type. Fields are specified as JSON field
// paths without a leading dot, for example 'spec.replicas'.
FieldPaths []string `json:"fieldPaths"`
// +kubebuilder:default:=false
// Required specifies whether or not a value for this parameter must be
// supplied when authoring an ApplicationConfiguration.
// +optional
Required *bool `json:"required,omitempty"`
// Description of this parameter.
// +optional
Description *string `json:"description,omitempty"`
}
// A ComponentSpec defines the desired state of a Component.
type ComponentSpec struct {
// A Workload that will be created for each ApplicationConfiguration that
// includes this Component. Workload is an instance of a workloadDefinition.
// We either use the GVK info or a special "type" field in the workload to associate
// the content of the workload with its workloadDefinition
// +kubebuilder:validation:EmbeddedResource
// +kubebuilder:pruning:PreserveUnknownFields
Workload runtime.RawExtension `json:"workload"`
// HelmRelease records a Helm release used by a Helm module workload.
// +optional
Helm *common.Helm `json:"helm,omitempty"`
// Parameters exposed by this component. ApplicationConfigurations that
// reference this component may specify values for these parameters, which
// will in turn be injected into the embedded workload.
// +optional
Parameters []ComponentParameter `json:"parameters,omitempty"`
}
// A ComponentStatus represents the observed state of a Component.
type ComponentStatus struct {
// The generation observed by the component controller.
// +optional
ObservedGeneration int64 `json:"observedGeneration"`
runtimev1alpha1.ConditionedStatus `json:",inline"`
// LatestRevision of component
// +optional
LatestRevision *common.Revision `json:"latestRevision,omitempty"`
// One Component should only be used by one AppConfig
}
// +kubebuilder:object:root=true
// A Component describes how an OAM workload kind may be instantiated.
// +kubebuilder:resource:categories={oam}
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:JSONPath=".spec.workload.kind",name=WORKLOAD-KIND,type=string
// +kubebuilder:printcolumn:name="age",type="date",JSONPath=".metadata.creationTimestamp"
type Component struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec ComponentSpec `json:"spec,omitempty"`
Status ComponentStatus `json:"status,omitempty"`
}
// +kubebuilder:object:root=true
// ComponentList contains a list of Component.
type ComponentList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []Component `json:"items"`
}
// A ComponentParameterValue specifies a value for a named parameter. The
// associated component must publish a parameter with this name.
type ComponentParameterValue struct {
// Name of the component parameter to set.
Name string `json:"name"`
// Value to set.
Value intstr.IntOrString `json:"value"`
}
// A ComponentTrait specifies a trait that should be applied to a component.
type ComponentTrait struct {
// A Trait that will be created for the component
// +kubebuilder:validation:EmbeddedResource
// +kubebuilder:pruning:PreserveUnknownFields
Trait runtime.RawExtension `json:"trait"`
// DataOutputs specify the data output sources from this trait.
// +optional
DataOutputs []DataOutput `json:"dataOutputs,omitempty"`
// DataInputs specify the data input sinks into this trait.
// +optional
DataInputs []DataInput `json:"dataInputs,omitempty"`
}
// A ComponentScope specifies a scope in which a component should exist.
type ComponentScope struct {
// A ScopeReference must refer to an OAM scope resource.
ScopeReference runtimev1alpha1.TypedReference `json:"scopeRef"`
}
// An ApplicationConfigurationComponent specifies a component of an
// ApplicationConfiguration. Each component is used to instantiate a workload.
type ApplicationConfigurationComponent struct {
// ComponentName specifies a component whose latest revision will be bind
// with ApplicationConfiguration. When the spec of the referenced component
// changes, ApplicationConfiguration will automatically migrate all trait
// affect from the prior revision to the new one. This is mutually exclusive
// with RevisionName.
// +optional
ComponentName string `json:"componentName,omitempty"`
// RevisionName of a specific component revision to which to bind
// ApplicationConfiguration. This is mutually exclusive with componentName.
// +optional
RevisionName string `json:"revisionName,omitempty"`
// DataOutputs specify the data output sources from this component.
DataOutputs []DataOutput `json:"dataOutputs,omitempty"`
// DataInputs specify the data input sinks into this component.
DataInputs []DataInput `json:"dataInputs,omitempty"`
// ParameterValues specify values for the the specified component's
// parameters. Any parameter required by the component must be specified.
// +optional
ParameterValues []ComponentParameterValue `json:"parameterValues,omitempty"`
// Traits of the specified component.
// +optional
Traits []ComponentTrait `json:"traits,omitempty"`
// Scopes in which the specified component should exist.
// +optional
Scopes []ComponentScope `json:"scopes,omitempty"`
}
// An ApplicationConfigurationSpec defines the desired state of a
// ApplicationConfiguration.
type ApplicationConfigurationSpec struct {
// Components of which this ApplicationConfiguration consists. Each
// component will be used to instantiate a workload.
Components []ApplicationConfigurationComponent `json:"components"`
}
// A TraitStatus represents the state of a trait.
type TraitStatus string
// A WorkloadTrait represents a trait associated with a workload and its status
type WorkloadTrait struct {
// Status is a place holder for a customized controller to fill
// if it needs a single place to summarize the status of the trait
Status TraitStatus `json:"status,omitempty"`
// Reference to a trait created by an ApplicationConfiguration.
Reference runtimev1alpha1.TypedReference `json:"traitRef"`
// Message will allow controller to leave some additional information for this trait
Message string `json:"message,omitempty"`
// AppliedGeneration indicates the generation observed by the appConfig controller.
// The same field is also recorded in the annotations of traits.
// A trait is possible to be deleted from cluster after created.
// This field is useful to track the observed generation of traits after they are
// deleted.
AppliedGeneration int64 `json:"appliedGeneration,omitempty"`
// DependencyUnsatisfied notify does the trait has dependency unsatisfied
DependencyUnsatisfied bool `json:"dependencyUnsatisfied,omitempty"`
}
// A ScopeStatus represents the state of a scope.
type ScopeStatus string
// A WorkloadScope represents a scope associated with a workload and its status
type WorkloadScope struct {
// Status is a place holder for a customized controller to fill
// if it needs a single place to summarize the status of the scope
Status ScopeStatus `json:"status,omitempty"`
// Reference to a scope created by an ApplicationConfiguration.
Reference runtimev1alpha1.TypedReference `json:"scopeRef"`
}
// A WorkloadStatus represents the status of a workload.
type WorkloadStatus struct {
// Status is a place holder for a customized controller to fill
// if it needs a single place to summarize the entire status of the workload
Status string `json:"status,omitempty"`
// ComponentName that produced this workload.
ComponentName string `json:"componentName,omitempty"`
// ComponentRevisionName of current component
ComponentRevisionName string `json:"componentRevisionName,omitempty"`
// DependencyUnsatisfied notify does the workload has dependency unsatisfied
DependencyUnsatisfied bool `json:"dependencyUnsatisfied,omitempty"`
// AppliedComponentRevision indicates the applied component revision name of this workload
AppliedComponentRevision string `json:"appliedComponentRevision,omitempty"`
// Reference to a workload created by an ApplicationConfiguration.
Reference runtimev1alpha1.TypedReference `json:"workloadRef,omitempty"`
// Traits associated with this workload.
Traits []WorkloadTrait `json:"traits,omitempty"`
// Scopes associated with this workload.
Scopes []WorkloadScope `json:"scopes,omitempty"`
}
// HistoryWorkload contain the old component revision that are still running
type HistoryWorkload struct {
// Revision of this workload
Revision string `json:"revision,omitempty"`
// Reference to running workload.
Reference runtimev1alpha1.TypedReference `json:"workloadRef,omitempty"`
}
// A ApplicationStatus represents the state of the entire application.
type ApplicationStatus string
// An ApplicationConfigurationStatus represents the observed state of a
// ApplicationConfiguration.
type ApplicationConfigurationStatus struct {
runtimev1alpha1.ConditionedStatus `json:",inline"`
// Status is a place holder for a customized controller to fill
// if it needs a single place to summarize the status of the entire application
Status ApplicationStatus `json:"status,omitempty"`
Dependency DependencyStatus `json:"dependency,omitempty"`
// RollingStatus indicates what phase are we in the rollout phase
RollingStatus types.RollingStatus `json:"rollingStatus,omitempty"`
// Workloads created by this ApplicationConfiguration.
Workloads []WorkloadStatus `json:"workloads,omitempty"`
// The generation observed by the appConfig controller.
// +optional
ObservedGeneration int64 `json:"observedGeneration"`
// HistoryWorkloads will record history but still working revision workloads.
HistoryWorkloads []HistoryWorkload `json:"historyWorkloads,omitempty"`
}
// DependencyStatus represents the observed state of the dependency of
// an ApplicationConfiguration.
type DependencyStatus struct {
Unsatisfied []UnstaifiedDependency `json:"unsatisfied,omitempty"`
}
// UnstaifiedDependency describes unsatisfied dependency flow between
// one pair of objects.
type UnstaifiedDependency struct {
Reason string `json:"reason"`
From DependencyFromObject `json:"from"`
To DependencyToObject `json:"to"`
}
// DependencyFromObject represents the object that dependency data comes from.
type DependencyFromObject struct {
runtimev1alpha1.TypedReference `json:",inline"`
FieldPath string `json:"fieldPath,omitempty"`
}
// DependencyToObject represents the object that dependency data goes to.
type DependencyToObject struct {
runtimev1alpha1.TypedReference `json:",inline"`
FieldPaths []string `json:"fieldPaths,omitempty"`
}
// +kubebuilder:object:root=true
// An ApplicationConfiguration represents an OAM application.
// +kubebuilder:resource:shortName=appconfig,categories={oam}
// +kubebuilder:subresource:status
type ApplicationConfiguration struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec ApplicationConfigurationSpec `json:"spec,omitempty"`
Status ApplicationConfigurationStatus `json:"status,omitempty"`
}
// +kubebuilder:object:root=true
// ApplicationConfigurationList contains a list of ApplicationConfiguration.
type ApplicationConfigurationList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []ApplicationConfiguration `json:"items"`
}
// DataOutput specifies a data output source from an object.
type DataOutput struct {
// Name is the unique name of a DataOutput in an ApplicationConfiguration.
Name string `json:"name,omitempty"`
// FieldPath refers to the value of an object's field.
FieldPath string `json:"fieldPath,omitempty"`
// Conditions specify the conditions that should be satisfied before emitting a data output.
// Different conditions are AND-ed together.
// If no conditions is specified, it is by default to check output value not empty.
// +optional
Conditions []ConditionRequirement `json:"conditions,omitempty"`
// OutputStore specifies the object used to store intermediate data generated by Operations
OutputStore StoreReference `json:"outputStore,omitempty"`
}
// StoreReference specifies the referenced object in DataOutput or DataInput
type StoreReference struct {
runtimev1alpha1.TypedReference `json:",inline"`
// Operations specify the data processing operations
Operations []DataOperation `json:"operations,omitempty"`
}
// DataOperation defines the specific operation for data
type DataOperation struct {
// Type specifies the type of DataOperation
Type string `json:"type"`
// Operator specifies the operation under this DataOperation type
Operator DataOperator `json:"op"`
// ToFieldPath refers to the value of an object's field
ToFieldPath string `json:"toFieldPath"`
// ToDataPath refers to the value of an object's specfied by ToDataPath. For example the ToDataPath "redis" specifies "redis info" in '{"redis":"redis info"}'
ToDataPath string `json:"toDataPath,omitempty"`
// +optional
// Value specifies an expected value
// This is mutually exclusive with ValueFrom
Value string `json:"value,omitempty"`
// +optional
// ValueFrom specifies expected value from object such as workload and trait
// This is mutually exclusive with Value
ValueFrom ValueFrom `json:"valueFrom,omitempty"`
Conditions []ConditionRequirement `json:"conditions,omitempty"`
}
// DataOperator defines the type of Operator in DataOperation
type DataOperator string
const (
// AddOperator specifies the add operation for data passing
AddOperator DataOperator = "add"
// DeleteOperator specifies the delete operation for data passing
DeleteOperator DataOperator = "delete"
// ReplaceOperator specifies the replace operation for data passing
ReplaceOperator DataOperator = "replace"
)
// DataInput specifies a data input sink to an object.
// If input is array, it will be appended to the target field paths.
type DataInput struct {
// ValueFrom specifies the value source.
ValueFrom DataInputValueFrom `json:"valueFrom,omitempty"`
// ToFieldPaths specifies the field paths of an object to fill passed value.
ToFieldPaths []string `json:"toFieldPaths,omitempty"`
// StrategyMergeKeys specifies the merge key if the toFieldPaths target is an array.
// The StrategyMergeKeys is optional, by default, if the toFieldPaths target is an array, we will append.
// If StrategyMergeKeys specified, we will check the key in the target array.
// If any key exist, do update; if no key exist, append.
StrategyMergeKeys []string `json:"strategyMergeKeys,omitempty"`
// When the Conditions is satified, ToFieldPaths will be filled with passed value
Conditions []ConditionRequirement `json:"conditions,omitempty"`
// InputStore specifies the object used to read intermediate data genereted by DataOutput
InputStore StoreReference `json:"inputStore,omitempty"`
}
// DataInputValueFrom specifies the value source for a data input.
type DataInputValueFrom struct {
// DataOutputName matches a name of a DataOutput in the same AppConfig.
DataOutputName string `json:"dataOutputName"`
}
// ConditionRequirement specifies the requirement to match a value.
type ConditionRequirement struct {
Operator ConditionOperator `json:"op"`
// +optional
// Value specifies an expected value
// This is mutually exclusive with ValueFrom
Value string `json:"value,omitempty"`
// +optional
// ValueFrom specifies expected value from AppConfig
// This is mutually exclusive with Value
ValueFrom ValueFrom `json:"valueFrom,omitempty"`
// +optional
// FieldPath specifies got value from workload/trait object
FieldPath string `json:"fieldPath,omitempty"`
}
// ValueFrom gets value from AppConfig object by specifying a path
type ValueFrom struct {
FieldPath string `json:"fieldPath"`
}
// ConditionOperator specifies the operator to match a value.
type ConditionOperator string
const (
// ConditionEqual indicates equal to given value
ConditionEqual ConditionOperator = "eq"
// ConditionNotEqual indicates not equal to given value
ConditionNotEqual ConditionOperator = "notEq"
// ConditionNotEmpty indicates given value not empty
ConditionNotEmpty ConditionOperator = "notEmpty"
)

View File

@@ -0,0 +1,409 @@
/*
Copyright 2021 The KubeVela Authors.
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 v1alpha2
package v1alpha2
import (
runtimev1alpha1 "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1"
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/intstr"
"github.com/oam-dev/kubevela/pkg/oam"
)
// An OperatingSystem required by a containerised workload.
type OperatingSystem string
// Supported operating system types.
const (
OperatingSystemLinux OperatingSystem = "linux"
OperatingSystemWindows OperatingSystem = "windows"
)
// A CPUArchitecture required by a containerised workload.
type CPUArchitecture string
// Supported architectures
const (
CPUArchitectureI386 CPUArchitecture = "i386"
CPUArchitectureAMD64 CPUArchitecture = "amd64"
CPUArchitectureARM CPUArchitecture = "arm"
CPUArchitectureARM64 CPUArchitecture = "arm64"
)
// A SecretKeySelector is a reference to a secret key in an arbitrary namespace.
type SecretKeySelector struct {
// The name of the secret.
Name string `json:"name"`
// The key to select.
Key string `json:"key"`
}
// TODO(negz): The OAM spec calls for float64 quantities in some cases, but this
// is incompatible with controller-gen and Kubernetes API conventions. We should
// reassess whether resource.Quantity is appropriate after resolving
// https://github.com/oam-dev/spec/issues/313
// CPUResources required by a container.
type CPUResources struct {
// Required CPU count. 1.0 represents one CPU core.
Required resource.Quantity `json:"required"`
}
// MemoryResources required by a container.
type MemoryResources struct {
// Required memory.
Required resource.Quantity `json:"required"`
}
// GPUResources required by a container.
type GPUResources struct {
// Required GPU count.
Required resource.Quantity `json:"required"`
}
// DiskResource required by a container.
type DiskResource struct {
// Required disk space.
Required resource.Quantity `json:"required"`
// Ephemeral specifies whether an external disk needs to be mounted.
// +optional
Ephemeral *bool `json:"ephemeral,omitempty"`
}
// A VolumeAccessMode determines how a volume may be accessed.
type VolumeAccessMode string
// Volume access modes.
const (
VolumeAccessModeRO VolumeAccessMode = "RO"
VolumeAccessModeRW VolumeAccessMode = "RW"
)
// A VolumeSharingPolicy determines how a volume may be shared.
type VolumeSharingPolicy string
// Volume sharing policies.
const (
VolumeSharingPolicyExclusive VolumeSharingPolicy = "Exclusive"
VolumeSharingPolicyShared VolumeSharingPolicy = "Shared"
)
// VolumeResource required by a container.
type VolumeResource struct {
// Name of this volume. Must be unique within its container.
Name string `json:"name"`
// MountPath at which this volume will be mounted within its container.
MountPath string `json:"mountPath"`
// TODO(negz): Use +kubebuilder:default marker to default AccessMode to RW
// and SharingPolicy to Exclusive once we're generating v1 CRDs.
// AccessMode of this volume; RO (read only) or RW (read and write).
// +optional
// +kubebuilder:validation:Enum=RO;RW
AccessMode *VolumeAccessMode `json:"accessMode,omitempty"`
// SharingPolicy of this volume; Exclusive or Shared.
// +optional
// +kubebuilder:validation:Enum=Exclusive;Shared
SharingPolicy *VolumeSharingPolicy `json:"sharingPolicy,omitempty"`
// Disk requirements of this volume.
// +optional
Disk *DiskResource `json:"disk,omitempty"`
}
// ExtendedResource required by a container.
type ExtendedResource struct {
// Name of the external resource. Resource names are specified in
// kind.group/version format, e.g. motionsensor.ext.example.com/v1.
Name string `json:"name"`
// Required extended resource(s), e.g. 8 or "very-cool-widget"
Required intstr.IntOrString `json:"required"`
}
// ContainerResources specifies a container's required compute resources.
type ContainerResources struct {
// CPU required by this container.
CPU CPUResources `json:"cpu"`
// Memory required by this container.
Memory MemoryResources `json:"memory"`
// GPU required by this container.
// +optional
GPU *GPUResources `json:"gpu,omitempty"`
// Volumes required by this container.
// +optional
Volumes []VolumeResource `json:"volumes,omitempty"`
// Extended resources required by this container.
// +optional
Extended []ExtendedResource `json:"extended,omitempty"`
}
// A ContainerEnvVar specifies an environment variable that should be set within
// a container.
type ContainerEnvVar struct {
// Name of the environment variable. Must be composed of valid Unicode
// letter and number characters, as well as _ and -.
// +kubebuilder:validation:Pattern=^[-_a-zA-Z0-9]+$
Name string `json:"name"`
// Value of the environment variable.
// +optional
Value *string `json:"value,omitempty"`
// FromSecret is a secret key reference which can be used to assign a value
// to the environment variable.
// +optional
FromSecret *SecretKeySelector `json:"fromSecret,omitempty"`
}
// A ContainerConfigFile specifies a configuration file that should be written
// within a container.
type ContainerConfigFile struct {
// Path within the container at which the configuration file should be
// written.
Path string `json:"path"`
// Value that should be written to the configuration file.
// +optional
Value *string `json:"value,omitempty"`
// FromSecret is a secret key reference which can be used to assign a value
// to be written to the configuration file at the given path in the
// container.
// +optional
FromSecret *SecretKeySelector `json:"fromSecret,omitempty"`
}
// A TransportProtocol represents a transport layer protocol.
type TransportProtocol string
// Transport protocols.
const (
TransportProtocolTCP TransportProtocol = "TCP"
TransportProtocolUDP TransportProtocol = "UDP"
)
// A ContainerPort specifies a port that is exposed by a container.
type ContainerPort struct {
// Name of this port. Must be unique within its container. Must be lowercase
// alphabetical characters.
// +kubebuilder:validation:Pattern=^[a-z]+$
Name string `json:"name"`
// Port number. Must be unique within its container.
Port int32 `json:"containerPort"`
// TODO(negz): Use +kubebuilder:default marker to default Protocol to TCP
// once we're generating v1 CRDs.
// Protocol used by the server listening on this port.
// +kubebuilder:validation:Enum=TCP;UDP
// +optional
Protocol *TransportProtocol `json:"protocol,omitempty"`
}
// An ExecProbe probes a container's health by executing a command.
type ExecProbe struct {
// Command to be run by this probe.
Command []string `json:"command"`
}
// A HTTPHeader to be passed when probing a container.
type HTTPHeader struct {
// Name of this HTTP header. Must be unique per probe.
Name string `json:"name"`
// Value of this HTTP header.
Value string `json:"value"`
}
// A HTTPGetProbe probes a container's health by sending an HTTP GET request.
type HTTPGetProbe struct {
// Path to probe, e.g. '/healthz'.
Path string `json:"path"`
// Port to probe.
Port int32 `json:"port"`
// HTTPHeaders to send with the GET request.
// +optional
HTTPHeaders []HTTPHeader `json:"httpHeaders,omitempty"`
}
// A TCPSocketProbe probes a container's health by connecting to a TCP socket.
type TCPSocketProbe struct {
// Port this probe should connect to.
Port int32 `json:"port"`
}
// A ContainerHealthProbe specifies how to probe the health of a container.
// Exactly one of Exec, HTTPGet, or TCPSocket must be specified.
type ContainerHealthProbe struct {
// Exec probes a container's health by executing a command.
// +optional
Exec *ExecProbe `json:"exec,omitempty"`
// HTTPGet probes a container's health by sending an HTTP GET request.
// +optional
HTTPGet *HTTPGetProbe `json:"httpGet,omitempty"`
// TCPSocketProbe probes a container's health by connecting to a TCP socket.
// +optional
TCPSocket *TCPSocketProbe `json:"tcpSocket,omitempty"`
// InitialDelaySeconds after a container starts before the first probe.
// +optional
InitialDelaySeconds *int32 `json:"initialDelaySeconds,omitempty"`
// TODO(negz): Use +kubebuilder:default marker to default PeriodSeconds,
// TimeoutSeconds, SuccessThreshold, and FailureThreshold to 10, 1, 1, and 3
// respectively once we're generating v1 CRDs.
// PeriodSeconds between probes.
// +optional
PeriodSeconds *int32 `json:"periodSeconds,omitempty"`
// TimeoutSeconds after which the probe times out.
// +optional
TimeoutSeconds *int32 `json:"timeoutSeconds,omitempty"`
// SuccessThreshold specifies how many consecutive probes must success in
// order for the container to be considered healthy.
// +optional
SuccessThreshold *int32 `json:"successThreshold,omitempty"`
// FailureThreshold specifies how many consecutive probes must fail in order
// for the container to be considered healthy.
// +optional
FailureThreshold *int32 `json:"failureThreshold,omitempty"`
}
// A Container represents an Open Containers Initiative (OCI) container.
type Container struct {
// Name of this container. Must be unique within its workload.
Name string `json:"name"`
// Image this container should run. Must be a path-like or URI-like
// representation of an OCI image. May be prefixed with a registry address
// and should be suffixed with a tag.
Image string `json:"image"`
// Resources required by this container
// +optional
Resources *ContainerResources `json:"resources,omitempty"`
// Command to be run by this container.
// +optional
Command []string `json:"command,omitempty"`
// Arguments to be passed to the command run by this container.
// +optional
Arguments []string `json:"args,omitempty"`
// Environment variables that should be set within this container.
// +optional
Environment []ContainerEnvVar `json:"env,omitempty"`
// ConfigFiles that should be written within this container.
// +optional
ConfigFiles []ContainerConfigFile `json:"config,omitempty"`
// Ports exposed by this container.
// +optional
Ports []ContainerPort `json:"ports,omitempty"`
// A LivenessProbe assesses whether this container is alive. Containers that
// fail liveness probes will be restarted.
// +optional
LivenessProbe *ContainerHealthProbe `json:"livenessProbe,omitempty"`
// A ReadinessProbe assesses whether this container is ready to serve
// requests. Containers that fail readiness probes will be withdrawn from
// service.
// +optional
ReadinessProbe *ContainerHealthProbe `json:"readinessProbe,omitempty"`
// TODO(negz): Ideally the key within this secret would be configurable, but
// the current OAM spec allows only a secret name.
// ImagePullSecret specifies the name of a Secret from which the
// credentials required to pull this container's image can be loaded.
// +optional
ImagePullSecret *string `json:"imagePullSecret,omitempty"`
}
// A ContainerizedWorkloadSpec defines the desired state of a
// ContainerizedWorkload.
type ContainerizedWorkloadSpec struct {
// OperatingSystem required by this workload.
// +kubebuilder:validation:Enum=linux;windows
// +optional
OperatingSystem *OperatingSystem `json:"osType,omitempty"`
// CPUArchitecture required by this workload.
// +kubebuilder:validation:Enum=i386;amd64;arm;arm64
// +optional
CPUArchitecture *CPUArchitecture `json:"arch,omitempty"`
// Containers of which this workload consists.
Containers []Container `json:"containers"`
}
// A ContainerizedWorkloadStatus represents the observed state of a
// ContainerizedWorkload.
type ContainerizedWorkloadStatus struct {
runtimev1alpha1.ConditionedStatus `json:",inline"`
// Resources managed by this containerised workload.
Resources []runtimev1alpha1.TypedReference `json:"resources,omitempty"`
}
var _ oam.Workload = &ContainerizedWorkload{}
// +kubebuilder:object:root=true
// A ContainerizedWorkload is a workload that runs OCI containers.
// +kubebuilder:resource:categories={oam}
// +kubebuilder:subresource:status
type ContainerizedWorkload struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec ContainerizedWorkloadSpec `json:"spec,omitempty"`
Status ContainerizedWorkloadStatus `json:"status,omitempty"`
}
// +kubebuilder:object:root=true
// ContainerizedWorkloadList contains a list of ContainerizedWorkload.
type ContainerizedWorkloadList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []ContainerizedWorkload `json:"items"`
}

View File

@@ -0,0 +1,22 @@
/*
Copyright 2021 The KubeVela Authors.
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 v1alpha2 contains resources relating to the Open Application Model.
// See https://github.com/oam-dev/spec for more details.
// +kubebuilder:object:generate=true
// +groupName=core.oam.dev
// +versionName=v1alpha2
package v1alpha2

View File

@@ -0,0 +1,93 @@
/*
Copyright 2021 The KubeVela Authors.
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.
*/
// This code is manually implemented, but should be generated in the future.
package v1alpha2
import (
runtimev1alpha1 "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1"
)
// GetCondition of this ManualScalerTrait.
func (tr *ManualScalerTrait) GetCondition(ct runtimev1alpha1.ConditionType) runtimev1alpha1.Condition {
return tr.Status.GetCondition(ct)
}
// SetConditions of this ManualScalerTrait.
func (tr *ManualScalerTrait) SetConditions(c ...runtimev1alpha1.Condition) {
tr.Status.SetConditions(c...)
}
// GetWorkloadReference of this ManualScalerTrait.
func (tr *ManualScalerTrait) GetWorkloadReference() runtimev1alpha1.TypedReference {
return tr.Spec.WorkloadReference
}
// SetWorkloadReference of this ManualScalerTrait.
func (tr *ManualScalerTrait) SetWorkloadReference(r runtimev1alpha1.TypedReference) {
tr.Spec.WorkloadReference = r
}
// GetCondition of this ApplicationConfiguration.
func (ac *ApplicationConfiguration) GetCondition(ct runtimev1alpha1.ConditionType) runtimev1alpha1.Condition {
return ac.Status.GetCondition(ct)
}
// SetConditions of this ApplicationConfiguration.
func (ac *ApplicationConfiguration) SetConditions(c ...runtimev1alpha1.Condition) {
ac.Status.SetConditions(c...)
}
// GetCondition of this Component.
func (cm *Component) GetCondition(ct runtimev1alpha1.ConditionType) runtimev1alpha1.Condition {
return cm.Status.GetCondition(ct)
}
// SetConditions of this Component.
func (cm *Component) SetConditions(c ...runtimev1alpha1.Condition) {
cm.Status.SetConditions(c...)
}
// GetCondition of this ContainerizedWorkload.
func (wl *ContainerizedWorkload) GetCondition(ct runtimev1alpha1.ConditionType) runtimev1alpha1.Condition {
return wl.Status.GetCondition(ct)
}
// SetConditions of this ContainerizedWorkload.
func (wl *ContainerizedWorkload) SetConditions(c ...runtimev1alpha1.Condition) {
wl.Status.SetConditions(c...)
}
// GetCondition of this HealthScope.
func (hs *HealthScope) GetCondition(ct runtimev1alpha1.ConditionType) runtimev1alpha1.Condition {
return hs.Status.GetCondition(ct)
}
// SetConditions of this HealthScope.
func (hs *HealthScope) SetConditions(c ...runtimev1alpha1.Condition) {
hs.Status.SetConditions(c...)
}
// GetWorkloadReferences to get all workload references for scope.
func (hs *HealthScope) GetWorkloadReferences() []runtimev1alpha1.TypedReference {
return hs.Spec.WorkloadReferences
}
// AddWorkloadReference to add a workload reference to this scope.
func (hs *HealthScope) AddWorkloadReference(r runtimev1alpha1.TypedReference) {
hs.Spec.WorkloadReferences = append(hs.Spec.WorkloadReferences, r)
}

View File

@@ -0,0 +1,158 @@
/*
Copyright 2021 The KubeVela Authors.
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 v1alpha2
import (
"reflect"
"k8s.io/apimachinery/pkg/runtime/schema"
"sigs.k8s.io/controller-runtime/pkg/scheme"
)
// Package type metadata.
const (
Group = "core.oam.dev"
Version = "v1alpha2"
)
var (
// SchemeGroupVersion is group version used to register these objects
SchemeGroupVersion = schema.GroupVersion{Group: Group, Version: Version}
// SchemeBuilder is used to add go types to the GroupVersionKind scheme
SchemeBuilder = &scheme.Builder{GroupVersion: SchemeGroupVersion}
)
// ComponentDefinition type metadata.
var (
ComponentDefinitionKind = reflect.TypeOf(ComponentDefinition{}).Name()
ComponentDefinitionGroupKind = schema.GroupKind{Group: Group, Kind: ComponentDefinitionKind}.String()
ComponentDefinitionKindAPIVersion = ComponentDefinitionKind + "." + SchemeGroupVersion.String()
ComponentDefinitionGroupVersionKind = SchemeGroupVersion.WithKind(ComponentDefinitionKind)
)
// WorkloadDefinition type metadata.
var (
WorkloadDefinitionKind = reflect.TypeOf(WorkloadDefinition{}).Name()
WorkloadDefinitionGroupKind = schema.GroupKind{Group: Group, Kind: WorkloadDefinitionKind}.String()
WorkloadDefinitionKindAPIVersion = WorkloadDefinitionKind + "." + SchemeGroupVersion.String()
WorkloadDefinitionGroupVersionKind = SchemeGroupVersion.WithKind(WorkloadDefinitionKind)
)
// TraitDefinition type metadata.
var (
TraitDefinitionKind = reflect.TypeOf(TraitDefinition{}).Name()
TraitDefinitionGroupKind = schema.GroupKind{Group: Group, Kind: TraitDefinitionKind}.String()
TraitDefinitionKindAPIVersion = TraitDefinitionKind + "." + SchemeGroupVersion.String()
TraitDefinitionGroupVersionKind = SchemeGroupVersion.WithKind(TraitDefinitionKind)
)
// ScopeDefinition type metadata.
var (
ScopeDefinitionKind = reflect.TypeOf(ScopeDefinition{}).Name()
ScopeDefinitionGroupKind = schema.GroupKind{Group: Group, Kind: ScopeDefinitionKind}.String()
ScopeDefinitionKindAPIVersion = ScopeDefinitionKind + "." + SchemeGroupVersion.String()
ScopeDefinitionGroupVersionKind = SchemeGroupVersion.WithKind(ScopeDefinitionKind)
)
// Component type metadata.
var (
ComponentKind = reflect.TypeOf(Component{}).Name()
ComponentGroupKind = schema.GroupKind{Group: Group, Kind: ComponentKind}.String()
ComponentKindAPIVersion = ComponentKind + "." + SchemeGroupVersion.String()
ComponentGroupVersionKind = SchemeGroupVersion.WithKind(ComponentKind)
)
// ApplicationConfiguration type metadata.
var (
ApplicationConfigurationKind = reflect.TypeOf(ApplicationConfiguration{}).Name()
ApplicationConfigurationGroupKind = schema.GroupKind{Group: Group, Kind: ApplicationConfigurationKind}.String()
ApplicationConfigurationKindAPIVersion = ApplicationConfigurationKind + "." + SchemeGroupVersion.String()
ApplicationConfigurationGroupVersionKind = SchemeGroupVersion.WithKind(ApplicationConfigurationKind)
)
// ApplicationContext type metadata.
var (
ApplicationContextKind = reflect.TypeOf(ApplicationContext{}).Name()
ApplicationContextGroupKind = schema.GroupKind{Group: Group, Kind: ApplicationContextKind}.String()
ApplicationContextKindAPIVersion = ApplicationContextKind + "." + SchemeGroupVersion.String()
ApplicationContextGroupVersionKind = SchemeGroupVersion.WithKind(ApplicationContextKind)
)
// ContainerizedWorkload type metadata.
var (
ContainerizedWorkloadKind = reflect.TypeOf(ContainerizedWorkload{}).Name()
ContainerizedWorkloadGroupKind = schema.GroupKind{Group: Group, Kind: ContainerizedWorkloadKind}.String()
ContainerizedWorkloadKindAPIVersion = ContainerizedWorkloadKind + "." + SchemeGroupVersion.String()
ContainerizedWorkloadGroupVersionKind = SchemeGroupVersion.WithKind(ContainerizedWorkloadKind)
)
// ManualScalerTrait type metadata.
var (
ManualScalerTraitKind = reflect.TypeOf(ManualScalerTrait{}).Name()
ManualScalerTraitGroupKind = schema.GroupKind{Group: Group, Kind: ManualScalerTraitKind}.String()
ManualScalerTraitKindAPIVersion = ManualScalerTraitKind + "." + SchemeGroupVersion.String()
ManualScalerTraitGroupVersionKind = SchemeGroupVersion.WithKind(ManualScalerTraitKind)
)
// HealthScope type metadata.
var (
HealthScopeKind = reflect.TypeOf(HealthScope{}).Name()
HealthScopeGroupKind = schema.GroupKind{Group: Group, Kind: HealthScopeKind}.String()
HealthScopeKindAPIVersion = HealthScopeKind + "." + SchemeGroupVersion.String()
HealthScopeGroupVersionKind = SchemeGroupVersion.WithKind(HealthScopeKind)
)
// Application type metadata.
var (
ApplicationKind = reflect.TypeOf(Application{}).Name()
ApplicationGroupKind = schema.GroupKind{Group: Group, Kind: ApplicationKind}.String()
ApplicationKindAPIVersion = ApplicationKind + "." + SchemeGroupVersion.String()
ApplicationKindVersionKind = SchemeGroupVersion.WithKind(ApplicationKind)
)
// AppRollout type metadata.
var (
AppRolloutKind = reflect.TypeOf(AppRollout{}).Name()
AppRolloutGroupKind = schema.GroupKind{Group: Group, Kind: AppRolloutKind}.String()
AppRolloutKindAPIVersion = ApplicationKind + "." + SchemeGroupVersion.String()
AppRolloutKindVersionKind = SchemeGroupVersion.WithKind(AppRolloutKind)
)
// ApplicationRevision type metadata
var (
ApplicationRevisionKind = reflect.TypeOf(ApplicationRevision{}).Name()
ApplicationRevisionGroupKind = schema.GroupKind{Group: Group, Kind: ApplicationRevisionKind}.String()
ApplicationRevisionKindAPIVersion = ApplicationRevisionKind + "." + SchemeGroupVersion.String()
ApplicationRevisionGroupVersionKind = SchemeGroupVersion.WithKind(ApplicationRevisionKind)
)
func init() {
SchemeBuilder.Register(&ComponentDefinition{}, &ComponentDefinitionList{})
SchemeBuilder.Register(&WorkloadDefinition{}, &WorkloadDefinitionList{})
SchemeBuilder.Register(&TraitDefinition{}, &TraitDefinitionList{})
SchemeBuilder.Register(&ScopeDefinition{}, &ScopeDefinitionList{})
SchemeBuilder.Register(&Component{}, &ComponentList{})
SchemeBuilder.Register(&ApplicationConfiguration{}, &ApplicationConfigurationList{})
SchemeBuilder.Register(&ContainerizedWorkload{}, &ContainerizedWorkloadList{})
SchemeBuilder.Register(&ManualScalerTrait{}, &ManualScalerTraitList{})
SchemeBuilder.Register(&HealthScope{}, &HealthScopeList{})
SchemeBuilder.Register(&Application{}, &ApplicationList{})
SchemeBuilder.Register(&AppRollout{}, &AppRolloutList{})
SchemeBuilder.Register(&ApplicationRevision{}, &ApplicationRevisionList{})
SchemeBuilder.Register(&ApplicationContext{}, &ApplicationContextList{})
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,197 @@
/*
Copyright 2021. The KubeVela Authors.
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 v1beta1
import (
runtimev1alpha1 "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// AppDeploymentPhase defines the phase that the AppDeployment is undergoing.
type AppDeploymentPhase string
const (
// PhaseRolling is the phase when the AppDeployment is rolling live instances from old revisions to new ones.
PhaseRolling AppDeploymentPhase = "Rolling"
// PhaseCompleted is the phase when the AppDeployment is done with reconciliation.
PhaseCompleted AppDeploymentPhase = "Completed"
// PhaseFailed is the phase when the AppDeployment has failed in reconciliation due to unexpected conditions.
PhaseFailed AppDeploymentPhase = "Failed"
)
// HTTPMatchRequest specifies a set of criterion to be met in order for the
// rule to be applied to the HTTP request. For example, the following
// restricts the rule to match only requests where the URL path
// starts with /ratings/v2/ and the request contains a custom `end-user` header
// with value `jason`.
type HTTPMatchRequest struct {
// URI defines how to match with an URI.
URI *URIMatch `json:"uri,omitempty"`
}
// URIMatch defines the rules to match with an URI.
type URIMatch struct {
Prefix string `json:"prefix,omitempty"`
}
// HTTPRule defines the rules to match and split http traffic across revisions.
type HTTPRule struct {
// Match defines the conditions to be satisfied for the rule to be
// activated. All conditions inside a single match block have AND
// semantics, while the list of match blocks have OR semantics. The rule
// is matched if any one of the match blocks succeed.
Match []*HTTPMatchRequest `json:"match,omitempty"`
// WeightedTargets defines the revision targets to select and route traffic to.
WeightedTargets []WeightedTarget `json:"weightedTargets,omitempty"`
}
// WeightedTarget defines the revision target to select and route traffic to.
type WeightedTarget struct {
// RevisionName is the name of the app revision.
RevisionName string `json:"revisionName,omitempty"`
// ComponentName is the name of the component.
// Note that it is the original component name in the Application. No need to append revision.
ComponentName string `json:"componentName,omitempty"`
// Port is the port to route traffic towards.
Port int `json:"port,omitempty"`
// Weight defines the proportion of traffic to be forwarded to the service
// version. (0-100). Sum of weights across destinations SHOULD BE == 100.
// If there is only one destination in a rule, the weight value is assumed to
// be 100.
Weight int `json:"weight,omitempty"`
}
// Traffic defines the traffic rules to apply across revisions.
type Traffic struct {
// Hosts are the destination hosts to which traffic is being sent. Could
// be a DNS name with wildcard prefix or an IP address.
Hosts []string `json:"hosts,omitempty"`
// Gateways specifies the names of gateways that should apply these rules.
// Gateways in other namespaces may be referred to by
// `<gateway namespace>/<gateway name>`; specifying a gateway with no
// namespace qualifier is the same as specifying the AppDeployment's namespace.
Gateways []string `json:"gateways,omitempty"`
// HTTP defines the rules to match and split http traffoc across revisions.
HTTP []HTTPRule `json:"http,omitempty"`
}
// ClusterSelector defines the rules to select a Cluster resource.
// Either name or labels is needed.
type ClusterSelector struct {
// Name is the name of the cluster.
Name string `json:"name,omitempty"`
// Labels defines the label selector to select the cluster.
Labels map[string]string `json:"labels,omitempty"`
}
// Distribution defines the replica distribution of an AppRevision to a cluster.
type Distribution struct {
// Replicas is the replica number.
Replicas int `json:"replicas,omitempty"`
}
// ClusterPlacement defines the cluster placement rules for an app revision.
type ClusterPlacement struct {
// ClusterSelector selects the cluster to deploy apps to.
// If not specified, it indicates the host cluster per se.
ClusterSelector *ClusterSelector `json:"clusterSelector,omitempty"`
// Distribution defines the replica distribution of an AppRevision to a cluster.
Distribution Distribution `json:"distribution,omitempty"`
}
// AppRevision specifies an AppRevision resource to and the rules to apply to it.
type AppRevision struct {
// RevisionName is the name of the AppRevision.
RevisionName string `json:"revisionName,omitempty"`
// Placement defines the cluster placement rules for an app revision.
Placement []ClusterPlacement `json:"placement,omitempty"`
}
// ClusterPlacementStatus shows the placement results of a cluster.
type ClusterPlacementStatus struct {
// ClusterName indicates the name of the cluster to deploy apps to.
// If empty, it indicates the host cluster per se.
ClusterName string `json:"clusterName,omitempty"`
// Replicas indicates the replica number of an app revision to deploy to a cluster.
Replicas int `json:"replicas,omitempty"`
}
// PlacementStatus shows the cluster placement results of an app revision.
type PlacementStatus struct {
// RevisionName is the name of the AppRevision.
RevisionName string `json:"revisionName,omitempty"`
// Clusters shows cluster placement results.
Clusters []ClusterPlacementStatus `json:"clusters,omitempty"`
}
// AppDeploymentSpec defines how to describe an upgrade between different apps
type AppDeploymentSpec struct {
// Traffic defines the traffic rules to apply across revisions.
Traffic *Traffic `json:"traffic,omitempty"`
// AppRevision specifies AppRevision resources to and the rules to apply to them.
AppRevisions []AppRevision `json:"appRevisions,omitempty"`
}
// AppDeploymentStatus defines the observed state of AppDeployment
type AppDeploymentStatus struct {
// Conditions represents the latest available observations of a CloneSet's current state.
runtimev1alpha1.ConditionedStatus `json:",inline"`
// Phase shows the phase that the AppDeployment is undergoing.
// If Phase is Rolling, no update should be made to the spec.
Phase AppDeploymentPhase `json:"phase,omitempty"`
// Placement shows the cluster placement results of the app revisions.
Placement []PlacementStatus `json:"placement,omitempty"`
}
// AppDeployment is the Schema for the AppDeployment API
// +kubebuilder:object:root=true
// +kubebuilder:resource:categories={oam},shortName=appdeploy
// +kubebuilder:subresource:status
type AppDeployment struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec AppDeploymentSpec `json:"spec,omitempty"`
Status AppDeploymentStatus `json:"status,omitempty"`
}
// AppDeploymentList contains a list of AppDeployment
// +kubebuilder:object:root=true
type AppDeploymentList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []AppDeployment `json:"items"`
}

View File

@@ -0,0 +1,102 @@
/*
Copyright 2021. The KubeVela Authors.
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 v1beta1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
"github.com/oam-dev/kubevela/apis/standard.oam.dev/v1alpha1"
)
// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
// ApplicationTrait defines the trait of application
type ApplicationTrait struct {
Type string `json:"type"`
// +kubebuilder:pruning:PreserveUnknownFields
Properties runtime.RawExtension `json:"properties,omitempty"`
}
// ApplicationComponent describe the component of application
type ApplicationComponent struct {
Name string `json:"name"`
Type string `json:"type"`
// +kubebuilder:pruning:PreserveUnknownFields
Properties runtime.RawExtension `json:"properties,omitempty"`
// Traits define the trait of one component, the type must be array to keep the order.
Traits []ApplicationTrait `json:"traits,omitempty"`
// +kubebuilder:pruning:PreserveUnknownFields
// scopes in ApplicationComponent defines the component-level scopes
// the format is <scope-type:scope-instance-name> pairs, the key represents type of `ScopeDefinition` while the value represent the name of scope instance.
Scopes map[string]string `json:"scopes,omitempty"`
}
// ApplicationSpec is the spec of Application
type ApplicationSpec struct {
Components []ApplicationComponent `json:"components"`
// TODO(wonderflow): we should have application level scopes supported here
// RolloutPlan is the details on how to rollout the resources
// The controller simply replace the old resources with the new one if there is no rollout plan involved
// +optional
RolloutPlan *v1alpha1.RolloutPlan `json:"rolloutPlan,omitempty"`
}
// +kubebuilder:object:root=true
// Application is the Schema for the applications API
// +kubebuilder:storageversion
// +kubebuilder:subresource:status
// +kubebuilder:resource:categories={oam},shortName=app
// +kubebuilder:printcolumn:name="COMPONENT",type=string,JSONPath=`.spec.components[*].name`
// +kubebuilder:printcolumn:name="TYPE",type=string,JSONPath=`.spec.components[*].type`
// +kubebuilder:printcolumn:name="PHASE",type=string,JSONPath=`.status.status`
// +kubebuilder:printcolumn:name="HEALTHY",type=boolean,JSONPath=`.status.services[*].healthy`
// +kubebuilder:printcolumn:name="STATUS",type=string,JSONPath=`.status.services[*].message`
// +kubebuilder:printcolumn:name="AGE",type=date,JSONPath=".metadata.creationTimestamp"
type Application struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec ApplicationSpec `json:"spec,omitempty"`
Status common.AppStatus `json:"status,omitempty"`
}
// +kubebuilder:object:root=true
// ApplicationList contains a list of Application
type ApplicationList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []Application `json:"items"`
}
// GetComponent get the component from the application based on its workload type
func (app *Application) GetComponent(workloadType string) *ApplicationComponent {
for _, c := range app.Spec.Components {
if c.Type == workloadType {
return &c
}
}
return nil
}

View File

@@ -0,0 +1,75 @@
/*
Copyright 2021. The KubeVela Authors.
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 v1beta1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
)
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
// ApplicationRevisionSpec is the spec of ApplicationRevision
type ApplicationRevisionSpec struct {
// Application records the snapshot of the created/modified Application
Application Application `json:"application"`
// ComponentDefinitions records the snapshot of the componentDefinitions related with the created/modified Application
ComponentDefinitions map[string]ComponentDefinition `json:"componentDefinitions,omitempty"`
// WorkloadDefinitions records the snapshot of the workloadDefinitions related with the created/modified Application
WorkloadDefinitions map[string]WorkloadDefinition `json:"workloadDefinitions,omitempty"`
// TraitDefinitions records the snapshot of the traitDefinitions related with the created/modified Application
TraitDefinitions map[string]TraitDefinition `json:"traitDefinitions,omitempty"`
// ScopeDefinitions records the snapshot of the scopeDefinitions related with the created/modified Application
ScopeDefinitions map[string]ScopeDefinition `json:"scopeDefinitions,omitempty"`
// Components records the rendered components from Application, it will contains the whole K8s CR of workload in it.
Components []common.RawComponent `json:"components,omitempty"`
// ApplicationConfiguration records the rendered applicationConfiguration from Application,
// it will contains the whole K8s CR of trait and the reference component in it.
// +kubebuilder:validation:EmbeddedResource
// +kubebuilder:pruning:PreserveUnknownFields
ApplicationConfiguration runtime.RawExtension `json:"applicationConfiguration"`
}
// +kubebuilder:object:root=true
// ApplicationRevision is the Schema for the ApplicationRevision API
// +kubebuilder:storageversion
// +kubebuilder:resource:categories={oam},shortName=apprev
// +kubebuilder:printcolumn:name="AGE",type=date,JSONPath=".metadata.creationTimestamp"
type ApplicationRevision struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec ApplicationRevisionSpec `json:"spec,omitempty"`
}
// +kubebuilder:object:root=true
// ApplicationRevisionList contains a list of ApplicationRevision
type ApplicationRevisionList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []ApplicationRevision `json:"items"`
}

View File

@@ -0,0 +1,89 @@
/*
Copyright 2021. The KubeVela Authors.
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 v1beta1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"github.com/oam-dev/kubevela/apis/standard.oam.dev/v1alpha1"
)
// AppRolloutSpec defines how to describe an upgrade between different apps
type AppRolloutSpec struct {
// TargetAppRevisionName contains the name of the applicationConfiguration that we need to upgrade to.
// Here we use an applicationConfiguration as a revision of an application, thus the name alone is suffice
TargetAppRevisionName string `json:"targetAppRevisionName"`
// SourceAppRevisionName contains the name of the applicationConfiguration that we need to upgrade from.
// it can be empty only when it's the first time to deploy the application
SourceAppRevisionName string `json:"sourceAppRevisionName,omitempty"`
// The list of component to upgrade in the application.
// We only support single component application so far
// TODO: (RZ) Support multiple components in an application
// +optional
ComponentList []string `json:"componentList,omitempty"`
// RolloutPlan is the details on how to rollout the resources
RolloutPlan v1alpha1.RolloutPlan `json:"rolloutPlan"`
// RevertOnDelete revert the failed rollout when the rollout CR is deleted
// It will revert the change back to the source version at once (not in batches)
// Default is false
// +optional
RevertOnDelete bool `json:"revertOnDelete,omitempty"`
}
// AppRolloutStatus defines the observed state of AppRollout
type AppRolloutStatus struct {
v1alpha1.RolloutStatus `json:",inline"`
// LastUpgradedTargetAppRevision contains the name of the app that we upgraded to
// We will restart the rollout if this is not the same as the spec
LastUpgradedTargetAppRevision string `json:"lastTargetAppRevision"`
// LastSourceAppRevision contains the name of the app that we need to upgrade from.
// We will restart the rollout if this is not the same as the spec
LastSourceAppRevision string `json:"LastSourceAppRevision,omitempty"`
}
// AppRollout is the Schema for the AppRollout API
// +kubebuilder:object:root=true
// +kubebuilder:resource:categories={oam},shortName=approllout
// +kubebuilder:subresource:status
// +kubebuilder:storageversion
// +kubebuilder:printcolumn:name="TARGET",type=string,JSONPath=`.status.rolloutTargetSize`
// +kubebuilder:printcolumn:name="UPGRADED",type=string,JSONPath=`.status.upgradedReplicas`
// +kubebuilder:printcolumn:name="READY",type=string,JSONPath=`.status.upgradedReadyReplicas`
// +kubebuilder:printcolumn:name="BATCH-STATE",type=string,JSONPath=`.status.batchRollingState`
// +kubebuilder:printcolumn:name="ROLLING-STATE",type=string,JSONPath=`.status.rollingState`
// +kubebuilder:printcolumn:name="AGE",type=date,JSONPath=".metadata.creationTimestamp"
type AppRollout struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec AppRolloutSpec `json:"spec,omitempty"`
Status AppRolloutStatus `json:"status,omitempty"`
}
// AppRolloutList contains a list of AppRollout
// +kubebuilder:object:root=true
type AppRolloutList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []AppRollout `json:"items"`
}

View File

@@ -0,0 +1,61 @@
/*
Copyright 2021 The KubeVela Authors.
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 v1beta1
import (
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.
// ClusterSpec defines the desired state of Cluster
type ClusterSpec struct {
// KubeconfigSecretRef specifies the reference to the secret
// that contains the kubeconfig in field `config`.
KubeconfigSecretRef LocalSecretReference `json:"kubeconfigSecretRef,omitempty"`
}
// LocalSecretReference is a reference to a secret within the enclosing
// namespace.
type LocalSecretReference struct {
// Name of a secret within the enclosing namespace.
Name string `json:"name"`
}
// ClusterStatus defines the observed state of Cluster
type ClusterStatus struct {
}
// +kubebuilder:object:root=true
// Cluster is the Schema for the clusters API
type Cluster struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec ClusterSpec `json:"spec,omitempty"`
Status ClusterStatus `json:"status,omitempty"`
}
// +kubebuilder:object:root=true
// ClusterList contains a list of Cluster
type ClusterList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []Cluster `json:"items"`
}

View File

@@ -0,0 +1,100 @@
/*
Copyright 2021. The KubeVela Authors.
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 v1beta1
import (
runtimev1alpha1 "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
)
// ComponentDefinitionSpec defines the desired state of ComponentDefinition
type ComponentDefinitionSpec struct {
// Workload is a workload type descriptor
Workload common.WorkloadTypeDescriptor `json:"workload"`
// ChildResourceKinds are the list of GVK of the child resources this workload generates
ChildResourceKinds []common.ChildResourceKind `json:"childResourceKinds,omitempty"`
// RevisionLabel indicates which label for underlying resources(e.g. pods) of this workload
// can be used by trait to create resource selectors(e.g. label selector for pods).
// +optional
RevisionLabel string `json:"revisionLabel,omitempty"`
// PodSpecPath indicates where/if this workload has K8s podSpec field
// if one workload has podSpec, trait can do lot's of assumption such as port, env, volume fields.
// +optional
PodSpecPath string `json:"podSpecPath,omitempty"`
// Status defines the custom health policy and status message for workload
// +optional
Status *common.Status `json:"status,omitempty"`
// Schematic defines the data format and template of the encapsulation of the workload
// +optional
Schematic *common.Schematic `json:"schematic,omitempty"`
// Extension is used for extension needs by OAM platform builders
// +optional
// +kubebuilder:pruning:PreserveUnknownFields
Extension *runtime.RawExtension `json:"extension,omitempty"`
}
// ComponentDefinitionStatus is the status of ComponentDefinition
type ComponentDefinitionStatus struct {
// ConditionedStatus reflects the observed status of a resource
runtimev1alpha1.ConditionedStatus `json:",inline"`
// ConfigMapRef refer to a ConfigMap which contains OpenAPI V3 JSON schema of Component parameters.
ConfigMapRef string `json:"configMapRef,omitempty"`
}
// +kubebuilder:object:root=true
// ComponentDefinition is the Schema for the componentdefinitions API
// +kubebuilder:resource:scope=Namespaced,categories={oam},shortName=comp
// +kubebuilder:storageversion
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name="WORKLOAD-KIND",type=string,JSONPath=".spec.workload.definition.kind"
// +kubebuilder:printcolumn:name="DESCRIPTION",type=string,JSONPath=".metadata.annotations.definition\\.oam\\.dev/description"
type ComponentDefinition struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec ComponentDefinitionSpec `json:"spec,omitempty"`
Status ComponentDefinitionStatus `json:"status,omitempty"`
}
// SetConditions set condition for WorkloadDefinition
func (cd *ComponentDefinition) SetConditions(c ...runtimev1alpha1.Condition) {
cd.Status.SetConditions(c...)
}
// GetCondition gets condition from WorkloadDefinition
func (cd *ComponentDefinition) GetCondition(conditionType runtimev1alpha1.ConditionType) runtimev1alpha1.Condition {
return cd.Status.GetCondition(conditionType)
}
// +kubebuilder:object:root=true
// ComponentDefinitionList contains a list of ComponentDefinition
type ComponentDefinitionList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []ComponentDefinition `json:"items"`
}

View File

@@ -0,0 +1,20 @@
/*
Copyright 2021. The KubeVela Authors.
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 v1beta1
// Hub marks this type as a conversion hub.
func (*Application) Hub() {}

View File

@@ -0,0 +1,286 @@
/*
Copyright 2021. The KubeVela Authors.
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 v1beta1
import (
runtimev1alpha1 "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/types"
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
)
// A WorkloadDefinitionSpec defines the desired state of a WorkloadDefinition.
type WorkloadDefinitionSpec struct {
// Reference to the CustomResourceDefinition that defines this workload kind.
Reference common.DefinitionReference `json:"definitionRef"`
// ChildResourceKinds are the list of GVK of the child resources this workload generates
ChildResourceKinds []common.ChildResourceKind `json:"childResourceKinds,omitempty"`
// RevisionLabel indicates which label for underlying resources(e.g. pods) of this workload
// can be used by trait to create resource selectors(e.g. label selector for pods).
// +optional
RevisionLabel string `json:"revisionLabel,omitempty"`
// PodSpecPath indicates where/if this workload has K8s podSpec field
// if one workload has podSpec, trait can do lot's of assumption such as port, env, volume fields.
// +optional
PodSpecPath string `json:"podSpecPath,omitempty"`
// Status defines the custom health policy and status message for workload
// +optional
Status *common.Status `json:"status,omitempty"`
// Schematic defines the data format and template of the encapsulation of the workload
// +optional
Schematic *common.Schematic `json:"schematic,omitempty"`
// Extension is used for extension needs by OAM platform builders
// +optional
// +kubebuilder:pruning:PreserveUnknownFields
Extension *runtime.RawExtension `json:"extension,omitempty"`
}
// WorkloadDefinitionStatus is the status of WorkloadDefinition
type WorkloadDefinitionStatus struct {
runtimev1alpha1.ConditionedStatus `json:",inline"`
}
// +kubebuilder:object:root=true
// A WorkloadDefinition registers a kind of Kubernetes custom resource as a
// valid OAM workload kind by referencing its CustomResourceDefinition. The CRD
// is used to validate the schema of the workload when it is embedded in an OAM
// Component.
// +kubebuilder:resource:scope=Namespaced,categories={oam},shortName=workload
// +kubebuilder:storageversion
// +kubebuilder:printcolumn:name="DEFINITION-NAME",type=string,JSONPath=".spec.definitionRef.name"
// +kubebuilder:printcolumn:name="DESCRIPTION",type=string,JSONPath=".metadata.annotations.definition\\.oam\\.dev/description"
type WorkloadDefinition struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec WorkloadDefinitionSpec `json:"spec,omitempty"`
Status WorkloadDefinitionStatus `json:"status,omitempty"`
}
// SetConditions set condition for WorkloadDefinition
func (wd *WorkloadDefinition) SetConditions(c ...runtimev1alpha1.Condition) {
wd.Status.SetConditions(c...)
}
// GetCondition gets condition from WorkloadDefinition
func (wd *WorkloadDefinition) GetCondition(conditionType runtimev1alpha1.ConditionType) runtimev1alpha1.Condition {
return wd.Status.GetCondition(conditionType)
}
// +kubebuilder:object:root=true
// WorkloadDefinitionList contains a list of WorkloadDefinition.
type WorkloadDefinitionList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []WorkloadDefinition `json:"items"`
}
// A TraitDefinitionSpec defines the desired state of a TraitDefinition.
type TraitDefinitionSpec struct {
// Reference to the CustomResourceDefinition that defines this trait kind.
Reference common.DefinitionReference `json:"definitionRef,omitempty"`
// Revision indicates whether a trait is aware of component revision
// +optional
RevisionEnabled bool `json:"revisionEnabled,omitempty"`
// WorkloadRefPath indicates where/if a trait accepts a workloadRef object
// +optional
WorkloadRefPath string `json:"workloadRefPath,omitempty"`
// PodDisruptive specifies whether using the trait will cause the pod to restart or not.
// +optional
PodDisruptive bool `json:"podDisruptive,omitempty"`
// AppliesToWorkloads specifies the list of workload kinds this trait
// applies to. Workload kinds are specified in kind.group/version format,
// e.g. server.core.oam.dev/v1alpha2. Traits that omit this field apply to
// all workload kinds.
// +optional
AppliesToWorkloads []string `json:"appliesToWorkloads,omitempty"`
// ConflictsWith specifies the list of traits(CRD name, Definition name, CRD group)
// which could not apply to the same workloads with this trait.
// Traits that omit this field can work with any other traits.
// Example rules:
// "service" # Trait definition name
// "services.k8s.io" # API resource/crd name
// "*.networking.k8s.io" # API group
// "labelSelector:foo=bar" # label selector
// labelSelector format: https://pkg.go.dev/k8s.io/apimachinery/pkg/labels#Parse
// +optional
ConflictsWith []string `json:"conflictsWith,omitempty"`
// Schematic defines the data format and template of the encapsulation of the trait
// +optional
Schematic *common.Schematic `json:"schematic,omitempty"`
// Status defines the custom health policy and status message for trait
// +optional
Status *common.Status `json:"status,omitempty"`
// Extension is used for extension needs by OAM platform builders
// +optional
// +kubebuilder:pruning:PreserveUnknownFields
Extension *runtime.RawExtension `json:"extension,omitempty"`
}
// TraitDefinitionStatus is the status of TraitDefinition
type TraitDefinitionStatus struct {
// ConditionedStatus reflects the observed status of a resource
runtimev1alpha1.ConditionedStatus `json:",inline"`
// ConfigMapRef refer to a ConfigMap which contains OpenAPI V3 JSON schema of Component parameters.
ConfigMapRef string `json:"configMapRef,omitempty"`
}
// +kubebuilder:object:root=true
// A TraitDefinition registers a kind of Kubernetes custom resource as a valid
// OAM trait kind by referencing its CustomResourceDefinition. The CRD is used
// to validate the schema of the trait when it is embedded in an OAM
// ApplicationConfiguration.
// +kubebuilder:resource:scope=Namespaced,categories={oam},shortName=trait
// +kubebuilder:subresource:status
// +kubebuilder:storageversion
// +kubebuilder:printcolumn:name="APPLIES-TO",type=string,JSONPath=".spec.appliesToWorkloads"
// +kubebuilder:printcolumn:name="DESCRIPTION",type=string,JSONPath=".metadata.annotations.definition\\.oam\\.dev/description"
type TraitDefinition struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec TraitDefinitionSpec `json:"spec,omitempty"`
Status TraitDefinitionStatus `json:"status,omitempty"`
}
// SetConditions set condition for TraitDefinition
func (td *TraitDefinition) SetConditions(c ...runtimev1alpha1.Condition) {
td.Status.SetConditions(c...)
}
// GetCondition gets condition from TraitDefinition
func (td *TraitDefinition) GetCondition(conditionType runtimev1alpha1.ConditionType) runtimev1alpha1.Condition {
return td.Status.GetCondition(conditionType)
}
// +kubebuilder:object:root=true
// TraitDefinitionList contains a list of TraitDefinition.
type TraitDefinitionList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []TraitDefinition `json:"items"`
}
// A ScopeDefinitionSpec defines the desired state of a ScopeDefinition.
type ScopeDefinitionSpec struct {
// Reference to the CustomResourceDefinition that defines this scope kind.
Reference common.DefinitionReference `json:"definitionRef"`
// WorkloadRefsPath indicates if/where a scope accepts workloadRef objects
WorkloadRefsPath string `json:"workloadRefsPath,omitempty"`
// AllowComponentOverlap specifies whether an OAM component may exist in
// multiple instances of this kind of scope.
AllowComponentOverlap bool `json:"allowComponentOverlap"`
// Extension is used for extension needs by OAM platform builders
// +optional
// +kubebuilder:pruning:PreserveUnknownFields
Extension *runtime.RawExtension `json:"extension,omitempty"`
}
// +kubebuilder:object:root=true
// A ScopeDefinition registers a kind of Kubernetes custom resource as a valid
// OAM scope kind by referencing its CustomResourceDefinition. The CRD is used
// to validate the schema of the scope when it is embedded in an OAM
// ApplicationConfiguration.
// +kubebuilder:printcolumn:JSONPath=".spec.definitionRef.name",name=DEFINITION-NAME,type=string
// +kubebuilder:resource:scope=Namespaced,categories={oam},shortName=scope
// +kubebuilder:storageversion
type ScopeDefinition struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec ScopeDefinitionSpec `json:"spec,omitempty"`
}
// +kubebuilder:object:root=true
// ScopeDefinitionList contains a list of ScopeDefinition.
type ScopeDefinitionList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []ScopeDefinition `json:"items"`
}
// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// An ResourceTracker represents a tracker for track cross namespace resources
// +kubebuilder:resource:scope=Cluster,categories={oam},shortName=tracker
type ResourceTracker struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Status ResourceTrackerStatus `json:"status,omitempty"`
}
// ResourceTrackerStatus define the status of resourceTracker
type ResourceTrackerStatus struct {
TrackedResources []TypedReference `json:"trackedResources,omitempty"`
}
// A TypedReference refers to an object by Name, Kind, and APIVersion. It is
// commonly used to reference across-namespace objects
type TypedReference struct {
// APIVersion of the referenced object.
APIVersion string `json:"apiVersion"`
// Kind of the referenced object.
Kind string `json:"kind"`
// Name of the referenced object.
Name string `json:"name"`
// Namespace of the objects outside the application namespace.
// +optional
Namespace string `json:"namespace,omitempty"`
// UID of the referenced object.
// +optional
UID types.UID `json:"uid,omitempty"`
}
// +kubebuilder:object:root=true
// ResourceTrackerList contains a list of ResourceTracker
type ResourceTrackerList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []ResourceTracker `json:"items"`
}

View File

@@ -0,0 +1,22 @@
/*
Copyright 2021. The KubeVela Authors.
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 v1beta1 contains resources relating to the Open Application Model.
// See https://github.com/oam-dev/spec for more details.
// +kubebuilder:object:generate=true
// +groupName=core.oam.dev
// +versionName=v1beta1
package v1beta1

View File

@@ -0,0 +1,131 @@
/*
Copyright 2021. The KubeVela Authors.
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 v1beta1
import (
"reflect"
"k8s.io/apimachinery/pkg/runtime/schema"
"sigs.k8s.io/controller-runtime/pkg/scheme"
)
// Package type metadata.
const (
Group = "core.oam.dev"
Version = "v1beta1"
)
var (
// SchemeGroupVersion is group version used to register these objects
SchemeGroupVersion = schema.GroupVersion{Group: Group, Version: Version}
// SchemeBuilder is used to add go types to the GroupVersionKind scheme
SchemeBuilder = &scheme.Builder{GroupVersion: SchemeGroupVersion}
)
// ComponentDefinition type metadata.
var (
ComponentDefinitionKind = reflect.TypeOf(ComponentDefinition{}).Name()
ComponentDefinitionGroupKind = schema.GroupKind{Group: Group, Kind: ComponentDefinitionKind}.String()
ComponentDefinitionKindAPIVersion = ComponentDefinitionKind + "." + SchemeGroupVersion.String()
ComponentDefinitionGroupVersionKind = SchemeGroupVersion.WithKind(ComponentDefinitionKind)
)
// WorkloadDefinition type metadata.
var (
WorkloadDefinitionKind = reflect.TypeOf(WorkloadDefinition{}).Name()
WorkloadDefinitionGroupKind = schema.GroupKind{Group: Group, Kind: WorkloadDefinitionKind}.String()
WorkloadDefinitionKindAPIVersion = WorkloadDefinitionKind + "." + SchemeGroupVersion.String()
WorkloadDefinitionGroupVersionKind = SchemeGroupVersion.WithKind(WorkloadDefinitionKind)
)
// TraitDefinition type metadata.
var (
TraitDefinitionKind = reflect.TypeOf(TraitDefinition{}).Name()
TraitDefinitionGroupKind = schema.GroupKind{Group: Group, Kind: TraitDefinitionKind}.String()
TraitDefinitionKindAPIVersion = TraitDefinitionKind + "." + SchemeGroupVersion.String()
TraitDefinitionGroupVersionKind = SchemeGroupVersion.WithKind(TraitDefinitionKind)
)
// Application type metadata.
var (
ApplicationKind = reflect.TypeOf(Application{}).Name()
ApplicationGroupKind = schema.GroupKind{Group: Group, Kind: ApplicationKind}.String()
ApplicationKindAPIVersion = ApplicationKind + "." + SchemeGroupVersion.String()
ApplicationKindVersionKind = SchemeGroupVersion.WithKind(ApplicationKind)
)
// AppRollout type metadata.
var (
AppRolloutKind = reflect.TypeOf(AppRollout{}).Name()
AppRolloutGroupKind = schema.GroupKind{Group: Group, Kind: AppRolloutKind}.String()
AppRolloutKindAPIVersion = ApplicationKind + "." + SchemeGroupVersion.String()
AppRolloutKindVersionKind = SchemeGroupVersion.WithKind(AppRolloutKind)
)
// ApplicationRevision type metadata
var (
ApplicationRevisionKind = reflect.TypeOf(ApplicationRevision{}).Name()
ApplicationRevisionGroupKind = schema.GroupKind{Group: Group, Kind: ApplicationRevisionKind}.String()
ApplicationRevisionKindAPIVersion = ApplicationRevisionKind + "." + SchemeGroupVersion.String()
ApplicationRevisionGroupVersionKind = SchemeGroupVersion.WithKind(ApplicationRevisionKind)
)
// ScopeDefinition type metadata.
var (
ScopeDefinitionKind = reflect.TypeOf(ScopeDefinition{}).Name()
ScopeDefinitionGroupKind = schema.GroupKind{Group: Group, Kind: ScopeDefinitionKind}.String()
ScopeDefinitionKindAPIVersion = ScopeDefinitionKind + "." + SchemeGroupVersion.String()
ScopeDefinitionGroupVersionKind = SchemeGroupVersion.WithKind(ScopeDefinitionKind)
)
// ResourceTracker type metadata.
var (
ResourceTrackerKind = reflect.TypeOf(ResourceTracker{}).Name()
ResourceTrackerGroupKind = schema.GroupKind{Group: Group, Kind: ResourceTrackerKind}.String()
ResourceTrackerKindAPIVersion = ResourceTrackerKind + "." + SchemeGroupVersion.String()
ResourceTrackerKindVersionKind = SchemeGroupVersion.WithKind(ResourceTrackerKind)
)
// AppDeployment type metadata.
var (
AppDeploymentKind = reflect.TypeOf(AppDeployment{}).Name()
AppDeploymentGroupKind = schema.GroupKind{Group: Group, Kind: AppDeploymentKind}.String()
AppDeploymentKindAPIVersion = AppDeploymentKind + "." + SchemeGroupVersion.String()
AppDeploymentKindVersionKind = SchemeGroupVersion.WithKind(AppDeploymentKind)
)
// Cluster type metadata.
var (
ClusterKind = reflect.TypeOf(Cluster{}).Name()
ClusterGroupKind = schema.GroupKind{Group: Group, Kind: ClusterKind}.String()
ClusterKindAPIVersion = ApplicationKind + "." + SchemeGroupVersion.String()
ClusterKindVersionKind = SchemeGroupVersion.WithKind(ClusterKind)
)
func init() {
SchemeBuilder.Register(&ComponentDefinition{}, &ComponentDefinitionList{})
SchemeBuilder.Register(&WorkloadDefinition{}, &WorkloadDefinitionList{})
SchemeBuilder.Register(&TraitDefinition{}, &TraitDefinitionList{})
SchemeBuilder.Register(&ScopeDefinition{}, &ScopeDefinitionList{})
SchemeBuilder.Register(&Application{}, &ApplicationList{})
SchemeBuilder.Register(&AppRollout{}, &AppRolloutList{})
SchemeBuilder.Register(&ApplicationRevision{}, &ApplicationRevisionList{})
SchemeBuilder.Register(&AppDeployment{}, &AppDeploymentList{})
SchemeBuilder.Register(&Cluster{}, &ClusterList{})
SchemeBuilder.Register(&ResourceTracker{}, &ResourceTrackerList{})
}

File diff suppressed because it is too large Load Diff

37
apis/generate.go Normal file
View File

@@ -0,0 +1,37 @@
// +build generate
/*
Copyright 2021 The KubeVela Authors.
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.
*/
// 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
// NOTE(@wonderflow) We don't remove existing CRDs here, because the crd folders contain not only auto generated.
// Generate deepcopy methodsets and CRD manifests
//go:generate go run -tags generate sigs.k8s.io/controller-tools/cmd/controller-gen object:headerFile=../hack/boilerplate.go.txt paths=./... crd:crdVersions=v1 output:artifacts:config=../config/crd/base
// Generate legacy_support for K8s 1.12~1.15 versions CRD manifests
//go:generate go run -tags generate sigs.k8s.io/controller-tools/cmd/controller-gen object:headerFile=../hack/boilerplate.go.txt paths=./... crd:trivialVersions=true output:artifacts:config=../legacy/charts/vela-core-legacy/crds
//go:generate go run ../legacy/convert/main.go ../legacy/charts/vela-core-legacy/crds
//go:generate go run ../hack/crd/update.go ../charts/vela-core/crds/standard.oam.dev_podspecworkloads.yaml
package apis
import (
_ "sigs.k8s.io/controller-tools/cmd/controller-gen" //nolint:typecheck
)

View File

@@ -1,5 +1,5 @@
/*
Copyright 2021 The KubeVela Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -24,9 +24,16 @@ import (
"sigs.k8s.io/controller-runtime/pkg/scheme"
)
const (
// GroupName of the CRDs
GroupName = "standard.oam.dev"
// Version of the group of CRDs
Version = "v1alpha1"
)
var (
// SchemeGroupVersion is group version used to register these objects
SchemeGroupVersion = schema.GroupVersion{Group: "standard.oam.dev", Version: "v1alpha1"}
SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: Version}
// SchemeBuilder is used to add go types to the GroupVersionKind scheme
SchemeBuilder = &scheme.Builder{GroupVersion: SchemeGroupVersion}

View File

@@ -1,5 +1,5 @@
/*
Copyright 2021 The KubeVela Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -18,25 +18,26 @@ package v1alpha1
import (
cpv1alpha1 "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1"
"github.com/crossplane/oam-kubernetes-runtime/pkg/oam"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"github.com/oam-dev/kubevela/pkg/oam"
)
// ContainerizedSpec defines the desired state of Containerized
type ContainerizedSpec struct {
// PodSpecWorkloadSpec defines the desired state of PodSpecWorkload
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 containerized
// we omit the meta part as it will be exactly the same as the PodSpecWorkload
PodSpec v1.PodSpec `json:"podSpec"`
}
// ContainerizedStatus defines the observed state of Containerized
type ContainerizedStatus struct {
// PodSpecWorkloadStatus defines the observed state of PodSpecWorkload
type PodSpecWorkloadStatus struct {
cpv1alpha1.ConditionedStatus `json:",inline"`
// Resources managed by this workload.
@@ -45,36 +46,40 @@ type ContainerizedStatus struct {
// +kubebuilder:object:root=true
// Containerized is the Schema for the containerizeds API
// 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 Containerized struct {
type PodSpecWorkload struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec ContainerizedSpec `json:"spec,omitempty"`
Status ContainerizedStatus `json:"status,omitempty"`
Spec PodSpecWorkloadSpec `json:"spec,omitempty"`
Status PodSpecWorkloadStatus `json:"status,omitempty"`
}
// +kubebuilder:object:root=true
// ContainerizedList contains a list of Containerized
type ContainerizedList struct {
// PodSpecWorkloadList contains a list of PodSpecWorkload
type PodSpecWorkloadList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []Containerized `json:"items"`
Items []PodSpecWorkload `json:"items"`
}
func init() {
SchemeBuilder.Register(&Containerized{}, &ContainerizedList{})
SchemeBuilder.Register(&PodSpecWorkload{}, &PodSpecWorkloadList{})
}
var _ oam.Workload = &Containerized{}
var _ oam.Workload = &PodSpecWorkload{}
func (in *Containerized) SetConditions(c ...cpv1alpha1.Condition) {
// SetConditions set condition for this CR
func (in *PodSpecWorkload) SetConditions(c ...cpv1alpha1.Condition) {
in.Status.SetConditions(c...)
}
func (in *Containerized) GetCondition(c cpv1alpha1.ConditionType) cpv1alpha1.Condition {
// GetCondition set condition for this CR
func (in *PodSpecWorkload) GetCondition(c cpv1alpha1.ConditionType) cpv1alpha1.Condition {
return in.Status.GetCondition(c)
}

View File

@@ -0,0 +1,283 @@
/*
Copyright 2021 The KubeVela Authors.
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 (
runtimev1alpha1 "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1"
"k8s.io/apimachinery/pkg/util/intstr"
)
// RolloutStrategyType defines strategies for pods rollout
type RolloutStrategyType string
const (
// IncreaseFirstRolloutStrategyType indicates that we increase the target resources first
IncreaseFirstRolloutStrategyType RolloutStrategyType = "IncreaseFirst"
// DecreaseFirstRolloutStrategyType indicates that we decrease the source resources first
DecreaseFirstRolloutStrategyType RolloutStrategyType = "DecreaseFirst"
)
// HookType can be pre, post or during rollout
type HookType string
const (
// InitializeRolloutHook execute webhook during the rollout initializing phase
InitializeRolloutHook HookType = "initialize-rollout"
// PreBatchRolloutHook execute webhook before each batch rollout
PreBatchRolloutHook HookType = "pre-batch-rollout"
// PostBatchRolloutHook execute webhook after each batch rollout
PostBatchRolloutHook HookType = "post-batch-rollout"
// FinalizeRolloutHook execute the webhook during the rollout finalizing phase
FinalizeRolloutHook HookType = "finalize-rollout"
)
// RollingState is the overall rollout state
type RollingState string
const (
// LocatingTargetAppState indicates that the rollout is in the stage of locating target app
// we use this state to make sure we special handle the target app successfully only once
LocatingTargetAppState RollingState = "locatingTargetApp"
// VerifyingSpecState indicates that the rollout is in the stage of verifying the rollout settings
// and the controller can locate both the target and the source
VerifyingSpecState RollingState = "verifyingSpec"
// InitializingState indicates that the rollout is initializing all the new resources
InitializingState RollingState = "initializing"
// RollingInBatchesState indicates that the rollout starts rolling
RollingInBatchesState RollingState = "rollingInBatches"
// FinalisingState indicates that the rollout is finalizing, possibly clean up the old resources, adjust traffic
FinalisingState RollingState = "finalising"
// RolloutFailingState indicates that the rollout is failing
// one needs to finalize it before mark it as failed by cleaning up the old resources, adjust traffic
RolloutFailingState RollingState = "rolloutFailing"
// RolloutSucceedState indicates that rollout successfully completed to match the desired target state
RolloutSucceedState RollingState = "rolloutSucceed"
// RolloutAbandoningState indicates that the rollout is being abandoned
// we need to finalize it by cleaning up the old resources, adjust traffic and return control back to its owner
RolloutAbandoningState RollingState = "rolloutAbandoning"
// RolloutDeletingState indicates that the rollout is being deleted
// we need to finalize it by cleaning up the old resources, adjust traffic and return control back to its owner
RolloutDeletingState RollingState = "RolloutDeletingState"
// RolloutFailedState indicates that rollout is failed, the target replica is not reached
// we can not move forward anymore, we will let the client to decide when or whether to revert.
RolloutFailedState RollingState = "rolloutFailed"
)
// BatchRollingState is the sub state when the rollout is on the fly
type BatchRollingState string
const (
// BatchInitializingState still rolling the batch, the batch rolling is not completed yet
BatchInitializingState BatchRollingState = "batchInitializing"
// BatchInRollingState still rolling the batch, the batch rolling is not completed yet
BatchInRollingState BatchRollingState = "batchInRolling"
// BatchVerifyingState verifying if the application is ready to roll.
BatchVerifyingState BatchRollingState = "batchVerifying"
// BatchRolloutFailedState indicates that the batch didn't get the manual or automatic approval
BatchRolloutFailedState BatchRollingState = "batchVerifyFailed"
// BatchFinalizingState indicates that all the pods in the are available, we can move on to the next batch
BatchFinalizingState BatchRollingState = "batchFinalizing"
// BatchReadyState indicates that all the pods in the are upgraded and its state is ready
BatchReadyState BatchRollingState = "batchReady"
)
// RolloutPlan fines the details of the rollout plan
type RolloutPlan struct {
// RolloutStrategy defines strategies for the rollout plan
// The default is IncreaseFirstRolloutStrategyType
// +optional
RolloutStrategy RolloutStrategyType `json:"rolloutStrategy,omitempty"`
// The size of the target resource. The default is the same
// as the size of the source resource.
// +optional
TargetSize *int32 `json:"targetSize,omitempty"`
// The number of batches, default = 1
// +optional
NumBatches *int32 `json:"numBatches,omitempty"`
// The exact distribution among batches.
// its size has to be exactly the same as the NumBatches (if set)
// The total number cannot exceed the targetSize or the size of the source resource
// We will IGNORE the last batch's replica field if it's a percentage since round errors can lead to inaccurate sum
// We highly recommend to leave the last batch's replica field empty
// +optional
RolloutBatches []RolloutBatch `json:"rolloutBatches,omitempty"`
// All pods in the batches up to the batchPartition (included) will have
// the target resource specification while the rest still have the source resource
// This is designed for the operators to manually rollout
// Default is the the number of batches which will rollout all the batches
// +optional
BatchPartition *int32 `json:"batchPartition,omitempty"`
// Paused the rollout, default is false
// +optional
Paused bool `json:"paused,omitempty"`
// RolloutWebhooks provide a way for the rollout to interact with an external process
// +optional
RolloutWebhooks []RolloutWebhook `json:"rolloutWebhooks,omitempty"`
// CanaryMetric provides a way for the rollout process to automatically check certain metrics
// before complete the process
// +optional
CanaryMetric []CanaryMetric `json:"canaryMetric,omitempty"`
}
// RolloutBatch is used to describe how the each batch rollout should be
type RolloutBatch struct {
// Replicas is the number of pods to upgrade in this batch
// it can be an absolute number (ex: 5) or a percentage of total pods
// we will ignore the percentage of the last batch to just fill the gap
// +optional
// it is mutually exclusive with the PodList field
Replicas intstr.IntOrString `json:"replicas,omitempty"`
// The list of Pods to get upgraded
// +optional
// it is mutually exclusive with the Replicas field
PodList []string `json:"podList,omitempty"`
// MaxUnavailable is the max allowed number of pods that is unavailable
// during the upgrade. We will mark the batch as ready as long as there are less
// or equal number of pods unavailable than this number.
// default = 0
// +optional
MaxUnavailable *intstr.IntOrString `json:"maxUnavailable,omitempty"`
// The wait time, in seconds, between instances upgrades, default = 0
// +optional
InstanceInterval *int32 `json:"instanceInterval,omitempty"`
// RolloutWebhooks provides a way for the batch rollout to interact with an external process
// +optional
BatchRolloutWebhooks []RolloutWebhook `json:"batchRolloutWebhooks,omitempty"`
// CanaryMetric provides a way for the batch rollout process to automatically check certain metrics
// before moving to the next batch
// +optional
CanaryMetric []CanaryMetric `json:"canaryMetric,omitempty"`
}
// RolloutWebhook holds the reference to external checks used for canary analysis
type RolloutWebhook struct {
// Type of this webhook
Type HookType `json:"type"`
// Name of this webhook
Name string `json:"name"`
// URL address of this webhook
URL string `json:"url"`
// Method the HTTP call method, default is POST
Method string `json:"method,omitempty"`
// ExpectedStatus contains all the expected http status code that we will accept as success
ExpectedStatus []int `json:"expectedStatus,omitempty"`
// Metadata (key-value pairs) for this webhook
// +optional
Metadata *map[string]string `json:"metadata,omitempty"`
}
// RolloutWebhookPayload holds the info and metadata sent to webhooks
type RolloutWebhookPayload struct {
// Name of the upgrading resource
Name string `json:"name"`
// Namespace of the upgrading resource
Namespace string `json:"namespace"`
// Phase of the rollout
Phase string `json:"phase"`
// Metadata (key-value pairs) are the extra data send to this webhook
Metadata map[string]string `json:"metadata,omitempty"`
}
// CanaryMetric holds the reference to metrics used for canary analysis
type CanaryMetric struct {
// Name of the metric
Name string `json:"name"`
// Interval represents the windows size
Interval string `json:"interval,omitempty"`
// Range value accepted for this metric
// +optional
MetricsRange *MetricsExpectedRange `json:"metricsRange,omitempty"`
// TemplateRef references a metric template object
// +optional
TemplateRef *runtimev1alpha1.TypedReference `json:"templateRef,omitempty"`
}
// MetricsExpectedRange defines the range used for metrics validation
type MetricsExpectedRange struct {
// Minimum value
// +optional
Min *intstr.IntOrString `json:"min,omitempty"`
// Maximum value
// +optional
Max *intstr.IntOrString `json:"max,omitempty"`
}
// RolloutStatus defines the observed state of a rollout plan
type RolloutStatus struct {
// Conditions represents the latest available observations of a CloneSet's current state.
runtimev1alpha1.ConditionedStatus `json:",inline"`
// RolloutTargetSize is the size of the target resources. This is determined once the initial spec verification
// and does not change until the rollout is restarted
RolloutOriginalSize int32 `json:"rolloutOriginalSize,omitempty"`
// RolloutTargetSize is the size of the target resources. This is determined once the initial spec verification
// and does not change until the rollout is restarted
RolloutTargetSize int32 `json:"rolloutTargetSize,omitempty"`
// NewPodTemplateIdentifier is a string that uniquely represent the new pod template
// each workload type could use different ways to identify that so we cannot compare between resources
NewPodTemplateIdentifier string `json:"targetGeneration,omitempty"`
// lastAppliedPodTemplateIdentifier is a string that uniquely represent the last pod template
// each workload type could use different ways to identify that so we cannot compare between resources
// We update this field only after a successful rollout
LastAppliedPodTemplateIdentifier string `json:"lastAppliedPodTemplateIdentifier,omitempty"`
// RollingState is the Rollout State
RollingState RollingState `json:"rollingState"`
// BatchRollingState only meaningful when the Status is rolling
// +optional
BatchRollingState BatchRollingState `json:"batchRollingState"`
// The current batch the rollout is working on/blocked
// it starts from 0
CurrentBatch int32 `json:"currentBatch"`
// UpgradedReplicas is the number of Pods upgraded by the rollout controller
UpgradedReplicas int32 `json:"upgradedReplicas"`
// UpgradedReadyReplicas is the number of Pods upgraded by the rollout controller that have a Ready Condition.
UpgradedReadyReplicas int32 `json:"upgradedReadyReplicas"`
}

View File

@@ -0,0 +1,429 @@
/*
Copyright 2021 The KubeVela Authors.
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 (
"fmt"
"time"
runtimev1alpha1 "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/klog/v2"
)
// RolloutEvent is used to describe the events during rollout
type RolloutEvent string
const (
// RollingFailedEvent indicates that we encountered an unexpected error during upgrading and can't be retried
RollingFailedEvent RolloutEvent = "RollingFailedEvent"
// RollingRetriableFailureEvent indicates that we encountered an unexpected but retriable error
RollingRetriableFailureEvent RolloutEvent = "RollingRetriableFailureEvent"
// AppLocatedEvent indicates that apps are located successfully
AppLocatedEvent RolloutEvent = "AppLocatedEvent"
// RollingModifiedEvent indicates that the rolling target or source has changed
RollingModifiedEvent RolloutEvent = "RollingModifiedEvent"
// RollingDeletedEvent indicates that the rolling is being deleted
RollingDeletedEvent RolloutEvent = "RollingDeletedEvent"
// RollingSpecVerifiedEvent indicates that we have successfully verified that the rollout spec
RollingSpecVerifiedEvent RolloutEvent = "RollingSpecVerifiedEvent"
// RollingInitializedEvent indicates that we have finished initializing all the workload resources
RollingInitializedEvent RolloutEvent = "RollingInitializedEvent"
// AllBatchFinishedEvent indicates that all batches are upgraded
AllBatchFinishedEvent RolloutEvent = "AllBatchFinishedEvent"
// RollingFinalizedEvent indicates that we have finalized the rollout which includes but not
// limited to the resource garbage collection
RollingFinalizedEvent RolloutEvent = "AllBatchFinishedEvent"
// InitializedOneBatchEvent indicates that we have successfully rolled out one batch
InitializedOneBatchEvent RolloutEvent = "InitializedOneBatchEvent"
// FinishedOneBatchEvent indicates that we have successfully rolled out one batch
FinishedOneBatchEvent RolloutEvent = "FinishedOneBatchEvent"
// RolloutOneBatchEvent indicates that we have rollout one batch
RolloutOneBatchEvent RolloutEvent = "RolloutOneBatchEvent"
// OneBatchAvailableEvent indicates that the batch resource is considered available
// this events comes after we have examine the pod readiness check and traffic shifting if needed
OneBatchAvailableEvent RolloutEvent = "OneBatchAvailable"
// BatchRolloutApprovedEvent indicates that we got the approval manually
BatchRolloutApprovedEvent RolloutEvent = "BatchRolloutApprovedEvent"
// BatchRolloutFailedEvent indicates that we are waiting for the approval of the
BatchRolloutFailedEvent RolloutEvent = "BatchRolloutFailedEvent"
)
// These are valid conditions of the rollout.
const (
// RolloutSpecVerifying indicates that the rollout just started with verification
RolloutSpecVerifying runtimev1alpha1.ConditionType = "RolloutSpecVerifying"
// RolloutInitializing means we start to initialize the cluster
RolloutInitializing runtimev1alpha1.ConditionType = "RolloutInitializing"
// RolloutInProgress means we are upgrading resources.
RolloutInProgress runtimev1alpha1.ConditionType = "RolloutInProgress"
// RolloutFinalizing means the rollout is finalizing
RolloutFinalizing runtimev1alpha1.ConditionType = "RolloutFinalizing"
// RolloutFailing means the rollout is failing
RolloutFailing runtimev1alpha1.ConditionType = "RolloutFailing"
// RolloutAbandoning means that the rollout is being abandoned.
RolloutAbandoning runtimev1alpha1.ConditionType = "RolloutAbandoning"
// RolloutDeleting means that the rollout is being deleted.
RolloutDeleting runtimev1alpha1.ConditionType = "RolloutDeleting"
// RolloutFailed means that the rollout failed.
RolloutFailed runtimev1alpha1.ConditionType = "RolloutFailed"
// RolloutSucceed means that the rollout is done.
RolloutSucceed runtimev1alpha1.ConditionType = "RolloutSucceed"
// BatchInitializing
BatchInitializing runtimev1alpha1.ConditionType = "BatchInitializing"
// BatchPaused
BatchPaused runtimev1alpha1.ConditionType = "BatchPaused"
// BatchVerifying
BatchVerifying runtimev1alpha1.ConditionType = "BatchVerifying"
// BatchRolloutFailed
BatchRolloutFailed runtimev1alpha1.ConditionType = "BatchRolloutFailed"
// BatchFinalizing
BatchFinalizing runtimev1alpha1.ConditionType = "BatchFinalizing"
// BatchReady
BatchReady runtimev1alpha1.ConditionType = "BatchReady"
)
// NewPositiveCondition creates a positive condition type
func NewPositiveCondition(condType runtimev1alpha1.ConditionType) runtimev1alpha1.Condition {
return runtimev1alpha1.Condition{
Type: condType,
Status: v1.ConditionTrue,
LastTransitionTime: metav1.NewTime(time.Now()),
}
}
// NewNegativeCondition creates a false condition type
func NewNegativeCondition(condType runtimev1alpha1.ConditionType, message string) runtimev1alpha1.Condition {
return runtimev1alpha1.Condition{
Type: condType,
Status: v1.ConditionFalse,
LastTransitionTime: metav1.NewTime(time.Now()),
Message: message,
}
}
const invalidRollingStateTransition = "the rollout state transition from `%s` state with `%s` is invalid"
const invalidBatchRollingStateTransition = "the batch rolling state transition from `%s` state with `%s` is invalid"
func (r *RolloutStatus) getRolloutConditionType() runtimev1alpha1.ConditionType {
// figure out which condition type should we put in the condition depends on its state
switch r.RollingState {
case VerifyingSpecState:
return RolloutSpecVerifying
case InitializingState:
return RolloutInitializing
case RollingInBatchesState:
switch r.BatchRollingState {
case BatchInitializingState:
return BatchInitializing
case BatchVerifyingState:
return BatchVerifying
case BatchFinalizingState:
return BatchFinalizing
case BatchRolloutFailedState:
return BatchRolloutFailed
case BatchReadyState:
return BatchReady
default:
return RolloutInProgress
}
case FinalisingState:
return RolloutFinalizing
case RolloutFailingState:
return RolloutFailing
case RolloutAbandoningState:
return RolloutAbandoning
case RolloutDeletingState:
return RolloutDeleting
case RolloutSucceedState:
return RolloutSucceed
default:
return RolloutFailed
}
}
// RolloutRetry is a special state transition since we need an error message
func (r *RolloutStatus) RolloutRetry(reason string) {
// we can still retry, no change on the state
r.SetConditions(NewNegativeCondition(r.getRolloutConditionType(), reason))
}
// RolloutFailed is a special state transition since we need an error message
func (r *RolloutStatus) RolloutFailed(reason string) {
// set the condition first which depends on the state
r.SetConditions(NewNegativeCondition(r.getRolloutConditionType(), reason))
r.RollingState = RolloutFailedState
}
// RolloutFailing is a special state transition that always moves the rollout state to the failing state
func (r *RolloutStatus) RolloutFailing(reason string) {
// set the condition first which depends on the state
r.SetConditions(NewNegativeCondition(r.getRolloutConditionType(), reason))
r.RollingState = RolloutFailingState
r.BatchRollingState = BatchInitializingState
}
// ResetStatus resets the status of the rollout to start from beginning
func (r *RolloutStatus) ResetStatus() {
r.NewPodTemplateIdentifier = ""
r.RolloutTargetSize = -1
r.LastAppliedPodTemplateIdentifier = ""
r.RollingState = LocatingTargetAppState
r.BatchRollingState = BatchInitializingState
r.CurrentBatch = 0
r.UpgradedReplicas = 0
r.UpgradedReadyReplicas = 0
}
// SetRolloutCondition sets the supplied condition, replacing any existing condition
// of the same type unless they are identical.
func (r *RolloutStatus) SetRolloutCondition(new runtimev1alpha1.Condition) {
exists := false
for i, existing := range r.Conditions {
if existing.Type != new.Type {
continue
}
// we want to update the condition when the LTT changes
if existing.Type == new.Type &&
existing.Status == new.Status &&
existing.Reason == new.Reason &&
existing.Message == new.Message &&
existing.LastTransitionTime == new.LastTransitionTime {
exists = true
continue
}
r.Conditions[i] = new
exists = true
}
if !exists {
r.Conditions = append(r.Conditions, new)
}
}
// we can't panic since it will crash the other controllers
func (r *RolloutStatus) illegalStateTransition(err error) {
r.RolloutFailed(err.Error())
}
// StateTransition is the center place to do rollout state transition
// it returns an error if the transition is invalid
// it changes the coming rollout state if it's valid
func (r *RolloutStatus) StateTransition(event RolloutEvent) {
rollingState := r.RollingState
batchRollingState := r.BatchRollingState
defer func() {
klog.InfoS("try to execute a rollout state transition",
"pre rolling state", rollingState,
"pre batch rolling state", batchRollingState,
"post rolling state", r.RollingState,
"post batch rolling state", r.BatchRollingState)
}()
// we have special transition for these types of event since they require additional info
if event == RollingFailedEvent || event == RollingRetriableFailureEvent {
r.illegalStateTransition(fmt.Errorf(invalidRollingStateTransition, rollingState, event))
return
}
// special handle modified event here
if event == RollingModifiedEvent {
if r.RollingState == RolloutDeletingState {
r.illegalStateTransition(fmt.Errorf(invalidRollingStateTransition, rollingState, event))
return
}
if r.RollingState == RolloutFailedState || r.RollingState == RolloutSucceedState {
r.ResetStatus()
} else {
r.SetRolloutCondition(NewNegativeCondition(r.getRolloutConditionType(), "Rollout Spec is modified"))
r.RollingState = RolloutAbandoningState
r.BatchRollingState = BatchInitializingState
}
return
}
// special handle deleted event here, it can happen at many states
if event == RollingDeletedEvent {
if r.RollingState == RolloutFailedState || r.RollingState == RolloutSucceedState {
r.illegalStateTransition(fmt.Errorf(invalidRollingStateTransition, rollingState, event))
return
}
r.SetRolloutCondition(NewNegativeCondition(r.getRolloutConditionType(), "Rollout is being deleted"))
r.RollingState = RolloutDeletingState
r.BatchRollingState = BatchInitializingState
return
}
// special handle appLocatedEvent event here, it only applies to one state but it's legal to happen at other states
if event == AppLocatedEvent {
if r.RollingState == LocatingTargetAppState {
r.RollingState = VerifyingSpecState
}
return
}
switch rollingState {
case VerifyingSpecState:
if event == RollingSpecVerifiedEvent {
r.SetRolloutCondition(NewPositiveCondition(r.getRolloutConditionType()))
r.RollingState = InitializingState
return
}
r.illegalStateTransition(fmt.Errorf(invalidRollingStateTransition, rollingState, event))
case InitializingState:
if event == RollingInitializedEvent {
r.SetRolloutCondition(NewPositiveCondition(r.getRolloutConditionType()))
r.RollingState = RollingInBatchesState
r.BatchRollingState = BatchInitializingState
return
}
r.illegalStateTransition(fmt.Errorf(invalidRollingStateTransition, rollingState, event))
case RollingInBatchesState:
r.batchStateTransition(event)
return
case RolloutAbandoningState:
if event == RollingFinalizedEvent {
r.SetRolloutCondition(NewPositiveCondition(r.getRolloutConditionType()))
r.ResetStatus()
return
}
r.illegalStateTransition(fmt.Errorf(invalidRollingStateTransition, rollingState, event))
case RolloutDeletingState:
if event == RollingFinalizedEvent {
r.SetRolloutCondition(NewPositiveCondition(r.getRolloutConditionType()))
r.RollingState = RolloutFailedState
return
}
r.illegalStateTransition(fmt.Errorf(invalidRollingStateTransition, rollingState, event))
case FinalisingState:
if event == RollingFinalizedEvent {
r.SetRolloutCondition(NewPositiveCondition(r.getRolloutConditionType()))
r.RollingState = RolloutSucceedState
return
}
r.illegalStateTransition(fmt.Errorf(invalidRollingStateTransition, rollingState, event))
case RolloutFailingState:
if event == RollingFinalizedEvent {
r.SetRolloutCondition(NewPositiveCondition(r.getRolloutConditionType()))
r.RollingState = RolloutFailedState
return
}
r.illegalStateTransition(fmt.Errorf(invalidRollingStateTransition, rollingState, event))
case RolloutSucceedState, RolloutFailedState:
r.illegalStateTransition(fmt.Errorf(invalidRollingStateTransition, rollingState, event))
default:
r.illegalStateTransition(fmt.Errorf("invalid rolling state %s before transition", rollingState))
}
}
// batchStateTransition handles the state transition when the rollout is in action
func (r *RolloutStatus) batchStateTransition(event RolloutEvent) {
batchRollingState := r.BatchRollingState
if event == BatchRolloutFailedEvent {
r.BatchRollingState = BatchRolloutFailedState
r.RollingState = RolloutFailedState
r.SetConditions(NewNegativeCondition(r.getRolloutConditionType(), "failed"))
return
}
switch batchRollingState {
case BatchInitializingState:
if event == InitializedOneBatchEvent {
r.BatchRollingState = BatchInRollingState
return
}
r.illegalStateTransition(fmt.Errorf(invalidBatchRollingStateTransition, batchRollingState, event))
case BatchInRollingState:
if event == RolloutOneBatchEvent {
r.SetRolloutCondition(NewPositiveCondition(r.getRolloutConditionType()))
r.BatchRollingState = BatchVerifyingState
return
}
r.illegalStateTransition(fmt.Errorf(invalidBatchRollingStateTransition, batchRollingState, event))
case BatchVerifyingState:
if event == OneBatchAvailableEvent {
r.SetRolloutCondition(NewPositiveCondition(r.getRolloutConditionType()))
r.BatchRollingState = BatchFinalizingState
return
}
r.illegalStateTransition(fmt.Errorf(invalidBatchRollingStateTransition, batchRollingState, event))
case BatchFinalizingState:
if event == FinishedOneBatchEvent {
r.SetRolloutCondition(NewPositiveCondition(r.getRolloutConditionType()))
r.BatchRollingState = BatchReadyState
return
}
if event == AllBatchFinishedEvent {
r.SetRolloutCondition(NewPositiveCondition(r.getRolloutConditionType()))
// transition out of the batch loop
r.BatchRollingState = BatchReadyState
r.RollingState = FinalisingState
return
}
r.illegalStateTransition(fmt.Errorf(invalidBatchRollingStateTransition, batchRollingState, event))
case BatchReadyState:
if event == BatchRolloutApprovedEvent {
r.SetRolloutCondition(NewPositiveCondition(r.getRolloutConditionType()))
r.BatchRollingState = BatchInitializingState
r.CurrentBatch++
return
}
r.illegalStateTransition(fmt.Errorf(invalidBatchRollingStateTransition, batchRollingState, event))
default:
r.illegalStateTransition(fmt.Errorf("invalid batch rolling state %s", batchRollingState))
}
}

View File

@@ -0,0 +1,88 @@
/*
Copyright 2021 The KubeVela Authors.
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 (
runtimev1alpha1 "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"github.com/oam-dev/kubevela/pkg/oam"
)
// RolloutTraitSpec defines the desired state of RolloutTrait
type RolloutTraitSpec struct {
// TargetRef references a target resource that contains the newer version
// of the software. We assumed that new resource already exists.
// This is the only resource we work on if the resource is a stateful resource (cloneset/statefulset)
TargetRef runtimev1alpha1.TypedReference `json:"targetRef"`
// SourceRef references the list of resources that contains the older version
// of the software. We assume that it's the first time to deploy when we cannot find any source.
// +optional
SourceRef []runtimev1alpha1.TypedReference `json:"sourceRef,omitempty"`
// RolloutPlan is the details on how to rollout the resources
RolloutPlan RolloutPlan `json:"rolloutPlan"`
}
// RolloutTrait is the Schema for the RolloutTrait API
// +kubebuilder:object:root=true
// +genclient
// +kubebuilder:resource:categories={oam}
// +kubebuilder:subresource:status
type RolloutTrait struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec RolloutTraitSpec `json:"spec,omitempty"`
Status RolloutStatus `json:"status,omitempty"`
}
// RolloutTraitList contains a list of RolloutTrait
// +kubebuilder:object:root=true
// +genclient
type RolloutTraitList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []RolloutTrait `json:"items"`
}
func init() {
SchemeBuilder.Register(&RolloutTrait{}, &RolloutTraitList{})
}
var _ oam.Trait = &RolloutTrait{}
// SetConditions for set CR condition
func (tr *RolloutTrait) SetConditions(c ...runtimev1alpha1.Condition) {
tr.Status.SetConditions(c...)
}
// GetCondition for get CR condition
func (tr *RolloutTrait) GetCondition(c runtimev1alpha1.ConditionType) runtimev1alpha1.Condition {
return tr.Status.GetCondition(c)
}
// GetWorkloadReference of this MetricsTrait.
func (tr *RolloutTrait) GetWorkloadReference() runtimev1alpha1.TypedReference {
return tr.Spec.TargetRef
}
// SetWorkloadReference of this MetricsTrait.
func (tr *RolloutTrait) SetWorkloadReference(r runtimev1alpha1.TypedReference) {
tr.Spec.TargetRef = r
}

View File

@@ -1,7 +1,7 @@
// +build !ignore_autogenerated
/*
Copyright 2021 The KubeVela Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -22,35 +22,62 @@ package v1alpha1
import (
corev1alpha1 "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1"
"k8s.io/api/networking/v1beta1"
runtime "k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/util/intstr"
)
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Backend) DeepCopyInto(out *Backend) {
func (in *CanaryMetric) DeepCopyInto(out *CanaryMetric) {
*out = *in
out.Port = in.Port
if in.SelectLabels != nil {
in, out := &in.SelectLabels, &out.SelectLabels
*out = make(map[string]string, len(*in))
for key, val := range *in {
(*out)[key] = val
}
if in.MetricsRange != nil {
in, out := &in.MetricsRange, &out.MetricsRange
*out = new(MetricsExpectedRange)
(*in).DeepCopyInto(*out)
}
if in.TemplateRef != nil {
in, out := &in.TemplateRef, &out.TemplateRef
*out = new(corev1alpha1.TypedReference)
**out = **in
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Backend.
func (in *Backend) DeepCopy() *Backend {
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CanaryMetric.
func (in *CanaryMetric) DeepCopy() *CanaryMetric {
if in == nil {
return nil
}
out := new(Backend)
out := new(CanaryMetric)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Containerized) DeepCopyInto(out *Containerized) {
func (in *MetricsExpectedRange) DeepCopyInto(out *MetricsExpectedRange) {
*out = *in
if in.Min != nil {
in, out := &in.Min, &out.Min
*out = new(intstr.IntOrString)
**out = **in
}
if in.Max != nil {
in, out := &in.Max, &out.Max
*out = new(intstr.IntOrString)
**out = **in
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MetricsExpectedRange.
func (in *MetricsExpectedRange) DeepCopy() *MetricsExpectedRange {
if in == nil {
return nil
}
out := new(MetricsExpectedRange)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *PodSpecWorkload) DeepCopyInto(out *PodSpecWorkload) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
@@ -58,18 +85,18 @@ func (in *Containerized) DeepCopyInto(out *Containerized) {
in.Status.DeepCopyInto(&out.Status)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Containerized.
func (in *Containerized) DeepCopy() *Containerized {
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodSpecWorkload.
func (in *PodSpecWorkload) DeepCopy() *PodSpecWorkload {
if in == nil {
return nil
}
out := new(Containerized)
out := new(PodSpecWorkload)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *Containerized) DeepCopyObject() runtime.Object {
func (in *PodSpecWorkload) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
@@ -77,31 +104,31 @@ func (in *Containerized) DeepCopyObject() runtime.Object {
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ContainerizedList) DeepCopyInto(out *ContainerizedList) {
func (in *PodSpecWorkloadList) DeepCopyInto(out *PodSpecWorkloadList) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ListMeta.DeepCopyInto(&out.ListMeta)
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]Containerized, len(*in))
*out = make([]PodSpecWorkload, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ContainerizedList.
func (in *ContainerizedList) DeepCopy() *ContainerizedList {
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodSpecWorkloadList.
func (in *PodSpecWorkloadList) DeepCopy() *PodSpecWorkloadList {
if in == nil {
return nil
}
out := new(ContainerizedList)
out := new(PodSpecWorkloadList)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *ContainerizedList) DeepCopyObject() runtime.Object {
func (in *PodSpecWorkloadList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
@@ -109,7 +136,7 @@ func (in *ContainerizedList) DeepCopyObject() runtime.Object {
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ContainerizedSpec) DeepCopyInto(out *ContainerizedSpec) {
func (in *PodSpecWorkloadSpec) DeepCopyInto(out *PodSpecWorkloadSpec) {
*out = *in
if in.Replicas != nil {
in, out := &in.Replicas, &out.Replicas
@@ -119,18 +146,18 @@ func (in *ContainerizedSpec) DeepCopyInto(out *ContainerizedSpec) {
in.PodSpec.DeepCopyInto(&out.PodSpec)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ContainerizedSpec.
func (in *ContainerizedSpec) DeepCopy() *ContainerizedSpec {
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodSpecWorkloadSpec.
func (in *PodSpecWorkloadSpec) DeepCopy() *PodSpecWorkloadSpec {
if in == nil {
return nil
}
out := new(ContainerizedSpec)
out := new(PodSpecWorkloadSpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ContainerizedStatus) DeepCopyInto(out *ContainerizedStatus) {
func (in *PodSpecWorkloadStatus) DeepCopyInto(out *PodSpecWorkloadStatus) {
*out = *in
in.ConditionedStatus.DeepCopyInto(&out.ConditionedStatus)
if in.Resources != nil {
@@ -140,115 +167,130 @@ func (in *ContainerizedStatus) DeepCopyInto(out *ContainerizedStatus) {
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ContainerizedStatus.
func (in *ContainerizedStatus) DeepCopy() *ContainerizedStatus {
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodSpecWorkloadStatus.
func (in *PodSpecWorkloadStatus) DeepCopy() *PodSpecWorkloadStatus {
if in == nil {
return nil
}
out := new(ContainerizedStatus)
out := new(PodSpecWorkloadStatus)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *MetricsTrait) DeepCopyInto(out *MetricsTrait) {
func (in *RolloutBatch) DeepCopyInto(out *RolloutBatch) {
*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 MetricsTrait.
func (in *MetricsTrait) DeepCopy() *MetricsTrait {
if in == nil {
return nil
}
out := new(MetricsTrait)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *MetricsTrait) 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 *MetricsTraitList) DeepCopyInto(out *MetricsTraitList) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ListMeta.DeepCopyInto(&out.ListMeta)
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]MetricsTrait, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MetricsTraitList.
func (in *MetricsTraitList) DeepCopy() *MetricsTraitList {
if in == nil {
return nil
}
out := new(MetricsTraitList)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *MetricsTraitList) 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 *MetricsTraitSpec) DeepCopyInto(out *MetricsTraitSpec) {
*out = *in
in.ScrapeService.DeepCopyInto(&out.ScrapeService)
out.WorkloadReference = in.WorkloadReference
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MetricsTraitSpec.
func (in *MetricsTraitSpec) DeepCopy() *MetricsTraitSpec {
if in == nil {
return nil
}
out := new(MetricsTraitSpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *MetricsTraitStatus) DeepCopyInto(out *MetricsTraitStatus) {
*out = *in
in.ConditionedStatus.DeepCopyInto(&out.ConditionedStatus)
if in.ServiceMonitorNames != nil {
in, out := &in.ServiceMonitorNames, &out.ServiceMonitorNames
out.Replicas = in.Replicas
if in.PodList != nil {
in, out := &in.PodList, &out.PodList
*out = make([]string, len(*in))
copy(*out, *in)
}
if in.MaxUnavailable != nil {
in, out := &in.MaxUnavailable, &out.MaxUnavailable
*out = new(intstr.IntOrString)
**out = **in
}
if in.InstanceInterval != nil {
in, out := &in.InstanceInterval, &out.InstanceInterval
*out = new(int32)
**out = **in
}
if in.BatchRolloutWebhooks != nil {
in, out := &in.BatchRolloutWebhooks, &out.BatchRolloutWebhooks
*out = make([]RolloutWebhook, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
if in.CanaryMetric != nil {
in, out := &in.CanaryMetric, &out.CanaryMetric
*out = make([]CanaryMetric, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MetricsTraitStatus.
func (in *MetricsTraitStatus) DeepCopy() *MetricsTraitStatus {
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RolloutBatch.
func (in *RolloutBatch) DeepCopy() *RolloutBatch {
if in == nil {
return nil
}
out := new(MetricsTraitStatus)
out := new(RolloutBatch)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Route) DeepCopyInto(out *Route) {
func (in *RolloutPlan) DeepCopyInto(out *RolloutPlan) {
*out = *in
if in.TargetSize != nil {
in, out := &in.TargetSize, &out.TargetSize
*out = new(int32)
**out = **in
}
if in.NumBatches != nil {
in, out := &in.NumBatches, &out.NumBatches
*out = new(int32)
**out = **in
}
if in.RolloutBatches != nil {
in, out := &in.RolloutBatches, &out.RolloutBatches
*out = make([]RolloutBatch, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
if in.BatchPartition != nil {
in, out := &in.BatchPartition, &out.BatchPartition
*out = new(int32)
**out = **in
}
if in.RolloutWebhooks != nil {
in, out := &in.RolloutWebhooks, &out.RolloutWebhooks
*out = make([]RolloutWebhook, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
if in.CanaryMetric != nil {
in, out := &in.CanaryMetric, &out.CanaryMetric
*out = make([]CanaryMetric, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RolloutPlan.
func (in *RolloutPlan) DeepCopy() *RolloutPlan {
if in == nil {
return nil
}
out := new(RolloutPlan)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *RolloutStatus) DeepCopyInto(out *RolloutStatus) {
*out = *in
in.ConditionedStatus.DeepCopyInto(&out.ConditionedStatus)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RolloutStatus.
func (in *RolloutStatus) DeepCopy() *RolloutStatus {
if in == nil {
return nil
}
out := new(RolloutStatus)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *RolloutTrait) DeepCopyInto(out *RolloutTrait) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
@@ -256,18 +298,18 @@ func (in *Route) DeepCopyInto(out *Route) {
in.Status.DeepCopyInto(&out.Status)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Route.
func (in *Route) DeepCopy() *Route {
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RolloutTrait.
func (in *RolloutTrait) DeepCopy() *RolloutTrait {
if in == nil {
return nil
}
out := new(Route)
out := new(RolloutTrait)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *Route) DeepCopyObject() runtime.Object {
func (in *RolloutTrait) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
@@ -275,31 +317,31 @@ func (in *Route) DeepCopyObject() runtime.Object {
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *RouteList) DeepCopyInto(out *RouteList) {
func (in *RolloutTraitList) DeepCopyInto(out *RolloutTraitList) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ListMeta.DeepCopyInto(&out.ListMeta)
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]Route, len(*in))
*out = make([]RolloutTrait, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RouteList.
func (in *RouteList) DeepCopy() *RouteList {
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RolloutTraitList.
func (in *RolloutTraitList) DeepCopy() *RolloutTraitList {
if in == nil {
return nil
}
out := new(RouteList)
out := new(RolloutTraitList)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *RouteList) DeepCopyObject() runtime.Object {
func (in *RolloutTraitList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
@@ -307,108 +349,76 @@ func (in *RouteList) DeepCopyObject() runtime.Object {
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *RouteSpec) DeepCopyInto(out *RouteSpec) {
func (in *RolloutTraitSpec) DeepCopyInto(out *RolloutTraitSpec) {
*out = *in
out.WorkloadReference = in.WorkloadReference
if in.TLS != nil {
in, out := &in.TLS, &out.TLS
*out = new(TLS)
**out = **in
out.TargetRef = in.TargetRef
if in.SourceRef != nil {
in, out := &in.SourceRef, &out.SourceRef
*out = make([]corev1alpha1.TypedReference, len(*in))
copy(*out, *in)
}
if in.DefaultBackend != nil {
in, out := &in.DefaultBackend, &out.DefaultBackend
*out = new(v1beta1.IngressBackend)
(*in).DeepCopyInto(*out)
in.RolloutPlan.DeepCopyInto(&out.RolloutPlan)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RolloutTraitSpec.
func (in *RolloutTraitSpec) DeepCopy() *RolloutTraitSpec {
if in == nil {
return nil
}
if in.CustomHeaders != nil {
in, out := &in.CustomHeaders, &out.CustomHeaders
out := new(RolloutTraitSpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *RolloutWebhook) DeepCopyInto(out *RolloutWebhook) {
*out = *in
if in.ExpectedStatus != nil {
in, out := &in.ExpectedStatus, &out.ExpectedStatus
*out = make([]int, len(*in))
copy(*out, *in)
}
if in.Metadata != nil {
in, out := &in.Metadata, &out.Metadata
*out = new(map[string]string)
if **in != nil {
in, out := *in, *out
*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 RolloutWebhook.
func (in *RolloutWebhook) DeepCopy() *RolloutWebhook {
if in == nil {
return nil
}
out := new(RolloutWebhook)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *RolloutWebhookPayload) DeepCopyInto(out *RolloutWebhookPayload) {
*out = *in
if in.Metadata != nil {
in, out := &in.Metadata, &out.Metadata
*out = make(map[string]string, len(*in))
for key, val := range *in {
(*out)[key] = val
}
}
if in.Backend != nil {
in, out := &in.Backend, &out.Backend
*out = new(Backend)
(*in).DeepCopyInto(*out)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RouteSpec.
func (in *RouteSpec) DeepCopy() *RouteSpec {
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RolloutWebhookPayload.
func (in *RolloutWebhookPayload) DeepCopy() *RolloutWebhookPayload {
if in == nil {
return nil
}
out := new(RouteSpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *RouteStatus) DeepCopyInto(out *RouteStatus) {
*out = *in
if in.Ingress != nil {
in, out := &in.Ingress, &out.Ingress
*out = new(corev1alpha1.TypedReference)
**out = **in
}
if in.Service != nil {
in, out := &in.Service, &out.Service
*out = new(corev1alpha1.TypedReference)
**out = **in
}
in.ConditionedStatus.DeepCopyInto(&out.ConditionedStatus)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RouteStatus.
func (in *RouteStatus) DeepCopy() *RouteStatus {
if in == nil {
return nil
}
out := new(RouteStatus)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ScapeServiceEndPoint) DeepCopyInto(out *ScapeServiceEndPoint) {
*out = *in
out.TargetPort = in.TargetPort
if in.TargetSelector != nil {
in, out := &in.TargetSelector, &out.TargetSelector
*out = make(map[string]string, len(*in))
for key, val := range *in {
(*out)[key] = val
}
}
if in.Enabled != nil {
in, out := &in.Enabled, &out.Enabled
*out = new(bool)
**out = **in
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ScapeServiceEndPoint.
func (in *ScapeServiceEndPoint) DeepCopy() *ScapeServiceEndPoint {
if in == nil {
return nil
}
out := new(ScapeServiceEndPoint)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *TLS) DeepCopyInto(out *TLS) {
*out = *in
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TLS.
func (in *TLS) DeepCopy() *TLS {
if in == nil {
return nil
}
out := new(TLS)
out := new(RolloutWebhookPayload)
in.DeepCopyInto(out)
return out
}

237
apis/types/capability.go Normal file
View File

@@ -0,0 +1,237 @@
/*
Copyright 2021 The KubeVela Authors.
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 types
import (
"encoding/json"
"cuelang.org/go/cue"
"github.com/google/go-cmp/cmp"
"github.com/spf13/pflag"
)
// Source record the source of Capability
type Source struct {
RepoName string `json:"repoName"`
ChartName string `json:"chartName,omitempty"`
}
// CRDInfo record the CRD info of the Capability
type CRDInfo struct {
APIVersion string `json:"apiVersion"`
Kind string `json:"kind"`
}
// Capability defines the content of a capability
type Capability struct {
Name string `json:"name"`
Type CapType `json:"type"`
CueTemplate string `json:"template,omitempty"`
CueTemplateURI string `json:"templateURI,omitempty"`
Parameters []Parameter `json:"parameters,omitempty"`
CrdName string `json:"crdName,omitempty"`
Center string `json:"center,omitempty"`
Status string `json:"status,omitempty"`
Description string `json:"description,omitempty"`
// trait only
AppliesTo []string `json:"appliesTo,omitempty"`
// Namespace represents it's a system-level or user-level capability.
Namespace string `json:"namespace,omitempty"`
// Plugin Source
Source *Source `json:"source,omitempty"`
Install *Installation `json:"install,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"`
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 (
// TypeComponentDefinition represents OAM ComponentDefinition
TypeComponentDefinition CapType = "componentDefinition"
// TypeWorkload represents OAM Workload
TypeWorkload CapType = "workload"
// TypeTrait represents OAM Trait
TypeTrait CapType = "trait"
// TypeScope represent OAM Scope
TypeScope CapType = "scope"
)
// CapabilityConfigMapNamePrefix is the prefix for capability ConfigMap name
const CapabilityConfigMapNamePrefix = "schema-"
const (
// OpenapiV3JSONSchema is the key to store OpenAPI v3 JSON schema in ConfigMap
OpenapiV3JSONSchema string = "openapi-v3-json-schema"
)
// CapabilityCategory defines the category of a capability
type CapabilityCategory string
// categories of capability schematic
const (
TerraformCategory CapabilityCategory = "terraform"
HelmCategory CapabilityCategory = "helm"
KubeCategory CapabilityCategory = "kube"
CUECategory CapabilityCategory = "cue"
)
// Parameter defines a parameter for cli from capability template
type Parameter struct {
Name string `json:"name"`
Short string `json:"short,omitempty"`
Required bool `json:"required,omitempty"`
Default interface{} `json:"default,omitempty"`
Usage string `json:"usage,omitempty"`
Type cue.Kind `json:"type,omitempty"`
Alias string `json:"alias,omitempty"`
}
// SetFlagBy set cli flag from Parameter
func SetFlagBy(flags *pflag.FlagSet, v Parameter) {
name := v.Name
if v.Alias != "" {
name = v.Alias
}
// nolint:exhaustive
switch v.Type {
case cue.IntKind:
var vv int64
switch val := v.Default.(type) {
case int64:
vv = val
case json.Number:
vv, _ = val.Int64()
case int:
vv = int64(val)
case float64:
vv = int64(val)
}
flags.Int64P(name, v.Short, vv, v.Usage)
case cue.StringKind:
flags.StringP(name, v.Short, v.Default.(string), v.Usage)
case cue.BoolKind:
flags.BoolP(name, v.Short, v.Default.(bool), v.Usage)
case cue.NumberKind, cue.FloatKind:
var vv float64
switch val := v.Default.(type) {
case int64:
vv = float64(val)
case json.Number:
vv, _ = val.Float64()
case int:
vv = float64(val)
case float64:
vv = val
}
flags.Float64P(name, v.Short, vv, v.Usage)
default:
// other types not supported yet
}
}
// 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
}
// nolint:exhaustive
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
default:
// complex type not supported, will regard them as not changed.
}
return true
})}
// EqualCapability will check whether two capabilities is equal
func EqualCapability(a, b Capability) bool {
return cmp.Equal(a, b, CapabilityCmpOptions...)
}

31
apis/types/rolling.go Normal file
View File

@@ -0,0 +1,31 @@
/*
Copyright 2021 The KubeVela Authors.
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 types
// RollingStatus represents the rollout phases
type RollingStatus string
const (
// RollingTemplating means that the AC is rolling and need template
RollingTemplating RollingStatus = "RollingTemplating"
// RollingTemplated means that the AC is rolling and it already templated
RollingTemplated RollingStatus = "RollingTemplated"
// RollingCompleted means that the AC is the new active revision of the application
RollingCompleted RollingStatus = "RollingCompleted"
// InactiveAfterRollingCompleted means that the AC is the inactive revision after the rolling is finished
InactiveAfterRollingCompleted RollingStatus = "InactiveAfterRollingCompleted"
)

69
apis/types/types.go Normal file
View File

@@ -0,0 +1,69 @@
/*
Copyright 2021 The KubeVela Authors.
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 types
const (
// 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 (
// AnnDescription is the annotation which describe what is the capability used for in a WorkloadDefinition/TraitDefinition Object
AnnDescription = "definition.oam.dev/description"
)
const (
// StatusDeployed represents the App was deployed
StatusDeployed = "Deployed"
// 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"`
Email string `json:"email,omitempty"`
Domain string `json:"domain,omitempty"`
Current string `json:"current,omitempty"`
}
const (
// TagCommandType used for tag cli category
TagCommandType = "commandType"
// 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"
// TypePlugin defines one category used in Kubectl Plugin
TypePlugin = "Debug and Test"
)

View File

@@ -1,44 +0,0 @@
#!/bin/bash
# Copyright 2019 The Knative Authors
#
# 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.
#!/usr/bin/env bash
# Download and unpack cert-manager
CERT_MANAGER_VERSION=1.0.0
ARCHIVE_DOWNLOAD_URL=https://github.com/jetstack/cert-manager/archive/v${CERT_MANAGER_VERSION}.tar.gz
YAML_URL=https://github.com/jetstack/cert-manager/releases/download/v${CERT_MANAGER_VERSION}/cert-manager.yaml
wget $ARCHIVE_DOWNLOAD_URL
tar xzf v${CERT_MANAGER_VERSION}.tar.gz
(
# subshell in downloaded directory
cd cert-manager-${CERT_MANAGER_VERSION} || exit
# Copy the CRD yaml file
cp deploy/manifests/00-crds.yaml ../cert-manager-crds.yaml
)
# Download the cert-manager yaml file
wget $YAML_URL
# Clean up.
rm -rf cert-manager-${CERT_MANAGER_VERSION}
rm v${CERT_MANAGER_VERSION}.tar.gz
# Add enable-certificate-owner-ref option to cert-manager's controller.
# The option is to cleans up secret(certificate) by adding ownerref.
patch -l cert-manager.yaml owner-ref.patch

View File

@@ -1,4 +0,0 @@
#!/bin/bash
# Download and unpack operator Lifecycle Manager (coreos)
curl -sL https://github.com/operator-framework/operator-lifecycle-manager/releases/download/0.15.1/install.sh | bash -s 0.15.1

View File

@@ -1,24 +0,0 @@
apiVersion: v1
kind: Namespace
metadata:
name: my-grafana-operator
---
apiVersion: operators.coreos.com/v1
kind: OperatorGroup
metadata:
name: operatorgroup
namespace: my-grafana-operator
spec:
targetNamespaces:
- my-grafana-operator
---
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
name: my-grafana-operator
namespace: my-grafana-operator
spec:
channel: alpha
name: grafana-operator
source: operatorhubio-catalog
sourceNamespace: olm

View File

@@ -1,6 +0,0 @@
apiVersion: v1
kind: Namespace
metadata:
labels:
mornitoring: oam
name: monitoring

View File

@@ -1,265 +0,0 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.2.4
creationTimestamp: null
name: podmonitors.monitoring.coreos.com
spec:
group: monitoring.coreos.com
names:
kind: PodMonitor
listKind: PodMonitorList
plural: podmonitors
singular: podmonitor
scope: Namespaced
versions:
- name: v1
schema:
openAPIV3Schema:
description: PodMonitor defines monitoring for a set of pods.
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: Specification of desired Pod selection for target discovery
by Prometheus.
properties:
jobLabel:
description: The label to use to retrieve the job name from.
type: string
namespaceSelector:
description: Selector to select which namespaces the Endpoints objects
are discovered from.
properties:
any:
description: Boolean describing whether all namespaces are selected
in contrast to a list restricting them.
type: boolean
matchNames:
description: List of namespace names.
items:
type: string
type: array
type: object
podMetricsEndpoints:
description: A list of endpoints allowed as part of this PodMonitor.
items:
description: PodMetricsEndpoint defines a scrapeable endpoint of
a Kubernetes Pod serving Prometheus metrics.
properties:
honorLabels:
description: HonorLabels chooses the metric's labels on collisions
with target labels.
type: boolean
honorTimestamps:
description: HonorTimestamps controls whether Prometheus respects
the timestamps present in scraped data.
type: boolean
interval:
description: Interval at which metrics should be scraped
type: string
metricRelabelings:
description: MetricRelabelConfigs to apply to samples before
ingestion.
items:
description: 'RelabelConfig allows dynamic rewriting of the
label set, being applied to samples before ingestion. It
defines `<metric_relabel_configs>`-section of Prometheus
configuration. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs'
properties:
action:
description: Action to perform based on regex matching.
Default is 'replace'
type: string
modulus:
description: Modulus to take of the hash of the source
label values.
format: int64
type: integer
regex:
description: Regular expression against which the extracted
value is matched. Default is '(.*)'
type: string
replacement:
description: Replacement value against which a regex replace
is performed if the regular expression matches. Regex
capture groups are available. Default is '$1'
type: string
separator:
description: Separator placed between concatenated source
label values. default is ';'.
type: string
sourceLabels:
description: The source labels select values from existing
labels. Their content is concatenated using the configured
separator and matched against the configured regular
expression for the replace, keep, and drop actions.
items:
type: string
type: array
targetLabel:
description: Label to which the resulting value is written
in a replace action. It is mandatory for replace actions.
Regex capture groups are available.
type: string
type: object
type: array
params:
additionalProperties:
items:
type: string
type: array
description: Optional HTTP URL parameters
type: object
path:
description: HTTP path to scrape for metrics.
type: string
port:
description: Name of the pod port this endpoint refers to. Mutually
exclusive with targetPort.
type: string
proxyUrl:
description: ProxyURL eg http://proxyserver:2195 Directs scrapes
to proxy through this endpoint.
type: string
relabelings:
description: 'RelabelConfigs to apply to samples before ingestion.
More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config'
items:
description: 'RelabelConfig allows dynamic rewriting of the
label set, being applied to samples before ingestion. It
defines `<metric_relabel_configs>`-section of Prometheus
configuration. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs'
properties:
action:
description: Action to perform based on regex matching.
Default is 'replace'
type: string
modulus:
description: Modulus to take of the hash of the source
label values.
format: int64
type: integer
regex:
description: Regular expression against which the extracted
value is matched. Default is '(.*)'
type: string
replacement:
description: Replacement value against which a regex replace
is performed if the regular expression matches. Regex
capture groups are available. Default is '$1'
type: string
separator:
description: Separator placed between concatenated source
label values. default is ';'.
type: string
sourceLabels:
description: The source labels select values from existing
labels. Their content is concatenated using the configured
separator and matched against the configured regular
expression for the replace, keep, and drop actions.
items:
type: string
type: array
targetLabel:
description: Label to which the resulting value is written
in a replace action. It is mandatory for replace actions.
Regex capture groups are available.
type: string
type: object
type: array
scheme:
description: HTTP scheme to use for scraping.
type: string
scrapeTimeout:
description: Timeout after which the scrape is ended
type: string
targetPort:
anyOf:
- type: integer
- type: string
description: 'Deprecated: Use ''port'' instead.'
x-kubernetes-int-or-string: true
type: object
type: array
podTargetLabels:
description: PodTargetLabels transfers labels on the Kubernetes Pod
onto the target.
items:
type: string
type: array
sampleLimit:
description: SampleLimit defines per-scrape limit on number of scraped
samples that will be accepted.
format: int64
type: integer
selector:
description: Selector to select Pod objects.
properties:
matchExpressions:
description: matchExpressions is a list of label selector requirements.
The requirements are ANDed.
items:
description: A label selector requirement is a selector that
contains values, a key, and an operator that relates the key
and values.
properties:
key:
description: key is the label key that the selector applies
to.
type: string
operator:
description: operator represents a key's relationship to
a set of values. Valid operators are In, NotIn, Exists
and DoesNotExist.
type: string
values:
description: values is an array of string values. If the
operator is In or NotIn, the values array must be non-empty.
If the operator is Exists or DoesNotExist, the values
array must be empty. This array is replaced during a strategic
merge patch.
items:
type: string
type: array
required:
- key
- operator
type: object
type: array
matchLabels:
additionalProperties:
type: string
description: matchLabels is a map of {key,value} pairs. A single
{key,value} in the matchLabels map is equivalent to an element
of matchExpressions, whose key field is "key", the operator
is "In", and the values array contains only "value". The requirements
are ANDed.
type: object
type: object
required:
- podMetricsEndpoints
- selector
type: object
required:
- spec
type: object
served: true
storage: true
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []

View File

@@ -1,212 +0,0 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.2.4
creationTimestamp: null
name: probes.monitoring.coreos.com
spec:
group: monitoring.coreos.com
names:
kind: Probe
listKind: ProbeList
plural: probes
singular: probe
scope: Namespaced
versions:
- name: v1
schema:
openAPIV3Schema:
description: Probe defines monitoring for a set of static targets or ingresses.
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: Specification of desired Ingress selection for target discovery
by Prometheus.
properties:
interval:
description: Interval at which targets are probed using the configured
prober. If not specified Prometheus' global scrape interval is used.
type: string
jobName:
description: The job name assigned to scraped metrics by default.
type: string
module:
description: 'The module to use for probing specifying how to probe
the target. Example module configuring in the blackbox exporter:
https://github.com/prometheus/blackbox_exporter/blob/master/example.yml'
type: string
prober:
description: Specification for the prober to use for probing targets.
The prober.URL parameter is required. Targets cannot be probed if
left empty.
properties:
path:
description: Path to collect metrics from. Defaults to `/probe`.
type: string
scheme:
description: HTTP scheme to use for scraping. Defaults to `http`.
type: string
url:
description: Mandatory URL of the prober.
type: string
required:
- url
type: object
scrapeTimeout:
description: Timeout for scraping metrics from the Prometheus exporter.
type: string
targets:
description: Targets defines a set of static and/or dynamically discovered
targets to be probed using the prober.
properties:
ingress:
description: Ingress defines the set of dynamically discovered
ingress objects which hosts are considered for probing.
properties:
namespaceSelector:
description: Select Ingress objects by namespace.
properties:
any:
description: Boolean describing whether all namespaces
are selected in contrast to a list restricting them.
type: boolean
matchNames:
description: List of namespace names.
items:
type: string
type: array
type: object
relabelingConfigs:
description: 'RelabelConfigs to apply to samples before ingestion.
More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config'
items:
description: 'RelabelConfig allows dynamic rewriting of
the label set, being applied to samples before ingestion.
It defines `<metric_relabel_configs>`-section of Prometheus
configuration. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs'
properties:
action:
description: Action to perform based on regex matching.
Default is 'replace'
type: string
modulus:
description: Modulus to take of the hash of the source
label values.
format: int64
type: integer
regex:
description: Regular expression against which the extracted
value is matched. Default is '(.*)'
type: string
replacement:
description: Replacement value against which a regex
replace is performed if the regular expression matches.
Regex capture groups are available. Default is '$1'
type: string
separator:
description: Separator placed between concatenated source
label values. default is ';'.
type: string
sourceLabels:
description: The source labels select values from existing
labels. Their content is concatenated using the configured
separator and matched against the configured regular
expression for the replace, keep, and drop actions.
items:
type: string
type: array
targetLabel:
description: Label to which the resulting value is written
in a replace action. It is mandatory for replace actions.
Regex capture groups are available.
type: string
type: object
type: array
selector:
description: Select Ingress objects by labels.
properties:
matchExpressions:
description: matchExpressions is a list of label selector
requirements. The requirements are ANDed.
items:
description: A label selector requirement is a selector
that contains values, a key, and an operator that
relates the key and values.
properties:
key:
description: key is the label key that the selector
applies to.
type: string
operator:
description: operator represents a key's relationship
to a set of values. Valid operators are In, NotIn,
Exists and DoesNotExist.
type: string
values:
description: values is an array of string values.
If the operator is In or NotIn, the values array
must be non-empty. If the operator is Exists or
DoesNotExist, the values array must be empty.
This array is replaced during a strategic merge
patch.
items:
type: string
type: array
required:
- key
- operator
type: object
type: array
matchLabels:
additionalProperties:
type: string
description: matchLabels is a map of {key,value} pairs.
A single {key,value} in the matchLabels map is equivalent
to an element of matchExpressions, whose key field is
"key", the operator is "In", and the values array contains
only "value". The requirements are ANDed.
type: object
type: object
type: object
staticConfig:
description: 'StaticConfig defines static targets which are considers
for probing. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#static_config.'
properties:
labels:
additionalProperties:
type: string
description: Labels assigned to all metrics scraped from the
targets.
type: object
static:
description: Targets is a list of URLs to probe using the
configured prober.
items:
type: string
type: array
type: object
type: object
type: object
required:
- spec
type: object
served: true
storage: true
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []

View File

@@ -1,94 +0,0 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.2.4
creationTimestamp: null
name: prometheusrules.monitoring.coreos.com
spec:
group: monitoring.coreos.com
names:
kind: PrometheusRule
listKind: PrometheusRuleList
plural: prometheusrules
singular: prometheusrule
scope: Namespaced
versions:
- name: v1
schema:
openAPIV3Schema:
description: PrometheusRule defines alerting rules for a Prometheus instance
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: Specification of desired alerting rule definitions for Prometheus.
properties:
groups:
description: Content of Prometheus rule file
items:
description: 'RuleGroup is a list of sequentially evaluated recording
and alerting rules. Note: PartialResponseStrategy is only used
by ThanosRuler and will be ignored by Prometheus instances. Valid
values for this field are ''warn'' or ''abort''. More info: https://github.com/thanos-io/thanos/blob/master/docs/components/rule.md#partial-response'
properties:
interval:
type: string
name:
type: string
partial_response_strategy:
type: string
rules:
items:
description: Rule describes an alerting or recording rule.
properties:
alert:
type: string
annotations:
additionalProperties:
type: string
type: object
expr:
anyOf:
- type: integer
- type: string
x-kubernetes-int-or-string: true
for:
type: string
labels:
additionalProperties:
type: string
type: object
record:
type: string
required:
- expr
type: object
type: array
required:
- name
- rules
type: object
type: array
type: object
required:
- spec
type: object
served: true
storage: true
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []

View File

@@ -1,465 +0,0 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.2.4
creationTimestamp: null
name: servicemonitors.monitoring.coreos.com
spec:
group: monitoring.coreos.com
names:
kind: ServiceMonitor
listKind: ServiceMonitorList
plural: servicemonitors
singular: servicemonitor
scope: Namespaced
versions:
- name: v1
schema:
openAPIV3Schema:
description: ServiceMonitor defines monitoring for a set of services.
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: Specification of desired Service selection for target discovery
by Prometheus.
properties:
endpoints:
description: A list of endpoints allowed as part of this ServiceMonitor.
items:
description: Endpoint defines a scrapeable endpoint serving Prometheus
metrics.
properties:
basicAuth:
description: 'BasicAuth allow an endpoint to authenticate over
basic authentication More info: https://prometheus.io/docs/operating/configuration/#endpoints'
properties:
password:
description: The secret in the service monitor namespace
that contains the password for authentication.
properties:
key:
description: The key of the secret to select from. Must
be a valid secret key.
type: string
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind, uid?'
type: string
optional:
description: Specify whether the Secret or its key must
be defined
type: boolean
required:
- key
type: object
username:
description: The secret in the service monitor namespace
that contains the username for authentication.
properties:
key:
description: The key of the secret to select from. Must
be a valid secret key.
type: string
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind, uid?'
type: string
optional:
description: Specify whether the Secret or its key must
be defined
type: boolean
required:
- key
type: object
type: object
bearerTokenFile:
description: File to read bearer token for scraping targets.
type: string
bearerTokenSecret:
description: Secret to mount to read bearer token for scraping
targets. The secret needs to be in the same namespace as the
service monitor and accessible by the Prometheus Operator.
properties:
key:
description: The key of the secret to select from. Must
be a valid secret key.
type: string
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind, uid?'
type: string
optional:
description: Specify whether the Secret or its key must
be defined
type: boolean
required:
- key
type: object
honorLabels:
description: HonorLabels chooses the metric's labels on collisions
with target labels.
type: boolean
honorTimestamps:
description: HonorTimestamps controls whether Prometheus respects
the timestamps present in scraped data.
type: boolean
interval:
description: Interval at which metrics should be scraped
type: string
metricRelabelings:
description: MetricRelabelConfigs to apply to samples before
ingestion.
items:
description: 'RelabelConfig allows dynamic rewriting of the
label set, being applied to samples before ingestion. It
defines `<metric_relabel_configs>`-section of Prometheus
configuration. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs'
properties:
action:
description: Action to perform based on regex matching.
Default is 'replace'
type: string
modulus:
description: Modulus to take of the hash of the source
label values.
format: int64
type: integer
regex:
description: Regular expression against which the extracted
value is matched. Default is '(.*)'
type: string
replacement:
description: Replacement value against which a regex replace
is performed if the regular expression matches. Regex
capture groups are available. Default is '$1'
type: string
separator:
description: Separator placed between concatenated source
label values. default is ';'.
type: string
sourceLabels:
description: The source labels select values from existing
labels. Their content is concatenated using the configured
separator and matched against the configured regular
expression for the replace, keep, and drop actions.
items:
type: string
type: array
targetLabel:
description: Label to which the resulting value is written
in a replace action. It is mandatory for replace actions.
Regex capture groups are available.
type: string
type: object
type: array
params:
additionalProperties:
items:
type: string
type: array
description: Optional HTTP URL parameters
type: object
path:
description: HTTP path to scrape for metrics.
type: string
port:
description: Name of the service port this endpoint refers to.
Mutually exclusive with targetPort.
type: string
proxyUrl:
description: ProxyURL eg http://proxyserver:2195 Directs scrapes
to proxy through this endpoint.
type: string
relabelings:
description: 'RelabelConfigs to apply to samples before scraping.
More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config'
items:
description: 'RelabelConfig allows dynamic rewriting of the
label set, being applied to samples before ingestion. It
defines `<metric_relabel_configs>`-section of Prometheus
configuration. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs'
properties:
action:
description: Action to perform based on regex matching.
Default is 'replace'
type: string
modulus:
description: Modulus to take of the hash of the source
label values.
format: int64
type: integer
regex:
description: Regular expression against which the extracted
value is matched. Default is '(.*)'
type: string
replacement:
description: Replacement value against which a regex replace
is performed if the regular expression matches. Regex
capture groups are available. Default is '$1'
type: string
separator:
description: Separator placed between concatenated source
label values. default is ';'.
type: string
sourceLabels:
description: The source labels select values from existing
labels. Their content is concatenated using the configured
separator and matched against the configured regular
expression for the replace, keep, and drop actions.
items:
type: string
type: array
targetLabel:
description: Label to which the resulting value is written
in a replace action. It is mandatory for replace actions.
Regex capture groups are available.
type: string
type: object
type: array
scheme:
description: HTTP scheme to use for scraping.
type: string
scrapeTimeout:
description: Timeout after which the scrape is ended
type: string
targetPort:
anyOf:
- type: integer
- type: string
description: Name or number of the pod port this endpoint refers
to. Mutually exclusive with port.
x-kubernetes-int-or-string: true
tlsConfig:
description: TLS configuration to use when scraping the endpoint
properties:
ca:
description: Stuct containing the CA cert to use for the
targets.
properties:
configMap:
description: ConfigMap containing data to use for the
targets.
properties:
key:
description: The key to select.
type: string
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind,
uid?'
type: string
optional:
description: Specify whether the ConfigMap or its
key must be defined
type: boolean
required:
- key
type: object
secret:
description: Secret containing data to use for the targets.
properties:
key:
description: The key of the secret to select from. Must
be a valid secret key.
type: string
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind,
uid?'
type: string
optional:
description: Specify whether the Secret or its key
must be defined
type: boolean
required:
- key
type: object
type: object
caFile:
description: Path to the CA cert in the Prometheus container
to use for the targets.
type: string
cert:
description: Struct containing the client cert file for
the targets.
properties:
configMap:
description: ConfigMap containing data to use for the
targets.
properties:
key:
description: The key to select.
type: string
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind,
uid?'
type: string
optional:
description: Specify whether the ConfigMap or its
key must be defined
type: boolean
required:
- key
type: object
secret:
description: Secret containing data to use for the targets.
properties:
key:
description: The key of the secret to select from. Must
be a valid secret key.
type: string
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind,
uid?'
type: string
optional:
description: Specify whether the Secret or its key
must be defined
type: boolean
required:
- key
type: object
type: object
certFile:
description: Path to the client cert file in the Prometheus
container for the targets.
type: string
insecureSkipVerify:
description: Disable target certificate validation.
type: boolean
keyFile:
description: Path to the client key file in the Prometheus
container for the targets.
type: string
keySecret:
description: Secret containing the client key file for the
targets.
properties:
key:
description: The key of the secret to select from. Must
be a valid secret key.
type: string
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind, uid?'
type: string
optional:
description: Specify whether the Secret or its key must
be defined
type: boolean
required:
- key
type: object
serverName:
description: Used to verify the hostname for the targets.
type: string
type: object
type: object
type: array
jobLabel:
description: The label to use to retrieve the job name from.
type: string
namespaceSelector:
description: Selector to select which namespaces the Endpoints objects
are discovered from.
properties:
any:
description: Boolean describing whether all namespaces are selected
in contrast to a list restricting them.
type: boolean
matchNames:
description: List of namespace names.
items:
type: string
type: array
type: object
podTargetLabels:
description: PodTargetLabels transfers labels on the Kubernetes Pod
onto the target.
items:
type: string
type: array
sampleLimit:
description: SampleLimit defines per-scrape limit on number of scraped
samples that will be accepted.
format: int64
type: integer
selector:
description: Selector to select Endpoints objects.
properties:
matchExpressions:
description: matchExpressions is a list of label selector requirements.
The requirements are ANDed.
items:
description: A label selector requirement is a selector that
contains values, a key, and an operator that relates the key
and values.
properties:
key:
description: key is the label key that the selector applies
to.
type: string
operator:
description: operator represents a key's relationship to
a set of values. Valid operators are In, NotIn, Exists
and DoesNotExist.
type: string
values:
description: values is an array of string values. If the
operator is In or NotIn, the values array must be non-empty.
If the operator is Exists or DoesNotExist, the values
array must be empty. This array is replaced during a strategic
merge patch.
items:
type: string
type: array
required:
- key
- operator
type: object
type: array
matchLabels:
additionalProperties:
type: string
description: matchLabels is a map of {key,value} pairs. A single
{key,value} in the matchLabels map is equivalent to an element
of matchExpressions, whose key field is "key", the operator
is "In", and the values array contains only "value". The requirements
are ANDed.
type: object
type: object
targetLabels:
description: TargetLabels transfers labels on the Kubernetes Service
onto the target.
items:
type: string
type: array
required:
- endpoints
- selector
type: object
required:
- spec
type: object
served: true
storage: true
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []

View File

@@ -1,82 +0,0 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
labels:
app.kubernetes.io/component: controller
app.kubernetes.io/name: prometheus-operator
app.kubernetes.io/version: v0.41.1
name: prometheus-operator
rules:
- apiGroups:
- monitoring.coreos.com
resources:
- alertmanagers
- alertmanagers/finalizers
- prometheuses
- prometheuses/finalizers
- thanosrulers
- thanosrulers/finalizers
- servicemonitors
- podmonitors
- probes
- prometheusrules
verbs:
- '*'
- apiGroups:
- apps
resources:
- statefulsets
verbs:
- '*'
- apiGroups:
- ""
resources:
- configmaps
- secrets
verbs:
- '*'
- apiGroups:
- ""
resources:
- pods
verbs:
- list
- delete
- apiGroups:
- ""
resources:
- services
- services/finalizers
- endpoints
verbs:
- get
- create
- update
- delete
- apiGroups:
- ""
resources:
- nodes
verbs:
- list
- watch
- apiGroups:
- ""
resources:
- namespaces
verbs:
- get
- list
- watch
- apiGroups:
- authentication.k8s.io
resources:
- tokenreviews
verbs:
- create
- apiGroups:
- authorization.k8s.io
resources:
- subjectaccessreviews
verbs:
- create

View File

@@ -1,34 +0,0 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
labels:
app.kubernetes.io/component: controller
app.kubernetes.io/name: prometheus-operator
app.kubernetes.io/version: v0.41.1
name: prometheus-operator
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: prometheus-operator
subjects:
- kind: ServiceAccount
name: prometheus-operator
namespace: monitoring
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
labels:
app.kubernetes.io/component: controller
app.kubernetes.io/name: prometheus-operator
app.kubernetes.io/version: v0.41.1
name: prometheus-operator-admin
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: "cluster-admin"
subjects:
- kind: ServiceAccount
name: prometheus-operator
namespace: monitoring

View File

@@ -1,60 +0,0 @@
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app.kubernetes.io/component: controller
app.kubernetes.io/name: prometheus-operator
app.kubernetes.io/version: v0.41.1
name: prometheus-operator
namespace: monitoring
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/component: controller
app.kubernetes.io/name: prometheus-operator
template:
metadata:
labels:
app.kubernetes.io/component: controller
app.kubernetes.io/name: prometheus-operator
app.kubernetes.io/version: v0.41.1
spec:
containers:
- args:
- --kubelet-service=kube-system/kubelet
- --logtostderr=true
- --config-reloader-image=jimmidyson/configmap-reload:v0.4.0
- --prometheus-config-reloader=quay.io/coreos/prometheus-config-reloader:v0.41.1
image: quay.io/coreos/prometheus-operator:v0.41.1
name: prometheus-operator
ports:
- containerPort: 8080
name: http
resources:
limits:
cpu: 200m
memory: 200Mi
requests:
cpu: 100m
memory: 100Mi
securityContext:
allowPrivilegeEscalation: false
- args:
- --logtostderr
- --secure-listen-address=:8443
- --tls-cipher-suites=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305,TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305
- --upstream=http://127.0.0.1:8080/
image: quay.io/coreos/kube-rbac-proxy:v0.4.1
name: kube-rbac-proxy
ports:
- containerPort: 8443
name: https
securityContext:
runAsUser: 65534
nodeSelector:
beta.kubernetes.io/os: linux
securityContext:
runAsNonRoot: true
runAsUser: 65534
serviceAccountName: prometheus-operator

View File

@@ -1,18 +0,0 @@
apiVersion: v1
kind: Service
metadata:
labels:
app.kubernetes.io/component: controller
app.kubernetes.io/name: prometheus-operator
app.kubernetes.io/version: v0.41.1
name: prometheus-operator
namespace: monitoring
spec:
clusterIP: None
ports:
- name: https
port: 8443
targetPort: https
selector:
app.kubernetes.io/component: controller
app.kubernetes.io/name: prometheus-operator

View File

@@ -1,9 +0,0 @@
apiVersion: v1
kind: ServiceAccount
metadata:
labels:
app.kubernetes.io/component: controller
app.kubernetes.io/name: prometheus-operator
app.kubernetes.io/version: v0.41.1
name: prometheus-operator
namespace: monitoring

View File

@@ -1,6 +1,6 @@
apiVersion: v2
name: vela-core
description: A Helm chart for Kubernetes
description: A Helm chart for KubeVela core
# A chart can be either an 'application' or a 'library' chart.
#

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,196 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.2.4
name: appdeployments.core.oam.dev
spec:
group: core.oam.dev
names:
categories:
- oam
kind: AppDeployment
listKind: AppDeploymentList
plural: appdeployments
shortNames:
- appdeploy
singular: appdeployment
scope: Namespaced
versions:
- name: v1beta1
schema:
openAPIV3Schema:
description: AppDeployment is the Schema for the AppDeployment 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: AppDeploymentSpec defines how to describe an upgrade between different apps
properties:
appRevisions:
description: AppRevision specifies AppRevision resources to and the rules to apply to them.
items:
description: AppRevision specifies an AppRevision resource to and the rules to apply to it.
properties:
placement:
description: Placement defines the cluster placement rules for an app revision.
items:
description: ClusterPlacement defines the cluster placement rules for an app revision.
properties:
clusterSelector:
description: ClusterSelector selects the cluster to deploy apps to. If not specified, it indicates the host cluster per se.
properties:
labels:
additionalProperties:
type: string
description: Labels defines the label selector to select the cluster.
type: object
name:
description: Name is the name of the cluster.
type: string
type: object
distribution:
description: Distribution defines the replica distribution of an AppRevision to a cluster.
properties:
replicas:
description: Replicas is the replica number.
type: integer
type: object
type: object
type: array
revisionName:
description: RevisionName is the name of the AppRevision.
type: string
type: object
type: array
traffic:
description: Traffic defines the traffic rules to apply across revisions.
properties:
gateways:
description: Gateways specifies the names of gateways that should apply these rules. Gateways in other namespaces may be referred to by `<gateway namespace>/<gateway name>`; specifying a gateway with no namespace qualifier is the same as specifying the AppDeployment's namespace.
items:
type: string
type: array
hosts:
description: Hosts are the destination hosts to which traffic is being sent. Could be a DNS name with wildcard prefix or an IP address.
items:
type: string
type: array
http:
description: HTTP defines the rules to match and split http traffoc across revisions.
items:
description: HTTPRule defines the rules to match and split http traffic across revisions.
properties:
match:
description: Match defines the conditions to be satisfied for the rule to be activated. All conditions inside a single match block have AND semantics, while the list of match blocks have OR semantics. The rule is matched if any one of the match blocks succeed.
items:
description: HTTPMatchRequest specifies a set of criterion to be met in order for the rule to be applied to the HTTP request. For example, the following restricts the rule to match only requests where the URL path starts with /ratings/v2/ and the request contains a custom `end-user` header with value `jason`.
properties:
uri:
description: URI defines how to match with an URI.
properties:
prefix:
type: string
type: object
type: object
type: array
weightedTargets:
description: WeightedTargets defines the revision targets to select and route traffic to.
items:
description: WeightedTarget defines the revision target to select and route traffic to.
properties:
componentName:
description: ComponentName is the name of the component. Note that it is the original component name in the Application. No need to append revision.
type: string
port:
description: Port is the port to route traffic towards.
type: integer
revisionName:
description: RevisionName is the name of the app revision.
type: string
weight:
description: Weight defines the proportion of traffic to be forwarded to the service version. (0-100). Sum of weights across destinations SHOULD BE == 100. If there is only one destination in a rule, the weight value is assumed to be 100.
type: integer
type: object
type: array
type: object
type: array
type: object
type: object
status:
description: AppDeploymentStatus defines the observed state of AppDeployment
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
phase:
description: Phase shows the phase that the AppDeployment is undergoing. If Phase is Rolling, no update should be made to the spec.
type: string
placement:
description: Placement shows the cluster placement results of the app revisions.
items:
description: PlacementStatus shows the cluster placement results of an app revision.
properties:
clusters:
description: Clusters shows cluster placement results.
items:
description: ClusterPlacementStatus shows the placement results of a cluster.
properties:
clusterName:
description: ClusterName indicates the name of the cluster to deploy apps to. If empty, it indicates the host cluster per se.
type: string
replicas:
description: Replicas indicates the replica number of an app revision to deploy to a cluster.
type: integer
type: object
type: array
revisionName:
description: RevisionName is the name of the AppRevision.
type: string
type: object
type: array
type: object
type: object
served: true
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []

View File

@@ -5,13 +5,11 @@ kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.2.4
creationTimestamp: null
name: applicationconfigurations.core.oam.dev
spec:
group: core.oam.dev
names:
categories:
- crossplane
- oam
kind: ApplicationConfiguration
listKind: ApplicationConfigurationList
@@ -27,47 +25,141 @@ spec:
description: An ApplicationConfiguration represents an OAM application.
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'
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'
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: An ApplicationConfigurationSpec defines the desired state
of a ApplicationConfiguration.
description: An ApplicationConfigurationSpec defines the desired state of a ApplicationConfiguration.
properties:
components:
description: Components of which this ApplicationConfiguration consists.
Each component will be used to instantiate a workload.
description: Components of which this ApplicationConfiguration consists. Each component will be used to instantiate a workload.
items:
description: An ApplicationConfigurationComponent specifies a component
of an ApplicationConfiguration. Each component is used to instantiate
a workload.
description: An ApplicationConfigurationComponent specifies a component of an ApplicationConfiguration. Each component is used to instantiate a workload.
properties:
componentName:
description: ComponentName specifies a component whose latest
revision will be bind with ApplicationConfiguration. When
the spec of the referenced component changes, ApplicationConfiguration
will automatically migrate all trait affect from the prior
revision to the new one. This is mutually exclusive with RevisionName.
description: ComponentName specifies a component whose latest revision will be bind with ApplicationConfiguration. When the spec of the referenced component changes, ApplicationConfiguration will automatically migrate all trait affect from the prior revision to the new one. This is mutually exclusive with RevisionName.
type: string
dataInputs:
description: DataInputs specify the data input sinks into this
component.
description: DataInputs specify the data input sinks into this component.
items:
description: DataInput specifies a data input sink to an object.
If input is array, it will be appended to the target field
paths.
description: DataInput specifies a data input sink to an object. If input is array, it will be appended to the target field paths.
properties:
conditions:
description: When the Conditions is satified, ToFieldPaths will be filled with passed value
items:
description: ConditionRequirement specifies the requirement to match a value.
properties:
fieldPath:
description: FieldPath specifies got value from workload/trait object
type: string
op:
description: ConditionOperator specifies the operator to match a value.
type: string
value:
description: Value specifies an expected value This is mutually exclusive with ValueFrom
type: string
valueFrom:
description: ValueFrom specifies expected value from AppConfig This is mutually exclusive with Value
properties:
fieldPath:
type: string
required:
- fieldPath
type: object
required:
- op
type: object
type: array
inputStore:
description: InputStore specifies the object used to read intermediate data genereted by DataOutput
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
operations:
description: Operations specify the data processing operations
items:
description: DataOperation defines the specific operation for data
properties:
conditions:
items:
description: ConditionRequirement specifies the requirement to match a value.
properties:
fieldPath:
description: FieldPath specifies got value from workload/trait object
type: string
op:
description: ConditionOperator specifies the operator to match a value.
type: string
value:
description: Value specifies an expected value This is mutually exclusive with ValueFrom
type: string
valueFrom:
description: ValueFrom specifies expected value from AppConfig This is mutually exclusive with Value
properties:
fieldPath:
type: string
required:
- fieldPath
type: object
required:
- op
type: object
type: array
op:
description: Operator specifies the operation under this DataOperation type
type: string
toDataPath:
description: ToDataPath refers to the value of an object's specfied by ToDataPath. For example the ToDataPath "redis" specifies "redis info" in '{"redis":"redis info"}'
type: string
toFieldPath:
description: ToFieldPath refers to the value of an object's field
type: string
type:
description: Type specifies the type of DataOperation
type: string
value:
description: Value specifies an expected value This is mutually exclusive with ValueFrom
type: string
valueFrom:
description: ValueFrom specifies expected value from object such as workload and trait This is mutually exclusive with Value
properties:
fieldPath:
type: string
required:
- fieldPath
type: object
required:
- op
- toFieldPath
- type
type: object
type: array
uid:
description: UID of the referenced object.
type: string
required:
- apiVersion
- kind
- name
type: object
strategyMergeKeys:
description: StrategyMergeKeys specifies the merge key if the toFieldPaths target is an array. The StrategyMergeKeys is optional, by default, if the toFieldPaths target is an array, we will append. If StrategyMergeKeys specified, we will check the key in the target array. If any key exist, do update; if no key exist, append.
items:
type: string
type: array
toFieldPaths:
description: ToFieldPaths specifies the field paths of
an object to fill passed value.
description: ToFieldPaths specifies the field paths of an object to fill passed value.
items:
type: string
type: array
@@ -75,8 +167,7 @@ spec:
description: ValueFrom specifies the value source.
properties:
dataOutputName:
description: DataOutputName matches a name of a DataOutput
in the same AppConfig.
description: DataOutputName matches a name of a DataOutput in the same AppConfig.
type: string
required:
- dataOutputName
@@ -84,53 +175,127 @@ spec:
type: object
type: array
dataOutputs:
description: DataOutputs specify the data output sources from
this component.
description: DataOutputs specify the data output sources from this component.
items:
description: DataOutput specifies a data output source from
an object.
description: DataOutput specifies a data output source from an object.
properties:
conditions:
description: Conditions specify the conditions that should
be satisfied before emitting a data output. Different
conditions are AND-ed together. If no conditions is
specified, it is by default to check output value not
empty.
description: Conditions specify the conditions that should be satisfied before emitting a data output. Different conditions are AND-ed together. If no conditions is specified, it is by default to check output value not empty.
items:
description: ConditionRequirement specifies the requirement
to match a value.
description: ConditionRequirement specifies the requirement to match a value.
properties:
fieldPath:
description: FieldPath specifies got value from workload/trait object
type: string
op:
description: ConditionOperator specifies the operator
to match a value.
description: ConditionOperator specifies the operator to match a value.
type: string
value:
description: Value specifies an expected value This is mutually exclusive with ValueFrom
type: string
valueFrom:
description: ValueFrom specifies expected value from AppConfig This is mutually exclusive with Value
properties:
fieldPath:
type: string
required:
- fieldPath
type: object
required:
- op
- value
type: object
type: array
fieldPath:
description: FieldPath refers to the value of an object's
field.
description: FieldPath refers to the value of an object's field.
type: string
name:
description: Name is the unique name of a DataOutput in
an ApplicationConfiguration.
description: Name is the unique name of a DataOutput in an ApplicationConfiguration.
type: string
outputStore:
description: OutputStore specifies the object used to store intermediate data generated by Operations
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
operations:
description: Operations specify the data processing operations
items:
description: DataOperation defines the specific operation for data
properties:
conditions:
items:
description: ConditionRequirement specifies the requirement to match a value.
properties:
fieldPath:
description: FieldPath specifies got value from workload/trait object
type: string
op:
description: ConditionOperator specifies the operator to match a value.
type: string
value:
description: Value specifies an expected value This is mutually exclusive with ValueFrom
type: string
valueFrom:
description: ValueFrom specifies expected value from AppConfig This is mutually exclusive with Value
properties:
fieldPath:
type: string
required:
- fieldPath
type: object
required:
- op
type: object
type: array
op:
description: Operator specifies the operation under this DataOperation type
type: string
toDataPath:
description: ToDataPath refers to the value of an object's specfied by ToDataPath. For example the ToDataPath "redis" specifies "redis info" in '{"redis":"redis info"}'
type: string
toFieldPath:
description: ToFieldPath refers to the value of an object's field
type: string
type:
description: Type specifies the type of DataOperation
type: string
value:
description: Value specifies an expected value This is mutually exclusive with ValueFrom
type: string
valueFrom:
description: ValueFrom specifies expected value from object such as workload and trait This is mutually exclusive with Value
properties:
fieldPath:
type: string
required:
- fieldPath
type: object
required:
- op
- toFieldPath
- type
type: object
type: array
uid:
description: UID of the referenced object.
type: string
required:
- apiVersion
- kind
- name
type: object
type: object
type: array
parameterValues:
description: ParameterValues specify values for the the specified
component's parameters. Any parameter required by the component
must be specified.
description: ParameterValues specify values for the the specified component's parameters. Any parameter required by the component must be specified.
items:
description: A ComponentParameterValue specifies a value for
a named parameter. The associated component must publish
a parameter with this name.
description: A ComponentParameterValue specifies a value for a named parameter. The associated component must publish a parameter with this name.
properties:
name:
description: Name of the component parameter to set.
@@ -147,20 +312,15 @@ spec:
type: object
type: array
revisionName:
description: RevisionName of a specific component revision to
which to bind ApplicationConfiguration. This is mutually exclusive
with componentName.
description: RevisionName of a specific component revision to which to bind ApplicationConfiguration. This is mutually exclusive with componentName.
type: string
scopes:
description: Scopes in which the specified component should
exist.
description: Scopes in which the specified component should exist.
items:
description: A ComponentScope specifies a scope in which a
component should exist.
description: A ComponentScope specifies a scope in which a component should exist.
properties:
scopeRef:
description: A ScopeReference must refer to an OAM scope
resource.
description: A ScopeReference must refer to an OAM scope resource.
properties:
apiVersion:
description: APIVersion of the referenced object.
@@ -186,20 +346,125 @@ spec:
traits:
description: Traits of the specified component.
items:
description: A ComponentTrait specifies a trait that should
be applied to a component.
description: A ComponentTrait specifies a trait that should be applied to a component.
properties:
dataInputs:
description: DataInputs specify the data input sinks into
this trait.
description: DataInputs specify the data input sinks into this trait.
items:
description: DataInput specifies a data input sink to
an object. If input is array, it will be appended
to the target field paths.
description: DataInput specifies a data input sink to an object. If input is array, it will be appended to the target field paths.
properties:
conditions:
description: When the Conditions is satified, ToFieldPaths will be filled with passed value
items:
description: ConditionRequirement specifies the requirement to match a value.
properties:
fieldPath:
description: FieldPath specifies got value from workload/trait object
type: string
op:
description: ConditionOperator specifies the operator to match a value.
type: string
value:
description: Value specifies an expected value This is mutually exclusive with ValueFrom
type: string
valueFrom:
description: ValueFrom specifies expected value from AppConfig This is mutually exclusive with Value
properties:
fieldPath:
type: string
required:
- fieldPath
type: object
required:
- op
type: object
type: array
inputStore:
description: InputStore specifies the object used to read intermediate data genereted by DataOutput
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
operations:
description: Operations specify the data processing operations
items:
description: DataOperation defines the specific operation for data
properties:
conditions:
items:
description: ConditionRequirement specifies the requirement to match a value.
properties:
fieldPath:
description: FieldPath specifies got value from workload/trait object
type: string
op:
description: ConditionOperator specifies the operator to match a value.
type: string
value:
description: Value specifies an expected value This is mutually exclusive with ValueFrom
type: string
valueFrom:
description: ValueFrom specifies expected value from AppConfig This is mutually exclusive with Value
properties:
fieldPath:
type: string
required:
- fieldPath
type: object
required:
- op
type: object
type: array
op:
description: Operator specifies the operation under this DataOperation type
type: string
toDataPath:
description: ToDataPath refers to the value of an object's specfied by ToDataPath. For example the ToDataPath "redis" specifies "redis info" in '{"redis":"redis info"}'
type: string
toFieldPath:
description: ToFieldPath refers to the value of an object's field
type: string
type:
description: Type specifies the type of DataOperation
type: string
value:
description: Value specifies an expected value This is mutually exclusive with ValueFrom
type: string
valueFrom:
description: ValueFrom specifies expected value from object such as workload and trait This is mutually exclusive with Value
properties:
fieldPath:
type: string
required:
- fieldPath
type: object
required:
- op
- toFieldPath
- type
type: object
type: array
uid:
description: UID of the referenced object.
type: string
required:
- apiVersion
- kind
- name
type: object
strategyMergeKeys:
description: StrategyMergeKeys specifies the merge key if the toFieldPaths target is an array. The StrategyMergeKeys is optional, by default, if the toFieldPaths target is an array, we will append. If StrategyMergeKeys specified, we will check the key in the target array. If any key exist, do update; if no key exist, append.
items:
type: string
type: array
toFieldPaths:
description: ToFieldPaths specifies the field paths
of an object to fill passed value.
description: ToFieldPaths specifies the field paths of an object to fill passed value.
items:
type: string
type: array
@@ -207,8 +472,7 @@ spec:
description: ValueFrom specifies the value source.
properties:
dataOutputName:
description: DataOutputName matches a name of
a DataOutput in the same AppConfig.
description: DataOutputName matches a name of a DataOutput in the same AppConfig.
type: string
required:
- dataOutputName
@@ -216,43 +480,121 @@ spec:
type: object
type: array
dataOutputs:
description: DataOutputs specify the data output sources
from this trait.
description: DataOutputs specify the data output sources from this trait.
items:
description: DataOutput specifies a data output source
from an object.
description: DataOutput specifies a data output source from an object.
properties:
conditions:
description: Conditions specify the conditions that
should be satisfied before emitting a data output.
Different conditions are AND-ed together. If no
conditions is specified, it is by default to check
output value not empty.
description: Conditions specify the conditions that should be satisfied before emitting a data output. Different conditions are AND-ed together. If no conditions is specified, it is by default to check output value not empty.
items:
description: ConditionRequirement specifies the
requirement to match a value.
description: ConditionRequirement specifies the requirement to match a value.
properties:
fieldPath:
description: FieldPath specifies got value from workload/trait object
type: string
op:
description: ConditionOperator specifies the
operator to match a value.
description: ConditionOperator specifies the operator to match a value.
type: string
value:
description: Value specifies an expected value This is mutually exclusive with ValueFrom
type: string
valueFrom:
description: ValueFrom specifies expected value from AppConfig This is mutually exclusive with Value
properties:
fieldPath:
type: string
required:
- fieldPath
type: object
required:
- op
- value
type: object
type: array
fieldPath:
description: FieldPath refers to the value of an
object's field.
description: FieldPath refers to the value of an object's field.
type: string
name:
description: Name is the unique name of a DataOutput
in an ApplicationConfiguration.
description: Name is the unique name of a DataOutput in an ApplicationConfiguration.
type: string
outputStore:
description: OutputStore specifies the object used to store intermediate data generated by Operations
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
operations:
description: Operations specify the data processing operations
items:
description: DataOperation defines the specific operation for data
properties:
conditions:
items:
description: ConditionRequirement specifies the requirement to match a value.
properties:
fieldPath:
description: FieldPath specifies got value from workload/trait object
type: string
op:
description: ConditionOperator specifies the operator to match a value.
type: string
value:
description: Value specifies an expected value This is mutually exclusive with ValueFrom
type: string
valueFrom:
description: ValueFrom specifies expected value from AppConfig This is mutually exclusive with Value
properties:
fieldPath:
type: string
required:
- fieldPath
type: object
required:
- op
type: object
type: array
op:
description: Operator specifies the operation under this DataOperation type
type: string
toDataPath:
description: ToDataPath refers to the value of an object's specfied by ToDataPath. For example the ToDataPath "redis" specifies "redis info" in '{"redis":"redis info"}'
type: string
toFieldPath:
description: ToFieldPath refers to the value of an object's field
type: string
type:
description: Type specifies the type of DataOperation
type: string
value:
description: Value specifies an expected value This is mutually exclusive with ValueFrom
type: string
valueFrom:
description: ValueFrom specifies expected value from object such as workload and trait This is mutually exclusive with Value
properties:
fieldPath:
type: string
required:
- fieldPath
type: object
required:
- op
- toFieldPath
- type
type: object
type: array
uid:
description: UID of the referenced object.
type: string
required:
- apiVersion
- kind
- name
type: object
type: object
type: array
trait:
@@ -270,8 +612,7 @@ spec:
- components
type: object
status:
description: An ApplicationConfigurationStatus represents the observed
state of a ApplicationConfiguration.
description: An ApplicationConfigurationStatus represents the observed state of a ApplicationConfiguration.
properties:
conditions:
description: Conditions of the resource.
@@ -279,25 +620,20 @@ spec:
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.
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.
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.
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?
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.
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
@@ -307,17 +643,14 @@ spec:
type: object
type: array
dependency:
description: DependencyStatus represents the observed state of the
dependency of an ApplicationConfiguration.
description: DependencyStatus represents the observed state of the dependency of an ApplicationConfiguration.
properties:
unsatisfied:
items:
description: UnstaifiedDependency describes unsatisfied dependency
flow between one pair of objects.
description: UnstaifiedDependency describes unsatisfied dependency flow between one pair of objects.
properties:
from:
description: DependencyFromObject represents the object
that dependency data comes from.
description: DependencyFromObject represents the object that dependency data comes from.
properties:
apiVersion:
description: APIVersion of the referenced object.
@@ -338,9 +671,10 @@ spec:
- kind
- name
type: object
reason:
type: string
to:
description: DependencyToObject represents the object that
dependency data goes to.
description: DependencyToObject represents the object that dependency data goes to.
properties:
apiVersion:
description: APIVersion of the referenced object.
@@ -365,31 +699,72 @@ spec:
type: object
required:
- from
- reason
- to
type: object
type: array
type: object
historyWorkloads:
description: HistoryWorkloads will record history but still working revision workloads.
items:
description: HistoryWorkload contain the old component revision that are still running
properties:
revision:
description: Revision of this workload
type: string
workloadRef:
description: Reference to running 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
type: object
type: array
observedGeneration:
description: The generation observed by the appConfig controller.
format: int64
type: integer
rollingStatus:
description: RollingStatus indicates what phase are we in the rollout phase
type: string
status:
description: Status is a place holder for a customized controller
to fill if it needs a single place to summarize the status of the
entire application
description: Status is a place holder for a customized controller to fill if it needs a single place to summarize the status of the entire application
type: string
workloads:
description: Workloads created by this ApplicationConfiguration.
items:
description: A WorkloadStatus represents the status of a workload.
properties:
appliedComponentRevision:
description: AppliedComponentRevision indicates the applied component revision name of this workload
type: string
componentName:
description: ComponentName that produced this workload.
type: string
componentRevisionName:
description: ComponentRevisionName of current component
type: string
dependencyUnsatisfied:
description: DependencyUnsatisfied notify does the workload has dependency unsatisfied
type: boolean
scopes:
description: Scopes associated with this workload.
items:
description: A WorkloadScope represents a scope associated
with a workload and its status
description: A WorkloadScope represents a scope associated with a workload and its status
properties:
scopeRef:
description: Reference to a scope created by an ApplicationConfiguration.
@@ -412,29 +787,32 @@ spec:
- name
type: object
status:
description: Status is a place holder for a customized
controller to fill if it needs a single place to summarize
the status of the scope
description: Status is a place holder for a customized controller to fill if it needs a single place to summarize the status of the scope
type: string
required:
- scopeRef
type: object
type: array
status:
description: Status is a place holder for a customized controller
to fill if it needs a single place to summarize the entire
status of the workload
description: Status is a place holder for a customized controller to fill if it needs a single place to summarize the entire status of the workload
type: string
traits:
description: Traits associated with this workload.
items:
description: A WorkloadTrait represents a trait associated
with a workload and its status
description: A WorkloadTrait represents a trait associated with a workload and its status
properties:
appliedGeneration:
description: AppliedGeneration indicates the generation observed by the appConfig controller. The same field is also recorded in the annotations of traits. A trait is possible to be deleted from cluster after created. This field is useful to track the observed generation of traits after they are deleted.
format: int64
type: integer
dependencyUnsatisfied:
description: DependencyUnsatisfied notify does the trait has dependency unsatisfied
type: boolean
message:
description: Message will allow controller to leave some additional information for this trait
type: string
status:
description: Status is a place holder for a customized
controller to fill if it needs a single place to summarize
the status of the trait
description: Status is a place holder for a customized controller to fill if it needs a single place to summarize the status of the trait
type: string
traitRef:
description: Reference to a trait created by an ApplicationConfiguration.
@@ -482,8 +860,6 @@ spec:
type: object
type: object
type: array
required:
- dependency
type: object
type: object
served: true

View File

@@ -0,0 +1,304 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.2.4
name: applicationcontexts.core.oam.dev
spec:
group: core.oam.dev
names:
categories:
- oam
kind: ApplicationContext
listKind: ApplicationContextList
plural: applicationcontexts
shortNames:
- appcontext
singular: applicationcontext
scope: Namespaced
versions:
- name: v1alpha2
schema:
openAPIV3Schema:
description: ApplicationContext is the Schema for the ApplicationContext 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: ApplicationContextSpec is the spec of ApplicationContext
properties:
applicationRevisionName:
description: ApplicationRevisionName points to the snapshot of an Application with all its closure
type: string
required:
- applicationRevisionName
type: object
status:
description: we need to reuse the AC status
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
dependency:
description: DependencyStatus represents the observed state of the dependency of an ApplicationConfiguration.
properties:
unsatisfied:
items:
description: UnstaifiedDependency describes unsatisfied dependency flow between one pair of objects.
properties:
from:
description: DependencyFromObject represents the object that dependency data comes from.
properties:
apiVersion:
description: APIVersion of the referenced object.
type: string
fieldPath:
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
reason:
type: string
to:
description: DependencyToObject represents the object that dependency data goes to.
properties:
apiVersion:
description: APIVersion of the referenced object.
type: string
fieldPaths:
items:
type: string
type: array
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:
- from
- reason
- to
type: object
type: array
type: object
historyWorkloads:
description: HistoryWorkloads will record history but still working revision workloads.
items:
description: HistoryWorkload contain the old component revision that are still running
properties:
revision:
description: Revision of this workload
type: string
workloadRef:
description: Reference to running 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
type: object
type: array
observedGeneration:
description: The generation observed by the appConfig controller.
format: int64
type: integer
rollingStatus:
description: RollingStatus indicates what phase are we in the rollout phase
type: string
status:
description: Status is a place holder for a customized controller to fill if it needs a single place to summarize the status of the entire application
type: string
workloads:
description: Workloads created by this ApplicationConfiguration.
items:
description: A WorkloadStatus represents the status of a workload.
properties:
appliedComponentRevision:
description: AppliedComponentRevision indicates the applied component revision name of this workload
type: string
componentName:
description: ComponentName that produced this workload.
type: string
componentRevisionName:
description: ComponentRevisionName of current component
type: string
dependencyUnsatisfied:
description: DependencyUnsatisfied notify does the workload has dependency unsatisfied
type: boolean
scopes:
description: Scopes associated with this workload.
items:
description: A WorkloadScope represents a scope associated with a workload and its status
properties:
scopeRef:
description: Reference to a scope created by an ApplicationConfiguration.
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
status:
description: Status is a place holder for a customized controller to fill if it needs a single place to summarize the status of the scope
type: string
required:
- scopeRef
type: object
type: array
status:
description: Status is a place holder for a customized controller to fill if it needs a single place to summarize the entire status of the workload
type: string
traits:
description: Traits associated with this workload.
items:
description: A WorkloadTrait represents a trait associated with a workload and its status
properties:
appliedGeneration:
description: AppliedGeneration indicates the generation observed by the appConfig controller. The same field is also recorded in the annotations of traits. A trait is possible to be deleted from cluster after created. This field is useful to track the observed generation of traits after they are deleted.
format: int64
type: integer
dependencyUnsatisfied:
description: DependencyUnsatisfied notify does the trait has dependency unsatisfied
type: boolean
message:
description: Message will allow controller to leave some additional information for this trait
type: string
status:
description: Status is a place holder for a customized controller to fill if it needs a single place to summarize the status of the trait
type: string
traitRef:
description: Reference to a trait created by an ApplicationConfiguration.
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:
- traitRef
type: object
type: array
workloadRef:
description: Reference to a workload created by an ApplicationConfiguration.
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
type: object
type: array
type: object
type: object
served: true
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,976 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
cert-manager.io/inject-ca-from: vela-system/kubevela-vela-core-root-cert
controller-gen.kubebuilder.io/version: v0.2.4
name: applications.core.oam.dev
spec:
conversion:
strategy: Webhook
webhook:
clientConfig:
service:
name: vela-core-webhook
namespace: vela-system
path: /convert
port: 443
conversionReviewVersions:
- v1beta1
- v1alpha2
group: core.oam.dev
names:
categories:
- oam
kind: Application
listKind: ApplicationList
plural: applications
shortNames:
- app
singular: application
scope: Namespaced
versions:
- additionalPrinterColumns:
- jsonPath: .spec.components[*].name
name: COMPONENT
type: string
- jsonPath: .spec.components[*].type
name: TYPE
type: string
- jsonPath: .status.status
name: PHASE
type: string
- jsonPath: .status.services[*].healthy
name: HEALTHY
type: boolean
- jsonPath: .status.services[*].message
name: STATUS
type: string
- jsonPath: .metadata.creationTimestamp
name: AGE
type: date
name: v1alpha2
schema:
openAPIV3Schema:
description: Application is the Schema for the applications 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: ApplicationSpec is the spec of Application
properties:
components:
items:
description: ApplicationComponent describe the component of application
properties:
name:
type: string
scopes:
additionalProperties:
type: string
description: scopes in ApplicationComponent defines the component-level scopes the format is <scope-type:scope-instance-name> pairs, the key represents type of `ScopeDefinition` while the value represent the name of scope instance.
type: object
x-kubernetes-preserve-unknown-fields: true
settings:
type: object
x-kubernetes-preserve-unknown-fields: true
traits:
description: Traits define the trait of one component, the type must be array to keep the order.
items:
description: ApplicationTrait defines the trait of application
properties:
name:
type: string
properties:
type: object
x-kubernetes-preserve-unknown-fields: true
required:
- name
type: object
type: array
type:
type: string
required:
- name
- type
type: object
type: array
rolloutPlan:
description: RolloutPlan is the details on how to rollout the resources The controller simply replace the old resources with the new one if there is no rollout plan involved
properties:
batchPartition:
description: All pods in the batches up to the batchPartition (included) will have the target resource specification while the rest still have the source resource This is designed for the operators to manually rollout Default is the the number of batches which will rollout all the batches
format: int32
type: integer
canaryMetric:
description: CanaryMetric provides a way for the rollout process to automatically check certain metrics before complete the process
items:
description: CanaryMetric holds the reference to metrics used for canary analysis
properties:
interval:
description: Interval represents the windows size
type: string
metricsRange:
description: Range value accepted for this metric
properties:
max:
anyOf:
- type: integer
- type: string
description: Maximum value
x-kubernetes-int-or-string: true
min:
anyOf:
- type: integer
- type: string
description: Minimum value
x-kubernetes-int-or-string: true
type: object
name:
description: Name of the metric
type: string
templateRef:
description: TemplateRef references a metric template object
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:
- name
type: object
type: array
numBatches:
description: The number of batches, default = 1
format: int32
type: integer
paused:
description: Paused the rollout, default is false
type: boolean
rolloutBatches:
description: The exact distribution among batches. its size has to be exactly the same as the NumBatches (if set) The total number cannot exceed the targetSize or the size of the source resource We will IGNORE the last batch's replica field if it's a percentage since round errors can lead to inaccurate sum We highly recommend to leave the last batch's replica field empty
items:
description: RolloutBatch is used to describe how the each batch rollout should be
properties:
batchRolloutWebhooks:
description: RolloutWebhooks provides a way for the batch rollout to interact with an external process
items:
description: RolloutWebhook holds the reference to external checks used for canary analysis
properties:
expectedStatus:
description: ExpectedStatus contains all the expected http status code that we will accept as success
items:
type: integer
type: array
metadata:
additionalProperties:
type: string
description: Metadata (key-value pairs) for this webhook
type: object
method:
description: Method the HTTP call method, default is POST
type: string
name:
description: Name of this webhook
type: string
type:
description: Type of this webhook
type: string
url:
description: URL address of this webhook
type: string
required:
- name
- type
- url
type: object
type: array
canaryMetric:
description: CanaryMetric provides a way for the batch rollout process to automatically check certain metrics before moving to the next batch
items:
description: CanaryMetric holds the reference to metrics used for canary analysis
properties:
interval:
description: Interval represents the windows size
type: string
metricsRange:
description: Range value accepted for this metric
properties:
max:
anyOf:
- type: integer
- type: string
description: Maximum value
x-kubernetes-int-or-string: true
min:
anyOf:
- type: integer
- type: string
description: Minimum value
x-kubernetes-int-or-string: true
type: object
name:
description: Name of the metric
type: string
templateRef:
description: TemplateRef references a metric template object
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:
- name
type: object
type: array
instanceInterval:
description: The wait time, in seconds, between instances upgrades, default = 0
format: int32
type: integer
maxUnavailable:
anyOf:
- type: integer
- type: string
description: MaxUnavailable is the max allowed number of pods that is unavailable during the upgrade. We will mark the batch as ready as long as there are less or equal number of pods unavailable than this number. default = 0
x-kubernetes-int-or-string: true
podList:
description: The list of Pods to get upgraded it is mutually exclusive with the Replicas field
items:
type: string
type: array
replicas:
anyOf:
- type: integer
- type: string
description: 'Replicas is the number of pods to upgrade in this batch it can be an absolute number (ex: 5) or a percentage of total pods we will ignore the percentage of the last batch to just fill the gap it is mutually exclusive with the PodList field'
x-kubernetes-int-or-string: true
type: object
type: array
rolloutStrategy:
description: RolloutStrategy defines strategies for the rollout plan The default is IncreaseFirstRolloutStrategyType
type: string
rolloutWebhooks:
description: RolloutWebhooks provide a way for the rollout to interact with an external process
items:
description: RolloutWebhook holds the reference to external checks used for canary analysis
properties:
expectedStatus:
description: ExpectedStatus contains all the expected http status code that we will accept as success
items:
type: integer
type: array
metadata:
additionalProperties:
type: string
description: Metadata (key-value pairs) for this webhook
type: object
method:
description: Method the HTTP call method, default is POST
type: string
name:
description: Name of this webhook
type: string
type:
description: Type of this webhook
type: string
url:
description: URL address of this webhook
type: string
required:
- name
- type
- url
type: object
type: array
targetSize:
description: The size of the target resource. The default is the same as the size of the source resource.
format: int32
type: integer
type: object
required:
- components
type: object
status:
description: AppStatus defines the observed state of Application
properties:
batchRollingState:
description: BatchRollingState only meaningful when the Status is rolling
type: string
components:
description: Components record the related Components created by Application Controller
items:
description: A TypedReference refers to an object by Name, Kind, and APIVersion. It is commonly used to reference cluster-scoped objects or objects where the namespace is already known.
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
type: array
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
currentBatch:
description: The current batch the rollout is working on/blocked it starts from 0
format: int32
type: integer
lastAppliedPodTemplateIdentifier:
description: lastAppliedPodTemplateIdentifier is a string that uniquely represent the last pod template each workload type could use different ways to identify that so we cannot compare between resources We update this field only after a successful rollout
type: string
latestRevision:
description: LatestRevision of the application configuration it generates
properties:
name:
type: string
revision:
format: int64
type: integer
revisionHash:
description: RevisionHash record the hash value of the spec of ApplicationRevision object.
type: string
required:
- name
- revision
type: object
resourceTracker:
description: ResourceTracker record the status of the ResourceTracker
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
rollingState:
description: RollingState is the Rollout State
type: string
rolloutOriginalSize:
description: RolloutTargetSize is the size of the target resources. This is determined once the initial spec verification and does not change until the rollout is restarted
format: int32
type: integer
rolloutTargetSize:
description: RolloutTargetSize is the size of the target resources. This is determined once the initial spec verification and does not change until the rollout is restarted
format: int32
type: integer
services:
description: Services record the status of the application services
items:
description: ApplicationComponentStatus record the health status of App component
properties:
healthy:
type: boolean
message:
type: string
name:
type: string
traits:
items:
description: ApplicationTraitStatus records the trait health status
properties:
healthy:
type: boolean
message:
type: string
type:
type: string
required:
- healthy
- type
type: object
type: array
workloadDefinition:
description: WorkloadDefinition is the definition of a WorkloadDefinition, such as deployments/apps.v1
properties:
apiVersion:
type: string
kind:
type: string
required:
- apiVersion
- kind
type: object
required:
- healthy
- name
type: object
type: array
status:
description: ApplicationPhase is a label for the condition of a application at the current time
type: string
targetGeneration:
description: NewPodTemplateIdentifier is a string that uniquely represent the new pod template each workload type could use different ways to identify that so we cannot compare between resources
type: string
upgradedReadyReplicas:
description: UpgradedReadyReplicas is the number of Pods upgraded by the rollout controller that have a Ready Condition.
format: int32
type: integer
upgradedReplicas:
description: UpgradedReplicas is the number of Pods upgraded by the rollout controller
format: int32
type: integer
required:
- currentBatch
- rollingState
- upgradedReadyReplicas
- upgradedReplicas
type: object
type: object
served: true
storage: false
subresources:
status: {}
- additionalPrinterColumns:
- jsonPath: .spec.components[*].name
name: COMPONENT
type: string
- jsonPath: .spec.components[*].type
name: TYPE
type: string
- jsonPath: .status.status
name: PHASE
type: string
- jsonPath: .status.services[*].healthy
name: HEALTHY
type: boolean
- jsonPath: .status.services[*].message
name: STATUS
type: string
- jsonPath: .metadata.creationTimestamp
name: AGE
type: date
name: v1beta1
schema:
openAPIV3Schema:
description: Application is the Schema for the applications 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: ApplicationSpec is the spec of Application
properties:
components:
items:
description: ApplicationComponent describe the component of application
properties:
name:
type: string
properties:
type: object
x-kubernetes-preserve-unknown-fields: true
scopes:
additionalProperties:
type: string
description: scopes in ApplicationComponent defines the component-level scopes the format is <scope-type:scope-instance-name> pairs, the key represents type of `ScopeDefinition` while the value represent the name of scope instance.
type: object
x-kubernetes-preserve-unknown-fields: true
traits:
description: Traits define the trait of one component, the type must be array to keep the order.
items:
description: ApplicationTrait defines the trait of application
properties:
properties:
type: object
x-kubernetes-preserve-unknown-fields: true
type:
type: string
required:
- type
type: object
type: array
type:
type: string
required:
- name
- type
type: object
type: array
rolloutPlan:
description: RolloutPlan is the details on how to rollout the resources The controller simply replace the old resources with the new one if there is no rollout plan involved
properties:
batchPartition:
description: All pods in the batches up to the batchPartition (included) will have the target resource specification while the rest still have the source resource This is designed for the operators to manually rollout Default is the the number of batches which will rollout all the batches
format: int32
type: integer
canaryMetric:
description: CanaryMetric provides a way for the rollout process to automatically check certain metrics before complete the process
items:
description: CanaryMetric holds the reference to metrics used for canary analysis
properties:
interval:
description: Interval represents the windows size
type: string
metricsRange:
description: Range value accepted for this metric
properties:
max:
anyOf:
- type: integer
- type: string
description: Maximum value
x-kubernetes-int-or-string: true
min:
anyOf:
- type: integer
- type: string
description: Minimum value
x-kubernetes-int-or-string: true
type: object
name:
description: Name of the metric
type: string
templateRef:
description: TemplateRef references a metric template object
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:
- name
type: object
type: array
numBatches:
description: The number of batches, default = 1
format: int32
type: integer
paused:
description: Paused the rollout, default is false
type: boolean
rolloutBatches:
description: The exact distribution among batches. its size has to be exactly the same as the NumBatches (if set) The total number cannot exceed the targetSize or the size of the source resource We will IGNORE the last batch's replica field if it's a percentage since round errors can lead to inaccurate sum We highly recommend to leave the last batch's replica field empty
items:
description: RolloutBatch is used to describe how the each batch rollout should be
properties:
batchRolloutWebhooks:
description: RolloutWebhooks provides a way for the batch rollout to interact with an external process
items:
description: RolloutWebhook holds the reference to external checks used for canary analysis
properties:
expectedStatus:
description: ExpectedStatus contains all the expected http status code that we will accept as success
items:
type: integer
type: array
metadata:
additionalProperties:
type: string
description: Metadata (key-value pairs) for this webhook
type: object
method:
description: Method the HTTP call method, default is POST
type: string
name:
description: Name of this webhook
type: string
type:
description: Type of this webhook
type: string
url:
description: URL address of this webhook
type: string
required:
- name
- type
- url
type: object
type: array
canaryMetric:
description: CanaryMetric provides a way for the batch rollout process to automatically check certain metrics before moving to the next batch
items:
description: CanaryMetric holds the reference to metrics used for canary analysis
properties:
interval:
description: Interval represents the windows size
type: string
metricsRange:
description: Range value accepted for this metric
properties:
max:
anyOf:
- type: integer
- type: string
description: Maximum value
x-kubernetes-int-or-string: true
min:
anyOf:
- type: integer
- type: string
description: Minimum value
x-kubernetes-int-or-string: true
type: object
name:
description: Name of the metric
type: string
templateRef:
description: TemplateRef references a metric template object
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:
- name
type: object
type: array
instanceInterval:
description: The wait time, in seconds, between instances upgrades, default = 0
format: int32
type: integer
maxUnavailable:
anyOf:
- type: integer
- type: string
description: MaxUnavailable is the max allowed number of pods that is unavailable during the upgrade. We will mark the batch as ready as long as there are less or equal number of pods unavailable than this number. default = 0
x-kubernetes-int-or-string: true
podList:
description: The list of Pods to get upgraded it is mutually exclusive with the Replicas field
items:
type: string
type: array
replicas:
anyOf:
- type: integer
- type: string
description: 'Replicas is the number of pods to upgrade in this batch it can be an absolute number (ex: 5) or a percentage of total pods we will ignore the percentage of the last batch to just fill the gap it is mutually exclusive with the PodList field'
x-kubernetes-int-or-string: true
type: object
type: array
rolloutStrategy:
description: RolloutStrategy defines strategies for the rollout plan The default is IncreaseFirstRolloutStrategyType
type: string
rolloutWebhooks:
description: RolloutWebhooks provide a way for the rollout to interact with an external process
items:
description: RolloutWebhook holds the reference to external checks used for canary analysis
properties:
expectedStatus:
description: ExpectedStatus contains all the expected http status code that we will accept as success
items:
type: integer
type: array
metadata:
additionalProperties:
type: string
description: Metadata (key-value pairs) for this webhook
type: object
method:
description: Method the HTTP call method, default is POST
type: string
name:
description: Name of this webhook
type: string
type:
description: Type of this webhook
type: string
url:
description: URL address of this webhook
type: string
required:
- name
- type
- url
type: object
type: array
targetSize:
description: The size of the target resource. The default is the same as the size of the source resource.
format: int32
type: integer
type: object
required:
- components
type: object
status:
description: AppStatus defines the observed state of Application
properties:
batchRollingState:
description: BatchRollingState only meaningful when the Status is rolling
type: string
components:
description: Components record the related Components created by Application Controller
items:
description: A TypedReference refers to an object by Name, Kind, and APIVersion. It is commonly used to reference cluster-scoped objects or objects where the namespace is already known.
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
type: array
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
currentBatch:
description: The current batch the rollout is working on/blocked it starts from 0
format: int32
type: integer
lastAppliedPodTemplateIdentifier:
description: lastAppliedPodTemplateIdentifier is a string that uniquely represent the last pod template each workload type could use different ways to identify that so we cannot compare between resources We update this field only after a successful rollout
type: string
latestRevision:
description: LatestRevision of the application configuration it generates
properties:
name:
type: string
revision:
format: int64
type: integer
revisionHash:
description: RevisionHash record the hash value of the spec of ApplicationRevision object.
type: string
required:
- name
- revision
type: object
resourceTracker:
description: ResourceTracker record the status of the ResourceTracker
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
rollingState:
description: RollingState is the Rollout State
type: string
rolloutOriginalSize:
description: RolloutTargetSize is the size of the target resources. This is determined once the initial spec verification and does not change until the rollout is restarted
format: int32
type: integer
rolloutTargetSize:
description: RolloutTargetSize is the size of the target resources. This is determined once the initial spec verification and does not change until the rollout is restarted
format: int32
type: integer
services:
description: Services record the status of the application services
items:
description: ApplicationComponentStatus record the health status of App component
properties:
healthy:
type: boolean
message:
type: string
name:
type: string
traits:
items:
description: ApplicationTraitStatus records the trait health status
properties:
healthy:
type: boolean
message:
type: string
type:
type: string
required:
- healthy
- type
type: object
type: array
workloadDefinition:
description: WorkloadDefinition is the definition of a WorkloadDefinition, such as deployments/apps.v1
properties:
apiVersion:
type: string
kind:
type: string
required:
- apiVersion
- kind
type: object
required:
- healthy
- name
type: object
type: array
status:
description: ApplicationPhase is a label for the condition of a application at the current time
type: string
targetGeneration:
description: NewPodTemplateIdentifier is a string that uniquely represent the new pod template each workload type could use different ways to identify that so we cannot compare between resources
type: string
upgradedReadyReplicas:
description: UpgradedReadyReplicas is the number of Pods upgraded by the rollout controller that have a Ready Condition.
format: int32
type: integer
upgradedReplicas:
description: UpgradedReplicas is the number of Pods upgraded by the rollout controller
format: int32
type: integer
required:
- currentBatch
- rollingState
- upgradedReadyReplicas
- upgradedReplicas
type: object
type: object
served: true
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []

View File

@@ -0,0 +1,731 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.2.4
name: approllouts.core.oam.dev
spec:
group: core.oam.dev
names:
categories:
- oam
kind: AppRollout
listKind: AppRolloutList
plural: approllouts
shortNames:
- approllout
singular: approllout
scope: Namespaced
versions:
- additionalPrinterColumns:
- jsonPath: .status.rolloutStatus.rolloutTargetSize
name: TARGET
type: string
- jsonPath: .status.rolloutStatus.upgradedReplicas
name: UPGRADED
type: string
- jsonPath: .status.rolloutStatus.upgradedReadyReplicas
name: READY
type: string
- jsonPath: .status.rolloutStatus.batchRollingState
name: BATCH-STATE
type: string
- jsonPath: .status.rolloutStatus.rollingState
name: ROLLING-STATE
type: string
- jsonPath: .metadata.creationTimestamp
name: AGE
type: date
name: v1alpha2
schema:
openAPIV3Schema:
description: AppRollout is the Schema for the AppRollout 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: AppRolloutSpec defines how to describe an upgrade between different apps
properties:
componentList:
description: 'The list of component to upgrade in the application. We only support single component application so far TODO: (RZ) Support multiple components in an application'
items:
type: string
type: array
revertOnDelete:
description: RevertOnDelete revert the rollout when the rollout CR is deleted It will remove the target app from the kubernetes if it's set to true
type: boolean
rolloutPlan:
description: RolloutPlan is the details on how to rollout the resources
properties:
batchPartition:
description: All pods in the batches up to the batchPartition (included) will have the target resource specification while the rest still have the source resource This is designed for the operators to manually rollout Default is the the number of batches which will rollout all the batches
format: int32
type: integer
canaryMetric:
description: CanaryMetric provides a way for the rollout process to automatically check certain metrics before complete the process
items:
description: CanaryMetric holds the reference to metrics used for canary analysis
properties:
interval:
description: Interval represents the windows size
type: string
metricsRange:
description: Range value accepted for this metric
properties:
max:
anyOf:
- type: integer
- type: string
description: Maximum value
x-kubernetes-int-or-string: true
min:
anyOf:
- type: integer
- type: string
description: Minimum value
x-kubernetes-int-or-string: true
type: object
name:
description: Name of the metric
type: string
templateRef:
description: TemplateRef references a metric template object
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:
- name
type: object
type: array
numBatches:
description: The number of batches, default = 1
format: int32
type: integer
paused:
description: Paused the rollout, default is false
type: boolean
rolloutBatches:
description: The exact distribution among batches. its size has to be exactly the same as the NumBatches (if set) The total number cannot exceed the targetSize or the size of the source resource We will IGNORE the last batch's replica field if it's a percentage since round errors can lead to inaccurate sum We highly recommend to leave the last batch's replica field empty
items:
description: RolloutBatch is used to describe how the each batch rollout should be
properties:
batchRolloutWebhooks:
description: RolloutWebhooks provides a way for the batch rollout to interact with an external process
items:
description: RolloutWebhook holds the reference to external checks used for canary analysis
properties:
expectedStatus:
description: ExpectedStatus contains all the expected http status code that we will accept as success
items:
type: integer
type: array
metadata:
additionalProperties:
type: string
description: Metadata (key-value pairs) for this webhook
type: object
method:
description: Method the HTTP call method, default is POST
type: string
name:
description: Name of this webhook
type: string
type:
description: Type of this webhook
type: string
url:
description: URL address of this webhook
type: string
required:
- name
- type
- url
type: object
type: array
canaryMetric:
description: CanaryMetric provides a way for the batch rollout process to automatically check certain metrics before moving to the next batch
items:
description: CanaryMetric holds the reference to metrics used for canary analysis
properties:
interval:
description: Interval represents the windows size
type: string
metricsRange:
description: Range value accepted for this metric
properties:
max:
anyOf:
- type: integer
- type: string
description: Maximum value
x-kubernetes-int-or-string: true
min:
anyOf:
- type: integer
- type: string
description: Minimum value
x-kubernetes-int-or-string: true
type: object
name:
description: Name of the metric
type: string
templateRef:
description: TemplateRef references a metric template object
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:
- name
type: object
type: array
instanceInterval:
description: The wait time, in seconds, between instances upgrades, default = 0
format: int32
type: integer
maxUnavailable:
anyOf:
- type: integer
- type: string
description: MaxUnavailable is the max allowed number of pods that is unavailable during the upgrade. We will mark the batch as ready as long as there are less or equal number of pods unavailable than this number. default = 0
x-kubernetes-int-or-string: true
podList:
description: The list of Pods to get upgraded it is mutually exclusive with the Replicas field
items:
type: string
type: array
replicas:
anyOf:
- type: integer
- type: string
description: 'Replicas is the number of pods to upgrade in this batch it can be an absolute number (ex: 5) or a percentage of total pods we will ignore the percentage of the last batch to just fill the gap it is mutually exclusive with the PodList field'
x-kubernetes-int-or-string: true
type: object
type: array
rolloutStrategy:
description: RolloutStrategy defines strategies for the rollout plan The default is IncreaseFirstRolloutStrategyType
type: string
rolloutWebhooks:
description: RolloutWebhooks provide a way for the rollout to interact with an external process
items:
description: RolloutWebhook holds the reference to external checks used for canary analysis
properties:
expectedStatus:
description: ExpectedStatus contains all the expected http status code that we will accept as success
items:
type: integer
type: array
metadata:
additionalProperties:
type: string
description: Metadata (key-value pairs) for this webhook
type: object
method:
description: Method the HTTP call method, default is POST
type: string
name:
description: Name of this webhook
type: string
type:
description: Type of this webhook
type: string
url:
description: URL address of this webhook
type: string
required:
- name
- type
- url
type: object
type: array
targetSize:
description: The size of the target resource. The default is the same as the size of the source resource.
format: int32
type: integer
type: object
sourceAppRevisionName:
description: SourceAppRevisionName contains the name of the applicationRevision that we need to upgrade from. it can be empty only when the rolling is only a scale event
type: string
targetAppRevisionName:
description: TargetAppRevisionName contains the name of the applicationRevision that we need to upgrade to.
type: string
required:
- rolloutPlan
- targetAppRevisionName
type: object
status:
description: AppRolloutStatus defines the observed state of AppRollout
properties:
LastSourceAppRevision:
description: LastSourceAppRevision contains the name of the app that we need to upgrade from. We will restart the rollout if this is not the same as the spec
type: string
batchRollingState:
description: BatchRollingState only meaningful when the Status is rolling
type: string
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
currentBatch:
description: The current batch the rollout is working on/blocked it starts from 0
format: int32
type: integer
lastAppliedPodTemplateIdentifier:
description: lastAppliedPodTemplateIdentifier is a string that uniquely represent the last pod template each workload type could use different ways to identify that so we cannot compare between resources We update this field only after a successful rollout
type: string
lastTargetAppRevision:
description: LastUpgradedTargetAppRevision contains the name of the app that we upgraded to We will restart the rollout if this is not the same as the spec
type: string
rollingState:
description: RollingState is the Rollout State
type: string
rolloutOriginalSize:
description: RolloutTargetSize is the size of the target resources. This is determined once the initial spec verification and does not change until the rollout is restarted
format: int32
type: integer
rolloutTargetSize:
description: RolloutTargetSize is the size of the target resources. This is determined once the initial spec verification and does not change until the rollout is restarted
format: int32
type: integer
targetGeneration:
description: NewPodTemplateIdentifier is a string that uniquely represent the new pod template each workload type could use different ways to identify that so we cannot compare between resources
type: string
upgradedReadyReplicas:
description: UpgradedReadyReplicas is the number of Pods upgraded by the rollout controller that have a Ready Condition.
format: int32
type: integer
upgradedReplicas:
description: UpgradedReplicas is the number of Pods upgraded by the rollout controller
format: int32
type: integer
required:
- currentBatch
- lastTargetAppRevision
- rollingState
- upgradedReadyReplicas
- upgradedReplicas
type: object
type: object
served: true
storage: false
subresources:
status: {}
- additionalPrinterColumns:
- jsonPath: .status.rolloutTargetSize
name: TARGET
type: string
- jsonPath: .status.upgradedReplicas
name: UPGRADED
type: string
- jsonPath: .status.upgradedReadyReplicas
name: READY
type: string
- jsonPath: .status.batchRollingState
name: BATCH-STATE
type: string
- jsonPath: .status.rollingState
name: ROLLING-STATE
type: string
- jsonPath: .metadata.creationTimestamp
name: AGE
type: date
name: v1beta1
schema:
openAPIV3Schema:
description: AppRollout is the Schema for the AppRollout 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: AppRolloutSpec defines how to describe an upgrade between different apps
properties:
componentList:
description: 'The list of component to upgrade in the application. We only support single component application so far TODO: (RZ) Support multiple components in an application'
items:
type: string
type: array
revertOnDelete:
description: RevertOnDelete revert the failed rollout when the rollout CR is deleted It will revert the change back to the source version at once (not in batches) Default is false
type: boolean
rolloutPlan:
description: RolloutPlan is the details on how to rollout the resources
properties:
batchPartition:
description: All pods in the batches up to the batchPartition (included) will have the target resource specification while the rest still have the source resource This is designed for the operators to manually rollout Default is the the number of batches which will rollout all the batches
format: int32
type: integer
canaryMetric:
description: CanaryMetric provides a way for the rollout process to automatically check certain metrics before complete the process
items:
description: CanaryMetric holds the reference to metrics used for canary analysis
properties:
interval:
description: Interval represents the windows size
type: string
metricsRange:
description: Range value accepted for this metric
properties:
max:
anyOf:
- type: integer
- type: string
description: Maximum value
x-kubernetes-int-or-string: true
min:
anyOf:
- type: integer
- type: string
description: Minimum value
x-kubernetes-int-or-string: true
type: object
name:
description: Name of the metric
type: string
templateRef:
description: TemplateRef references a metric template object
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:
- name
type: object
type: array
numBatches:
description: The number of batches, default = 1
format: int32
type: integer
paused:
description: Paused the rollout, default is false
type: boolean
rolloutBatches:
description: The exact distribution among batches. its size has to be exactly the same as the NumBatches (if set) The total number cannot exceed the targetSize or the size of the source resource We will IGNORE the last batch's replica field if it's a percentage since round errors can lead to inaccurate sum We highly recommend to leave the last batch's replica field empty
items:
description: RolloutBatch is used to describe how the each batch rollout should be
properties:
batchRolloutWebhooks:
description: RolloutWebhooks provides a way for the batch rollout to interact with an external process
items:
description: RolloutWebhook holds the reference to external checks used for canary analysis
properties:
expectedStatus:
description: ExpectedStatus contains all the expected http status code that we will accept as success
items:
type: integer
type: array
metadata:
additionalProperties:
type: string
description: Metadata (key-value pairs) for this webhook
type: object
method:
description: Method the HTTP call method, default is POST
type: string
name:
description: Name of this webhook
type: string
type:
description: Type of this webhook
type: string
url:
description: URL address of this webhook
type: string
required:
- name
- type
- url
type: object
type: array
canaryMetric:
description: CanaryMetric provides a way for the batch rollout process to automatically check certain metrics before moving to the next batch
items:
description: CanaryMetric holds the reference to metrics used for canary analysis
properties:
interval:
description: Interval represents the windows size
type: string
metricsRange:
description: Range value accepted for this metric
properties:
max:
anyOf:
- type: integer
- type: string
description: Maximum value
x-kubernetes-int-or-string: true
min:
anyOf:
- type: integer
- type: string
description: Minimum value
x-kubernetes-int-or-string: true
type: object
name:
description: Name of the metric
type: string
templateRef:
description: TemplateRef references a metric template object
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:
- name
type: object
type: array
instanceInterval:
description: The wait time, in seconds, between instances upgrades, default = 0
format: int32
type: integer
maxUnavailable:
anyOf:
- type: integer
- type: string
description: MaxUnavailable is the max allowed number of pods that is unavailable during the upgrade. We will mark the batch as ready as long as there are less or equal number of pods unavailable than this number. default = 0
x-kubernetes-int-or-string: true
podList:
description: The list of Pods to get upgraded it is mutually exclusive with the Replicas field
items:
type: string
type: array
replicas:
anyOf:
- type: integer
- type: string
description: 'Replicas is the number of pods to upgrade in this batch it can be an absolute number (ex: 5) or a percentage of total pods we will ignore the percentage of the last batch to just fill the gap it is mutually exclusive with the PodList field'
x-kubernetes-int-or-string: true
type: object
type: array
rolloutStrategy:
description: RolloutStrategy defines strategies for the rollout plan The default is IncreaseFirstRolloutStrategyType
type: string
rolloutWebhooks:
description: RolloutWebhooks provide a way for the rollout to interact with an external process
items:
description: RolloutWebhook holds the reference to external checks used for canary analysis
properties:
expectedStatus:
description: ExpectedStatus contains all the expected http status code that we will accept as success
items:
type: integer
type: array
metadata:
additionalProperties:
type: string
description: Metadata (key-value pairs) for this webhook
type: object
method:
description: Method the HTTP call method, default is POST
type: string
name:
description: Name of this webhook
type: string
type:
description: Type of this webhook
type: string
url:
description: URL address of this webhook
type: string
required:
- name
- type
- url
type: object
type: array
targetSize:
description: The size of the target resource. The default is the same as the size of the source resource.
format: int32
type: integer
type: object
sourceAppRevisionName:
description: SourceAppRevisionName contains the name of the applicationConfiguration that we need to upgrade from. it can be empty only when it's the first time to deploy the application
type: string
targetAppRevisionName:
description: TargetAppRevisionName contains the name of the applicationConfiguration that we need to upgrade to. Here we use an applicationConfiguration as a revision of an application, thus the name alone is suffice
type: string
required:
- rolloutPlan
- targetAppRevisionName
type: object
status:
description: AppRolloutStatus defines the observed state of AppRollout
properties:
LastSourceAppRevision:
description: LastSourceAppRevision contains the name of the app that we need to upgrade from. We will restart the rollout if this is not the same as the spec
type: string
batchRollingState:
description: BatchRollingState only meaningful when the Status is rolling
type: string
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
currentBatch:
description: The current batch the rollout is working on/blocked it starts from 0
format: int32
type: integer
lastAppliedPodTemplateIdentifier:
description: lastAppliedPodTemplateIdentifier is a string that uniquely represent the last pod template each workload type could use different ways to identify that so we cannot compare between resources We update this field only after a successful rollout
type: string
lastTargetAppRevision:
description: LastUpgradedTargetAppRevision contains the name of the app that we upgraded to We will restart the rollout if this is not the same as the spec
type: string
rollingState:
description: RollingState is the Rollout State
type: string
rolloutOriginalSize:
description: RolloutTargetSize is the size of the target resources. This is determined once the initial spec verification and does not change until the rollout is restarted
format: int32
type: integer
rolloutTargetSize:
description: RolloutTargetSize is the size of the target resources. This is determined once the initial spec verification and does not change until the rollout is restarted
format: int32
type: integer
targetGeneration:
description: NewPodTemplateIdentifier is a string that uniquely represent the new pod template each workload type could use different ways to identify that so we cannot compare between resources
type: string
upgradedReadyReplicas:
description: UpgradedReadyReplicas is the number of Pods upgraded by the rollout controller that have a Ready Condition.
format: int32
type: integer
upgradedReplicas:
description: UpgradedReplicas is the number of Pods upgraded by the rollout controller
format: int32
type: integer
required:
- currentBatch
- lastTargetAppRevision
- rollingState
- upgradedReadyReplicas
- upgradedReplicas
type: object
type: object
served: true
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []

View File

@@ -0,0 +1,55 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.2.4
name: clusters.core.oam.dev
spec:
group: core.oam.dev
names:
kind: Cluster
listKind: ClusterList
plural: clusters
singular: cluster
scope: Namespaced
versions:
- name: v1beta1
schema:
openAPIV3Schema:
description: Cluster is the Schema for the clusters 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: ClusterSpec defines the desired state of Cluster
properties:
kubeconfigSecretRef:
description: KubeconfigSecretRef specifies the reference to the secret that contains the kubeconfig in field `config`.
properties:
name:
description: Name of a secret within the enclosing namespace.
type: string
required:
- name
type: object
type: object
status:
description: ClusterStatus defines the observed state of Cluster
type: object
type: object
served: true
storage: true
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []

View File

@@ -0,0 +1,419 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.2.4
name: componentdefinitions.core.oam.dev
spec:
group: core.oam.dev
names:
categories:
- oam
kind: ComponentDefinition
listKind: ComponentDefinitionList
plural: componentdefinitions
shortNames:
- comp
singular: componentdefinition
scope: Namespaced
versions:
- additionalPrinterColumns:
- jsonPath: .spec.workload.definition.kind
name: WORKLOAD-KIND
type: string
- jsonPath: .metadata.annotations.definition\.oam\.dev/description
name: DESCRIPTION
type: string
name: v1alpha2
schema:
openAPIV3Schema:
description: ComponentDefinition is the Schema for the componentdefinitions 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: ComponentDefinitionSpec defines the desired state of ComponentDefinition
properties:
childResourceKinds:
description: ChildResourceKinds are the list of GVK of the child resources this workload generates
items:
description: A ChildResourceKind defines a child Kubernetes resource kind with a selector
properties:
apiVersion:
description: APIVersion of the child resource
type: string
kind:
description: Kind of the child resource
type: string
selector:
additionalProperties:
type: string
description: Selector to select the child resources that the workload wants to expose to traits
type: object
required:
- apiVersion
- kind
type: object
type: array
extension:
description: Extension is used for extension needs by OAM platform builders
type: object
x-kubernetes-preserve-unknown-fields: true
podSpecPath:
description: PodSpecPath indicates where/if this workload has K8s podSpec field if one workload has podSpec, trait can do lot's of assumption such as port, env, volume fields.
type: string
revisionLabel:
description: RevisionLabel indicates which label for underlying resources(e.g. pods) of this workload can be used by trait to create resource selectors(e.g. label selector for pods).
type: string
schematic:
description: Schematic defines the data format and template of the encapsulation of the workload
properties:
cue:
description: CUE defines the encapsulation in CUE format
properties:
template:
description: Template defines the abstraction template data of the capability, it will replace the old CUE template in extension field. Template is a required field if CUE is defined in Capability Definition.
type: string
required:
- template
type: object
helm:
description: A Helm represents resources used by a Helm module
properties:
release:
description: Release records a Helm release used by a Helm module workload.
type: object
x-kubernetes-preserve-unknown-fields: true
repository:
description: HelmRelease records a Helm repository used by a Helm module workload.
type: object
x-kubernetes-preserve-unknown-fields: true
required:
- release
- repository
type: object
kube:
description: Kube defines the encapsulation in raw Kubernetes resource format
properties:
parameters:
description: Parameters defines configurable parameters
items:
description: A KubeParameter defines a configurable parameter of a component.
properties:
description:
description: Description of this parameter.
type: string
fieldPaths:
description: "FieldPaths specifies an array of fields within this workload that will be overwritten by the value of this parameter. \tAll fields must be of the same type. Fields are specified as JSON field paths without a leading dot, for example 'spec.replicas'."
items:
type: string
type: array
name:
description: Name of this parameter
type: string
required:
default: false
description: Required specifies whether or not a value for this parameter must be supplied when authoring an Application.
type: boolean
type:
description: 'ValueType indicates the type of the parameter value, and only supports basic data types: string, number, boolean.'
enum:
- string
- number
- boolean
type: string
required:
- fieldPaths
- name
- type
type: object
type: array
template:
description: Template defines the raw Kubernetes resource
type: object
x-kubernetes-preserve-unknown-fields: true
required:
- template
type: object
type: object
status:
description: Status defines the custom health policy and status message for workload
properties:
customStatus:
description: CustomStatus defines the custom status message that could display to user
type: string
healthPolicy:
description: HealthPolicy defines the health check policy for the abstraction
type: string
type: object
workload:
description: Workload is a workload type descriptor
properties:
definition:
description: Definition mutually exclusive to workload.type, a embedded WorkloadDefinition
properties:
apiVersion:
type: string
kind:
type: string
required:
- apiVersion
- kind
type: object
type:
description: Type ref to a WorkloadDefinition via name
type: string
type: object
required:
- workload
type: object
status:
description: ComponentDefinitionStatus is the status of ComponentDefinition
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
configMapRef:
description: ConfigMapRef refer to a ConfigMap which contains OpenAPI V3 JSON schema of Component parameters.
type: string
type: object
type: object
served: true
storage: false
subresources:
status: {}
- additionalPrinterColumns:
- jsonPath: .spec.workload.definition.kind
name: WORKLOAD-KIND
type: string
- jsonPath: .metadata.annotations.definition\.oam\.dev/description
name: DESCRIPTION
type: string
name: v1beta1
schema:
openAPIV3Schema:
description: ComponentDefinition is the Schema for the componentdefinitions 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: ComponentDefinitionSpec defines the desired state of ComponentDefinition
properties:
childResourceKinds:
description: ChildResourceKinds are the list of GVK of the child resources this workload generates
items:
description: A ChildResourceKind defines a child Kubernetes resource kind with a selector
properties:
apiVersion:
description: APIVersion of the child resource
type: string
kind:
description: Kind of the child resource
type: string
selector:
additionalProperties:
type: string
description: Selector to select the child resources that the workload wants to expose to traits
type: object
required:
- apiVersion
- kind
type: object
type: array
extension:
description: Extension is used for extension needs by OAM platform builders
type: object
x-kubernetes-preserve-unknown-fields: true
podSpecPath:
description: PodSpecPath indicates where/if this workload has K8s podSpec field if one workload has podSpec, trait can do lot's of assumption such as port, env, volume fields.
type: string
revisionLabel:
description: RevisionLabel indicates which label for underlying resources(e.g. pods) of this workload can be used by trait to create resource selectors(e.g. label selector for pods).
type: string
schematic:
description: Schematic defines the data format and template of the encapsulation of the workload
properties:
cue:
description: CUE defines the encapsulation in CUE format
properties:
template:
description: Template defines the abstraction template data of the capability, it will replace the old CUE template in extension field. Template is a required field if CUE is defined in Capability Definition.
type: string
required:
- template
type: object
helm:
description: A Helm represents resources used by a Helm module
properties:
release:
description: Release records a Helm release used by a Helm module workload.
type: object
x-kubernetes-preserve-unknown-fields: true
repository:
description: HelmRelease records a Helm repository used by a Helm module workload.
type: object
x-kubernetes-preserve-unknown-fields: true
required:
- release
- repository
type: object
kube:
description: Kube defines the encapsulation in raw Kubernetes resource format
properties:
parameters:
description: Parameters defines configurable parameters
items:
description: A KubeParameter defines a configurable parameter of a component.
properties:
description:
description: Description of this parameter.
type: string
fieldPaths:
description: "FieldPaths specifies an array of fields within this workload that will be overwritten by the value of this parameter. \tAll fields must be of the same type. Fields are specified as JSON field paths without a leading dot, for example 'spec.replicas'."
items:
type: string
type: array
name:
description: Name of this parameter
type: string
required:
default: false
description: Required specifies whether or not a value for this parameter must be supplied when authoring an Application.
type: boolean
type:
description: 'ValueType indicates the type of the parameter value, and only supports basic data types: string, number, boolean.'
enum:
- string
- number
- boolean
type: string
required:
- fieldPaths
- name
- type
type: object
type: array
template:
description: Template defines the raw Kubernetes resource
type: object
x-kubernetes-preserve-unknown-fields: true
required:
- template
type: object
type: object
status:
description: Status defines the custom health policy and status message for workload
properties:
customStatus:
description: CustomStatus defines the custom status message that could display to user
type: string
healthPolicy:
description: HealthPolicy defines the health check policy for the abstraction
type: string
type: object
workload:
description: Workload is a workload type descriptor
properties:
definition:
description: Definition mutually exclusive to workload.type, a embedded WorkloadDefinition
properties:
apiVersion:
type: string
kind:
type: string
required:
- apiVersion
- kind
type: object
type:
description: Type ref to a WorkloadDefinition via name
type: string
type: object
required:
- workload
type: object
status:
description: ComponentDefinitionStatus is the status of ComponentDefinition
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
configMapRef:
description: ConfigMapRef refer to a ConfigMap which contains OpenAPI V3 JSON schema of Component parameters.
type: string
type: object
type: object
served: true
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []

View File

@@ -5,13 +5,11 @@ kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.2.4
creationTimestamp: null
name: components.core.oam.dev
spec:
group: core.oam.dev
names:
categories:
- crossplane
- oam
kind: Component
listKind: ComponentList
@@ -32,48 +30,50 @@ spec:
description: A Component describes how an OAM workload kind may be instantiated.
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'
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'
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: A ComponentSpec defines the desired state of a Component.
properties:
helm:
description: HelmRelease records a Helm release used by a Helm module workload.
properties:
release:
description: Release records a Helm release used by a Helm module workload.
type: object
x-kubernetes-preserve-unknown-fields: true
repository:
description: HelmRelease records a Helm repository used by a Helm module workload.
type: object
x-kubernetes-preserve-unknown-fields: true
required:
- release
- repository
type: object
parameters:
description: Parameters exposed by this component. ApplicationConfigurations
that reference this component may specify values for these parameters,
which will in turn be injected into the embedded workload.
description: Parameters exposed by this component. ApplicationConfigurations that reference this component may specify values for these parameters, which will in turn be injected into the embedded workload.
items:
description: A ComponentParameter defines a configurable parameter
of a component.
description: A ComponentParameter defines a configurable parameter of a component.
properties:
description:
description: Description of this parameter.
type: string
fieldPaths:
description: FieldPaths specifies an array of fields within
this Component's workload that will be overwritten by the
value of this parameter. The type of the parameter (e.g. int,
string) is inferred from the type of these fields; All fields
must be of the same type. Fields are specified as JSON field
paths without a leading dot, for example 'spec.replicas'.
description: FieldPaths specifies an array of fields within this Component's workload that will be overwritten by the value of this parameter. The type of the parameter (e.g. int, string) is inferred from the type of these fields; All fields must be of the same type. Fields are specified as JSON field paths without a leading dot, for example 'spec.replicas'.
items:
type: string
type: array
name:
description: Name of this parameter. OAM ApplicationConfigurations
will specify parameter values using this name.
description: Name of this parameter. OAM ApplicationConfigurations will specify parameter values using this name.
type: string
required:
description: Required specifies whether or not a value for this
parameter must be supplied when authoring an ApplicationConfiguration.
default: false
description: Required specifies whether or not a value for this parameter must be supplied when authoring an ApplicationConfiguration.
type: boolean
required:
- fieldPaths
@@ -81,8 +81,7 @@ spec:
type: object
type: array
workload:
description: A Workload that will be created for each ApplicationConfiguration
that includes this Component. Workloads must be defined by a WorkloadDefinition.
description: A Workload that will be created for each ApplicationConfiguration that includes this Component. Workload is an instance of a workloadDefinition. We either use the GVK info or a special "type" field in the workload to associate the content of the workload with its workloadDefinition
type: object
x-kubernetes-embedded-resource: true
x-kubernetes-preserve-unknown-fields: true
@@ -98,25 +97,20 @@ spec:
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.
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.
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.
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?
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.
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
@@ -133,10 +127,17 @@ spec:
revision:
format: int64
type: integer
revisionHash:
description: RevisionHash record the hash value of the spec of ApplicationRevision object.
type: string
required:
- name
- revision
type: object
observedGeneration:
description: The generation observed by the component controller.
format: int64
type: integer
type: object
type: object
served: true

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