Commit Graph

304 Commits

Author SHA1 Message Date
yangsoon fed40a1060
fix webhook: set a default workload.type for componentdefinition which doesn't refer to a workload (#1686)
* fix webhook

* fix controller

* fix error message
2021-05-24 23:32:02 +08:00
Hongchao Deng ef021c5d2d api: add policy and workflow 2021-05-16 23:07:05 -04:00
Zheng Xi Zhou b3302b318c
Support server-side Terraform as cloud resource provider (#1519)
* Support server-side Terraform as cloud resource provider

Provide another schematic `Terraform` to provision cloud
resource.

Fix #698

* make namespace optional
add unit-tests

* support vela show to generate componentdefinition usage

* add unit-tests

* tidy go mod

* clean go mod and updated go sum

* Remove `variable` from `properties` of Terraform compoent

* don't literally set component catagory

* refine error message when a capability could not be found

* fix ut

* Code refactor and add unittests

* fix ci issues

* Update references/plugins/references.go

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

* add test cases

* fix ci issue

* revert lowercase of "Properties"

* fix ci issue

* add ut for appfile

* fix e2e issue

* add docs

* fix official site build

Co-authored-by: Jianbo Sun <wonderflow.sun@gmail.com>
2021-04-30 16:28:00 +08:00
wyike 29744a6f18
[Feature] embed rollout in an application (#1568)
* WIP refactor rollout reconcile

add construct func for reconcile

refactor application  event

WIP fix failed test

fix event reason

delete useless yaml

fix samll issue

add more test

fix more test

add e2e test and extract rollout plan from appRevision

extract inline appRollout status from appStatus

* fix-plugin-test

* debug e2e

* fix comments and rename app-embed-test

* delete empty line

* fix docs

* update rollout docs

fix appRollout docs

* update docs and delete useless debug info

* fix deployment plugin bug and algin with rollout related workload to deployment

* fix docs comment

* rename package crossplane-runtime v1alpha2

* copy from https://github.com/wangyikewxgm/kubevela/pull/1

* fix some comments issue and add todo

* fix error test
2021-04-30 15:17:43 +08:00
yangsoon ed3e8d384a
add DefinitionRevison and make Componet/TraitDefinition revisionable && fix legacy CRD (#1531)
* add definitionrevison type

* fix controller

* add test

* fix legacy

* fix unit-tests
2021-04-26 10:07:55 +08:00
yangsoon 63855abed9
fix cli: vela show support list the parameter of ComponentDefinition which use helm charts (#1543)
* vela show support helm

* show helm parameter in web

* add test

* support link jump

* add test
2021-04-23 16:50:44 +08:00
wyike 60b8ec3ff2
Set scpoe reference in application status.Service (#1540)
* WIP add new type

* add code and test

* WIP finish docs

* add sidbar for docs
2021-04-22 12:11:04 +08:00
Herman Zhu b726c5291f
feat(app) add k8s event for Application (#1463)
add k8s event for Application

fixed #1424

Signed-off-by: zhuhuijun <zhuhuijunzhj@gmail.com>

fix

Signed-off-by: zhuhuijun <zhuhuijunzhj@gmail.com>
2021-04-20 12:05:36 +08:00
yangsoon d063cd3b78
rm printcolumn AGE in crd (#1509) 2021-04-16 17:35:08 +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
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
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
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
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
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
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
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
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
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
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
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
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
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
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 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
yangsoon 4b9e933ca5
add v1beta1 types (#1268) 2021-03-24 13:27:29 +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
Jianbo Sun acf497b1c7
make CUE inner kube package as a standalone package && clean code (#1263) 2021-03-23 16:30:49 +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
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 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
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
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
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
Ryan Zhang b0bf9b1d96 allow state transition to be modified at any state 2021-03-18 00:39:02 -07:00
yangsoon 6a96062464 add related test. 2021-03-18 12:12:09 +08:00
Jianbo Sun 5b2b27e6a4
init ApplicationRevision CRD Object as revision of Application (#1214) 2021-03-17 18:34:10 -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
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
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
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
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
天元 9d5b31be2b remove local files, diretly use Definition/Application in Cluster 2021-03-12 10:59:24 +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
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
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
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
天元 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
天元 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
Ryan Zhang abf9270473 manual e2e test example with bug fixes 2021-03-01 01:00:27 -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
Ryan Zhang 073f3bc0c7
add hashtag and consolidate libs (#1082)
* add hashtag and consolidate libs

* fix CI
2021-02-20 23:10:15 -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
zhinong.gt 994c194d0f add data passing mechanism in kubevela 2021-02-07 16:43:13 +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
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
Ryan Zhang 15020660c9 cloneset controller draft 2021-02-04 17:01:22 -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
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
天元 f310665fe0 implement vela status in application CRD controller and refactor the health check code 2021-02-03 18:13:47 +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
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
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
Ryan Zhang ad496b132a further develop appDeployment controller 2021-01-28 17:59:31 -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
Ryan Zhang a257f6e60c application controller ignore annotation 2021-01-26 00:03:53 -08:00
Ryan Zhang e664831ff6 application deployment 2021-01-25 22:17:35 -08:00
Jianbo Sun 97f45ae859
code refactor (#935)
* code refactor

* update boilerplate.go.txt
2021-01-26 10:26:41 +08:00
Ryan Zhang adbe1f9368 add the rollout code framework 2021-01-20 13:08:00 -08:00
Ryan Zhang 023d24d392 draft 2021-01-19 15:50:38 -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
天元 1f1f3af7b7 refacter and add tests 2021-01-11 20:48:17 +08:00
天元 2761e7afb9 use map[string]string for scope 2021-01-11 10:54:57 +08:00
天元 718a4b1999 fix ci 2021-01-07 17:52:15 +08:00
天元 4cfee561b9 refactor and add scope to application 2021-01-07 13:07:12 +08:00
天元 3a47d5de73 refactor application object to have more strict schema 2020-12-29 15:48:32 +08:00
天元 4bed55b400 support strategy patch datainput merge for slice case 2020-12-23 21:53:05 +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
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
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
Jiaming Hu 5e4f270b1e move GetConfig function into specific commands 2020-12-01 21:44:06 -05:00
天元 43754e89b6 merge CI and makefile
Signed-off-by: 天元 <jianbo.sjb@alibaba-inc.com>
2020-11-27 12:16:36 +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
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
天元 fc805214c7 standardize project structure: change api to apis
Signed-off-by: 天元 <jianbo.sjb@alibaba-inc.com>
2020-11-25 17:28:09 +08:00