Compare commits

...

312 Commits

Author SHA1 Message Date
Sun Jianbo
2ffd56a993 Merge pull request #291 from wonderflow/zip
use compressed file for release
2020-09-17 15:07:00 +08:00
天元
e0d7eed9d3 update readme 2020-09-17 14:52:33 +08:00
Sun Jianbo
b0ec26bca0 Merge pull request #290 from wonderflow/image
update image tag to latest and change image pull policy
2020-09-17 14:44:19 +08:00
天元
2116c9ad0e use compressed file for release 2020-09-17 14:42:00 +08:00
天元
d02d6675ab update image tag to latest and change image pull policy 2020-09-17 14:08:33 +08:00
Sun Jianbo
1a43c0e540 Merge pull request #276 from wonderflow/routetrait
add route trait as vela api gateway
2020-09-17 14:06:00 +08:00
Sun Jianbo
e6b46c6c1b Merge pull request #288 from mosesyou/bugfix-comp-run
fix `vela comp run` panic when args empty
2020-09-17 11:57:27 +08:00
mosesyou
387afaa2c2 fix vela comp run panic when args empty 2020-09-17 11:08:55 +08:00
Ryan Zhang
f9fea8b53a Merge pull request #285 from wonderflow/dockerpackage
Add Image upload for Docker Hub and Github Docker package
2020-09-16 19:32:07 -07:00
Hongchao Deng
21c58c0aa2 Merge pull request #286 from oam-dev/warning
Add warning for not play around it for now
2020-09-16 16:43:43 -07:00
Lei Zhang (Harry)
d5a8b54503 Add warning for not play around it for now 2020-09-16 16:39:06 -07:00
天元
c390928368 split release and daily build 2020-09-16 22:57:56 +08:00
天元
c4897008dc add docker image build 2020-09-16 21:50:56 +08:00
天元
fe09a85e53 add docker build 2020-09-16 21:34:20 +08:00
天元
1b9ee5c882 add route trait as vela apigate 2020-09-16 19:42:01 +08:00
Sun Jianbo
cc5e3dc6a2 Merge pull request #281 from oam-dev/install-dependency
vela core install dependencies
2020-09-16 17:29:02 +08:00
Ryan Zhang
8a9470b9b3 fix build error 2020-09-16 01:12:50 -07:00
Ryan Zhang
e0a21b2bd4 Merge pull request #268 from wonderflow/template
update chart and refactor default workload type
2020-09-15 22:52:32 -07:00
Ryan Zhang
dfeff25a31 install dependencies 2020-09-15 22:04:52 -07:00
天元
9510db0ace update chart and refactor default workload 2020-09-16 12:09:29 +08:00
Sun Jianbo
1576d1ff2b Merge pull request #280 from hanxie-crypto/feature03
Update code and page optimization ,fix bug
2020-09-16 11:37:03 +08:00
hanxie
764e1bbb79 Update code and page optimization ,fix bug 2020-09-16 11:03:16 +08:00
Sun Jianbo
83e718c4cd Merge pull request #261 from hanxie-crypto/feature01
update dashboard ux
2020-09-16 10:50:13 +08:00
Ryan Zhang
16fd51a213 adjust the helm setting and README (#269)
* add dependancy installer and fix e2e

* fix build

* add kubebuilder
2020-09-15 15:08:17 +08:00
Sun Jianbo
1744b4752c Merge pull request #270 from zzxwill/website
Remove website related files
2020-09-13 11:44:31 +08:00
zzxwill
7ad7848856 Remove website related files
Removed website related files and planning moving
the website to oam-dev/kubevela.io
2020-09-13 11:29:44 +08:00
Sun Jianbo
6df4e192f9 Merge pull request #267 from zzxwill/env
Rename `vela env switch` to `vela env set`
2020-09-11 21:40:36 +08:00
zzxwill
bc3169a1b5 Rename vela env switch to vela env set
Renaming and update cli documentation
Fix #235
2020-09-11 19:46:45 +08:00
Sun Jianbo
97f4d516fb Merge pull request #260 from wonderflow/cleanup
Clean Up Projects
2020-09-11 18:24:28 +08:00
天元
5328a7d6b9 update readme 2020-09-11 18:15:38 +08:00
天元
1e4a1159b5 clean up 2020-09-11 17:52:14 +08:00
hanxie
b026cf20f4 update dashboard ux 2020-09-11 14:43:08 +08:00
天元
044df63770 change go package to oam-dev/kubevela 2020-09-11 12:29:12 +08:00
天元
edce904df6 fix create release workflow 2020-09-11 00:30:39 +08:00
Sun Jianbo
159ca172bf Merge pull request #258 from wonderflow/fixci
fix release workflow
2020-09-11 00:12:20 +08:00
天元
f1497c3fc2 fix release workflow 2020-09-11 00:10:46 +08:00
Sun Jianbo
a02ca0e415 Merge pull request #257 from wonderflow/refineci
Add Release action and make release
2020-09-10 22:43:51 +08:00
天元
cc669f450f cross build and upload assert 2020-09-10 21:54:44 +08:00
天元
12ecb89bc4 release 2020-09-10 20:33:37 +08:00
问心
0f5c6b668f Optimize env interface and separate responsibilities. (#215)
* Optimize env interface and separate responsibilities.

* Supplement E2E test;
Add api reference;

Supplement E2E test;
Add api reference;

* fix the dashboard to fit this API change.

fix the dashboard to fit this API change.

* Merge remote-tracking branch 'upstream/master'

# Conflicts:
#	dashboard/src/components/GlobalHeader/WorkSpaceDropDown.css
#	dashboard/src/components/GlobalHeader/WorkSpaceDropDown.jsx
#	dashboard/src/models/env.js
#	dashboard/src/pages/System/Env/index.jsx

Co-authored-by: xiaoyuaiheshui <714545064@qq.com>
2020-09-10 16:57:47 +08:00
hanxie
7accf86367 add dashboard ci (#256)
* Update 更新配置

* Add dashboard ci

* Fix ci

* Fix ci
2020-09-10 16:57:08 +08:00
Sun Jianbo
4aad15bb64 Merge pull request #254 from wonderflow/refineci
refine and split and faster CI
2020-09-10 15:43:56 +08:00
Sun Jianbo
b62b404d41 Merge pull request #255 from wonderflow/readme
update readme
2020-09-10 15:43:40 +08:00
天元
7f78ce5e7b refine and split and faster CI 2020-09-10 15:31:51 +08:00
天元
b09e3a9d37 update readme 2020-09-10 15:27:01 +08:00
Sun Jianbo
e597252a60 Merge pull request #253 from cloud-native-application/wonderflow-patch-1
Update and rename DEVELOPMENT.md to CONTRIBUTING.md
2020-09-10 15:22:55 +08:00
Sun Jianbo
8abf7bd615 Merge pull request #252 from cloud-native-application/add-license-1
ADD Apache LICENSE
2020-09-10 15:22:13 +08:00
Sun Jianbo
024dfebda1 Update and rename DEVELOPMENT.md to CONTRIBUTING.md 2020-09-10 15:12:22 +08:00
Sun Jianbo
82333a96d2 Merge pull request #250 from wonderflow/static
vela dashboard run
2020-09-10 15:07:32 +08:00
Sun Jianbo
3e6c4dc353 Create LICENSE 2020-09-10 15:06:54 +08:00
天元
1354b4afa4 add golintci and make it happy 2020-09-10 14:57:36 +08:00
天元
b466e6216c add lint check 2020-09-10 13:10:57 +08:00
天元
46f99a3ba4 vela dashboard run 2020-09-10 13:10:57 +08:00
Sun Jianbo
854949157d Merge pull request #249 from captainroy-hy/app-topology
implement "vela app status"
2020-09-10 10:06:25 +08:00
roy wang
def0f3ed7c refine output format of app status & comp status
Signed-off-by: roy wang <seiwy2010@gmail.com>
2020-09-10 10:51:16 +09:00
roy wang
54b5fd0ce3 vela app status
refine output of vela comp status

Signed-off-by: roy wang <seiwy2010@gmail.com>
2020-09-09 18:53:19 +09:00
Zheng Xi Zhou
44462a0e05 Create CNAME 2020-09-09 11:19:03 +08:00
guoxudong
3d9520897a clear hints for comp run (#247)
* clear hints for comp run

Signed-off-by: guoxudong <sunnydog0826@gmail.com>
2020-09-08 14:23:29 +08:00
Sun Jianbo
fcac657421 Merge pull request #248 from zzxwill/gh-pages
Github Pages for KubeVela homepage
2020-09-08 10:05:17 +08:00
hanxie
60aacae8e6 delete app ,dynamic menu and bugfix (#242) 2020-09-08 10:04:09 +08:00
zzxwill
0a2494a6a7 refine markdown webpage 2020-09-07 22:03:51 +08:00
Zheng Xi Zhou
5fcec0ffd5 Set theme jekyll-theme-cayman 2020-09-07 21:43:43 +08:00
Sun Jianbo
c031288c68 Merge pull request #246 from sunny0826/comp-delete
fix comp delete err
2020-09-04 14:49:46 +08:00
guoxudong
ed9fe6ad25 fix comp delete err
Signed-off-by: guoxudong <sunnydog0826@gmail.com>
2020-09-04 14:38:21 +08:00
Sun Jianbo
8da4f0359f Merge pull request #244 from cloud-native-application/fix-issues
fix webhook issues and push image to docker hub
2020-09-04 10:28:08 +08:00
Ryan Zhang
da1681803c fix webhook issues and push image to docker hub 2020-09-03 15:48:11 -07:00
Sun Jianbo
7232509f26 Merge pull request #238 from cloud-native-application/add-helm-chart
Add Vela core helm chart
2020-09-03 18:42:38 +08:00
Sun Jianbo
01afc07c66 Delete cert-manager.yaml.orig 2020-09-03 17:59:49 +08:00
Sun Jianbo
0cec61be80 Merge pull request #243 from sunny0826/fix-app-ls
fix app ls example
2020-09-03 15:33:17 +08:00
guoxudong
659f65cfb4 fix app ls example 2020-09-03 15:04:13 +08:00
boris
dc417f53d2 add remove cap center cli and api (#237)
* add remove cap center cli

* add delete cap center api

* doc: capability center delete api

* test: capability center delete e2e
2020-09-03 14:52:09 +08:00
Ryan Zhang
8597a122fb add manual test for containerized and metricsTrait 2020-09-02 21:16:44 -07:00
Sun Jianbo
42203ac34e Merge pull request #241 from wenxinnnnn/sort-application
Sort application list in inverse order of created time.
2020-09-02 19:05:19 +08:00
wenxin
4e887d0b04 sort application list in inverse order of created time. 2020-09-02 14:20:07 +08:00
Ryan Zhang
fe05ee22de manually verified 2020-09-01 22:11:16 -07:00
Ryan Zhang
4f270614d7 first step 2020-09-01 00:38:42 -07:00
Sun Jianbo
3d901470e5 Merge pull request #236 from wenxinnnnn/delete-application-doc
Supplemental interface documentation: delete an application
2020-09-01 11:02:21 +08:00
wenxin
1e8f31da01 Supplemental interface documentation: delete an application 2020-09-01 10:25:56 +08:00
Sun Jianbo
5aac4c3881 Merge pull request #233 from wenxinnnnn/delete-application
Delete an application
2020-08-31 21:11:06 +08:00
85589661@qq.com
522feef5b9 Delete an application 2020-08-31 18:37:34 +08:00
Sun Jianbo
469c631072 Merge pull request #232 from veophi/vela-veophi
add a line break for 'vela xxx show' commands
2020-08-31 10:13:02 +08:00
Vec
a31a7f204f add a line break for 'vela xxx show' commands 2020-08-30 16:37:56 +08:00
Sun Jianbo
0e1c6496c5 Merge pull request #224 from cloud-native-application/add-workload
Add containerized workload part 1
2020-08-29 21:41:09 +08:00
Ryan Zhang
92f112fd66 add definition files 2020-08-28 23:43:34 -07:00
Ryan Zhang
7867d3c258 add webhooks 2020-08-28 19:37:23 -07:00
Ryan Zhang
0103ca1d35 containerized controler 2020-08-28 11:43:43 -07:00
Ryan Zhang
f87b88d8b2 add containerized workload 2020-08-28 11:43:42 -07:00
Sun Jianbo
4bef004867 Merge pull request #230 from wenxinnnnn/env
Development on env
2020-08-28 19:13:53 +08:00
xiaoyuaiheshui
d341862694 Complete env page interface docking and page status
77
2020-08-28 18:44:47 +08:00
Sun Jianbo
4ae4664e35 Merge pull request #222 from hanxie-crypto/master
Capability interface , Page loading effect And app details page
2020-08-28 17:44:42 +08:00
Ryan Zhang
5f22a8de8a import trait-injector (#223)
* import trait-injector

* fix merge error
2020-08-28 16:33:19 +08:00
hanxie
c1b3325307 Capability interface , Page loading effect And app details page 2020-08-28 15:52:17 +08:00
Zheng Xi Zhou
dad964de61 Merge pull request #212 from zzxwill/log
Implement `vela logs`
2020-08-28 13:44:09 +08:00
zzxwill
af227117ab add help group setting 2020-08-28 11:16:25 +08:00
zzxwill
1845f70c3d Implement vela logs
Based on modifed `stern` project, tail logs of pods
of an application
2020-08-28 11:16:25 +08:00
Sun Jianbo
62fc11a5b2 Merge pull request #216 from wonderflow/scope
support scopes in appfile and make health scope as default
2020-08-28 10:32:10 +08:00
天元
2cd27b4196 support scopes in appfile and make health scope as default 2020-08-27 19:32:00 +08:00
Sun Jianbo
4e86f0d916 Merge pull request #213 from cloud-native-application/import-controllers
bootstrap vela core
2020-08-27 16:01:20 +08:00
Ryan Zhang
7de9f7b16b install kubebuilder to make the test run 2020-08-27 00:40:46 -07:00
Ryan Zhang
c1e18f1b40 fix the test 2020-08-27 00:09:22 -07:00
Sun Jianbo
91b87c4d80 Merge pull request #214 from wonderflow/readme
update readme and beautiful help
2020-08-27 13:46:26 +08:00
天元
c23b61b2b2 update readme and beautiful help 2020-08-27 13:27:45 +08:00
Ryan Zhang
b5f34b17b7 fix build break 2020-08-26 22:05:08 -07:00
Ryan Zhang
291a9e628e add all the controllers 2020-08-26 21:52:51 -07:00
Ryan Zhang
2478c1a9ae add the metrics trait 2020-08-26 21:52:26 -07:00
Sun Jianbo
ef0d974c16 Merge pull request #209 from wonderflow/status
fix vela app delete
2020-08-27 11:35:00 +08:00
Sun Jianbo
a4aa4f5904 Merge pull request #210 from zzxwill/api-issue
API request parameter check for trait attach
2020-08-27 11:23:05 +08:00
天元
210cbcc937 support vela comp ls 2020-08-27 11:21:13 +08:00
zzxwill
98dcf286ff API request parameter check for trait attach
check parameter `staging` before converting it
to bool and add logs
2020-08-26 16:17:12 +08:00
Sun Jianbo
ea78bedda8 Merge pull request #208 from wonderflow/initkube
add kubebuilder framework back and import oam-k8s-runtime
2020-08-26 16:10:38 +08:00
天元
eb693ed74a fix vela app delete 2020-08-26 16:10:04 +08:00
天元
da1831efef add kubebuilder framework back and import oam-k8s-runtime 2020-08-26 15:38:52 +08:00
Sun Jianbo
3498e5d68a Merge pull request #202 from hanxie-crypto/master
Add trait part and capability part interface
2020-08-25 18:04:28 +08:00
hanxie
1810bad0b7 appdetail bugfix 2020-08-25 17:47:54 +08:00
hanxie
56ae6be4cb restore workspacedropdown 2020-08-25 17:29:48 +08:00
hanxie
5f62f7b8a2 remove workspacedropdown temp 2020-08-25 17:27:39 +08:00
hanxie
e3e3a79205 Add trait part and capability part interface 2020-08-25 17:11:33 +08:00
Sun Jianbo
bc5af86a54 Merge pull request #201 from wonderflow/compls
add vela comp ls
2020-08-25 16:29:30 +08:00
天元
2042de2484 add vela comp ls 2020-08-25 16:13:35 +08:00
Zheng Xi Zhou
8da6e93480 Refine CI build (#196)
* Refine CI build

remove vela binary build during e2e-test, instead
use the binary after make build

* update old command `vela system:init`
2020-08-25 16:08:16 +08:00
Sun Jianbo
62937e1eb0 Merge pull request #194 from zzxwill/cli-documentation
Add Restful API reference
2020-08-25 10:15:12 +08:00
Zheng Xi Zhou
4fea3e9cf9 Implement API trait attach/detach, application get, capability center add/sync/list and fix detach issue (#187)
* implemented trait attach, get application

* implemented API for trait detach and fix trait detach issue

* implemeted API add/sync/list capability center

* implemented API capability add/remove/list

* update test-cases according to new cli style

* merge two ginkgo describe to one as in github environment ginkgo does NOT follow the order of describes

* merge two ginkgo describe to one as in github environment ginkgo does NOT follow the order of describes
2020-08-25 10:14:18 +08:00
wenxin
2a25b10874 Complete env page structure 2020-08-25 09:32:59 +08:00
zzxwill
d31bb40701 Add Restful API reference
added Restful API reference for dashboard development
and move cli docs to `documentation/cli`
2020-08-25 08:31:26 +08:00
Sun Jianbo
5942df5de9 Merge pull request #195 from wonderflow/style
use unix command style and refactor to new design
2020-08-24 20:38:19 +08:00
天元
40da5a1961 use unix command style and refactor to new design 2020-08-24 19:04:04 +08:00
Sun Jianbo
9efb1f60c7 Merge pull request #188 from mosesyou/bugfix-center-config
fix `cap:center:config` panic
2020-08-24 11:03:28 +08:00
mosesyou
34c33ceb07 fix cap:center:config panic 2020-08-24 10:22:31 +08:00
Zheng Xi Zhou
e34a7373d2 Merge pull request #185 from hanxie-crypto/master
Remove mock data
2020-08-21 19:28:41 +08:00
hanxie
a0cc32b04b Merge branch 'master' of https://github.com/hanxie-crypto/RudrX 2020-08-21 19:00:09 +08:00
hanxie
ed740a57b7 Update config file remove mock data 2020-08-21 18:59:59 +08:00
Zheng Xi Zhou
0b30c15ef9 Merge pull request #184 from hanxie-crypto/master
Update Capability static page docking with env and workload part of t…
2020-08-21 17:58:50 +08:00
hanxie
74103b3307 Merge branch 'master' into master 2020-08-21 17:56:12 +08:00
hanxie
da2f8a9a81 Update Capability static page docking with env and workload part of the interface 2020-08-21 17:49:26 +08:00
Zheng Xi Zhou
7e374d68fd Merge pull request #168 from hanxie-crypto/master
Update front-end project
2020-08-21 16:28:19 +08:00
Zheng Xi Zhou
0f9b5d2ecb Merge pull request #183 from zzxwill/api-trait
Implement API for listing/getting workloads/traits
2020-08-21 13:57:09 +08:00
zzxwill
f5de722768 add Get single capability instead of changing the arguments of listing capabilities 2020-08-21 11:30:51 +08:00
Sun Jianbo
ef8beacea7 Merge pull request #182 from mosesyou/feature-cap-center-list
add list all capability centers cli
2020-08-20 21:16:42 +08:00
mosesyou
6c892b4cf8 add list all capability centers cli 2020-08-20 19:42:55 +08:00
zzxwill
5cb3528045 Implment API for listing/getting workloads/traits
implemented getting and listing traitsdefinition,
getting a workloaddefinitions
2020-08-20 18:10:58 +08:00
Sun Jianbo
6370ecdc8d Merge pull request #179 from mosesyou/bugfix-env
fix not existed env successfully deleted
2020-08-20 10:31:21 +08:00
Sun Jianbo
58d5cc7059 Merge pull request #180 from zzxwill/api-workloaddef
Implement listing WorkloadDefinitions API
2020-08-20 10:12:00 +08:00
mosesyou
ed0141d65c fix not existed env successfully deleted 2020-08-20 10:11:29 +08:00
zzxwill
9e13078334 Implement listing WorkloadDefinitions API
implemented the API to list workloaddefinitions with
the workloadtype name and all its parameters
2020-08-19 22:39:53 +08:00
Sun Jianbo
1cf7e8cab9 Merge pull request #178 from zzxwill/api-app
Implement Workload Run API
2020-08-19 21:36:46 +08:00
zzxwill
59a7a96cae fix build issue and check err 2020-08-19 18:23:53 +08:00
zzxwill
657cb91db3 Implement Workload Run API
implemented workload run api and write e2e test
cases for workload run cli and API
2020-08-19 18:17:47 +08:00
Sun Jianbo
ae17dd3ffa Merge pull request #177 from mosesyou/dev-app
add flag `--app` for `app:ls`
2020-08-19 16:44:50 +08:00
mosesyou
579d5c667d add flag --app for app:ls 2020-08-19 15:48:23 +08:00
Sun Jianbo
1a222658a5 Merge pull request #170 from zzxwill/api-error-response
Fix api response for error cases
2020-08-18 21:12:10 +08:00
zzxwill
27cd1908ef Fix api response for error cases
when hitting issue, the response struct should be the same as
normal response as below.
```
type Response struct {
	Code int         `json:"code"`
	Data interface{} `json:"data"`
}
```
Fix #169
2020-08-18 19:48:31 +08:00
Zheng Xi Zhou
79d3d3c446 Implement env APIs (#164)
* Implement API `api/envs/default/apps/

implement API `api/envs/default/apps/ and refactor code

* address comments from @wonderflow and @ryan

* fix code rebase issue

* Implement env APIs

implemented APIs for env and make api-test
and e2e-setup

* fix ci issues

* address comments
2020-08-18 18:15:28 +08:00
hanxie
3146ea74c8 Merge branch 'master' of https://github.com/hanxie-crypto/RudrX 2020-08-18 18:06:07 +08:00
hanxie
22e6160a89 Add interface call 2020-08-18 18:04:53 +08:00
Sun Jianbo
978dd05cce Merge pull request #167 from cloud-native-application/wonderflow-patch-1
Update README.md
2020-08-18 17:13:42 +08:00
Sun Jianbo
442cb11415 Update README.md 2020-08-18 16:54:31 +08:00
Sun Jianbo
eb38931b02 Merge pull request #162 from zzxwill/cli-documentation
Add vela cli documentation
2020-08-17 13:28:31 +08:00
zzxwill
5e69557bca renaming file names to fix github README display 2020-08-17 13:12:43 +08:00
zzxwill
2f6fc442c3 Add vela cli documentation
This is use for 1) a first glance of vela command
and all sub commands 2) dashboard developers to look
function and parameters details
2020-08-17 11:32:37 +08:00
Zheng Xi Zhou
3916d2d83f Implement API `api/envs/default/apps/ (#147)
* Implement API `api/envs/default/apps/

implement API `api/envs/default/apps/ and refactor code

* address comments from @wonderflow and @ryan

* fix code rebase issue

* temporary comment BeforeSuite in integration/integration_suite_test.go to fix make issue
2020-08-17 11:01:31 +08:00
Sun Jianbo
d5d94c5cc5 Merge pull request #156 from wonderflow/fix
minor fixes
2020-08-14 15:58:19 +08:00
天元
fb73e27de3 fix e2e test 2020-08-14 15:51:51 +08:00
天元
0b6fd6a981 fix appfile update 2020-08-14 15:21:32 +08:00
天元
8910384946 minor fixes 2020-08-14 12:47:14 +08:00
Zheng Xi Zhou
9cbb3b4abe Apply builtin definition in system:init (#132)
* Apply builtin definition in system:init

Fix builtin definitions not installed issue

* install builtin definitions

* fix OAM runtime installation issue and refactor e2e

* fix e2e build issue

* manually install oam runtime and builtin capabilities

* remove system:init from e2e test
2020-08-14 09:50:16 +08:00
Zheng Xi Zhou
7d6d4f97b8 Merge pull request #154 from hanxie-crypto/master
Initialize Dashboard folder for front-end
2020-08-14 00:36:15 +08:00
hanxie
7921acad32 Merge branch 'master' into master 2020-08-13 19:47:25 +08:00
hanxie
cdde7b0ebc Initialize Dashboard folder for front-end 2020-08-13 19:25:12 +08:00
Sun Jianbo
1993c94666 Merge pull request #145 from wonderflow/stage
implement appfile oriented multiple OAM Application orchestration
2020-08-13 18:12:52 +08:00
天元
2caf373b53 support app:run 2020-08-13 18:05:49 +08:00
Sun Jianbo
6c9d4ce4a0 Merge pull request #148 from cloud-native-application/server-integration-test
add integration test for RESTful server
2020-08-13 17:10:38 +08:00
天元
9ea02adf2f implement appfile oriented OAM Application run 2020-08-13 14:13:22 +08:00
Ryan Zhang
ffd7db9029 add integration test for RESTful server 2020-08-12 14:48:52 -07:00
Sun Jianbo
30516c98b5 Merge pull request #144 from wonderflow/plugin
support vela cap:remove
2020-08-12 17:16:22 +08:00
Sun Jianbo
93e6e720d1 Merge pull request #142 from sunny0826/fix-ls
fixed some err in print info
2020-08-12 17:11:14 +08:00
天元
1baa6a09d1 support vela cap:remove 2020-08-12 17:08:14 +08:00
guoxudong
f084f81a1d fixed some err in print info
Signed-off-by: guoxudong <sunnydog0826@gmail.com>
2020-08-12 15:05:46 +08:00
Sun Jianbo
714727d9a1 Merge pull request #141 from wonderflow/plugin
fix addon add and list
2020-08-12 13:47:50 +08:00
天元
df2ad85c9c do some refactor for code as we change addon to capability 2020-08-12 13:37:20 +08:00
天元
a8aa5c6b20 rename addon to capability 2020-08-12 13:31:32 +08:00
天元
09929c0a66 fix vela:ls install status 2020-08-12 13:31:32 +08:00
天元
2f94c17890 support vela addon:install 2020-08-12 13:31:31 +08:00
天元
ae4ae3fff6 instal yaml for plugin 2020-08-12 13:31:31 +08:00
天元
0174305213 fix addon add and list 2020-08-12 13:31:30 +08:00
Zheng Xi Zhou
85c0f93bb3 Merge pull request #137 from cloud-native-application/gin-route
RESTful framework
2020-08-12 12:10:02 +08:00
Ryan Zhang
b8ef48f728 working version of the RESTful server with samples 2020-08-11 20:45:02 -07:00
Zheng Xi Zhou
a5b3ed93dd Fix app:status issue (#140)
* Show trait type in `app:ls`

Use trait type instead of its name in application list.
Fix app:status issue and refactor code
Fix #90

* followed comments to move some basic traits related functions to system.go

* Fix app:status issue

When the ApplicationConfiguration status haven't shown up,
it will hit an issue.
2020-08-11 17:38:34 +08:00
Zheng Xi Zhou
8b7f2e1a6e Show trait type in app:ls (#136)
* Show trait type in `app:ls`

Use trait type instead of its name in application list.
Fix app:status issue and refactor code
Fix #90

* Update pkg/cmd/status.go

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

* followed comments to move some basic traits related functions to system.go

Co-authored-by: Sun Jianbo <wonderflow.sun@gmail.com>
2020-08-11 15:14:14 +08:00
Ryan Zhang
06ed5e4cc1 RESTful framework 2020-08-10 22:53:44 -07:00
guoxudong
5c46477523 Fix failure of bash autocomplete script (#135)
* fix auto-completion

Signed-off-by: guoxudong <sunnydog0826@gmail.com>
2020-08-11 12:20:14 +08:00
Sun Jianbo
69c1044d00 Merge pull request #69 from zzxwill/e2e
add e2e framework sample
2020-08-10 17:30:07 +08:00
Sun Jianbo
da38ff11eb Merge pull request #130 from zzxwill/fix-overriden-help
Fix help message overridden issue
2020-08-10 17:21:49 +08:00
zzxwill
7d3d6c02eb Fix help message overridden issue
Help message of all subcommands are overridden by
root command. Fix issue #124, #127
2020-08-10 16:23:07 +08:00
Sun Jianbo
18b5d274e8 Merge pull request #123 from zzxwill/refine-docs
Fix typo
2020-08-10 14:11:42 +08:00
zzxwill
36318ac5aa Fix typo
Rename wrongly spelled `platform`
2020-08-10 14:07:15 +08:00
zzxwill
190fe97530 remove oam runtime workaround and complete some TODOs 2020-08-10 11:48:54 +08:00
Sun Jianbo
d139da7709 Merge pull request #122 from wonderflow/plugin
add addon:update and refactor addon code
2020-08-10 11:35:42 +08:00
zzxwill
bdf67d7e11 remove binary and add it to .gitignore 2020-08-10 10:44:43 +08:00
zzxwill
106d8a4729 renaming command name 2020-08-10 10:43:02 +08:00
zzxwill
90655bfdfc run e2e before make build and unit-test 2020-08-10 10:17:22 +08:00
zzxwill
d853ff82b0 sleep 10 seconds 2020-08-10 10:17:22 +08:00
zzxwill
5ffe9e2ce5 Temporarily fix oam kubernetes runtime CRD issue
after PR https://github.com/crossplane/oam-kubernetes-runtime/pull/162
is merged, this workround should be removed
2020-08-10 10:17:22 +08:00
zzxwill
22fe290c2c manually install oam runtime and apply definition manifests 2020-08-10 10:17:22 +08:00
zzxwill
e32ca064a1 change description name for trait attaching 2020-08-10 10:17:22 +08:00
zzxwill
90d7d78435 Add trait attach cases and refactor all others 2020-08-10 10:17:22 +08:00
zzxwill
940a7587d9 add tests for rudr ls 2020-08-10 10:17:22 +08:00
zzxwill
d9e7981ae0 add rudr env test cases and refine rudr run:workload 2020-08-10 10:17:22 +08:00
zzxwill
7c45ddb3c5 exclue e2e testw folder in case those test suites are triggerred by unit-test 2020-08-10 10:17:22 +08:00
zzxwill
a0177272d0 move e2e test folder in case those test suites are triggerred by unit-test 2020-08-10 10:17:22 +08:00
zzxwill
bc0c15988c update new rudr run command and add ginkgo test to makefile 2020-08-10 10:14:39 +08:00
zzxwill
c67f0f47d4 add e2e framework sample 2020-08-10 10:12:30 +08:00
天元
2a37a6dda7 add addon:update and refactor addon code 2020-08-10 00:08:49 +08:00
Sun Jianbo
393cc10fe0 Merge pull request #121 from wonderflow/plugin
fix vela system:init info
2020-08-09 21:40:54 +08:00
天元
6c1ad6c516 fix vela system:init info 2020-08-09 18:34:01 +08:00
Sun Jianbo
85be1ef738 Merge pull request #118 from erdun/version
Fix version info
2020-08-08 16:46:22 +08:00
erdun
8e8967a914 fix version info 2020-08-08 16:32:56 +08:00
Sun Jianbo
9da0a6f2ed Merge pull request #109 from erdun/show
Show command
2020-08-08 15:05:30 +08:00
Sun Jianbo
e749ccee14 Merge pull request #98 from cloud-native-application/restful-design
RESTful Draft
2020-08-08 15:03:58 +08:00
Ryan Zhang
354dc5469d address the comments 2020-08-07 17:20:18 -07:00
erdun
78496b2035 tmp resolve 2020-08-08 01:35:34 +08:00
erdun
28042ed0b9 show command 2020-08-08 01:34:43 +08:00
Sun Jianbo
f38c55aee1 Merge pull request #107 from wonderflow/stage
pretty help
2020-08-07 23:55:40 +08:00
天元
94a9b9f3c9 update readme and fix admin:init builtin resource 2020-08-07 23:48:51 +08:00
天元
9834ee23e2 pretty help 2020-08-07 23:39:45 +08:00
Sun Jianbo
0afa227383 Merge pull request #105 from wonderflow/refresh
add refresh and use local cache instead request cluster every time
2020-08-07 21:58:34 +08:00
天元
41536fe2cd add refresh and use local cache instead request cluster every time 2020-08-07 19:56:46 +08:00
Sun Jianbo
bb8043cc2b Merge pull request #103 from sunny0826/auto-completion
Add Auto completion command
2020-08-07 19:05:29 +08:00
guoxudong
335509230a fix
Signed-off-by: guoxudong <sunnydog0826@gmail.com>
2020-08-07 17:09:43 +08:00
guoxudong
5cbd0bef98 add auto-completion command
Signed-off-by: guoxudong <sunnydog0826@gmail.com>
2020-08-07 17:08:24 +08:00
Sun Jianbo
6b39ecdec2 Merge pull request #102 from wonderflow/stage
Clean up env issues
2020-08-07 16:44:42 +08:00
天元
93240b4ae6 make env help pretty 2020-08-07 16:38:23 +08:00
天元
772ea69fa2 remove kube flags 2020-08-07 15:08:35 +08:00
Ryan Zhang
92595615e1 first version 2020-08-06 22:55:17 -07:00
Sun Jianbo
428cb57b59 Merge pull request #101 from wonderflow/stage
rename rudrx/rudr to vela
2020-08-07 13:46:14 +08:00
天元
8418534a43 rename rudrx/rudr to vela 2020-08-07 13:40:20 +08:00
Herman Zhu
e6d4b85e39 feat(admin): support ruder admin:init and ruder admin:info (#75)
* feat(admin): support `ruder admin:init` and `ruder admin:info`

Support `ruder admin:init` and `ruder admin:info`

Fixes #12

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

* feat(admin): support `ruder admin:init` and `ruder admin:info`

Support `ruder admin:init` and `ruder admin:info`

Fixes #12

Signed-off-by: zhuhuijun <zhuhuijunzhj@gmail.com>
2020-08-07 13:02:23 +08:00
Sun Jianbo
27d14c3fbb Merge pull request #96 from zzxwill/addon
Implement `addon:config` and `addon:ls`
2020-08-07 10:34:15 +08:00
zzxwill
6665731228 adapt to new spec.extension.template 2020-08-07 10:21:44 +08:00
Ryan Zhang
c44e8cc597 complete the draft 2020-08-06 17:16:04 -07:00
Sun Jianbo
3440fba86e Merge pull request #99 from wonderflow/env
fix env init don't create namespace
2020-08-06 16:52:34 +08:00
天元
1a37099f1e fix definition files 2020-08-06 16:46:11 +08:00
天元
58b0f201bc add namespace to output, fixes #78 2020-08-06 16:42:47 +08:00
天元
84d18e43af fix env init don't create namespace 2020-08-06 16:03:53 +08:00
Ryan Zhang
da04a65d2e draft 2020-08-06 00:58:26 -07:00
zzxwill
d2fc983d30 Implement addon:config and addon:ls
Store addon center configuration in ~/.rudr/addon_config;
list workloaddefinitions and traitdefinitions, and check
wheter they are intalled.
2020-08-06 14:43:33 +08:00
Sun Jianbo
55eb1c6e33 Merge pull request #86 from wonderflow/cue
init cue dsl function
2020-08-06 13:15:13 +08:00
天元
780524e303 add annotation into definitions 2020-08-06 12:09:48 +08:00
天元
ae08333efa use cue template instead of parameter 2020-08-06 11:58:13 +08:00
天元
cb06bb710a init cue dsl function 2020-08-06 11:27:05 +08:00
Sun Jianbo
bcf758edfc Merge pull request #87 from baikai/fixissue68
Fix overlap of workloads in column `APPLIES TO` for command `rudr traits`
2020-08-06 00:18:11 +08:00
Sun Jianbo
72ea2c8782 Merge pull request #73 from zzxwill/unbind
Detach trait
2020-08-06 00:16:54 +08:00
Sun Jianbo
844b1e5c86 Merge pull request #92 from zzxwill/run-issue
Fix containerized:run issue
2020-08-06 00:15:41 +08:00
Sun Jianbo
b2c71cee0a Merge pull request #93 from zzxwill/refine-docs
Refine README and add command app:xxx
2020-08-06 00:09:48 +08:00
zzxwill
e019782ae2 fix typo 2020-08-05 21:46:32 +08:00
zzxwill
fda918ba39 Refine README and add command app:xxx 2020-08-05 21:33:46 +08:00
zzxwill
650288de88 Fix containerized:run issue
Fix issue #91 of "panic: assignment to entry in nil map"
2020-08-05 20:15:17 +08:00
zzxwill
547fdd3ff6 refine trait detaching 2020-08-05 20:06:00 +08:00
zzxwill
38b906c0f0 use command rudr <TraitType>:detach to detach a trait 2020-08-05 20:06:00 +08:00
zzxwill
7272069bff remove old detach command from main 2020-08-05 20:06:00 +08:00
zzxwill
7ff3e3b7ca merging trait detaching from detach.go to trait_bind 2020-08-05 20:06:00 +08:00
zzxwill
d200c6da6f delete file pkg/cmd/bind.go 2020-08-05 20:06:00 +08:00
zzxwill
0d4ee6970b refine detach with extended traitdefinition 2020-08-05 20:06:00 +08:00
zzxwill
0496bff6ea Detach trait
detach trait from an application
2020-08-05 20:06:00 +08:00
Sun Jianbo
49b285a619 Merge pull request #76 from zzxwill/status
implement `rudr status`
2020-08-05 13:50:10 +08:00
zzxwill
9c8c59ab2c check Marshal error 2020-08-05 11:28:45 +08:00
baikai.bk
a13a423b78 fix issue 68. 2020-08-05 10:42:02 +08:00
zzxwill
6210fef049 use applicationName here instead of appConfig.Spec.Components[0].ComponentName 2020-08-04 21:16:52 +08:00
zzxwill
bd1fd83c20 address comments from @Wonderflow 2020-08-04 21:16:52 +08:00
zzxwill
01ade795e3 implement rudr status
Implement `rudr status <APPLICATION-NAME>` to show the status
of the application, its workloads and traits
2020-08-04 21:16:52 +08:00
Sun Jianbo
648ad3321b Merge pull request #83 from zzxwill/ls-issue
Fix `rudr list` issue
2020-08-04 10:56:47 +08:00
Sun Jianbo
ca93a493a2 Merge pull request #84 from erdun/workload
Add component's workload label
2020-08-03 21:24:56 +08:00
zzxwill
a81b383be0 address comments from @Wonderflow 2020-08-03 21:21:14 +08:00
erdun
2989f738c9 workload label 2020-08-03 20:58:36 +08:00
zzxwill
d1b8fc214c Fix rudr list issue
Use the new way to retrieve namespace
2020-08-03 20:56:58 +08:00
Sun Jianbo
adc9d17482 Merge pull request #72 from wonderflow/trait
refactor trait from rudr bind to rudr <trait-type> appname
2020-08-02 10:55:44 +08:00
天元
1b4e79eea6 refactor trait from rudr bind to rudr <trait-type> appname 2020-08-01 21:46:19 +08:00
Sun Jianbo
f026f2f07c Merge pull request #70 from wonderflow/run
refactor rudr run to rudr <workload>:run
2020-08-01 18:40:40 +08:00
天元
728ebb33b2 refactor rudr run to rudr <workload>:run 2020-08-01 13:14:06 +08:00
Sun Jianbo
194bd472dc Merge pull request #65 from cloud-native-application/env
support rudr env
2020-07-31 12:23:15 +08:00
天元
dcf311cd4a clean up docs and test 2020-07-31 12:18:17 +08:00
天元
89601bee18 support rudr env 2020-07-31 10:34:17 +08:00
Sun Jianbo
b9a5389678 Merge pull request #45 from zzxwill/definition-extension
Move template to definition Extension field
2020-07-31 10:02:00 +08:00
zzxwill
318f9e59ae Correct rebase issue and add e2e test 2020-07-30 23:31:01 +08:00
zzxwill
e91dceac4b Make modification for latest xxxdefinition.spec.extension 2020-07-29 22:40:39 +08:00
zzxwill
b4065b1174 Move template to definition Extension field
As we plan to deprecate template, move template
to workloaddefinition and traitdefinition respectively.
2020-07-29 22:33:40 +08:00
Sun Jianbo
0cc615d7bb Merge pull request #62 from cloud-native-application/workloads
init rudr workloads
2020-07-29 19:03:25 +08:00
天元
bc52589ab6 init rudr workloads 2020-07-29 18:56:13 +08:00
Sun Jianbo
eacf298e25 Merge pull request #60 from cloud-native-application/traits
fix rudr traits
2020-07-29 18:49:12 +08:00
天元
2fb8eb6975 fix rudr traits 2020-07-29 17:57:55 +08:00
Sun Jianbo
04ccf7da10 Merge pull request #56 from cloud-native-application/ls
rename rudr apps to rudr ls
2020-07-29 16:58:08 +08:00
天元
a0646a2b53 rename rudr apps to rudr ls 2020-07-29 16:50:02 +08:00
Sun Jianbo
391638a36b Merge pull request #54 from cloud-native-application/more
fix CI
2020-07-29 16:46:15 +08:00
天元
66acb74f3b fix CI 2020-07-29 16:29:38 +08:00
Herman Zhu
a9f9bc055c feat(init): Add rudr init (#43)
* feat(init): Add `rudr init`

Support `rudr init` which will check/install oam-k8s-runtime into
cluster

Fixes #12

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

* feat(init): Add `rudr init`

Support `rudr init` which will check/install oam-k8s-runtime into cluster

Fixes #12

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

* feat(init): add version flag

Add version flag

Fixes #12

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

* feat(init): create native resource WorkloadDefinition

Create native resource WorkloadDefinition

Fixes: #12

Signed-off-by: zhuhuijun <zhuhuijunzhj@gmail.com>
2020-07-29 15:54:21 +08:00
Sun Jianbo
9d64307755 Merge pull request #50 from zzxwill/unbind
Refactor `rudr apps`
2020-07-27 10:44:23 +08:00
guoxudong
51f9ff4c61 add delete cmd (#48)
* add delete cmd

Signed-off-by: guoxudong <sunnydog0826@gmail.com>
2020-07-27 10:43:47 +08:00
zzxwill
a6e730d7bd Refactor rudr apps
Move some basic functions to cmd.util.helpers.go and
decompose some of them for further calling, like
`rudr unbind`
2020-07-24 21:47:11 +08:00
Sun Jianbo
3fa46a2321 Merge pull request #47 from zzxwill/apps
Implement list applications
2020-07-24 17:56:28 +08:00
zzxwill
e4500771bc address advices from wonderflow 2020-07-24 10:46:11 +08:00
zzxwill
66d0bdb61b Implement list applications
List appliations and support --application/-a
to filter applicatin lists
2020-07-23 21:40:30 +08:00
Sun Jianbo
720c604f40 Merge pull request #44 from sunny0826/issue-templates
add issue templates for repository
2020-07-23 19:02:45 +08:00
guoxudong
49e7b62596 add issue templates
Signed-off-by: guoxudong <sunnydog0826@gmail.com>
2020-07-23 18:27:23 +08:00
Sun Jianbo
f32bf44292 Merge pull request #42 from erdun/cobra
fix run bug
2020-07-23 13:22:50 +08:00
erdun
76ad168ccf fix run bug 2020-07-23 13:08:09 +08:00
Sun Jianbo
1aa798fb0b Merge pull request #39 from baikai/fixdevmd
Add Prerequisites about kustomize.
2020-07-22 17:29:56 +08:00
baikai.bk
afceb36068 Change kustomize version. 2020-07-22 15:08:29 +08:00
Sun Jianbo
bf9d068f3d Merge pull request #40 from erdun/cobra
Move fetching definitions to child command
2020-07-21 13:25:10 +08:00
erdun
e625745604 add UT 2020-07-21 11:13:47 +08:00
Sun Jianbo
4fffafb257 Merge pull request #38 from baikai/fixreadme
cmd rudr should be add exec privilege after build.
2020-07-21 10:48:29 +08:00
baikai.bk
07b8fbda6b Add Prerequisites about kustomize. 2020-07-20 22:08:03 +08:00
baikai.bk
4552636f04 cmd rudr should be add exec privilege after build. 2020-07-20 21:31:32 +08:00
erdun
4875cd2aab move init code to cobra 2020-07-20 00:17:39 +08:00
388 changed files with 58008 additions and 1757 deletions

43
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View File

@@ -0,0 +1,43 @@
---
name: Bug report
about: Create a report to help us improve
title: "[BUG]"
labels: kind/bug
assignees: ''
---
**Describe the bug**
<!--
A clear and concise description of what the bug is.
-->
**To Reproduce**
<!--
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
-->
**Expected behavior**
<!--
A clear and concise description of what you expected to happen.
-->
**Screenshots**
<!--
If applicable, add screenshots to help explain your problem.
-->
**Cluster information**
<!--
Describe your kubernetes cluster information.
- Kubernetes Version [e.g. 1.16.9]
-->
**Additional context**
<!--
Add any other context about the problem here.
-->

1
.github/ISSUE_TEMPLATE/config.yaml vendored Normal file
View File

@@ -0,0 +1 @@
blank_issues_enabled: true

View File

@@ -0,0 +1,28 @@
---
name: Feature request
about: Suggest an idea for this project
title: "[Feature]"
labels: kind/feature
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
<!--
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
-->
**Describe the solution you'd like**
<!--
A clear and concise description of what you want to happen.
-->
**Describe alternatives you've considered**
<!--
A clear and concise description of any alternative solutions or features you've considered.
-->
**Additional context**
<!--
Add any other context or screenshots about the feature request here.
-->

12
.github/ISSUE_TEMPLATE/question.md vendored Normal file
View File

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

25
.github/workflows/dashboard.yml vendored Normal file
View File

@@ -0,0 +1,25 @@
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

25
.github/workflows/docker.yml vendored Normal file
View File

@@ -0,0 +1,25 @@
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"

51
.github/workflows/e2e.yml vendored Normal file
View File

@@ -0,0 +1,51 @@
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

@@ -20,16 +20,6 @@ jobs:
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Get dependencies
run: |
go get -v -t -d ./...
- name: Run Make
run: make
- name: Run Make test
run: make test
- name: Install ginkgo
run: |
sudo apt-get update
@@ -40,8 +30,8 @@ jobs:
with:
version: "v0.7.0"
- name: Run e2e tests
run: |
make e2e-setup
make e2e-test
make e2e-cleanup
- name: install Kubebuilder
uses: RyanSiu1995/kubebuilder-action@v1
- name: Run Make test
run: make test

109
.github/workflows/release.yml vendored Normal file
View File

@@ -0,0 +1,109 @@
name: Release
on:
push:
tags:
- "v*"
jobs:
build:
name: Build
runs-on: ubuntu-latest
env:
VELA_VERSION: ${{ github.ref }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
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: 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: 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
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
asset_name: vela-${{ steps.get_version.outputs.VERSION }}-linux-amd64.tar.gz
asset_content_type: binary/octet-stream
- name: Upload Linux 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
asset_name: vela-${{ steps.get_version.outputs.VERSION }}-linux-amd64.zip
asset_content_type: binary/octet-stream
- name: Upload 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
asset_name: vela-${{ steps.get_version.outputs.VERSION }}-darwin-amd64.tar.gz
asset_content_type: binary/octet-stream
- name: Upload 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
asset_name: vela-${{ steps.get_version.outputs.VERSION }}-darwin-amd64.zip
asset_content_type: binary/octet-stream
- name: Upload 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
asset_name: vela-${{ steps.get_version.outputs.VERSION }}-windows-amd64.tar.gz
asset_content_type: binary/octet-stream
- name: Upload 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
asset_name: 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 }}
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
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 }}"

21
.gitignore vendored
View File

@@ -1,4 +1,3 @@
# Binaries for programs and plugins
*.exe
*.exe~
@@ -6,6 +5,8 @@
*.so
*.dylib
bin
_bin
e2e/vela
# Test binary, build with `go test -c`
*.test
@@ -28,4 +29,20 @@ bin
vendor/
# Vscode files
.vscode
.vscode
pkg/test/vela
config/crd/bases
tmp/
cmd/vela/fake/source.go
charts/vela-core/crds/_.yaml
# Dashboard
dashboard/node_modules/
.eslintcache
dashboard/dist/
dashboard/package-lock.json
dashboard/src/.umi/
package-lock.json
dashboard/src/.umi-production/

View File

@@ -1,19 +1,22 @@
# Development
# CONTRIBUTING
This doc explains how to set up a development environment, so you can get started
contributing to `RudrX` or build a PoC (Proof of Concept).
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.
## Build
* Clone this project
```shell script
git clone git@github.com:cloud-native-application/RudrX.git
git clone git@github.com:oam-dev/kubevela.git
```
* Install Template CRD into your cluster
@@ -34,7 +37,7 @@ If you change Template CRD, remember to rerun `make install`.
Use the following command to develop and debug.
```shell script
$ cd cmd/rudrx
$ cd cmd/vela
$ go run main.go COMMAND [FLAG]
```
@@ -63,5 +66,50 @@ workloaddefinition.core.oam.dev/deployments.apps deployment
workloaddefinition.core.oam.dev/statefulsets.apps statefulsets.apps
```
## E2E test
```
$ make e2e-test
Running Suite: Trait Suite
==========================
Random Seed: 1596559178
Will run 5 of 5 specs
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
```
## Make a pull request
Remember to write unit-test and e2e test before making a pull request.

View File

@@ -10,16 +10,17 @@ COPY go.sum go.sum
RUN go mod download
# Copy the go source
COPY cmd/server/main.go main.go
COPY cmd/core/main.go main.go
COPY api/ api/
COPY controllers/ controllers/
COPY pkg/ pkg/
# Build
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -o manager cmd/server/main.go
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -o manager main.go
# Use distroless as minimal base image to package the manager binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details
FROM gcr.io/distroless/static:nonroot
# 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

201
LICENSE Normal file
View File

@@ -0,0 +1,201 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
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.

153
Makefile
View File

@@ -1,8 +1,14 @@
# Vela version
VELA_VERSION ?= 0.1.0
# Repo info
GIT_COMMIT ?= git-$(shell git rev-parse --short HEAD)
VELA_VERSION_VAR := github.com/oam-dev/kubevela/version.VelaVersion
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"
# Image URL to use all building/pushing image targets
IMG ?= controller:latest
# Produce CRDs that work back to Kubernetes 1.11 (no version conversion)
CRD_OPTIONS ?= "crd:trivialVersions=true"
GOX = go run github.com/mitchellh/gox
TARGETS := darwin/amd64 linux/amd64 windows/amd64
DIST_DIRS := find * -type d -exec
# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
@@ -11,37 +17,41 @@ else
GOBIN=$(shell go env GOBIN)
endif
all: manager
all: build
# Run tests
test: generate fmt vet manifests
go test ./... -coverprofile cover.out
test: fmt vet lint
go test ./pkg/... -coverprofile cover.out
# Build manager binary
manager: generate fmt vet
go build -o bin/manager cmd/server/main.go
go build -o bin/rudrx cmd/rudrx/main.go
build: fmt vet lint
go run hack/chart/generate.go | go build -o bin/vela -ldflags ${LDFLAGS} cmd/vela/main.go
npm-build:
cd dashboard && npm run build && cd ./..
npm-install:
cd dashboard && npm install && cd ./..
generate-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/
compress:
( \
cd _bin && \
$(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 \
)
# Run against the configured Kubernetes cluster in ~/.kube/config
run: generate fmt vet manifests
go run ./cmd/server/main.go
# Install CRDs into a cluster
install: manifests
kustomize build config/crd | kubectl apply -f -
# Uninstall CRDs from a cluster
uninstall: manifests
kustomize build config/crd | kubectl delete -f -
# Deploy controller in the configured Kubernetes cluster in ~/.kube/config
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=config/crd/bases
run: fmt vet
go run ./cmd/core/main.go
# Run go fmt against code
fmt:
@@ -51,9 +61,8 @@ fmt:
vet:
go vet ./...
# Generate code
generate: controller-gen
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./..."
lint: golangci
$(GOLANGCILINT) run --timeout 10m -E golint,goimports ./...
# Build the docker image
docker-build: test
@@ -63,6 +72,61 @@ docker-build: test
docker-push:
docker push ${IMG}
e2e-setup:
ginkgo version
ginkgo -v -r e2e/setup
bin/vela dashboard &
e2e-test:
# Run e2e test
ginkgo -v -skipPackage setup,apiserver -r e2e
e2e-api-test:
# Run e2e test
ginkgo -v -r e2e/apiserver
e2e-cleanup:
# Clean up
# 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:
@@ -80,11 +144,22 @@ else
CONTROLLER_GEN=$(shell which controller-gen)
endif
e2e-setup:
# install oam-k8s-runtime
GOLANGCILINT_VERSION ?= v1.29.0
HOSTOS := $(shell uname -s | tr '[:upper:]' '[:lower:]')
HOSTARCH := $(shell uname -m)
ifeq ($(HOSTARCH),x86_64)
HOSTARCH := amd64
endif
e2e-test:
# Run e2e test
e2e-cleanup:
# Clean up
golangci:
ifeq (, $(shell which golangci-lint))
@{ \
set -e ;\
echo 'installing golangci-lint-$(GOLANGCILINT_VERSION)' ;\
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOBIN) $(GOLANGCILINT_VERSION) ;\
echo 'Install succeed' ;\
}
GOLANGCILINT=$(GOBIN)/golangci-lint
else
GOLANGCILINT=$(shell which golangci-lint)
endif

View File

@@ -1,7 +1,7 @@
domain: oam.dev
repo: github.com/cloud-native-application/rudrx
repo: github.com/oam-dev/kubevela
resources:
- group: admin
kind: Template
version: v1alpha2
- group: standard
kind: Route
version: v1alpha1
version: "2"

203
README.md
View File

@@ -1,129 +1,110 @@
# RudrX
# KubeVela
RudrX is a command-line tool to use OAM based micro-app engine.
The Open Application Platform based on Kubernetes and OAM.
## Develop
Check out [DEVELOPMENT.md](./DEVELOPMENT.md) to see how to develop with RudrX
: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:
## Use with command-line
### Build `rudr` binary
```shell script
$ cd cmd/rudrx
$ go build -o rudr
$ cp ./rudr /usr/local/bin
## Install
### Prerequisites
- Kubernetes cluster running Kubernetes v1.15.0 or greater
- kubectl current context is configured for the target cluster install
- ```kubectl config current-context```
### Get the Vela CLI
Download the `vela` binary from the [Releases page](https://github.com/oam-dev/kubevela/releases). Unpack the `vela` binary and add it to `$PATH` to get started.
```shell
sudo mv ./vela /usr/local/bin/vela
```
### RudrX commands
### Install Vela Core
- rudr help/prompts
```shell script
$ rudr -h
rudr is a command-line tool to use OAM based micro-app engine.
Usage:
rudr [flags]
rudr [command]
Available Commands:
bind Attach a trait to a component
help Help about any command
run Run OAM workloads
traits List traits
$ vela install
```
- create and run an appliction
This command will install vela core controller into your K8s cluster, along with built-in workloads and traits.
## Demos
#### Check workloads
```
$ vela workloads
NAME DEFINITION
backend containerizeds.standard.oam.dev
task jobs
webservice containerizeds.standard.oam.dev
```
#### workload run
```shell script
$ rudr run -h
Create and Run one component one AppConfig OAM APP
Usage:
rudr run [WORKLOAD_KIND] [args]
rudr run [command]
Examples:
rudr run containerized frontend -p 80 oam-dev/demo:v1
Available Commands:
containerized Run containerized workloads
Flags:
-h, --help help for run
-p, --port string
$ rudr run
You must specify a workload, like containerized, deployments.apps, statefulsets.apps
$ rudr run containerized
must specify name for workload
$ go run main.go run containerized poc nginx:1.9.4
Creating AppConfig poc
$ vela comp run -t webservice app123 -p 80 --image nginx:1.9.4
Creating AppConfig app123
SUCCEED
$ vela comp status app123
$ vela comp ls
NAME APP WORKLOAD TRAITS STATUS CREATED-TIME
app123 app123 deployment Deployed 2020-08-27 10:56:41 +0800 CST
```
- list traits
```shell script
$ rudr traits -h
List traits
#### app
Usage:
rudr traits [-workload WORKLOADNAME]
```
$ vela app ls
app123
Examples:
rudr traits
Flags:
-h, --help help for traits
-w, --workload string Workload name
$ rudr traits
NAME SHORT DEFINITION APPLIES TO STATUS
simplerollouttraits.extend.oam.dev SimpleRollout simplerollouttraits.extend.oam.dev core.oam.dev/v1alpha2.ContainerizedWorkload, deployments.... -
$ vela app delete app123
Deleting AppConfig "app123"
DELETE SUCCEED
```
- apply a trait to the workload
```shell script
$ rudr bind poc ManualScaler --replicaCount 5
Applying trait for component poc
Succeeded!
#### 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.
$ kubectl get applicationconfiguration poc2159 -o yaml
apiVersion: core.oam.dev/v1alpha2
kind: ApplicationConfiguration
metadata:
creationTimestamp: "2020-07-16T13:58:13Z"
generation: 2
name: poc
namespace: default
...
spec:
components:
- componentName: poc
traits:
- trait:
apiVersion: core.oam.dev/v1alpha2
kind: ManualScalerTrait
metadata:
name: manualscaler
spec:
replicaCount: 5
status:
conditions:
- lastTransitionTime: "2020-07-16T13:58:13Z"
reason: Successfully reconciled resource
status: "True"
type: Synced
workloads:
- componentName: poc
traits:
- traitRef:
apiVersion: core.oam.dev/v1alpha2
kind: ManualScalerTrait
name: manualscaler
workloadRef:
apiVersion: core.oam.dev/v1alpha2
kind: ContainerizedWorkload
name: poc
```

11
api/types/args.go Normal file
View File

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

137
api/types/capability.go Normal file
View File

@@ -0,0 +1,137 @@
/*
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)
}
}

43
api/types/types.go Normal file
View File

@@ -0,0 +1,43 @@
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

@@ -0,0 +1,80 @@
/*
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 (
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"
)
// ContainerizedSpec defines the desired state of Containerized
type ContainerizedSpec 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"`
// PodSpec describes the pods that will be created,
// we omit the meta part as it will be exactly the same as the containerized
PodSpec v1.PodSpec `json:"podSpec"`
}
// ContainerizedStatus defines the observed state of Containerized
type ContainerizedStatus struct {
cpv1alpha1.ConditionedStatus `json:",inline"`
// Resources managed by this workload.
Resources []cpv1alpha1.TypedReference `json:"resources,omitempty"`
}
// +kubebuilder:object:root=true
// Containerized is the Schema for the containerizeds API
// +kubebuilder:resource:categories={oam}
// +kubebuilder:subresource:status
type Containerized struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec ContainerizedSpec `json:"spec,omitempty"`
Status ContainerizedStatus `json:"status,omitempty"`
}
// +kubebuilder:object:root=true
// ContainerizedList contains a list of Containerized
type ContainerizedList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []Containerized `json:"items"`
}
func init() {
SchemeBuilder.Register(&Containerized{}, &ContainerizedList{})
}
var _ oam.Workload = &Containerized{}
func (in *Containerized) SetConditions(c ...cpv1alpha1.Condition) {
in.Status.SetConditions(c...)
}
func (in *Containerized) GetCondition(c cpv1alpha1.ConditionType) cpv1alpha1.Condition {
return in.Status.GetCondition(c)
}

View File

@@ -14,10 +14,10 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Package v1alpha2 contains API Schema definitions for the core.oam.dev v1alpha2 API group
// Package v1alpha1 contains API Schema definitions for the standard v1alpha1 API group
// +kubebuilder:object:generate=true
// +groupName=admin.oam.dev
package v1alpha2
// +groupName=standard.oam.dev
package v1alpha1
import (
"k8s.io/apimachinery/pkg/runtime/schema"
@@ -25,11 +25,11 @@ import (
)
var (
// GroupVersion is group version used to register these objects
GroupVersion = schema.GroupVersion{Group: "admin.oam.dev", Version: "v1alpha2"}
// SchemeGroupVersion is group version used to register these objects
SchemeGroupVersion = schema.GroupVersion{Group: "standard.oam.dev", Version: "v1alpha1"}
// SchemeBuilder is used to add go types to the GroupVersionKind scheme
SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}
SchemeBuilder = &scheme.Builder{GroupVersion: SchemeGroupVersion}
// AddToScheme adds the types in this group-version to the given scheme.
AddToScheme = SchemeBuilder.AddToScheme

View File

@@ -0,0 +1,114 @@
/*
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
}

138
api/v1alpha1/route_types.go Normal file
View File

@@ -0,0 +1,138 @@
/*
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
}

View File

@@ -0,0 +1,414 @@
// +build !ignore_autogenerated
/*
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 v1alpha1
import (
corev1alpha1 "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1"
"k8s.io/api/networking/v1beta1"
runtime "k8s.io/apimachinery/pkg/runtime"
)
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Backend) DeepCopyInto(out *Backend) {
*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
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Backend.
func (in *Backend) DeepCopy() *Backend {
if in == nil {
return nil
}
out := new(Backend)
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) {
*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 Containerized.
func (in *Containerized) DeepCopy() *Containerized {
if in == nil {
return nil
}
out := new(Containerized)
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 {
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 *ContainerizedList) DeepCopyInto(out *ContainerizedList) {
*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))
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 {
if in == nil {
return nil
}
out := new(ContainerizedList)
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 {
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 *ContainerizedSpec) DeepCopyInto(out *ContainerizedSpec) {
*out = *in
if in.Replicas != nil {
in, out := &in.Replicas, &out.Replicas
*out = new(int32)
**out = **in
}
in.PodSpec.DeepCopyInto(&out.PodSpec)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ContainerizedSpec.
func (in *ContainerizedSpec) DeepCopy() *ContainerizedSpec {
if in == nil {
return nil
}
out := new(ContainerizedSpec)
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) {
*out = *in
in.ConditionedStatus.DeepCopyInto(&out.ConditionedStatus)
if in.Resources != nil {
in, out := &in.Resources, &out.Resources
*out = make([]corev1alpha1.TypedReference, len(*in))
copy(*out, *in)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ContainerizedStatus.
func (in *ContainerizedStatus) DeepCopy() *ContainerizedStatus {
if in == nil {
return nil
}
out := new(ContainerizedStatus)
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) {
*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 = make([]string, len(*in))
copy(*out, *in)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MetricsTraitStatus.
func (in *MetricsTraitStatus) DeepCopy() *MetricsTraitStatus {
if in == nil {
return nil
}
out := new(MetricsTraitStatus)
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) {
*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 Route.
func (in *Route) DeepCopy() *Route {
if in == nil {
return nil
}
out := new(Route)
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 {
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 *RouteList) DeepCopyInto(out *RouteList) {
*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))
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 {
if in == nil {
return nil
}
out := new(RouteList)
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 {
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 *RouteSpec) DeepCopyInto(out *RouteSpec) {
*out = *in
out.WorkloadReference = in.WorkloadReference
if in.TLS != nil {
in, out := &in.TLS, &out.TLS
*out = new(TLS)
**out = **in
}
if in.DefaultBackend != nil {
in, out := &in.DefaultBackend, &out.DefaultBackend
*out = new(v1beta1.IngressBackend)
(*in).DeepCopyInto(*out)
}
if in.CustomHeaders != nil {
in, out := &in.CustomHeaders, &out.CustomHeaders
*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 {
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)
in.DeepCopyInto(out)
return out
}

View File

@@ -1,74 +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 v1alpha2
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
)
// 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.
// TemplateSpec defines the desired state of Template
type TemplateSpec struct {
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
// Important: Run "make" to regenerate code after modifying this file
Object unstructured.Unstructured `json:"object"`
LastCommandParam string `json:"lastCommandParam,omitempty"`
Parameters []Parameter `json:"parameters,omitempty"`
}
type Parameter struct {
Name string `json:"name"`
Short string `json:"short,omitempty"`
Required bool `json:"required,omitempty"`
FieldPaths []string `json:"fieldPaths"`
Default string `json:"default,omitempty"`
Usage string `json:"usage,omitempty"`
Type string `json:"type,omitempty"`
}
// TemplateStatus defines the observed state of Template
type TemplateStatus struct {
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
// Important: Run "make" to regenerate code after modifying this file
}
// +kubebuilder:object:root=true
// Template is the Schema for the templates API
type Template struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec TemplateSpec `json:"spec,omitempty"`
Status TemplateStatus `json:"status,omitempty"`
}
// +kubebuilder:object:root=true
// TemplateList contains a list of Template
type TemplateList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []Template `json:"items"`
}
func init() {
SchemeBuilder.Register(&Template{}, &TemplateList{})
}

View File

@@ -1,114 +0,0 @@
// +build !ignore_autogenerated
/*
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 v1alpha2
import (
runtime "k8s.io/apimachinery/pkg/runtime"
)
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Template) DeepCopyInto(out *Template) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
out.Spec = in.Spec
out.Status = in.Status
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Template.
func (in *Template) DeepCopy() *Template {
if in == nil {
return nil
}
out := new(Template)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *Template) 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 *TemplateList) DeepCopyInto(out *TemplateList) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ListMeta.DeepCopyInto(&out.ListMeta)
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]Template, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TemplateList.
func (in *TemplateList) DeepCopy() *TemplateList {
if in == nil {
return nil
}
out := new(TemplateList)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *TemplateList) 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 *TemplateSpec) DeepCopyInto(out *TemplateSpec) {
*out = *in
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TemplateSpec.
func (in *TemplateSpec) DeepCopy() *TemplateSpec {
if in == nil {
return nil
}
out := new(TemplateSpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *TemplateStatus) DeepCopyInto(out *TemplateStatus) {
*out = *in
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TemplateStatus.
func (in *TemplateStatus) DeepCopy() *TemplateStatus {
if in == nil {
return nil
}
out := new(TemplateStatus)
in.DeepCopyInto(out)
return out
}

View File

@@ -0,0 +1,44 @@
#!/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

@@ -0,0 +1,4 @@
#!/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

@@ -0,0 +1,24 @@
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

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

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,265 @@
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

@@ -0,0 +1,212 @@
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: []

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,94 @@
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

@@ -0,0 +1,465 @@
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: []

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,82 @@
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

@@ -0,0 +1,34 @@
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

@@ -0,0 +1,60 @@
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

@@ -0,0 +1,18 @@
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

@@ -0,0 +1,9 @@
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

@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/

View File

@@ -0,0 +1,21 @@
apiVersion: v2
name: vela-core
description: A Helm chart for Kubernetes
# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
version: 0.1.0
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application.
appVersion: 0.1.0

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,498 @@
---
apiVersion: apiextensions.k8s.io/v1
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
plural: applicationconfigurations
shortNames:
- appconfig
singular: applicationconfiguration
scope: Namespaced
versions:
- name: v1alpha2
schema:
openAPIV3Schema:
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'
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: 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.
items:
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.
type: string
dataInputs:
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.
properties:
toFieldPaths:
description: ToFieldPaths specifies the field paths of
an object to fill passed value.
items:
type: string
type: array
valueFrom:
description: ValueFrom specifies the value source.
properties:
dataOutputName:
description: DataOutputName matches a name of a DataOutput
in the same AppConfig.
type: string
required:
- dataOutputName
type: object
type: object
type: array
dataOutputs:
description: DataOutputs specify the data output sources from
this component.
items:
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.
items:
description: ConditionRequirement specifies the requirement
to match a value.
properties:
fieldPath:
type: string
op:
description: ConditionOperator specifies the operator
to match a value.
type: string
value:
type: string
required:
- op
- value
type: object
type: array
fieldPath:
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.
type: string
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.
items:
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.
type: string
value:
anyOf:
- type: integer
- type: string
description: Value to set.
x-kubernetes-int-or-string: true
required:
- name
- value
type: object
type: array
revisionName:
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.
items:
description: A ComponentScope specifies a scope in which a
component should exist.
properties:
scopeRef:
description: A ScopeReference must refer to an OAM scope
resource.
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:
- scopeRef
type: object
type: array
traits:
description: Traits of the specified component.
items:
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.
items:
description: DataInput specifies a data input sink to
an object. If input is array, it will be appended
to the target field paths.
properties:
toFieldPaths:
description: ToFieldPaths specifies the field paths
of an object to fill passed value.
items:
type: string
type: array
valueFrom:
description: ValueFrom specifies the value source.
properties:
dataOutputName:
description: DataOutputName matches a name of
a DataOutput in the same AppConfig.
type: string
required:
- dataOutputName
type: object
type: object
type: array
dataOutputs:
description: DataOutputs specify the data output sources
from this trait.
items:
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.
items:
description: ConditionRequirement specifies the
requirement to match a value.
properties:
fieldPath:
type: string
op:
description: ConditionOperator specifies the
operator to match a value.
type: string
value:
type: string
required:
- op
- value
type: object
type: array
fieldPath:
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.
type: string
type: object
type: array
trait:
description: A Trait that will be created for the component
type: object
x-kubernetes-embedded-resource: true
x-kubernetes-preserve-unknown-fields: true
required:
- trait
type: object
type: array
type: object
type: array
required:
- components
type: object
status:
description: An ApplicationConfigurationStatus represents the observed
state of a ApplicationConfiguration.
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
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
- to
type: object
type: array
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
entire application
type: string
workloads:
description: Workloads created by this ApplicationConfiguration.
items:
description: A WorkloadStatus represents the status of a workload.
properties:
componentName:
description: ComponentName that produced this workload.
type: string
componentRevisionName:
description: ComponentRevisionName of current component
type: string
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:
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
required:
- dependency
type: object
type: object
served: true
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []

View File

@@ -0,0 +1,151 @@
---
apiVersion: apiextensions.k8s.io/v1
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
plural: components
singular: component
scope: Namespaced
versions:
- additionalPrinterColumns:
- jsonPath: .spec.workload.kind
name: WORKLOAD-KIND
type: string
- jsonPath: .metadata.creationTimestamp
name: age
type: date
name: v1alpha2
schema:
openAPIV3Schema:
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'
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: A ComponentSpec defines the desired state of a Component.
properties:
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.
items:
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'.
items:
type: string
type: array
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.
type: boolean
required:
- fieldPaths
- name
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.
type: object
x-kubernetes-embedded-resource: true
x-kubernetes-preserve-unknown-fields: true
required:
- workload
type: object
status:
description: A ComponentStatus represents the observed state of a Component.
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
latestRevision:
description: LatestRevision of component
properties:
name:
type: string
revision:
format: int64
type: integer
required:
- name
- revision
type: object
type: object
type: object
served: true
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []

View File

@@ -0,0 +1,541 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.2.4
creationTimestamp: null
name: containerizedworkloads.core.oam.dev
spec:
group: core.oam.dev
names:
categories:
- crossplane
- oam
kind: ContainerizedWorkload
listKind: ContainerizedWorkloadList
plural: containerizedworkloads
singular: containerizedworkload
scope: Namespaced
versions:
- name: v1alpha2
schema:
openAPIV3Schema:
description: A ContainerizedWorkload is a workload that runs OCI containers.
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: A ContainerizedWorkloadSpec defines the desired state of
a ContainerizedWorkload.
properties:
arch:
description: CPUArchitecture required by this workload.
enum:
- i386
- amd64
- arm
- arm64
type: string
containers:
description: Containers of which this workload consists.
items:
description: A Container represents an Open Containers Initiative
(OCI) container.
properties:
args:
description: Arguments to be passed to the command run by this
container.
items:
type: string
type: array
command:
description: Command to be run by this container.
items:
type: string
type: array
config:
description: ConfigFiles that should be written within this
container.
items:
description: A ContainerConfigFile specifies a configuration
file that should be written within a container.
properties:
fromSecret:
description: 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.
properties:
key:
description: The key to select.
type: string
name:
description: The name of the secret.
type: string
required:
- key
- name
type: object
path:
description: Path within the container at which the configuration
file should be written.
type: string
value:
description: Value that should be written to the configuration
file.
type: string
required:
- path
type: object
type: array
env:
description: Environment variables that should be set within
this container.
items:
description: A ContainerEnvVar specifies an environment variable
that should be set within a container.
properties:
fromSecret:
description: FromSecret is a secret key reference which
can be used to assign a value to the environment variable.
properties:
key:
description: The key to select.
type: string
name:
description: The name of the secret.
type: string
required:
- key
- name
type: object
name:
description: Name of the environment variable. Must be
composed of valid Unicode letter and number characters,
as well as _ and -.
pattern: ^[-_a-zA-Z0-9]+$
type: string
value:
description: Value of the environment variable.
type: string
required:
- name
type: object
type: array
image:
description: 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.
type: string
imagePullSecret:
description: ImagePullSecret specifies the name of a Secret
from which the credentials required to pull this container's
image can be loaded.
type: string
livenessProbe:
description: A LivenessProbe assesses whether this container
is alive. Containers that fail liveness probes will be restarted.
properties:
exec:
description: Exec probes a container's health by executing
a command.
properties:
command:
description: Command to be run by this probe.
items:
type: string
type: array
required:
- command
type: object
failureThreshold:
description: FailureThreshold specifies how many consecutive
probes must fail in order for the container to be considered
healthy.
format: int32
type: integer
httpGet:
description: HTTPGet probes a container's health by sending
an HTTP GET request.
properties:
httpHeaders:
description: HTTPHeaders to send with the GET request.
items:
description: A HTTPHeader to be passed when probing
a container.
properties:
name:
description: Name of this HTTP header. Must be
unique per probe.
type: string
value:
description: Value of this HTTP header.
type: string
required:
- name
- value
type: object
type: array
path:
description: Path to probe, e.g. '/healthz'.
type: string
port:
description: Port to probe.
format: int32
type: integer
required:
- path
- port
type: object
initialDelaySeconds:
description: InitialDelaySeconds after a container starts
before the first probe.
format: int32
type: integer
periodSeconds:
description: PeriodSeconds between probes.
format: int32
type: integer
successThreshold:
description: SuccessThreshold specifies how many consecutive
probes must success in order for the container to be considered
healthy.
format: int32
type: integer
tcpSocket:
description: TCPSocketProbe probes a container's health
by connecting to a TCP socket.
properties:
port:
description: Port this probe should connect to.
format: int32
type: integer
required:
- port
type: object
timeoutSeconds:
description: TimeoutSeconds after which the probe times
out.
format: int32
type: integer
type: object
name:
description: Name of this container. Must be unique within its
workload.
type: string
ports:
description: Ports exposed by this container.
items:
description: A ContainerPort specifies a port that is exposed
by a container.
properties:
containerPort:
description: Port number. Must be unique within its container.
format: int32
type: integer
name:
description: Name of this port. Must be unique within
its container. Must be lowercase alphabetical characters.
pattern: ^[a-z]+$
type: string
protocol:
description: Protocol used by the server listening on
this port.
enum:
- TCP
- UDP
type: string
required:
- containerPort
- name
type: object
type: array
readinessProbe:
description: A ReadinessProbe assesses whether this container
is ready to serve requests. Containers that fail readiness
probes will be withdrawn from service.
properties:
exec:
description: Exec probes a container's health by executing
a command.
properties:
command:
description: Command to be run by this probe.
items:
type: string
type: array
required:
- command
type: object
failureThreshold:
description: FailureThreshold specifies how many consecutive
probes must fail in order for the container to be considered
healthy.
format: int32
type: integer
httpGet:
description: HTTPGet probes a container's health by sending
an HTTP GET request.
properties:
httpHeaders:
description: HTTPHeaders to send with the GET request.
items:
description: A HTTPHeader to be passed when probing
a container.
properties:
name:
description: Name of this HTTP header. Must be
unique per probe.
type: string
value:
description: Value of this HTTP header.
type: string
required:
- name
- value
type: object
type: array
path:
description: Path to probe, e.g. '/healthz'.
type: string
port:
description: Port to probe.
format: int32
type: integer
required:
- path
- port
type: object
initialDelaySeconds:
description: InitialDelaySeconds after a container starts
before the first probe.
format: int32
type: integer
periodSeconds:
description: PeriodSeconds between probes.
format: int32
type: integer
successThreshold:
description: SuccessThreshold specifies how many consecutive
probes must success in order for the container to be considered
healthy.
format: int32
type: integer
tcpSocket:
description: TCPSocketProbe probes a container's health
by connecting to a TCP socket.
properties:
port:
description: Port this probe should connect to.
format: int32
type: integer
required:
- port
type: object
timeoutSeconds:
description: TimeoutSeconds after which the probe times
out.
format: int32
type: integer
type: object
resources:
description: Resources required by this container
properties:
cpu:
description: CPU required by this container.
properties:
required:
description: Required CPU count. 1.0 represents one
CPU core.
type: string
required:
- required
type: object
extended:
description: Extended resources required by this container.
items:
description: ExtendedResource required by a container.
properties:
name:
description: Name of the external resource. Resource
names are specified in kind.group/version format,
e.g. motionsensor.ext.example.com/v1.
type: string
required:
anyOf:
- type: integer
- type: string
description: Required extended resource(s), e.g. 8
or "very-cool-widget"
x-kubernetes-int-or-string: true
required:
- name
- required
type: object
type: array
gpu:
description: GPU required by this container.
properties:
required:
description: Required GPU count.
type: string
required:
- required
type: object
memory:
description: Memory required by this container.
properties:
required:
description: Required memory.
type: string
required:
- required
type: object
volumes:
description: Volumes required by this container.
items:
description: VolumeResource required by a container.
properties:
accessMode:
description: AccessMode of this volume; RO (read only)
or RW (read and write).
enum:
- RO
- RW
type: string
disk:
description: Disk requirements of this volume.
properties:
ephemeral:
description: Ephemeral specifies whether an external
disk needs to be mounted.
type: boolean
required:
description: Required disk space.
type: string
required:
- required
type: object
mountPath:
description: MountPath at which this volume will be
mounted within its container.
type: string
name:
description: Name of this volume. Must be unique within
its container.
type: string
sharingPolicy:
description: SharingPolicy of this volume; Exclusive
or Shared.
enum:
- Exclusive
- Shared
type: string
required:
- mountPath
- name
type: object
type: array
required:
- cpu
- memory
type: object
required:
- image
- name
type: object
type: array
osType:
description: OperatingSystem required by this workload.
enum:
- linux
- windows
type: string
required:
- containers
type: object
status:
description: A ContainerizedWorkloadStatus represents the observed state
of a ContainerizedWorkload.
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
resources:
description: Resources managed by this containerised workload.
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
type: object
type: object
served: true
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []

View File

@@ -0,0 +1,203 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.2.4
creationTimestamp: null
name: healthscopes.core.oam.dev
spec:
group: core.oam.dev
names:
categories:
- crossplane
- oam
kind: HealthScope
listKind: HealthScopeList
plural: healthscopes
singular: healthscope
scope: Namespaced
versions:
- additionalPrinterColumns:
- jsonPath: .status.health
name: HEALTH
type: string
name: v1alpha2
schema:
openAPIV3Schema:
description: A HealthScope determines an aggregate health status based of
the health of components.
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: A HealthScopeSpec defines the desired state of a HealthScope.
properties:
probe-interval:
description: ProbeInterval is the amount of time in seconds between
probing tries.
format: int32
type: integer
probe-timeout:
description: ProbeTimeout is the amount of time in seconds to wait
when receiving a response before marked failure.
format: int32
type: integer
workloadRefs:
description: WorkloadReferences to the workloads that are in this
scope.
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
required:
- workloadRefs
type: object
status:
description: A HealthScopeStatus represents the observed state of a HealthScope.
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
healthConditions:
description: WorkloadHealthConditions represents health condition
of workloads in the scope
items:
description: WorkloadHealthCondition represents informative health
condition.
properties:
componentName:
description: ComponentName represents the component name if
target is a workload
type: string
diagnosis:
type: string
healthStatus:
description: HealthStatus represents health status strings.
type: string
targetWorkload:
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
workloadStatus:
description: WorkloadStatus represents status of workloads whose
HealthStatus is UNKNOWN.
type: string
required:
- healthStatus
type: object
type: array
scopeHealthCondition:
description: ScopeHealthCondition represents health condition summary
of the scope
properties:
healthStatus:
description: HealthStatus represents health status strings.
type: string
healthyWorkloads:
format: int64
type: integer
total:
format: int64
type: integer
unhealthyWorkloads:
format: int64
type: integer
unknownWorkloads:
format: int64
type: integer
required:
- healthStatus
type: object
required:
- scopeHealthCondition
type: object
type: object
served: true
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []

View File

@@ -0,0 +1,120 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.2.4
creationTimestamp: null
name: manualscalertraits.core.oam.dev
spec:
group: core.oam.dev
names:
categories:
- crossplane
- oam
kind: ManualScalerTrait
listKind: ManualScalerTraitList
plural: manualscalertraits
singular: manualscalertrait
scope: Namespaced
versions:
- name: v1alpha2
schema:
openAPIV3Schema:
description: A ManualScalerTrait determines how many replicas a workload should
have.
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: A ManualScalerTraitSpec defines the desired state of a ManualScalerTrait.
properties:
replicaCount:
description: ReplicaCount of the workload this trait applies to.
format: int32
type: integer
workloadRef:
description: WorkloadReference to the workload this trait applies
to.
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:
- replicaCount
- workloadRef
type: object
status:
description: A ManualScalerTraitStatus represents the observed state of
a ManualScalerTrait.
properties:
conditions:
description: Conditions of the resource.
items:
description: A Condition that may apply to a resource.
properties:
lastTransitionTime:
description: LastTransitionTime is the last time this condition
transitioned from one status to another.
format: date-time
type: string
message:
description: A Message containing details about this condition's
last transition from one status to another, if any.
type: string
reason:
description: A Reason for this condition's last transition from
one status to another.
type: string
status:
description: Status of this condition; is it currently True,
False, or Unknown?
type: string
type:
description: Type of this condition. At most one of each condition
type may apply to a resource at any point in time.
type: string
required:
- lastTransitionTime
- reason
- status
- type
type: object
type: array
type: object
type: object
served: true
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []

View File

@@ -0,0 +1,85 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.2.4
creationTimestamp: null
name: scopedefinitions.core.oam.dev
spec:
group: core.oam.dev
names:
categories:
- crossplane
- oam
kind: ScopeDefinition
listKind: ScopeDefinitionList
plural: scopedefinitions
singular: scopedefinition
scope: Cluster
versions:
- additionalPrinterColumns:
- jsonPath: .spec.definitionRef.name
name: DEFINITION-NAME
type: string
name: v1alpha2
schema:
openAPIV3Schema:
description: 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.
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: A ScopeDefinitionSpec defines the desired state of a ScopeDefinition.
properties:
allowComponentOverlap:
description: AllowComponentOverlap specifies whether an OAM component
may exist in multiple instances of this kind of scope.
type: boolean
definitionRef:
description: Reference to the CustomResourceDefinition that defines
this scope kind.
properties:
name:
description: Name of the referenced CustomResourceDefinition.
type: string
required:
- name
type: object
extension:
description: Extension is used for extension needs by OAM platform
builders
type: object
x-kubernetes-preserve-unknown-fields: true
workloadRefsPath:
description: WorkloadRefsPath indicates if/where a scope accepts workloadRef
objects
type: string
required:
- allowComponentOverlap
- definitionRef
type: object
type: object
served: true
storage: true
subresources: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []

View File

@@ -0,0 +1,92 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.2.4
creationTimestamp: null
name: traitdefinitions.core.oam.dev
spec:
group: core.oam.dev
names:
categories:
- crossplane
- oam
kind: TraitDefinition
listKind: TraitDefinitionList
plural: traitdefinitions
singular: traitdefinition
scope: Cluster
versions:
- additionalPrinterColumns:
- jsonPath: .spec.definitionRef.name
name: DEFINITION-NAME
type: string
name: v1alpha2
schema:
openAPIV3Schema:
description: 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.
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: A TraitDefinitionSpec defines the desired state of a TraitDefinition.
properties:
appliesToWorkloads:
description: 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.
items:
type: string
type: array
definitionRef:
description: Reference to the CustomResourceDefinition that defines
this trait kind.
properties:
name:
description: Name of the referenced CustomResourceDefinition.
type: string
required:
- name
type: object
extension:
description: Extension is used for extension needs by OAM platform
builders
type: object
x-kubernetes-preserve-unknown-fields: true
revisionEnabled:
description: Revision indicates whether a trait is aware of component
revision
type: boolean
workloadRefPath:
description: WorkloadRefPath indicates where/if a trait accepts a
workloadRef object
type: string
required:
- definitionRef
type: object
type: object
served: true
storage: true
subresources: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []

View File

@@ -0,0 +1,100 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.2.4
creationTimestamp: null
name: workloaddefinitions.core.oam.dev
spec:
group: core.oam.dev
names:
categories:
- crossplane
- oam
kind: WorkloadDefinition
listKind: WorkloadDefinitionList
plural: workloaddefinitions
singular: workloaddefinition
scope: Cluster
versions:
- additionalPrinterColumns:
- jsonPath: .spec.definitionRef.name
name: DEFINITION-NAME
type: string
name: v1alpha2
schema:
openAPIV3Schema:
description: 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.
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: A WorkloadDefinitionSpec defines the desired state of a WorkloadDefinition.
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
definitionRef:
description: Reference to the CustomResourceDefinition that defines
this workload kind.
properties:
name:
description: Name of the referenced CustomResourceDefinition.
type: string
required:
- name
type: object
extension:
description: Extension is used for extension needs by OAM platform
builders
type: object
x-kubernetes-preserve-unknown-fields: true
required:
- definitionRef
type: object
type: object
served: true
storage: true
subresources: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []

View File

@@ -0,0 +1,465 @@
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: []

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,153 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.2.5
creationTimestamp: null
name: metricstraits.standard.oam.dev
spec:
group: standard.oam.dev
names:
categories:
- oam
kind: MetricsTrait
listKind: MetricsTraitList
plural: metricstraits
singular: metricstrait
scope: Namespaced
versions:
- name: v1alpha1
schema:
openAPIV3Schema:
description: MetricsTrait is the Schema for the metricstraits 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: MetricsTraitSpec defines the desired state of MetricsTrait
properties:
scrapeService:
description: An endpoint to be monitored by a ServiceMonitor.
properties:
enabled:
description: The default is true
type: boolean
format:
description: The format of the metrics data, The default and only
supported format is "prometheus" for now
type: string
path:
description: HTTP path to scrape for metrics. default is /metrics
type: string
port:
anyOf:
- type: integer
- type: string
description: Number or name of the port to access on the pods
targeted by the service. When this field has value implies that
we need to create a service for the workload Mutually exclusive
with port.
x-kubernetes-int-or-string: true
scheme:
description: Scheme at which metrics should be scraped The default
and only supported scheme is "http"
type: string
selector:
additionalProperties:
type: string
description: Route service traffic to pods with label keys and
values matching this The default is the labels in the workload
Mutually exclusive with port.
type: object
type: object
workloadRef:
description: WorkloadReference to the workload whose metrics needs
to be exposed
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:
- scrapeService
type: object
status:
description: MetricsTraitStatus defines the observed state of MetricsTrait
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
serviceMonitorName:
description: ServiceMonitorNames managed by this trait
items:
type: string
type: array
type: object
required:
- spec
type: object
served: true
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []

View File

@@ -0,0 +1,245 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.2.5
creationTimestamp: null
name: routes.standard.oam.dev
spec:
group: standard.oam.dev
names:
categories:
- oam
kind: Route
listKind: RouteList
plural: routes
singular: route
scope: Namespaced
versions:
- name: v1alpha1
schema:
openAPIV3Schema:
description: Route is the Schema for the routes 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: RouteSpec defines the desired state of Route
properties:
backend:
description: Backend indicate how to connect backend service If it's
nil, will auto discovery
properties:
port:
anyOf:
- type: integer
- type: string
description: Port points to backend service port.
x-kubernetes-int-or-string: true
protocol:
description: Protocol means backend-protocol, HTTP, HTTPS, GRPC,
GRPCS, AJP and FCGI, By default uses HTTP
type: string
readTimeout:
description: ReadTimeout used for setting read timeout duration
for backend service, the unit is second.
type: integer
selectLabels:
additionalProperties:
type: string
description: SelectLabels for backend service.
type: object
sendTimeout:
description: SendTimeout used for setting send timeout duration
for backend service, the unit is second.
type: integer
type: object
customHeaders:
additionalProperties:
type: string
description: CustomHeaders pass a custom list of headers to the backend
service.
type: object
defaultBackend:
description: DefaultBackend uses serviceName
properties:
resource:
description: Resource is an ObjectRef to another Kubernetes resource
in the namespace of the Ingress object. If resource is specified,
serviceName and servicePort must not be specified.
properties:
apiGroup:
description: APIGroup is the group for the resource being
referenced. If APIGroup is not specified, the specified
Kind must be in the core API group. For any other third-party
types, APIGroup is required.
type: string
kind:
description: Kind is the type of resource being referenced
type: string
name:
description: Name is the name of resource being referenced
type: string
required:
- kind
- name
type: object
serviceName:
description: Specifies the name of the referenced service.
type: string
servicePort:
anyOf:
- type: integer
- type: string
description: Specifies the port of the referenced service.
x-kubernetes-int-or-string: true
type: object
host:
description: Host is the host of the route
type: string
path:
description: Path is location Path, default for "/"
type: string
rewriteTarget:
description: RewriteTarget will rewrite request from Path to RewriteTarget
path.
type: string
tls:
description: 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
properties:
issuerName:
type: string
type:
description: Type indicate the issuer is ClusterIssuer or NamespaceIssuer
type: string
type: object
workloadRef:
description: WorkloadReference to the workload whose metrics needs
to be exposed
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:
- host
type: object
status:
description: RouteStatus defines the observed state of Route
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
ingress:
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
service:
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: object
type: object
served: true
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []

View File

@@ -0,0 +1,21 @@
1. Get the application URL by running these commands:
{{- if .Values.ingress.enabled }}
{{- range $host := .Values.ingress.hosts }}
{{- range .paths }}
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ . }}
{{- end }}
{{- end }}
{{- else if contains "NodePort" .Values.service.type }}
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "kubevela.fullname" . }})
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
echo http://$NODE_IP:$NODE_PORT
{{- else if contains "LoadBalancer" .Values.service.type }}
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "kubevela.fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "kubevela.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
echo http://$SERVICE_IP:{{ .Values.service.port }}
{{- else if contains "ClusterIP" .Values.service.type }}
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "kubevela.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
echo "Visit http://127.0.0.1:8080 to use your application"
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:80
{{- end }}

View File

@@ -0,0 +1,63 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "kubevela.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "kubevela.fullname" -}}
{{- if .Values.fullnameOverride -}}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- if contains $name .Release.Name -}}
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "kubevela.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
Common labels
*/}}
{{- define "kubevela.labels" -}}
helm.sh/chart: {{ include "kubevela.chart" . }}
{{ include "kubevela.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end -}}
{{/*
Selector labels
*/}}
{{- define "kubevela.selectorLabels" -}}
app.kubernetes.io/name: {{ include "kubevela.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end -}}
{{/*
Create the name of the service account to use
*/}}
{{- define "kubevela.serviceAccountName" -}}
{{- if .Values.serviceAccount.create -}}
{{ default (include "kubevela.fullname" .) .Values.serviceAccount.name }}
{{- else -}}
{{ default "default" .Values.serviceAccount.name }}
{{- end -}}
{{- end -}}

View File

@@ -0,0 +1,36 @@
apiVersion: core.oam.dev/v1alpha2
kind: WorkloadDefinition
metadata:
name: backend
annotations:
definition.oam.dev/apiVersion: "standard.oam.dev/v1alpha1"
definition.oam.dev/kind: "Containerized"
spec:
definitionRef:
name: containerizeds.standard.oam.dev
childResourceKinds:
- apiVersion: apps/v1
kind: Deployment
- apiVersion: v1
kind: Service
extension:
template: |
#Template: {
apiVersion: "standard.oam.dev/v1alpha1"
kind: "Containerized"
metadata:
name: backend.name
spec: {
containers: [{
image: backend.image
name: backend.name
}]
}
}
backend: {
name: string
// +usage=specify app image
// +short=i
image: string
}

View File

@@ -0,0 +1,943 @@
---
---
apiVersion: v1
kind: Namespace
metadata:
name: cert-manager
---
# Source: cert-manager/templates/cainjector-serviceaccount.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
name: cert-manager-cainjector
namespace: "cert-manager"
labels:
app: cainjector
app.kubernetes.io/name: cainjector
app.kubernetes.io/instance: cert-manager
helm.sh/chart: cert-manager-v0.12.0
---
# Source: cert-manager/templates/serviceaccount.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
name: cert-manager
namespace: "cert-manager"
annotations:
labels:
app: cert-manager
app.kubernetes.io/name: cert-manager
app.kubernetes.io/instance: cert-manager
helm.sh/chart: cert-manager-v0.12.0
---
# Source: cert-manager/templates/webhook-serviceaccount.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
name: cert-manager-webhook
namespace: "cert-manager"
labels:
app: webhook
app.kubernetes.io/name: webhook
app.kubernetes.io/instance: cert-manager
helm.sh/chart: cert-manager-v0.12.0
---
# Source: cert-manager/templates/cainjector-rbac.yaml
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRole
metadata:
name: cert-manager-cainjector
labels:
app: cainjector
app.kubernetes.io/name: cainjector
app.kubernetes.io/instance: cert-manager
helm.sh/chart: cert-manager-v0.12.0
rules:
- apiGroups: ["cert-manager.io"]
resources: ["certificates"]
verbs: ["get", "list", "watch"]
- apiGroups: [""]
resources: ["secrets"]
verbs: ["get", "list", "watch"]
- apiGroups: [""]
resources: ["events"]
verbs: ["get", "create", "update", "patch"]
- apiGroups: ["admissionregistration.k8s.io"]
resources: ["validatingwebhookconfigurations", "mutatingwebhookconfigurations"]
verbs: ["get", "list", "watch", "update"]
- apiGroups: ["apiregistration.k8s.io"]
resources: ["apiservices"]
verbs: ["get", "list", "watch", "update"]
- apiGroups: ["apiextensions.k8s.io"]
resources: ["customresourcedefinitions"]
verbs: ["get", "list", "watch", "update"]
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: cert-manager-cainjector
labels:
app: cainjector
app.kubernetes.io/name: cainjector
app.kubernetes.io/instance: cert-manager
helm.sh/chart: cert-manager-v0.12.0
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cert-manager-cainjector
subjects:
- name: cert-manager-cainjector
namespace: "cert-manager"
kind: ServiceAccount
---
# leader election rules
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: Role
metadata:
name: cert-manager-cainjector:leaderelection
namespace: kube-system
labels:
app: cainjector
app.kubernetes.io/name: cainjector
app.kubernetes.io/instance: cert-manager
helm.sh/chart: cert-manager-v0.12.0
rules:
# Used for leader election by the controller
# TODO: refine the permission to *just* the leader election configmap
- apiGroups: [""]
resources: ["configmaps"]
verbs: ["get", "create", "update", "patch"]
---
# grant cert-manager permission to manage the leaderelection configmap in the
# leader election namespace
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: RoleBinding
metadata:
name: cert-manager-cainjector:leaderelection
namespace: kube-system
labels:
app: cainjector
app.kubernetes.io/name: cainjector
app.kubernetes.io/instance: cert-manager
helm.sh/chart: cert-manager-v0.12.0
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: cert-manager-cainjector:leaderelection
subjects:
- apiGroup: ""
kind: ServiceAccount
name: cert-manager-cainjector
namespace: cert-manager
---
# Source: cert-manager/templates/webhook-rbac.yaml
### Webhook ###
---
# apiserver gets the auth-delegator role to delegate auth decisions to
# the core apiserver
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: cert-manager-webhook:auth-delegator
labels:
app: webhook
app.kubernetes.io/name: webhook
app.kubernetes.io/instance: cert-manager
helm.sh/chart: cert-manager-v0.12.0
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: system:auth-delegator
subjects:
- apiGroup: ""
kind: ServiceAccount
name: cert-manager-webhook
namespace: cert-manager
---
# apiserver gets the ability to read authentication. This allows it to
# read the specific configmap that has the requestheader-* entries to
# api agg
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: RoleBinding
metadata:
name: cert-manager-webhook:webhook-authentication-reader
namespace: kube-system
labels:
app: webhook
app.kubernetes.io/name: webhook
app.kubernetes.io/instance: cert-manager
helm.sh/chart: cert-manager-v0.12.0
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: extension-apiserver-authentication-reader
subjects:
- apiGroup: ""
kind: ServiceAccount
name: cert-manager-webhook
namespace: cert-manager
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: cert-manager-webhook:webhook-requester
labels:
app: webhook
app.kubernetes.io/name: webhook
app.kubernetes.io/instance: cert-manager
helm.sh/chart: cert-manager-v0.12.0
rules:
- apiGroups:
- admission.cert-manager.io
resources:
- certificates
- certificaterequests
- issuers
- clusterissuers
verbs:
- create
---
# Source: cert-manager/templates/rbac.yaml
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: Role
metadata:
name: cert-manager:leaderelection
namespace: kube-system
labels:
app: cert-manager
app.kubernetes.io/name: cert-manager
app.kubernetes.io/instance: cert-manager
helm.sh/chart: cert-manager-v0.12.0
rules:
# Used for leader election by the controller
# TODO: refine the permission to *just* the leader election configmap
- apiGroups: [""]
resources: ["configmaps"]
verbs: ["get", "create", "update", "patch"]
---
# grant cert-manager permission to manage the leaderelection configmap in the
# leader election namespace
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: RoleBinding
metadata:
name: cert-manager:leaderelection
namespace: kube-system
labels:
app: cert-manager
app.kubernetes.io/name: cert-manager
app.kubernetes.io/instance: cert-manager
helm.sh/chart: cert-manager-v0.12.0
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: cert-manager:leaderelection
subjects:
- apiGroup: ""
kind: ServiceAccount
name: cert-manager
namespace: cert-manager
---
# Issuer controller role
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRole
metadata:
name: cert-manager-controller-issuers
labels:
app: cert-manager
app.kubernetes.io/name: cert-manager
app.kubernetes.io/instance: cert-manager
helm.sh/chart: cert-manager-v0.12.0
rules:
- apiGroups: ["cert-manager.io"]
resources: ["issuers", "issuers/status"]
verbs: ["update"]
- apiGroups: ["cert-manager.io"]
resources: ["issuers"]
verbs: ["get", "list", "watch"]
- apiGroups: [""]
resources: ["secrets"]
verbs: ["get", "list", "watch", "create", "update", "delete"]
- apiGroups: [""]
resources: ["events"]
verbs: ["create", "patch"]
---
# ClusterIssuer controller role
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRole
metadata:
name: cert-manager-controller-clusterissuers
labels:
app: cert-manager
app.kubernetes.io/name: cert-manager
app.kubernetes.io/instance: cert-manager
helm.sh/chart: cert-manager-v0.12.0
rules:
- apiGroups: ["cert-manager.io"]
resources: ["clusterissuers", "clusterissuers/status"]
verbs: ["update"]
- apiGroups: ["cert-manager.io"]
resources: ["clusterissuers"]
verbs: ["get", "list", "watch"]
- apiGroups: [""]
resources: ["secrets"]
verbs: ["get", "list", "watch", "create", "update", "delete"]
- apiGroups: [""]
resources: ["events"]
verbs: ["create", "patch"]
---
# Certificates controller role
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRole
metadata:
name: cert-manager-controller-certificates
labels:
app: cert-manager
app.kubernetes.io/name: cert-manager
app.kubernetes.io/instance: cert-manager
helm.sh/chart: cert-manager-v0.12.0
rules:
- apiGroups: ["cert-manager.io"]
resources: ["certificates", "certificates/status", "certificaterequests", "certificaterequests/status"]
verbs: ["update"]
- apiGroups: ["cert-manager.io"]
resources: ["certificates", "certificaterequests", "clusterissuers", "issuers"]
verbs: ["get", "list", "watch"]
# We require these rules to support users with the OwnerReferencesPermissionEnforcement
# admission controller enabled:
# https://kubernetes.io/docs/reference/access-authn-authz/admission-controllers/#ownerreferencespermissionenforcement
- apiGroups: ["cert-manager.io"]
resources: ["certificates/finalizers", "certificaterequests/finalizers"]
verbs: ["update"]
- apiGroups: ["acme.cert-manager.io"]
resources: ["orders"]
verbs: ["create", "delete", "get", "list", "watch"]
- apiGroups: [""]
resources: ["secrets"]
verbs: ["get", "list", "watch", "create", "update", "delete"]
- apiGroups: [""]
resources: ["events"]
verbs: ["create", "patch"]
---
# Orders controller role
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRole
metadata:
name: cert-manager-controller-orders
labels:
app: cert-manager
app.kubernetes.io/name: cert-manager
app.kubernetes.io/instance: cert-manager
helm.sh/chart: cert-manager-v0.12.0
rules:
- apiGroups: ["acme.cert-manager.io"]
resources: ["orders", "orders/status"]
verbs: ["update"]
- apiGroups: ["acme.cert-manager.io"]
resources: ["orders", "challenges"]
verbs: ["get", "list", "watch"]
- apiGroups: ["cert-manager.io"]
resources: ["clusterissuers", "issuers"]
verbs: ["get", "list", "watch"]
- apiGroups: ["acme.cert-manager.io"]
resources: ["challenges"]
verbs: ["create", "delete"]
# We require these rules to support users with the OwnerReferencesPermissionEnforcement
# admission controller enabled:
# https://kubernetes.io/docs/reference/access-authn-authz/admission-controllers/#ownerreferencespermissionenforcement
- apiGroups: ["acme.cert-manager.io"]
resources: ["orders/finalizers"]
verbs: ["update"]
- apiGroups: [""]
resources: ["secrets"]
verbs: ["get", "list", "watch"]
- apiGroups: [""]
resources: ["events"]
verbs: ["create", "patch"]
---
# Challenges controller role
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRole
metadata:
name: cert-manager-controller-challenges
labels:
app: cert-manager
app.kubernetes.io/name: cert-manager
app.kubernetes.io/instance: cert-manager
helm.sh/chart: cert-manager-v0.12.0
rules:
# Use to update challenge resource status
- apiGroups: ["acme.cert-manager.io"]
resources: ["challenges", "challenges/status"]
verbs: ["update"]
# Used to watch challenge resources
- apiGroups: ["acme.cert-manager.io"]
resources: ["challenges"]
verbs: ["get", "list", "watch"]
# Used to watch challenges, issuer and clusterissuer resources
- apiGroups: ["cert-manager.io"]
resources: ["issuers", "clusterissuers"]
verbs: ["get", "list", "watch"]
# Need to be able to retrieve ACME account private key to complete challenges
- apiGroups: [""]
resources: ["secrets"]
verbs: ["get", "list", "watch"]
# Used to create events
- apiGroups: [""]
resources: ["events"]
verbs: ["create", "patch"]
# HTTP01 rules
- apiGroups: [""]
resources: ["pods", "services"]
verbs: ["get", "list", "watch", "create", "delete"]
- apiGroups: ["extensions"]
resources: ["ingresses"]
verbs: ["get", "list", "watch", "create", "delete", "update"]
# We require these rules to support users with the OwnerReferencesPermissionEnforcement
# admission controller enabled:
# https://kubernetes.io/docs/reference/access-authn-authz/admission-controllers/#ownerreferencespermissionenforcement
- apiGroups: ["acme.cert-manager.io"]
resources: ["challenges/finalizers"]
verbs: ["update"]
# DNS01 rules (duplicated above)
- apiGroups: [""]
resources: ["secrets"]
verbs: ["get", "list", "watch"]
---
# ingress-shim controller role
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRole
metadata:
name: cert-manager-controller-ingress-shim
labels:
app: cert-manager
app.kubernetes.io/name: cert-manager
app.kubernetes.io/instance: cert-manager
helm.sh/chart: cert-manager-v0.12.0
rules:
- apiGroups: ["cert-manager.io"]
resources: ["certificates", "certificaterequests"]
verbs: ["create", "update", "delete"]
- apiGroups: ["cert-manager.io"]
resources: ["certificates", "certificaterequests", "issuers", "clusterissuers"]
verbs: ["get", "list", "watch"]
- apiGroups: ["extensions"]
resources: ["ingresses"]
verbs: ["get", "list", "watch"]
# We require these rules to support users with the OwnerReferencesPermissionEnforcement
# admission controller enabled:
# https://kubernetes.io/docs/reference/access-authn-authz/admission-controllers/#ownerreferencespermissionenforcement
- apiGroups: ["extensions"]
resources: ["ingresses/finalizers"]
verbs: ["update"]
- apiGroups: [""]
resources: ["events"]
verbs: ["create", "patch"]
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: cert-manager-controller-issuers
labels:
app: cert-manager
app.kubernetes.io/name: cert-manager
app.kubernetes.io/instance: cert-manager
helm.sh/chart: cert-manager-v0.12.0
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cert-manager-controller-issuers
subjects:
- name: cert-manager
namespace: "cert-manager"
kind: ServiceAccount
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: cert-manager-controller-clusterissuers
labels:
app: cert-manager
app.kubernetes.io/name: cert-manager
app.kubernetes.io/instance: cert-manager
helm.sh/chart: cert-manager-v0.12.0
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cert-manager-controller-clusterissuers
subjects:
- name: cert-manager
namespace: "cert-manager"
kind: ServiceAccount
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: cert-manager-controller-certificates
labels:
app: cert-manager
app.kubernetes.io/name: cert-manager
app.kubernetes.io/instance: cert-manager
helm.sh/chart: cert-manager-v0.12.0
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cert-manager-controller-certificates
subjects:
- name: cert-manager
namespace: "cert-manager"
kind: ServiceAccount
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: cert-manager-controller-orders
labels:
app: cert-manager
app.kubernetes.io/name: cert-manager
app.kubernetes.io/instance: cert-manager
helm.sh/chart: cert-manager-v0.12.0
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cert-manager-controller-orders
subjects:
- name: cert-manager
namespace: "cert-manager"
kind: ServiceAccount
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: cert-manager-controller-challenges
labels:
app: cert-manager
app.kubernetes.io/name: cert-manager
app.kubernetes.io/instance: cert-manager
helm.sh/chart: cert-manager-v0.12.0
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cert-manager-controller-challenges
subjects:
- name: cert-manager
namespace: "cert-manager"
kind: ServiceAccount
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: cert-manager-controller-ingress-shim
labels:
app: cert-manager
app.kubernetes.io/name: cert-manager
app.kubernetes.io/instance: cert-manager
helm.sh/chart: cert-manager-v0.12.0
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cert-manager-controller-ingress-shim
subjects:
- name: cert-manager
namespace: "cert-manager"
kind: ServiceAccount
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: cert-manager-view
labels:
app: cert-manager
app.kubernetes.io/name: cert-manager
app.kubernetes.io/instance: cert-manager
helm.sh/chart: cert-manager-v0.12.0
rbac.authorization.k8s.io/aggregate-to-view: "true"
rbac.authorization.k8s.io/aggregate-to-edit: "true"
rbac.authorization.k8s.io/aggregate-to-admin: "true"
rules:
- apiGroups: ["cert-manager.io"]
resources: ["certificates", "certificaterequests", "issuers"]
verbs: ["get", "list", "watch"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: cert-manager-edit
labels:
app: cert-manager
app.kubernetes.io/name: cert-manager
app.kubernetes.io/instance: cert-manager
helm.sh/chart: cert-manager-v0.12.0
rbac.authorization.k8s.io/aggregate-to-edit: "true"
rbac.authorization.k8s.io/aggregate-to-admin: "true"
rules:
- apiGroups: ["cert-manager.io"]
resources: ["certificates", "certificaterequests", "issuers"]
verbs: ["create", "delete", "deletecollection", "patch", "update"]
---
# Source: cert-manager/templates/service.yaml
apiVersion: v1
kind: Service
metadata:
name: cert-manager
namespace: "cert-manager"
labels:
app: cert-manager
app.kubernetes.io/name: cert-manager
app.kubernetes.io/instance: cert-manager
helm.sh/chart: cert-manager-v0.12.0
spec:
type: ClusterIP
ports:
- protocol: TCP
port: 9402
targetPort: 9402
selector:
app.kubernetes.io/name: cert-manager
app.kubernetes.io/instance: cert-manager
---
# Source: cert-manager/templates/webhook-service.yaml
apiVersion: v1
kind: Service
metadata:
name: cert-manager-webhook
namespace: "cert-manager"
labels:
app: webhook
app.kubernetes.io/name: webhook
app.kubernetes.io/instance: cert-manager
helm.sh/chart: cert-manager-v0.12.0
spec:
type: ClusterIP
ports:
- name: https
port: 443
targetPort: 10250
selector:
app: webhook
app.kubernetes.io/name: webhook
app.kubernetes.io/instance: cert-manager
---
# Source: cert-manager/templates/cainjector-deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: cert-manager-cainjector
namespace: "cert-manager"
labels:
app: cainjector
app.kubernetes.io/name: cainjector
app.kubernetes.io/instance: cert-manager
helm.sh/chart: cert-manager-v0.12.0
spec:
replicas: 1
selector:
matchLabels:
app: cainjector
app.kubernetes.io/name: cainjector
app.kubernetes.io/instance: cert-manager
template:
metadata:
labels:
app: cainjector
app.kubernetes.io/name: cainjector
app.kubernetes.io/instance: cert-manager
helm.sh/chart: cert-manager-v0.12.0
annotations:
spec:
serviceAccountName: cert-manager-cainjector
containers:
- name: cert-manager
image: "quay.io/jetstack/cert-manager-cainjector:v0.12.0"
imagePullPolicy: IfNotPresent
args:
- --v=2
- --leader-election-namespace=kube-system
env:
- name: POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
resources:
{}
---
# Source: cert-manager/templates/deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: cert-manager
namespace: "cert-manager"
labels:
app: cert-manager
app.kubernetes.io/name: cert-manager
app.kubernetes.io/instance: cert-manager
helm.sh/chart: cert-manager-v0.12.0
spec:
replicas: 1
selector:
matchLabels:
app: cert-manager
app.kubernetes.io/name: cert-manager
app.kubernetes.io/instance: cert-manager
template:
metadata:
labels:
app: cert-manager
app.kubernetes.io/name: cert-manager
app.kubernetes.io/instance: cert-manager
helm.sh/chart: cert-manager-v0.12.0
annotations:
prometheus.io/path: "/metrics"
prometheus.io/scrape: 'true'
prometheus.io/port: '9402'
spec:
serviceAccountName: cert-manager
containers:
- name: cert-manager
image: "quay.io/jetstack/cert-manager-controller:v0.12.0"
imagePullPolicy: IfNotPresent
args:
- --v=2
- --cluster-resource-namespace=$(POD_NAMESPACE)
- --leader-election-namespace=kube-system
- --webhook-namespace=$(POD_NAMESPACE)
- --webhook-ca-secret=cert-manager-webhook-ca
- --webhook-serving-secret=cert-manager-webhook-tls
- --webhook-dns-names=cert-manager-webhook,cert-manager-webhook.cert-manager,cert-manager-webhook.cert-manager.svc
- --enable-certificate-owner-ref
ports:
- containerPort: 9402
protocol: TCP
env:
- name: POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
resources:
requests:
cpu: 10m
memory: 32Mi
---
# Source: cert-manager/templates/webhook-deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: cert-manager-webhook
namespace: "cert-manager"
labels:
app: webhook
app.kubernetes.io/name: webhook
app.kubernetes.io/instance: cert-manager
helm.sh/chart: cert-manager-v0.12.0
spec:
replicas: 1
selector:
matchLabels:
app: webhook
app.kubernetes.io/name: webhook
app.kubernetes.io/instance: cert-manager
template:
metadata:
labels:
app: webhook
app.kubernetes.io/name: webhook
app.kubernetes.io/instance: cert-manager
helm.sh/chart: cert-manager-v0.12.0
annotations:
spec:
serviceAccountName: cert-manager-webhook
containers:
- name: cert-manager
image: "quay.io/jetstack/cert-manager-webhook:v0.12.0"
imagePullPolicy: IfNotPresent
args:
- --v=2
- --secure-port=10250
- --tls-cert-file=/certs/tls.crt
- --tls-private-key-file=/certs/tls.key
livenessProbe:
httpGet:
path: /livez
port: 6080
scheme: HTTP
readinessProbe:
httpGet:
path: /healthz
port: 6080
scheme: HTTP
env:
- name: POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
resources:
{}
volumeMounts:
- name: certs
mountPath: /certs
volumes:
- name: certs
secret:
secretName: cert-manager-webhook-tls
---
# Source: cert-manager/templates/webhook-mutating-webhook.yaml
apiVersion: admissionregistration.k8s.io/v1beta1
kind: MutatingWebhookConfiguration
metadata:
name: cert-manager-webhook
labels:
app: webhook
app.kubernetes.io/name: webhook
app.kubernetes.io/instance: cert-manager
helm.sh/chart: cert-manager-v0.12.0
annotations:
cert-manager.io/inject-ca-from-secret: "cert-manager/cert-manager-webhook-tls"
webhooks:
- name: webhook.cert-manager.io
rules:
- apiGroups:
- "cert-manager.io"
- "acme.cert-manager.io"
apiVersions:
- v1alpha2
operations:
- CREATE
- UPDATE
resources:
- "*/*"
failurePolicy: Fail
sideEffects: None
clientConfig:
service:
name: cert-manager-webhook
namespace: "cert-manager"
path: /mutate
---
# Source: cert-manager/templates/cainjector-psp-clusterrole.yaml
---
# Source: cert-manager/templates/cainjector-psp-clusterrolebinding.yaml
---
# Source: cert-manager/templates/cainjector-psp.yaml
---
# Source: cert-manager/templates/psp-clusterrole.yaml
---
# Source: cert-manager/templates/psp-clusterrolebinding.yaml
---
# Source: cert-manager/templates/psp.yaml
---
# Source: cert-manager/templates/servicemonitor.yaml
---
# Source: cert-manager/templates/webhook-psp-clusterrole.yaml
---
# Source: cert-manager/templates/webhook-psp-clusterrolebinding.yaml
---
# Source: cert-manager/templates/webhook-psp.yaml
---
# Source: cert-manager/templates/webhook-validating-webhook.yaml
apiVersion: admissionregistration.k8s.io/v1beta1
kind: ValidatingWebhookConfiguration
metadata:
name: cert-manager-webhook
labels:
app: webhook
app.kubernetes.io/name: webhook
app.kubernetes.io/instance: cert-manager
helm.sh/chart: cert-manager-v0.12.0
annotations:
cert-manager.io/inject-ca-from-secret: "cert-manager/cert-manager-webhook-tls"
webhooks:
- name: webhook.cert-manager.io
namespaceSelector:
matchExpressions:
- key: "cert-manager.io/disable-validation"
operator: "NotIn"
values:
- "true"
- key: "name"
operator: "NotIn"
values:
- cert-manager
rules:
- apiGroups:
- "cert-manager.io"
- "acme.cert-manager.io"
apiVersions:
- v1alpha2
operations:
- CREATE
- UPDATE
resources:
- "*/*"
failurePolicy: Fail
sideEffects: None
clientConfig:
service:
name: cert-manager-webhook
namespace: "cert-manager"
path: /mutate

View File

@@ -0,0 +1,13 @@
apiVersion: core.oam.dev/v1alpha2
kind: ScopeDefinition
metadata:
name: healthscopes.core.oam.dev
annotations:
definition.oam.dev/apiVersion: core.oam.dev/v1alpha2
definition.oam.dev/kind: HealthScope
namespace: default
spec:
workloadRefsPath: spec.workloadRefs
allowComponentOverlap: true
definitionRef:
name: healthscope.core.oam.dev

View File

@@ -0,0 +1,41 @@
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "kubevela.fullname" . -}}
{{- $svcPort := .Values.service.port -}}
{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1beta1
{{- else -}}
apiVersion: extensions/v1beta1
{{- end }}
kind: Ingress
metadata:
name: {{ $fullName }}
labels:
{{- include "kubevela.labels" . | nindent 4 }}
{{- with .Values.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if .Values.ingress.tls }}
tls:
{{- range .Values.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
{{- range .Values.ingress.hosts }}
- host: {{ .host | quote }}
http:
paths:
{{- range .paths }}
- path: {{ . }}
backend:
serviceName: {{ $fullName }}
servicePort: {{ $svcPort }}
{{- end }}
{{- end }}
{{- end }}

View File

@@ -0,0 +1,144 @@
---
{{- if .Values.serviceAccount.create -}}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "kubevela.serviceAccountName" . }}
labels:
{{- include "kubevela.labels" . | nindent 4 }}
{{- with .Values.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: manager-rolebinding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: "cluster-admin"
subjects:
- kind: ServiceAccount
name: {{ include "kubevela.serviceAccountName" . }}
namespace: {{ .Release.Namespace }}
---
# permissions to do leader election.
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: leader-election-role
rules:
- apiGroups:
- ""
resources:
- configmaps
verbs:
- get
- list
- watch
- create
- update
- patch
- delete
- apiGroups:
- ""
resources:
- configmaps/status
verbs:
- get
- update
- patch
- apiGroups:
- ""
resources:
- events
verbs:
- create
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: leader-election-rolebinding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: leader-election-role
subjects:
- kind: ServiceAccount
name: {{ include "kubevela.serviceAccountName" . }}
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "kubevela.fullname" . }}
labels:
{{- include "kubevela.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
{{- include "kubevela.selectorLabels" . | nindent 6 }}
template:
metadata:
labels:
{{- include "kubevela.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "kubevela.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Release.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
args:
- "--metrics-addr=:8080"
- "--enable-leader-election"
{{ if .Values.useWebhook }}
- "--use-webhook=true"
- "--webhook-port={{ .Values.webhookService.port }}"
- "--webhook-cert-dir={{ .Values.certificate.mountPath }}"
{{ end }}
image: {{ .Values.image.repository }}:{{ .Values.image.tag }}
imagePullPolicy: {{ quote .Values.image.pullPolicy }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{ if .Values.useWebhook }}
ports:
- containerPort: {{ .Values.webhookService.port }}
name: webhook-server
protocol: TCP
volumeMounts:
- mountPath: {{ .Values.certificate.mountPath }}
name: tls-cert-vol
readOnly: true
{{ end }}
volumes:
- name: tls-cert-vol
secret:
defaultMode: 420
secretName: {{ .Values.certificate.secretName | quote }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}

View File

@@ -0,0 +1,28 @@
apiVersion: core.oam.dev/v1alpha2
kind: TraitDefinition
metadata:
annotations:
definition.oam.dev/apiVersion: core.oam.dev/v1alpha2
definition.oam.dev/kind: ManualScalerTrait
name: manualscalertraits.core.oam.dev
namespace: default
spec:
appliesToWorkloads:
- core.oam.dev/v1alpha2.ContainerizedWorkload
- apps/v1.Deployment
definitionRef:
name: manualscalertraits.core.oam.dev
extension:
template: |-
#Template: {
apiVersion: "core.oam.dev/v1alpha2"
kind: "ManualScalerTrait"
spec: {
replicaCount: scale.replica
}
}
scale: {
//+short=r
replica: *2 | int
}
workloadRefPath: spec.workloadRef

View File

@@ -0,0 +1,17 @@
apiVersion: core.oam.dev/v1alpha2
kind: TraitDefinition
metadata:
name: metricstraits.standard.oam.dev
namespace: default
annotations:
definition.oam.dev/apiVersion: standard.oam.dev/v1alpha1
definition.oam.dev/kind: MetricsTrait
spec:
appliesToWorkloads:
- containerizedworkloads.core.oam.dev
- clonesetworkloads.apps.kruise.io
- deployments.apps
- statefulsets.apps
definitionRef:
name: metricstraits.standard.oam.dev
workloadRefPath: spec.workloadRef

View File

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

View File

@@ -0,0 +1,15 @@
apiVersion: v1
kind: Pod
metadata:
name: "{{ include "kubevela.fullname" . }}-test-connection"
labels:
{{- include "kubevela.labels" . | nindent 4 }}
annotations:
"helm.sh/hook": test-success
spec:
containers:
- name: wget
image: busybox
command: ['wget']
args: ['{{ include "kubevela.fullname" . }}:{{ .Values.service.port }}']
restartPolicy: Never

View File

@@ -0,0 +1,14 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: vela-config
namespace: default
data:
certificates.cert-manager.io: |
{
"repo": "jetstack",
"urL": "https://charts.jetstack.io",
"name": "cert-manager",
"namespace": "cert-manager",
"version": "1.0.0"
}

View File

@@ -0,0 +1,137 @@
{{- if .Values.useWebhook -}}
---
apiVersion: admissionregistration.k8s.io/v1beta1
kind: MutatingWebhookConfiguration
metadata:
creationTimestamp: null
name: mutating-webhook-configuration
annotations:
cert-manager.io/inject-ca-from: {{ .Release.Namespace }}/{{ .Values.certificate.certificateName }}
webhooks:
- clientConfig:
caBundle: Cg==
service:
name: {{ template "kubevela.name" . }}-webhook
namespace: {{ .Release.Namespace }}
path: /mutate-standard-oam-dev-v1alpha1-metricstrait
failurePolicy: Fail
name: mmetricstrait.kb.io
rules:
- apiGroups:
- standard.oam.dev
apiVersions:
- v1alpha1
operations:
- CREATE
- UPDATE
resources:
- metricstraits
- clientConfig:
caBundle: Cg==
service:
name: {{ template "kubevela.name" . }}-webhook
namespace: {{ .Release.Namespace }}
path: /mutate-standard-oam-dev-v1alpha1-containerized
failurePolicy: Fail
name: mcontainerized.kb.io
rules:
- apiGroups:
- standard.oam.dev
apiVersions:
- v1alpha1
operations:
- CREATE
- UPDATE
resources:
- Containerized
---
apiVersion: admissionregistration.k8s.io/v1beta1
kind: ValidatingWebhookConfiguration
metadata:
creationTimestamp: null
name: validating-webhook-configuration
annotations:
cert-manager.io/inject-ca-from: {{ .Release.Namespace }}/{{ .Values.certificate.certificateName }}
webhooks:
- clientConfig:
caBundle: Cg==
service:
name: {{ template "kubevela.name" . }}-webhook
namespace: {{ .Release.Namespace }}
path: /validate-standard-oam-dev-v1alpha1-metricstrait
failurePolicy: Fail
name: vmetricstrait.kb.io
rules:
- apiGroups:
- standard.oam.dev
apiVersions:
- v1alpha1
operations:
- CREATE
- UPDATE
- DELETE
resources:
- metricstraits
- clientConfig:
caBundle: Cg==
service:
name: {{ template "kubevela.name" . }}-webhook
namespace: {{ .Release.Namespace }}
path: /validate-standard-oam-dev-v1alpha1-containerized
failurePolicy: Fail
name: vcontainerized.kb.io
rules:
- apiGroups:
- standard.oam.dev
apiVersions:
- v1alpha1
operations:
- CREATE
- UPDATE
- DELETE
resources:
- Containerized
---
apiVersion: v1
kind: Service
metadata:
name: {{ template "kubevela.name" . }}-webhook
labels:
{{- include "kubevela.labels" . | nindent 4 }}
spec:
type: {{ .Values.webhookService.type }}
ports:
- port: 443
targetPort: {{ .Values.webhookService.port }}
protocol: TCP
name: https
selector:
{{ include "kubevela.selectorLabels" . | nindent 6 }}
---
# The following manifests contain a self-signed issuer CR and a certificate CR.
# More document can be found at https://docs.cert-manager.io
apiVersion: cert-manager.io/v1alpha2
kind: Issuer
metadata:
name: {{ .Values.certificate.issuerName | quote }}
spec:
selfSigned: {}
---
apiVersion: cert-manager.io/v1alpha2
kind: Certificate
metadata:
name: {{ .Values.certificate.certificateName }}
spec:
dnsNames:
- {{ template "kubevela.name" . }}-webhook.{{ .Release.Namespace }}.svc
- {{ template "kubevela.name" . }}-webhook.{{ .Release.Namespace }}.svc.cluster.local
issuerRef:
kind: Issuer
name: {{ .Values.certificate.issuerName | default "selfsigned-issuer" | quote }}
secretName: {{ .Values.certificate.secretName | quote }}
---
{{- end -}}

View File

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

View File

@@ -0,0 +1,78 @@
# Default values for kubevela.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
replicaCount: 1
useWebhook: true
image:
repository: oamdev/vela-core
tag: latest
pullPolicy: Always
imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""
serviceAccount:
# Specifies whether a service account should be created
create: true
# Annotations to add to the service account
annotations: {}
# The name of the service account to use.
# If not set and create is true, a name is generated using the fullname template
name:
podSecurityContext: {}
# fsGroup: 2000
securityContext: {}
# capabilities:
# drop:
# - ALL
# readOnlyRootFilesystem: true
# runAsNonRoot: true
# runAsUser: 1000
service:
type: ClusterIP
port: 80
ingress:
enabled: false
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
hosts:
- host: chart-example.local
paths: []
tls: []
# - secretName: chart-example-tls
# hosts:
# - chart-example.local
resources:
limits:
cpu: 500m
memory: 1Gi
requests:
cpu: 50m
memory: 20Mi
webhookService:
type: ClusterIP
port: 9443
nodeSelector: {}
tolerations: []
affinity: {}
# certificate related to the webhook
certificate:
issuerName: selfsigned-issuer
certificateName: serving-cert
secretName: webhook-server-cert
mountPath: /etc/k8s-webhook-certs
caBundle: replace-me

154
cmd/core/main.go Normal file
View File

@@ -0,0 +1,154 @@
package main
import (
"flag"
"io"
"os"
"strconv"
velacore "github.com/oam-dev/kubevela/api/v1alpha1"
velacontroller "github.com/oam-dev/kubevela/pkg/controller"
"github.com/oam-dev/kubevela/pkg/controller/dependency"
velawebhook "github.com/oam-dev/kubevela/pkg/webhook"
oamcore "github.com/crossplane/oam-kubernetes-runtime/apis/core"
oamcontroller "github.com/crossplane/oam-kubernetes-runtime/pkg/controller"
oamv1alpha2 "github.com/crossplane/oam-kubernetes-runtime/pkg/controller/v1alpha2"
oamwebhook "github.com/crossplane/oam-kubernetes-runtime/pkg/webhook/v1alpha2"
injectorv1alpha1 "github.com/oam-dev/trait-injector/api/v1alpha1"
injectorcontroller "github.com/oam-dev/trait-injector/controllers"
"github.com/oam-dev/trait-injector/pkg/injector"
"github.com/oam-dev/trait-injector/pkg/plugin"
monitoring "github.com/coreos/prometheus-operator/pkg/apis/monitoring/v1"
"github.com/crossplane/crossplane-runtime/pkg/logging"
certmanager "github.com/jetstack/cert-manager/pkg/apis/certmanager/v1alpha2"
"go.uber.org/zap/zapcore"
"gopkg.in/natefinch/lumberjack.v2"
crdv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
"k8s.io/apimachinery/pkg/runtime"
clientgoscheme "k8s.io/client-go/kubernetes/scheme"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/log/zap"
)
var scheme = runtime.NewScheme()
func init() {
_ = clientgoscheme.AddToScheme(scheme)
_ = crdv1.AddToScheme(scheme)
_ = oamcore.AddToScheme(scheme)
_ = monitoring.AddToScheme(scheme)
_ = velacore.AddToScheme(scheme)
_ = injectorv1alpha1.AddToScheme(scheme)
_ = certmanager.AddToScheme(scheme)
// +kubebuilder:scaffold:scheme
}
func main() {
var metricsAddr, logFilePath string
var enableLeaderElection, logCompress bool
var logRetainDate int
var certDir string
var webhookPort int
var useWebhook, useTraitInjector bool
var controllerArgs oamcontroller.Args
flag.BoolVar(&useWebhook, "use-webhook", false, "Enable Admission Webhook")
flag.BoolVar(&useTraitInjector, "use-trait-injector", false, "Enable TraitInjector")
flag.StringVar(&certDir, "webhook-cert-dir", "/k8s-webhook-server/serving-certs", "Admission webhook cert/key dir.")
flag.IntVar(&webhookPort, "webhook-port", 9443, "admission webhook listen address")
flag.StringVar(&metricsAddr, "metrics-addr", ":8080", "The address the metric endpoint binds to.")
flag.BoolVar(&enableLeaderElection, "enable-leader-election", false,
"Enable leader election for controller manager. Enabling this will ensure there is only one active controller manager.")
flag.StringVar(&logFilePath, "log-file-path", "", "The address the metric endpoint binds to.")
flag.IntVar(&logRetainDate, "log-retain-date", 7, "The number of days of logs history to retain.")
flag.BoolVar(&logCompress, "log-compress", true, "Enable compression on the rotated logs.")
flag.IntVar(&controllerArgs.RevisionLimit, "revision-limit", 50,
"RevisionLimit is the maximum number of revisions that will be maintained. The default value is 50.")
flag.Parse()
// setup logging
var w io.Writer
if len(logFilePath) > 0 {
w = zapcore.AddSync(&lumberjack.Logger{
Filename: logFilePath,
MaxAge: logRetainDate, // days
Compress: logCompress,
})
} else {
w = os.Stdout
}
ctrl.SetLogger(zap.New(func(o *zap.Options) {
o.Development = true
o.DestWritter = w
}))
setupLog := ctrl.Log.WithName("vela-runtime")
mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{
Scheme: scheme,
MetricsBindAddress: metricsAddr,
LeaderElection: enableLeaderElection,
LeaderElectionID: "vela-runtime",
Port: webhookPort,
CertDir: certDir,
})
if err != nil {
setupLog.Error(err, "unable to create a controller manager")
os.Exit(1)
}
k8sClient, err := client.New(ctrl.GetConfigOrDie(), client.Options{Scheme: scheme})
if err != nil {
setupLog.Error(err, "unable to create a kubernetes client")
os.Exit(1)
}
if err = dependency.Install(k8sClient); err != nil {
setupLog.Error(err, "unable to install the dependency")
os.Exit(1)
}
if useWebhook {
setupLog.Info("vela webhook enabled, will serving at :" + strconv.Itoa(webhookPort))
oamwebhook.Add(mgr)
velawebhook.Register(mgr)
}
if err = oamv1alpha2.Setup(mgr, controllerArgs, logging.NewLogrLogger(setupLog)); err != nil {
setupLog.Error(err, "unable to setup the oam core controller")
os.Exit(1)
}
if err = velacontroller.Setup(mgr); err != nil {
setupLog.Error(err, "unable to setup the vela core controller")
os.Exit(1)
}
if useTraitInjector {
// register all service injectors
plugin.RegisterTargetInjectors(injector.Defaults()...)
tiWebhook := &injectorcontroller.ServiceBindingReconciler{
Client: mgr.GetClient(),
Log: ctrl.Log.WithName("controllers").WithName("ServiceBinding"),
Scheme: mgr.GetScheme(),
Recorder: mgr.GetEventRecorderFor("servicebinding"),
}
if err = (tiWebhook).SetupWithManager(mgr); err != nil {
setupLog.Error(err, "unable to create controller", "controller", "ServiceBinding")
os.Exit(1)
}
// this has hard coded requirement "./ssl/service-injector.pem", "./ssl/service-injector.key"
go tiWebhook.ServeAdmission()
}
setupLog.Info("starting the vela controller manager")
if err := mgr.Start(ctrl.SetupSignalHandler()); err != nil {
setupLog.Error(err, "problem running manager")
os.Exit(1)
}
}

View File

@@ -1,90 +0,0 @@
package main
import (
"fmt"
"github.com/cloud-native-application/rudrx/pkg/cmd"
"math/rand"
"os"
"time"
coreoamdevv1alpha2 "github.com/cloud-native-application/rudrx/api/v1alpha2"
"k8s.io/apimachinery/pkg/runtime"
"github.com/cloud-native-application/rudrx/pkg/cmd/run"
cmdutil "github.com/cloud-native-application/rudrx/pkg/cmd/util"
"github.com/cloud-native-application/rudrx/pkg/utils/logs"
"github.com/crossplane/oam-kubernetes-runtime/apis/core"
"github.com/spf13/cobra"
"k8s.io/cli-runtime/pkg/genericclioptions"
clientgoscheme "k8s.io/client-go/kubernetes/scheme"
"sigs.k8s.io/controller-runtime/pkg/client"
)
// noUsageError suppresses usage printing when it occurs
// (since cobra doesn't provide a good way to avoid printing
// out usage in only certain situations).
type noUsageError struct{ error }
var (
scheme = runtime.NewScheme()
)
func init() {
_ = clientgoscheme.AddToScheme(scheme)
_ = coreoamdevv1alpha2.AddToScheme(scheme)
_ = core.AddToScheme(scheme)
// +kubebuilder:scaffold:scheme
}
func main() {
rand.Seed(time.Now().UnixNano())
command := newCommand()
logs.InitLogs()
defer logs.FlushLogs()
if err := command.Execute(); err != nil {
os.Exit(1)
}
}
func newCommand() *cobra.Command {
ioStream := cmdutil.IOStreams{In: os.Stdin, Out: os.Stdout, ErrOut: os.Stderr}
cmds := &cobra.Command{
Use: "rudrx",
Short: "rudrx is a command-line tool to use OAM based micro-app engine.",
Long: "rudrx is a command-line tool to use OAM based micro-app engine.",
Run: runHelp,
}
flags := cmds.PersistentFlags()
kubeConfigFlags := genericclioptions.NewConfigFlags(true).WithDeprecatedPasswordFlag()
kubeConfigFlags.AddFlags(flags)
f := cmdutil.NewFactory(kubeConfigFlags)
restConf, err := f.ToRESTConfig()
if err != nil {
fmt.Println("get kubeconfig err", err)
os.Exit(1)
}
client, err := client.New(restConf, client.Options{Scheme: scheme})
if err != nil {
fmt.Println("create client from kubeconfig err", err)
os.Exit(1)
}
cmds.AddCommand(
run.NewCmdRun(f, client, ioStream),
cmd.NewCmdTraits(f, client, ioStream),
cmd.NewCmdBind(f, client, ioStream),
)
return cmds
}
func runHelp(cmd *cobra.Command, args []string) {
cmd.Help()
}

View File

@@ -1,84 +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 main
import (
"flag"
"os"
"k8s.io/apimachinery/pkg/runtime"
clientgoscheme "k8s.io/client-go/kubernetes/scheme"
_ "k8s.io/client-go/plugin/pkg/client/auth/gcp"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/log/zap"
coreoamdevv1alpha2 "github.com/cloud-native-application/rudrx/api/v1alpha2"
"github.com/cloud-native-application/rudrx/controllers"
// +kubebuilder:scaffold:imports
)
var (
scheme = runtime.NewScheme()
setupLog = ctrl.Log.WithName("setup")
)
func init() {
_ = clientgoscheme.AddToScheme(scheme)
_ = coreoamdevv1alpha2.AddToScheme(scheme)
// +kubebuilder:scaffold:scheme
}
func main() {
var metricsAddr string
var enableLeaderElection bool
flag.StringVar(&metricsAddr, "metrics-addr", ":8080", "The address the metric endpoint binds to.")
flag.BoolVar(&enableLeaderElection, "enable-leader-election", false,
"Enable leader election for controller manager. "+
"Enabling this will ensure there is only one active controller manager.")
flag.Parse()
ctrl.SetLogger(zap.New(zap.UseDevMode(true)))
mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{
Scheme: scheme,
MetricsBindAddress: metricsAddr,
Port: 9443,
LeaderElection: enableLeaderElection,
LeaderElectionID: "285a4034.my.domain",
})
if err != nil {
setupLog.Error(err, "unable to start manager")
os.Exit(1)
}
if err = (&controllers.TemplateReconciler{
Client: mgr.GetClient(),
Log: ctrl.Log.WithName("controllers").WithName("Template"),
Scheme: mgr.GetScheme(),
}).SetupWithManager(mgr); err != nil {
setupLog.Error(err, "unable to create controller", "controller", "Template")
os.Exit(1)
}
// +kubebuilder:scaffold:builder
setupLog.Info("starting manager")
if err := mgr.Start(ctrl.SetupSignalHandler()); err != nil {
setupLog.Error(err, "problem running manager")
os.Exit(1)
}
}

5
cmd/vela/fake/source.go Normal file
View File

@@ -0,0 +1,5 @@
package fake
// FrontendSource is a base64-encoded, gzipped tarball of the default Frontend Static files.
// This whole file will be rewrite at build time.
var FrontendSource string

175
cmd/vela/main.go Normal file
View File

@@ -0,0 +1,175 @@
package main
import (
"flag"
"fmt"
"math/rand"
"os"
"runtime"
"time"
"github.com/oam-dev/kubevela/api/types"
"github.com/oam-dev/kubevela/cmd/vela/fake"
"github.com/oam-dev/kubevela/pkg/commands"
cmdutil "github.com/oam-dev/kubevela/pkg/commands/util"
"github.com/oam-dev/kubevela/pkg/utils/system"
"github.com/oam-dev/kubevela/version"
"github.com/crossplane/oam-kubernetes-runtime/apis/core"
"github.com/gosuri/uitable"
"github.com/spf13/cobra"
k8sruntime "k8s.io/apimachinery/pkg/runtime"
clientgoscheme "k8s.io/client-go/kubernetes/scheme"
"k8s.io/klog"
"sigs.k8s.io/controller-runtime/pkg/client/config"
)
var (
scheme = k8sruntime.NewScheme()
)
// chartTGZSource is a base64-encoded, gzipped tarball of the default Helm chart.
// Its value is initialized at build time.
var chartTGZSource string
func init() {
_ = clientgoscheme.AddToScheme(scheme)
_ = core.AddToScheme(scheme)
// +kubebuilder:scaffold:scheme
}
func main() {
rand.Seed(time.Now().UnixNano())
command := newCommand()
if err := command.Execute(); err != nil {
os.Exit(1)
}
}
func newCommand() *cobra.Command {
ioStream := cmdutil.IOStreams{In: os.Stdin, Out: os.Stdout, ErrOut: os.Stderr}
cmds := &cobra.Command{
Use: "vela",
DisableFlagParsing: true,
Run: func(cmd *cobra.Command, args []string) {
allCommands := cmd.Commands()
cmd.Printf("✈️ A Micro App Platform for Kubernetes.\n\nUsage:\n vela [flags]\n vela [command]\n\nAvailable Commands:\n\n")
PrintHelpByTag(cmd, allCommands, types.TypeStart)
PrintHelpByTag(cmd, allCommands, types.TypeApp)
PrintHelpByTag(cmd, allCommands, types.TypeTraits)
PrintHelpByTag(cmd, allCommands, types.TypeOthers)
PrintHelpByTag(cmd, allCommands, types.TypeSystem)
cmd.Println("Flags:")
cmd.Println(" -h, --help help for vela")
cmd.Println()
cmd.Println(`Use "vela [command] --help" for more information about a command.`)
},
SilenceUsage: true,
ValidArgsFunction: func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
return nil, cobra.ShellCompDirectiveNoFileComp
},
}
cmds.PersistentFlags().StringP("env", "e", "", "specify env name for application")
restConf, err := config.GetConfig()
if err != nil {
fmt.Println("get kubeconfig err", err)
os.Exit(1)
}
commandArgs := types.Args{
Config: restConf,
Schema: scheme,
}
if err := system.InitDirs(); err != nil {
fmt.Println("InitDir err", err)
os.Exit(1)
}
cmds.AddCommand(
// Getting Start
commands.NewInstallCommand(commandArgs, chartTGZSource, ioStream),
commands.NewEnvCommand(commandArgs, ioStream),
// Getting Start
NewVersionCommand(),
// Apps
commands.NewAppsCommand(commandArgs, ioStream),
// Workloads
commands.AddCompCommands(commandArgs, ioStream),
// Capability Systems
commands.CapabilityCommandGroup(commandArgs, ioStream),
// System
commands.SystemCommandGroup(commandArgs, ioStream),
commands.NewCompletionCommand(),
commands.NewTraitsCommand(ioStream),
commands.NewWorkloadsCommand(ioStream),
commands.NewDashboardCommand(commandArgs, ioStream, fake.FrontendSource),
commands.NewLogsCommand(commandArgs, ioStream),
)
// Traits
if err = commands.AddTraitCommands(cmds, commandArgs, ioStream); err != nil {
fmt.Println("Add trait commands from traitDefinition err", err)
os.Exit(1)
}
// this is for mute klog
fset := flag.NewFlagSet("logs", flag.ContinueOnError)
klog.InitFlags(fset)
_ = fset.Set("v", "-1")
return cmds
}
func PrintHelpByTag(cmd *cobra.Command, all []*cobra.Command, tag string) {
cmd.Printf(" %s:\n\n", tag)
table := uitable.New()
for _, c := range all {
if val, ok := c.Annotations[types.TagCommandType]; ok && val == tag {
table.AddRow(" "+c.Use, c.Long)
for _, subcmd := range c.Commands() {
table.AddRow(" "+subcmd.Use, " "+subcmd.Long)
}
}
}
cmd.Println(table.String())
if tag == types.TypeTraits {
if len(table.Rows) > 0 {
cmd.Println()
}
cmd.Println(" Want more? < install more capabilities by `vela cap` >")
}
cmd.Println()
}
func NewVersionCommand() *cobra.Command {
return &cobra.Command{
Use: "version",
Short: "Prints out build version information",
Long: "Prints out build version information",
Run: func(cmd *cobra.Command, args []string) {
fmt.Printf(`Version: %v
GitRevision: %v
GolangVersion: %v
`,
version.VelaVersion,
version.GitRevision,
runtime.Version())
},
Annotations: map[string]string{
types.TagCommandType: types.TypeStart,
},
}
}

View File

@@ -1,84 +0,0 @@
---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.2.5
creationTimestamp: null
name: templates.admin.oam.dev
spec:
group: admin.oam.dev
names:
kind: Template
listKind: TemplateList
plural: templates
singular: template
scope: Namespaced
validation:
openAPIV3Schema:
description: Template is the Schema for the templates 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: TemplateSpec defines the desired state of Template
properties:
lastCommandParam:
type: string
object:
description: 'INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
Important: Run "make" to regenerate code after modifying this file'
type: object
parameters:
items:
properties:
default:
type: string
fieldPaths:
items:
type: string
type: array
name:
type: string
required:
type: boolean
short:
type: string
type:
type: string
usage:
type: string
required:
- fieldPaths
- name
type: object
type: array
required:
- object
type: object
status:
description: TemplateStatus defines the observed state of Template
type: object
type: object
version: v1alpha2
versions:
- name: v1alpha2
served: true
storage: true
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []

View File

@@ -1,11 +0,0 @@
# This kustomization.yaml is not intended to be run by itself,
# since it depends on service name and namespace that are out of this kustomize package.
# It should be run by config/default
resources:
- bases/admin.oam.dev_templates.yaml
# +kubebuilder:scaffold:crdkustomizeresource
# the following config is for teaching kustomize how to do kustomization for CRDs.
configurations:
- kustomizeconfig.yaml

View File

@@ -1,3 +0,0 @@
# This file is for teaching kustomize how to substitute name and namespace reference in CRD
varReference:
- path: metadata/annotations

View File

@@ -1,70 +0,0 @@
# Adds namespace to all resources.
namespace: rudrx-system
# Value of this field is prepended to the
# names of all resources, e.g. a deployment named
# "wordpress" becomes "alices-wordpress".
# Note that it should also match with the prefix (text before '-') of the namespace
# field above.
namePrefix: rudrx-
# Labels to add to all resources and selectors.
#commonLabels:
# someName: someValue
bases:
- ../crd
- ../rbac
- ../manager
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in
# crd/kustomization.yaml
#- ../webhook
# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER'. 'WEBHOOK' components are required.
#- ../certmanager
# [PROMETHEUS] To enable prometheus monitor, uncomment all sections with 'PROMETHEUS'.
#- ../prometheus
patchesStrategicMerge:
# Protect the /metrics endpoint by putting it behind auth.
# If you want your controller-manager to expose the /metrics
# endpoint w/o any authn/z, please comment the following line.
- manager_auth_proxy_patch.yaml
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in
# crd/kustomization.yaml
#- manager_webhook_patch.yaml
# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER'.
# Uncomment 'CERTMANAGER' sections in crd/kustomization.yaml to enable the CA injection in the admission webhooks.
# 'CERTMANAGER' needs to be enabled to use ca injection
#- webhookcainjection_patch.yaml
# the following config is for teaching kustomize how to do var substitution
vars:
# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER' prefix.
#- name: CERTIFICATE_NAMESPACE # namespace of the certificate CR
# objref:
# kind: Certificate
# group: cert-manager.io
# version: v1alpha2
# name: serving-cert # this name should match the one in certificate.yaml
# fieldref:
# fieldpath: metadata.namespace
#- name: CERTIFICATE_NAME
# objref:
# kind: Certificate
# group: cert-manager.io
# version: v1alpha2
# name: serving-cert # this name should match the one in certificate.yaml
#- name: SERVICE_NAMESPACE # namespace of the service
# objref:
# kind: Service
# version: v1
# name: webhook-service
# fieldref:
# fieldpath: metadata.namespace
#- name: SERVICE_NAME
# objref:
# kind: Service
# version: v1
# name: webhook-service

View File

@@ -0,0 +1,23 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: controller-manager
namespace: system
spec:
template:
spec:
containers:
- name: manager
ports:
- containerPort: 9443
name: webhook-server
protocol: TCP
volumeMounts:
- mountPath: /tmp/k8s-webhook-server/serving-certs
name: cert
readOnly: true
volumes:
- name: cert
secret:
defaultMode: 420
secretName: webhook-server-cert

View File

@@ -1,2 +0,0 @@
resources:
- manager.yaml

View File

@@ -1,39 +0,0 @@
apiVersion: v1
kind: Namespace
metadata:
labels:
control-plane: controller-manager
name: system
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: controller-manager
namespace: system
labels:
control-plane: controller-manager
spec:
selector:
matchLabels:
control-plane: controller-manager
replicas: 1
template:
metadata:
labels:
control-plane: controller-manager
spec:
containers:
- command:
- /manager
args:
- --enable-leader-election
image: controller:latest
name: manager
resources:
limits:
cpu: 100m
memory: 30Mi
requests:
cpu: 100m
memory: 20Mi
terminationGracePeriodSeconds: 10

View File

@@ -1,7 +0,0 @@
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRole
metadata:
name: metrics-reader
rules:
- nonResourceURLs: ["/metrics"]
verbs: ["get"]

View File

@@ -1,13 +0,0 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: proxy-role
rules:
- apiGroups: ["authentication.k8s.io"]
resources:
- tokenreviews
verbs: ["create"]
- apiGroups: ["authorization.k8s.io"]
resources:
- subjectaccessreviews
verbs: ["create"]

View File

@@ -1,12 +0,0 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: proxy-rolebinding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: proxy-role
subjects:
- kind: ServiceAccount
name: default
namespace: system

View File

@@ -1,14 +0,0 @@
apiVersion: v1
kind: Service
metadata:
labels:
control-plane: controller-manager
name: controller-manager-metrics-service
namespace: system
spec:
ports:
- name: https
port: 8443
targetPort: https
selector:
control-plane: controller-manager

View File

@@ -1,12 +0,0 @@
resources:
- role.yaml
- role_binding.yaml
- leader_election_role.yaml
- leader_election_role_binding.yaml
# Comment the following 4 lines if you want to disable
# the auth proxy (https://github.com/brancz/kube-rbac-proxy)
# which protects your /metrics endpoint.
- auth_proxy_service.yaml
- auth_proxy_role.yaml
- auth_proxy_role_binding.yaml
- auth_proxy_client_clusterrole.yaml

View File

@@ -1,32 +0,0 @@
# permissions to do leader election.
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: leader-election-role
rules:
- apiGroups:
- ""
resources:
- configmaps
verbs:
- get
- list
- watch
- create
- update
- patch
- delete
- apiGroups:
- ""
resources:
- configmaps/status
verbs:
- get
- update
- patch
- apiGroups:
- ""
resources:
- events
verbs:
- create

View File

@@ -1,12 +0,0 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: leader-election-rolebinding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: leader-election-role
subjects:
- kind: ServiceAccount
name: default
namespace: system

View File

@@ -7,9 +7,19 @@ metadata:
name: manager-role
rules:
- apiGroups:
- admin.oam.dev
- ""
resources:
- templates
- events
verbs:
- create
- get
- list
- patch
- update
- apiGroups:
- core.oam.dev
resources:
- '*'
verbs:
- create
- delete
@@ -19,9 +29,67 @@ rules:
- update
- watch
- apiGroups:
- admin.oam.dev
- core.oam.dev
resources:
- templates/status
- '*/status'
verbs:
- get
- apiGroups:
- monitoring.coreos.com
resources:
- '*'
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- monitoring.coreos.com
resources:
- '*/status'
verbs:
- get
- patch
- update
- apiGroups:
- standard.oam.dev
resources:
- metricstraits
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- standard.oam.dev
resources:
- metricstraits/status
verbs:
- get
- patch
- update
- apiGroups:
- standard.oam.dev
resources:
- routes
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- standard.oam.dev
resources:
- routes/status
verbs:
- get
- patch

View File

@@ -1,12 +0,0 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: manager-rolebinding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: manager-role
subjects:
- kind: ServiceAccount
name: default
namespace: system

View File

@@ -1,24 +0,0 @@
# permissions for end users to edit templates.
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: template-editor-role
rules:
- apiGroups:
- admin.oam.dev
resources:
- templates
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- admin.oam.dev
resources:
- templates/status
verbs:
- get

View File

@@ -1,20 +0,0 @@
# permissions for end users to view templates.
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: template-viewer-role
rules:
- apiGroups:
- admin.oam.dev
resources:
- templates
verbs:
- get
- list
- watch
- apiGroups:
- admin.oam.dev
resources:
- templates/status
verbs:
- get

View File

@@ -1,34 +0,0 @@
apiVersion: admin.oam.dev/v1alpha2
kind: Template
metadata:
annotation:
version: 0.0.1
name: containerizedworkload-template
spec:
object:
apiVersion: core.oam.dev/v1alpha2
kind: ContainerizedWorkload
metadata:
name: tbd
spec:
containers:
- image: myrepo/myapp:v1
name: master
ports:
- containerPort: 6379
protocol: TCP
name: tbd # TODO(zzxwill) A temporary workaround for ContainerizedWorkload
lastCommandParam: image
parameters:
- name: image
short: i
required: true
type: string
fieldPaths:
- "spec.containers[0].image"
- name: port
short: p
required: false
type: int
fieldPaths:
- "spec.containers[0].ports[0].containerPort"

View File

@@ -1,15 +0,0 @@
apiVersion: core.oam.dev/v1alpha2
kind: WorkloadDefinition
metadata:
name: containerizedworkloads.core.oam.dev
annotations:
defatultTemplateRef: containerizedworkload-template
short: containerized
spec:
definitionRef:
name: containerizedworkloads.core.oam.dev
childResourceKinds:
- apiVersion: apps/v1
kind: Deployment
- apiVersion: v1
kind: Service

View File

@@ -1,19 +0,0 @@
apiVersion: admin.oam.dev/v1alpha2
kind: Template
metadata:
annotation:
version: 0.0.1
name: manualscalertrait.core.oam.dev-template
spec:
object:
apiVersion: core.oam.dev/v1alpha2
kind: ManualScalerTrait
spec:
replicaCount: 2
parameters:
- name: replicaCount
required: true
type: int
default: "5"
fieldPaths:
- "spec.replicaCount"

View File

@@ -1,12 +0,0 @@
apiVersion: core.oam.dev/v1alpha2
kind: TraitDefinition
metadata:
name: manualscalertrait.core.oam.dev
annotations:
defatultTemplateRef: manualscalertrait.core.oam.dev-template
short: ManualScaler
spec:
appliesToWorkloads:
- core.oam.dev/v1alpha2.ContainerizedWorkload
definitionRef:
name: manualscalertrait.core.oam.dev

View File

@@ -1,14 +0,0 @@
apiVersion: core.oam.dev/v1alpha2
kind: TraitDefinition
metadata:
name: simplerollouttraits.extend.oam.dev
annotations:
defatultTemplateRef: simplerollouttraits.extend.oam.dev-template
short: SimpleRollout
spec:
revisionEnabled: true
appliesToWorkloads:
- core.oam.dev/v1alpha2.ContainerizedWorkload
- deployments.apps
definitionRef:
name: simplerollouttraits.extend.oam.dev

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