Compare commits

..

73 Commits

Author SHA1 Message Date
Anoop Gopalakrishnan 7e154fbce7
Chore: Upgrade to support latest kubevela 1.10.1 (#161)
* Chore: Upgrade to support latest kubevela 1.10.0

fixes: https://github.com/kubevela/velad/issues/160

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

* Fix: correct golang version and actions vesions

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

* Fix: Upgrade kubevela and velaux version

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

* Fix: upgrade golangci lint version

Signed-off-by: Jerome Guionnet <jguionnet@guidewire.com>

* Fix: uprgrade golangci lint version

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

* Fix: upgrade staticcheck version

Signed-off-by: Jerome Guionnet <jguionnet@guidewire.com>

* Fix: upgrade staticcheck version

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

---------

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>
Signed-off-by: Jerome Guionnet <jguionnet@guidewire.com>
Co-authored-by: Jerome Guionnet <jguionnet@guidewire.com>
2025-02-20 05:10:00 -08:00
qiaozp c3beea6a6b
Chore: upgrade vela to v1.9.5 (#157)
Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
2023-08-02 19:16:51 +08:00
wyike 9849282a31
Merge pull request #154 from chivalryq/fix/install
Fix: install fail for invalid Host header
2023-07-28 10:15:26 +08:00
Qiaozp 089320fad3 Fix: install fail for invalid Host heade
Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
2023-07-27 17:37:11 +08:00
Anoop Gopalakrishnan aa3d7b9ccf
chore: Upgrade the vela dependencies (#152)
* chore: Upgrade the vela dependencies

- fixes #151

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

* Fix: solve dependency conflict

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* Fix compile conflict

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* Fix: downgrade go version to support github action builders

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

* Fix: updated the golang and linter versions

Signed-off-by: Anoop Gopalakrishnan <agopalakrishnan@guidewire.com>

* Try lint

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* fix go version

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* rollback golangci-lint

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* Add permission, bump staticcheck version

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* Use staticcheck action

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* Fix: remove go get command to download dependencies

Update velaux image

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* Fix: attempting to fix the build failure in staticheck

Signed-off-by: Anoop Gopalakrishnan <agopalakrishnan@guidewire.com>

* Fix: removed offending config for the docker setup

Signed-off-by: Anoop Gopalakrishnan <agopalakrishnan@guidewire.com>

* Fix: use newer docker version

- removed timeout as that was not having any effect in the docker start
  wait check time

Signed-off-by: Anoop Gopalakrishnan <agopalakrishnan@guidewire.com>

* Fix: e2e tests for mac os

- Upgrades docker version

Signed-off-by: Anoop Gopalakrishnan <agopalakrishnan@guidewire.com>

* Fix: upgrade the images for supporting k3s images

Signed-off-by: Anoop Gopalakrishnan <agopalakrishnan@guidewire.com>

---------

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>
Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
Signed-off-by: Anoop Gopalakrishnan <agopalakrishnan@guidewire.com>
Co-authored-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
2023-07-27 14:24:22 +08:00
qiaozp 46fd911d13
Make script compatible with Linux (#149) 2023-05-06 12:12:28 +08:00
Somefive 53db65bb9e
Merge pull request #145 from chivalryq/chore/add-codeowner
Update codeowner
2023-05-05 19:34:32 +08:00
Qiaozp a0de84a39a Update codeowner
Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
2023-05-05 11:39:47 +08:00
qiaozp e689ab1e45
Feat: bump kubevela to v1.8.0 (#142)
Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
2023-04-20 14:55:16 +08:00
qiaozp e9e899832c
Add velaux upgrade script (#140) 2023-04-11 22:30:58 +08:00
Somefive 6b5f971e34
Merge pull request #137 from chivalryq/fix/ha-nodename
fix unchangeable node name for velad install
2023-03-28 14:06:52 +08:00
Qiaozp 962ce760fa fix token hint
Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
2023-03-24 17:18:48 +08:00
Qiaozp ab5e4da9f1 fix unchangable node name for velad install
Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
2023-03-24 17:09:47 +08:00
qiaozp b60e6ac0ca
Bump vela to v1.7.6 (#135)
* Bump vela to v1.7.6

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* bump velaux

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* fix velaux image version

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

---------

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
2023-03-22 17:24:47 +08:00
Somefive 155e9107f1
Merge pull request #132 from chivalryq/bump-v1.7.5
Bump vela to v1.7.5
2023-03-14 17:01:01 +08:00
Qiaozp 7a45b956cd Bump vela to v1.7.5
Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
2023-03-14 14:33:24 +08:00
qiaozp ff1261bda2
Feat: allow join worker node on Linux (#131)
* Feat: allow join worker node on Linux

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* use env to provide token

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* allow detach worker

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* Add doc

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* reviewable

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* add velaux enable guide

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* reviewable

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

---------

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
2023-03-13 14:53:26 +08:00
fsl fbd81b5e00
Fix: update ci version (#129) 2023-03-01 14:58:41 +08:00
qiaozp 1254051855
Bump vela to v1.7.4 (#127) 2023-02-23 10:59:27 +08:00
qiaozp 57d26ff9d9
Feat: optimize the multi-node cluster usage (#126) 2023-02-22 15:34:48 +08:00
qiaozp ce6ccd29e9
Remove podOnly in velad's vela-core fork (#125) 2023-02-21 11:15:07 +08:00
fsl 257ac1ecf4
Fix: update package dependencies (#124) 2023-02-20 13:13:37 +08:00
qiaozp b2de768a26
Bump vela to v1.7.3 (#123) 2023-02-09 18:09:11 +08:00
qiaozp f495ab52e6
Feat: bump vela to v1.7.1 (#122) 2023-02-06 09:49:18 +08:00
qiaozp 9629357ce2
Fix: code lint CI (#121) 2023-02-05 15:55:19 +08:00
qiaozp 55cf302777
Switch back k3d repo from fork (#119)
Signed-off-by: qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
2023-02-04 19:48:38 +08:00
qiaozp 5e354fbd6a
Feat: add argument to e2e for testing air-gap installation capability (#120)
Signed-off-by: qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
2023-02-04 19:48:15 +08:00
fsl 24cf09d5b0
Fix: comment format (#118)
Signed-off-by: fengshunli <1171313930@qq.com>
2023-02-04 18:20:02 +08:00
fsl 8c51fa8e0b
Fix: add ARCH param (#117)
Signed-off-by: fengshunli <1171313930@qq.com>
2023-02-04 17:57:37 +08:00
fsl b65b0b9915
Fix: interception failed (#116)
Signed-off-by: fengshunli <1171313930@qq.com>
2023-02-04 15:29:45 +08:00
fsl 1848e24ebd
Fix: update package dependencies (#114)
Signed-off-by: fengshunli <1171313930@qq.com>
2023-02-04 10:39:14 +08:00
fsl bd22cd8bd2
Fix: remove outdated ioutil references (#113)
Signed-off-by: fengshunli <1171313930@qq.com>
2023-02-04 10:37:04 +08:00
qiaozp ffb935cb24
Fix: wrongly replaced k3d modules (#110)
Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
2023-02-03 17:58:00 +08:00
Somefive 6d567bab09
Merge pull request #112 from chivalryq/fix/proxy-image-tag
Fix: auto detect k3s images tag
2023-02-02 15:35:28 +08:00
Qiaozp e14291e764 allow air-gapped install
Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
2023-02-02 14:43:40 +08:00
Qiaozp c132369431 make source of truth for image tag
Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
2023-02-02 14:43:16 +08:00
Qiaozp 1fb6a29b72 Fix: k3d-proxy image tag
Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
2023-02-02 14:27:00 +08:00
qiaozp f43032dd60
Bump vela to v1.7.0 (#108)
Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
2023-01-14 22:28:09 +08:00
qiaozp a3449ff608
Bump vela to v1.7.0-beta.2 (#106)
Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
2023-01-12 08:09:29 +08:00
qiaozp 8ba1a4a7a5
Bump vela to v1.7.0-beta.1 (#105)
* Bump vela to v1.7.0-beta.1

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* remove replace

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* fix error templating

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
2023-01-09 10:41:26 +08:00
qiaozp 6d5278a568
Bump vela to v1.7.0-alpha.1 (#104)
* Bump vela to v1.7.0-alpha.1

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* go mod tidy

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
2022-12-27 11:49:40 +08:00
qiaozp f34e778d62
Fix: unable to import image Darwin/amd64 (#103)
* Fix: unable to import image Darwin/amd64

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* pin vela dependency to a commit

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* tidy modules

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
2022-12-26 16:02:07 +08:00
qiaozp 9cf91dbf26
Bump vela to v1.6.5 (#102)
Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
2022-12-20 09:57:53 +08:00
qiaozp eb410976ea
Bump k3s to v1.24.8, gateway use traefik by default (#100)
simplify the makefile target
2022-12-06 18:00:47 +08:00
qiaozp e596bdb828
Bump vela to v1.6.4 (#101)
Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
2022-12-06 17:06:41 +08:00
qiaozp fee275a9ab
Bump vela to 1.6.3, allow empty patch (#99)
Signed-off-by: qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

Signed-off-by: qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
2022-11-25 15:46:13 +08:00
qiaozp e028608819
Bump vela to v1.6.2 (#98)
Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
2022-11-17 11:18:49 +08:00
qiaozp 993e7c8ef6
Bump vela to v1.6.1, more automation (#96) 2022-11-10 17:22:05 +08:00
qiaozp c50085c60b
Bump vela to v1.6.0 (#95) 2022-11-02 11:01:16 +08:00
qiaozp f7feb07498
Bump vela to v1.6.0-alpha.6, add velaux enable test (#93)
* Bump vela to v1.6.0-alpha.6, add velaux enable test

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* use go 1.19 for compatibility

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* add assume-no-moving-gc package

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
2022-10-25 13:24:31 +08:00
Jianbo Sun 1cc0b8fe1b
Update 07.using-gateway-trait.md 2022-10-08 17:00:53 +08:00
qiaozp 31d5f454c6
Bump vela to v1.6.0-alpha.3 (#89)
Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
2022-09-28 15:26:00 +08:00
qiaozp 374872eb83
Fix: wrong cached k3d-tool image (#84) 2022-09-11 11:07:44 +08:00
qiaozp 534e7b91dd
Add codeowner (#83) 2022-09-06 12:03:32 +08:00
qiaozp 728481d07f
Bump vela to v1.6.0-alpha.1 (#81) 2022-09-01 11:24:07 +08:00
qiaozp f9b3b71f41
Feat: bump vela to v1.5.2 (#78) 2022-08-15 00:28:28 +08:00
qiaozp 11757c015b
Fix: better kubeconfig guide in windows (#77) 2022-08-08 23:06:38 +08:00
qiaozp 46aec6a772
Fix: release download dependency with wrong arch (#76) 2022-08-08 15:29:58 +08:00
qiaozp c33686cf1a
Feat: remove dependency for gzip in PATH (#74) 2022-08-04 00:14:09 +08:00
qiaozp feb6ea6e4d
Feat: bump vela to v1.5.0 (#73) 2022-08-03 23:50:38 +08:00
qiaozp 909a0e421a
Feat: bump vela to v1.5.0-beta.2 (#72)
Signed-off-by: qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
2022-07-28 18:01:58 +08:00
qiaozp 0cdd482432
Feat: bump vela to v1.5.0-beta.2 (#71)
Signed-off-by: qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
2022-07-26 20:53:28 +08:00
qiaozp 4ab6e5f3e4
Feat: bump vela to v1.5.0-beta.1 (#70)
* Feat: bump vela to v1.5.0-beta.1

Signed-off-by: qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* go.sum

Signed-off-by: qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
2022-07-26 13:41:41 +08:00
qiaozp c4231d5db2
Doc: access service in cluster (#68)
Signed-off-by: qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
2022-07-25 09:35:25 +08:00
qiaozp 7a2fdb7fc4
Fix: remove unsupported platform in install script (#62)
* Fix: modify install script

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* rollback

Signed-off-by: qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
2022-07-20 16:32:20 +08:00
qiaozp fc6a4319c1
Chore: Remove build action (#65) 2022-07-19 22:29:37 +08:00
Somefive 6f8e883506
Merge pull request #31 from kubevela/m1-version
Feat: add darwin-arm64 release
2022-07-19 18:10:19 +08:00
伊灵 db1805c586 re-write host kubeconfig
Signed-off-by: 伊灵 <qiaozhongpei.qzp@alibaba-inc.com>
2022-07-19 16:51:26 +08:00
伊灵 b0abd0429f rename fixed filename with amd64
Signed-off-by: 伊灵 <qiaozhongpei.qzp@alibaba-inc.com>
2022-07-19 15:22:21 +08:00
伊灵 8f77d086f9 organize action files and documents
Signed-off-by: 伊灵 <qiaozhongpei.qzp@alibaba-inc.com>
2022-07-19 15:14:46 +08:00
伊灵 1bbf774094 Skip import image
Signed-off-by: 伊灵 <qiaozhongpei.qzp@alibaba-inc.com>
2022-07-19 14:31:09 +08:00
qiaozp f12aead25f Feat: add darwin-arm64 release
Signed-off-by: qiaozp <chivalry.pp@gmail.com>
2022-07-19 12:08:58 +08:00
qiaozp 1b8b97781d
Feat: add linux-arm64 release (#63)
* Feat: add linux-arm64 release

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* comment test

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* fix test

Signed-off-by: qiaozp <chivalry.pp@gmail.com>
2022-07-13 23:40:56 +08:00
158 changed files with 2899 additions and 28820 deletions

3
.github/CODEOWNERS vendored Normal file
View File

@ -0,0 +1,3 @@
# This file is a github code protect rule follow the codeowners https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/creating-a-repository-on-github/about-code-owners#example-of-a-codeowners-file
* @chivalryq @wangyikewxgm

View File

@ -5,13 +5,12 @@ on:
branches: branches:
- main - main
jobs: jobs:
auto-release: auto-release:
runs-on: ubuntu-20.04 runs-on: ubuntu-22.04
steps: steps:
- name: Checkout source - name: Checkout source
uses: actions/checkout@v2 uses: actions/checkout@v4
with: with:
fetch-depth: 0 fetch-depth: 0
- name: Download auto - name: Download auto

View File

@ -1,26 +0,0 @@
name: Build
on:
push:
branches:
- main
- release-*
workflow_dispatch: { }
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install dependencies
uses: actions/setup-go@v2
with:
go-version: 1.17
- name: Build linux
run: make linux-amd64
- name: Build darwin
run: |
GOOS=darwin GOARCH=amd64 make darwin-amd64
- name: Build windows
run: |
GOOS=windows GOARCH=amd64 make windows-amd64

View File

@ -7,78 +7,82 @@ on:
- release-* - release-*
pull_request: pull_request:
branches: branches:
- master - main
- release-* - release-*
workflow_dispatch: { } workflow_dispatch: {}
permissions:
contents: read
env: env:
# Common versions # Common versions
GO_VERSION: '1.17' GO_VERSION: "1.22"
GOLANGCI_VERSION: 'v1.38' GOLANGCI_VERSION: "v1.54.2"
jobs: jobs:
staticcheck: staticcheck:
strategy: strategy:
matrix: matrix:
machines: [ "ubuntu-20.04","macos-12" ] machines: ["ubuntu-22.04", "macos-12"]
runs-on: ${{ matrix.machines }} runs-on: ${{ matrix.machines }}
steps: steps:
- name: Setup Go - name: Setup Go
uses: actions/setup-go@v2 uses: actions/setup-go@v5
with: with:
go-version: ${{ env.GO_VERSION }} go-version: ${{ env.GO_VERSION }}
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v4
with: with:
submodules: true submodules: true
- name: Setup Docker - name: Setup Docker
uses: docker-practice/actions-setup-docker@master uses: docker-practice/actions-setup-docker@master
with:
docker_version: "24.0.2"
- name: Download resources - name: Download resources
run: | run: |
make download_vela_images_addons make download_vela_images_addons
make download_k3s make download_k3s_images
make download_k3s_bin_script
make download_k3d make download_k3d
make pack_vela_chart
- name: Go Dependencies - name: Go Dependencies
run: | run: |
go mod tidy -compat=1.17 go mod tidy
go get -t -v -d ./...
- name: Install StaticCheck - uses: dominikh/staticcheck-action@v1.3.0
run: go install honnef.co/go/tools/cmd/staticcheck@v0.3.0 with:
version: "2024.1"
- name: Static Check install-go: false
run: staticcheck ./...
lint: lint:
strategy: strategy:
matrix: matrix:
machines: [ "ubuntu-20.04","macos-12" ] machines: ["ubuntu-22.04", "macos-12"]
runs-on: ${{ matrix.machines }} runs-on: ${{ matrix.machines }}
steps: steps:
- name: Setup Go - name: Setup Go
uses: actions/setup-go@v2 uses: actions/setup-go@v3
with: with:
go-version: ${{ env.GO_VERSION }} go-version: ${{ env.GO_VERSION }}
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v3
with: with:
submodules: true submodules: true
- name: Setup Docker - name: Setup Docker
uses: docker-practice/actions-setup-docker@master uses: docker-practice/actions-setup-docker@master
with:
docker_version: "24.0.2"
- name: Download resources - name: Download resources
run: | run: |
make download_vela_images_addons make download_vela_images_addons
make download_k3s make download_k3s_images
make download_k3s_bin_script
make download_k3d make download_k3d
make pack_vela_chart
# This action uses its own setup-go, which always seems to use the latest # This action uses its own setup-go, which always seems to use the latest
# stable version of Go. We could run 'make lint' to ensure our desired Go # stable version of Go. We could run 'make lint' to ensure our desired Go
@ -88,38 +92,39 @@ jobs:
uses: golangci/golangci-lint-action@v3 uses: golangci/golangci-lint-action@v3
with: with:
version: ${{ env.GOLANGCI_VERSION }} version: ${{ env.GOLANGCI_VERSION }}
args: --timeout 20m
go-check: go-check:
strategy: strategy:
matrix: matrix:
machines: [ "ubuntu-20.04","macos-12" ] machines: ["ubuntu-22.04", "macos-12"]
runs-on: ${{ matrix.machines }} runs-on: ${{ matrix.machines }}
steps: steps:
- name: Setup Go - name: Setup Go
uses: actions/setup-go@v2 uses: actions/setup-go@v5
with: with:
go-version: ${{ env.GO_VERSION }} go-version: ${{ env.GO_VERSION }}
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v4
with: with:
submodules: true submodules: true
- name: Go Dependencies - name: Go Dependencies
run: | run: |
go mod tidy -compat=1.17 go mod tidy
go get -t -v -d ./...
- name: Setup Docker - name: Setup Docker
uses: docker-practice/actions-setup-docker@master uses: docker-practice/actions-setup-docker@master
with:
docker_version: "24.0.2"
- name: Download resources - name: Download resources
run: | run: |
make download_vela_images_addons make download_vela_images_addons
make download_k3s make download_k3s_images
make download_k3s_bin_script
make download_k3d make download_k3d
make pack_vela_chart
- name: Check Diff - name: Check Diff
run: make check-diff run: make check-diff

View File

@ -11,65 +11,102 @@ on:
branches: branches:
- main - main
- release-* - release-*
workflow_dispatch: { } workflow_dispatch: {}
jobs: jobs:
build-artifact: build-artifact:
env: env:
VELAUX_VERSION_KEY: github.com/oam-dev/velad/version.VelaUXVersion VELAUX_VERSION_KEY: github.com/oam-dev/velad/version.VelaUXVersion
runs-on: ubuntu-20.04 runs-on: ubuntu-22.04
strategy:
matrix:
TARGETS:
[linux/amd64, darwin/amd64, windows/amd64, linux/arm64, darwin/arm64]
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- name: Install dependencies - name: Install dependencies
uses: actions/setup-go@v2 uses: actions/setup-go@v3
with: with:
go-version: 1.17 go-version: "1.22.0"
- name: Build linux - name: Get matrix
id: get_matrix
run: | run: |
GOOS=linux GOARCH=amd64 make linux-amd64 TARGETS=${{matrix.TARGETS}}
- name: Build darwin echo ::set-output name=OS::${TARGETS%/*}
echo ::set-output name=ARCH::${TARGETS#*/}
- name: Build
run: | run: |
GOOS=darwin GOARCH=amd64 make darwin-amd64 make ${{ steps.get_matrix.outputs.OS }}-${{ steps.get_matrix.outputs.ARCH }}
- name: Build windows - name: Upload artifacts
run: | uses: actions/upload-artifact@v4
GOOS=windows GOARCH=amd64 make windows-amd64
- name: Upload linux artifacts
uses: actions/upload-artifact@v3
with: with:
path: bin/velad-linux-amd64 path: bin/velad-${{ steps.get_matrix.outputs.OS }}-${{ steps.get_matrix.outputs.ARCH }}
name: velad-linux-amd64 name: velad-${{ steps.get_matrix.outputs.OS }}-${{ steps.get_matrix.outputs.ARCH }}
- name: Upload darwin artifacts
uses: actions/upload-artifact@v3
with:
path: bin/velad-darwin-amd64
name: velad-darwin-amd64
- name: Upload windows artifacts
uses: actions/upload-artifact@v3
with:
path: bin/velad-windows-amd64
name: velad-windows-amd64
test-linux: test-linux:
runs-on: ubuntu-20.04 runs-on: ubuntu-22.04
needs: [ build-artifact ] needs: [build-artifact]
steps: steps:
- uses: actions/download-artifact@v3 - uses: actions/checkout@v4
- name: Install dependencies
uses: actions/setup-go@v5
with:
go-version: "1.22.0"
- name: Install ginkgo
run: go install github.com/onsi/ginkgo/ginkgo@v1.16.5
- uses: actions/download-artifact@v4
with: with:
name: velad-linux-amd64 name: velad-linux-amd64
- run: chmod u+x velad-linux-amd64 && mv velad-linux-amd64 velad - run: |
- run: sudo ./velad install chmod u+x velad-linux-amd64 && mv velad-linux-amd64 velad
- run: sudo vela def list sudo ./velad install --set image.pullPolicy=Never --set admissionWebhooks.patch.image.pullPolicy=Never --set multicluster.clusterGateway.image.pullPolicy=Never
sudo chmod a+r $(./velad kubeconfig --host)
kubectl wait --for=condition=Ready pod -l app.kubernetes.io/name=vela-core --timeout=180s -n vela-system --kubeconfig=$(./velad kubeconfig --host)
sudo vela addon enable /root/.vela/addons/velaux
- name: Run e2e test
run: ginkgo -v ./test/e2e-test
test-darwin: test-darwin:
runs-on: macos-12 runs-on: macos-12
needs: [ build-artifact ] needs: [build-artifact]
steps: steps:
- uses: actions/download-artifact@v3 - uses: actions/checkout@v3
- name: Install dependencies
uses: actions/setup-go@v3
with:
go-version: "1.22.0"
- name: Install ginkgo
run: go install github.com/onsi/ginkgo/ginkgo@v1.16.5
- uses: actions/download-artifact@v4
with: with:
name: velad-darwin-amd64 name: velad-darwin-amd64
- name: Setup Docker - name: Setup Docker
uses: docker-practice/actions-setup-docker@master uses: docker-practice/actions-setup-docker@master
- run: chmod u+x velad-darwin-amd64 && mv velad-darwin-amd64 velad with:
- run: ./velad install docker_version: "24.0.2"
- run: vela def list - run: |
chmod u+x velad-darwin-amd64 && mv velad-darwin-amd64 velad
./velad install --set image.pullPolicy=Never --set admissionWebhooks.patch.image.pullPolicy=Never --set multicluster.clusterGateway.image.pullPolicy=Never
export KUBECONFIG=$(./velad kubeconfig --host)
kubectl wait --for=condition=Ready pod -l app.kubernetes.io/name=vela-core --timeout=180s -n vela-system
vela addon enable ~/.vela/addons/velaux
# TODO(qiaozp): fix the issue of e2e test on darwin
# - name: Run e2e test
# run: ginkgo -v ./test/e2e-test
# test-linux-arm64:
# runs-on: ubuntu-22.04
# needs: [ build-artifact ]
# steps:
# - uses: actions/download-artifact@v3
# with:
# name: velad-darwin-amd64
# - run: chmod u+x velad-linux-amd64 && mv velad-linux-amd64 velad
# - name: pguyot/arm-runner-action@v2
# with:
# commands: |
# sudo ./velad install --set image.pullPolicy=Never --set admissionWebhooks.patch.image.pullPolicy=Never --set multicluster.clusterGateway.image.pullPolicy=Never
# sudo vela def list
# test-windows: # test-windows:
# runs-on: windows-2022 # runs-on: windows-2022
# needs: [ build-artifact ] # needs: [ build-artifact ]
@ -80,5 +117,5 @@ jobs:
# - name: Setup Docker # - name: Setup Docker
# uses: docker-practice/actions-setup-docker@master # uses: docker-practice/actions-setup-docker@master
# - run: chmod u+x velad-windows-amd64 && mv velad-windows-amd64 velad.exe # - run: chmod u+x velad-windows-amd64 && mv velad-windows-amd64 velad.exe
# - run: .\velad install # - run: .\velad install --set image.pullPolicy=Never --set admissionWebhooks.patch.image.pullPolicy=Never --set multicluster.clusterGateway.image.pullPolicy=Never

View File

@ -4,7 +4,7 @@ on:
push: push:
tags: tags:
- "v*" - "v*"
workflow_dispatch: { } workflow_dispatch: {}
env: env:
GITHUB_TOKEN: ${{ github.token }} GITHUB_TOKEN: ${{ github.token }}
@ -18,7 +18,8 @@ jobs:
name: build name: build
strategy: strategy:
matrix: matrix:
TARGETS: [ linux/amd64, darwin/amd64, windows/amd64 ] TARGETS:
[linux/amd64, darwin/amd64, windows/amd64, linux/arm64, darwin/arm64]
env: env:
VELA_VERSION_KEY: github.com/oam-dev/velad/version.VelaVersion VELA_VERSION_KEY: github.com/oam-dev/velad/version.VelaVersion
VELAUX_VERSION_KEY: github.com/oam-dev/velad/version.VelaUXVersion VELAUX_VERSION_KEY: github.com/oam-dev/velad/version.VelaUXVersion
@ -28,11 +29,11 @@ jobs:
DIST_DIRS: find * -type d -exec DIST_DIRS: find * -type d -exec
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v4
- name: Set up Go - name: Set up Go
uses: actions/setup-go@v2 uses: actions/setup-go@v5
with: with:
go-version: 1.17 go-version: "1.22"
- name: Get release - name: Get release
id: get_release id: get_release
uses: bruceadams/get-release@v1.2.2 uses: bruceadams/get-release@v1.2.2
@ -61,10 +62,12 @@ jobs:
echo "LDFLAGS=${LDFLAGS}" >> $GITHUB_ENV echo "LDFLAGS=${LDFLAGS}" >> $GITHUB_ENV
- name: Build - name: Build
run: | run: |
export OS=${{ steps.get_matrix.outputs.OS }}
export ARCH=${{ steps.get_matrix.outputs.ARCH }}
make download_vela_images_addons make download_vela_images_addons
make download_k3s make download_k3s_images
make download_k3s_bin_script
make download_k3d make download_k3d
make pack_vela_chart
${{ env.GO_BUILD_ENV }} GOOS=${{ steps.get_matrix.outputs.OS }} GOARCH=${{ steps.get_matrix.outputs.ARCH }} \ ${{ env.GO_BUILD_ENV }} GOOS=${{ steps.get_matrix.outputs.OS }} GOARCH=${{ steps.get_matrix.outputs.ARCH }} \
go build -ldflags "${{ env.LDFLAGS }}" \ go build -ldflags "${{ env.LDFLAGS }}" \
-o _bin/velad/${{ steps.get_matrix.outputs.OS }}-${{ steps.get_matrix.outputs.ARCH }}/velad -v \ -o _bin/velad/${{ steps.get_matrix.outputs.OS }}-${{ steps.get_matrix.outputs.ARCH }}/velad -v \
@ -95,7 +98,7 @@ jobs:
asset_name: velad-${{ env.VELAD_VERSION }}-${{ steps.get_matrix.outputs.OS }}-${{ steps.get_matrix.outputs.ARCH }}.zip asset_name: velad-${{ env.VELAD_VERSION }}-${{ steps.get_matrix.outputs.OS }}-${{ steps.get_matrix.outputs.ARCH }}.zip
asset_content_type: binary/octet-stream asset_content_type: binary/octet-stream
- name: Post sha256 - name: Post sha256
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v4
with: with:
name: sha256sums name: sha256sums
path: ./_bin/sha256-${{ steps.get_matrix.outputs.OS }}-${{ steps.get_matrix.outputs.ARCH }}.txt path: ./_bin/sha256-${{ steps.get_matrix.outputs.OS }}-${{ steps.get_matrix.outputs.ARCH }}.txt
@ -123,4 +126,3 @@ jobs:
verlte ${{ env.VELAD_VERSION }} $LATEST_VERSION && echo "${{ env.VELAD_VERSION }} <= $LATEST_VERSION, skip update" && exit 0 verlte ${{ env.VELAD_VERSION }} $LATEST_VERSION && echo "${{ env.VELAD_VERSION }} <= $LATEST_VERSION, skip update" && exit 0
echo ${{ env.VELAD_VERSION }} > ./velad_latest_version echo ${{ env.VELAD_VERSION }} > ./velad_latest_version
./ossutil --config-file .ossutilconfig cp -u ./velad_latest_version oss://kubevela-docs/binary/velad/latest_version ./ossutil --config-file .ossutilconfig cp -u ./velad_latest_version oss://kubevela-docs/binary/velad/latest_version

View File

@ -37,10 +37,6 @@ linters-settings:
# report about shadowed variables # report about shadowed variables
check-shadowing: false check-shadowing: false
golint:
# minimal confidence for issues, default is 0.8
min-confidence: 0.8
gofmt: gofmt:
# simplify code: gofmt with `-s` option, true by default # simplify code: gofmt with `-s` option, true by default
simplify: true simplify: true
@ -115,10 +111,11 @@ linters:
- goconst - goconst
- goimports - goimports
- gofmt # We enable this as well as goimports for its simplify mode. - gofmt # We enable this as well as goimports for its simplify mode.
- golint
- unconvert - unconvert
- misspell - misspell
- nakedret - nakedret
- exportloopref
# - revive
presets: presets:
- bugs - bugs
@ -136,7 +133,6 @@ issues:
- errcheck - errcheck
- dupl - dupl
- gosec - gosec
- scopelint
- unparam - unparam
# Ease some gocritic warnings on test files. # Ease some gocritic warnings on test files.

View File

@ -1,46 +1,76 @@
include makefiles/dependency.mk include makefiles/dependency.mk
K3S_VERSION ?= v1.21.10+k3s1 K3S_VERSION ?= v1.27.2+k3s1
STATIC_DIR := pkg/resources/static STATIC_DIR := pkg/resources/static
VELA_VERSION ?= v1.5.0-alpha.3 VELA_VERSION ?= v1.10.1
VELAUX_VERSION ?= v1.5.0-alpha.3 VELAUX_VERSION ?= v1.9.4
GOOS ?= linux VELA_VERSION_NO_V := $(subst v,,$(VELA_VERSION))
GOARCH ?= amd64 VELAUX_IMAGE_VERSION ?= v1.9.4
LDFLAGS= "-X github.com/oam-dev/velad/version.VelaUXVersion=${VELAUX_VERSION} -X github.com/oam-dev/velad/version.VelaVersion=${VELA_VERSION}"
.DEFAULT_GOAL := linux-amd64 UNAME_S := $(shell uname -s)
linux-amd64: download_vela_images_addons download_k3s pack_vela_chart ifeq ($(UNAME_S), Linux)
go build -o bin/velad-${GOOS}-${GOARCH} \ OS ?= linux
-ldflags="-X github.com/oam-dev/velad/version.VelaUXVersion=${VELAUX_VERSION} -X github.com/oam-dev/velad/version.VelaVersion=${VELA_VERSION}" \ else
OS ?= darwin
endif
UNAME_M := $(shell uname -m)
ifeq ($(UNAME_M), arm64)
ARCH ?= arm64
else
ARCH ?= amd64
endif
.DEFAULT_GOAL := build
build:
echo "Building for ${OS}/${ARCH}"
OS=${OS} ARCH=${ARCH} make $(OS)-$(ARCH)
linux-amd64 linux-arm64: download_vela_images_addons download_k3s_bin_script download_k3s_images
$(eval OS := $(word 1, $(subst -, ,$@)))
$(eval ARCH := $(word 2, $(subst -, ,$@)))
echo "Compiling for ${OS}/${ARCH}"
GOOS=${OS} GOARCH=${ARCH} \
go build -o bin/velad-${OS}-${ARCH} \
-ldflags=${LDFLAGS} \
github.com/oam-dev/velad/cmd/velad github.com/oam-dev/velad/cmd/velad
darwin-amd64 darwin-arm64 windows-amd64: download_vela_images_addons download_k3d download_k3s_images
$(eval OS := $(word 1, $(subst -, ,$@)))
$(eval ARCH := $(word 2, $(subst -, ,$@)))
echo "Compiling for ${OS}/${ARCH}"
darwin-amd64 windows-amd64: download_vela_images_addons download_k3d pack_vela_chart download_k3s_images GOOS=${OS} GOARCH=${ARCH} \
GOOS=${GOOS} GOARCH=${GOARCH} \ go build -o bin/velad-${OS}-${ARCH} \
go build -o bin/velad-${GOOS}-${GOARCH} \ -ldflags=${LDFLAGS} \
-ldflags="-X github.com/oam-dev/velad/version.VelaUXVersion=${VELAUX_VERSION} -X github.com/oam-dev/velad/version.VelaVersion=${VELA_VERSION}" \
github.com/oam-dev/velad/cmd/velad github.com/oam-dev/velad/cmd/velad
download_vela_images_addons: CHART_DIR := ${STATIC_DIR}/vela/charts
./hack/download_vela_images.sh ${VELA_VERSION} ${VELAUX_VERSION} download_vela_chart:
mkdir -p ${CHART_DIR}
curl -L -o ${CHART_DIR}/vela-core.tgz https://kubevela.github.io/charts/vela-core-${VELA_VERSION_NO_V}.tgz
download_vela_images_addons: download_vela_chart
tar -xzf ${CHART_DIR}/vela-core.tgz -C ${CHART_DIR}
./hack/download_vela_images.sh ${VELA_VERSION} ${VELAUX_IMAGE_VERSION} ${ARCH}
./hack/download_addons.sh ${VELAUX_VERSION} ./hack/download_addons.sh ${VELAUX_VERSION}
rm -rf ${CHART_DIR}/vela-core
download_k3d: download_k3d:
./hack/download_k3d_images.sh ./hack/download_k3d_images.sh ${ARCH}
download_k3s: download_k3s_images download_k3s_bin_script:
mkdir -p ${STATIC_DIR}/k3s/other mkdir -p ${STATIC_DIR}/k3s/other
curl -Lo ${STATIC_DIR}/k3s/other/k3s https://github.com/k3s-io/k3s/releases/download/${K3S_VERSION}/k3s curl -Lo ${STATIC_DIR}/k3s/other/k3s https://github.com/k3s-io/k3s/releases/download/${K3S_VERSION}/k3s
curl -Lo ${STATIC_DIR}/k3s/other/setup.sh https://get.k3s.io curl -Lo ${STATIC_DIR}/k3s/other/setup.sh https://get.k3s.io
download_k3s_images: download_k3s_images:
mkdir -p ${STATIC_DIR}/k3s/images mkdir -p ${STATIC_DIR}/k3s/images
curl -Lo ${STATIC_DIR}/k3s/images/k3s-airgap-images-amd64.tar.gz https://github.com/k3s-io/k3s/releases/download/${K3S_VERSION}/k3s-airgap-images-amd64.tar.gz curl -Lo ${STATIC_DIR}/k3s/images/k3s-airgap-images.tar.gz https://github.com/k3s-io/k3s/releases/download/${K3S_VERSION}/k3s-airgap-images-${ARCH}.tar.gz
CHART_DIR := ${STATIC_DIR}/vela/charts
pack_vela_chart:
cp -r ${STATIC_DIR}/vela/charts/vela-core .
tar -czf ${STATIC_DIR}/vela/charts/vela-core.tgz vela-core
rm -r vela-core
.PHONY: clean .PHONY: clean
clean: clean:
@ -61,7 +91,7 @@ go-check:
go vet ./... go vet ./...
reviewable: lint staticcheck fmt go-check reviewable: lint staticcheck fmt go-check
go mod tidy -compat=1.17 go mod tidy
check-diff: reviewable check-diff: reviewable
git --no-pager diff git --no-pager diff

View File

@ -4,7 +4,7 @@ Lightweight Deploy tool, helps setup [KubeVela](https://github.com/kubevela/kube
English | [简体中文](docs/readme-zh.md) English | [简体中文](docs/readme-zh.md)
![Build](https://github.com/kubevela/velad/actions/workflows/build.yaml/badge.svg) ![E2E Test](https://github.com/kubevela/velad/actions/workflows/e2e-test.yaml/badge.svg)
## Introduction ## Introduction
@ -72,4 +72,8 @@ velad uninstall
### More example ### More example
Please check [docs](./docs/) for more VelaD example Please check [docs](./docs/) for more VelaD example
## Known issues
- Installation on darwin-arm64 (Apple chip) machine isn't fully air-gapped. Please track #64 for more info.

View File

@ -3,48 +3,8 @@
VelaD embed one KubeVela Helm chart and VelaD's build process will cache some images(e.g. vela-core). VelaD embed one KubeVela Helm chart and VelaD's build process will cache some images(e.g. vela-core).
When KubeVela has a new release. Do these steps below to upgrade VelaD's embedded KubeVela version. When KubeVela has a new release. Do these steps below to upgrade VelaD's embedded KubeVela version.
1. Upgrade vela-core helm chart 1. Upgrade go.mod
2. Upgrade go.mod 2. Upgrade vela version in makefile
3. Upgrade vela version in makefile
### Upgrade vela-core helm chart.
First check the now vela-core version:
```shell
cat pkg/resources/static/vela/charts/vela-core/Chart.yaml | grep version:
```
Output like:
```text
version: v1.4.2
```
Then use upgrade script, for example if you want to upgrade vela to v1.4.3, use `v1.4.2` and `v1.4.3`
as the first and the second argument:
```shell
./hack/upgrade_vela.sh v1.4.2 v1.4.3
```
This script will clone the KubeVela repo and make diff between tag v1.4.2 and v1.4.3. Then try to patch the diff in VelaD's
embedded vela-core chart in `pkg/resources/static/vela/charts/vela-core`
If there are conflict, you have to resolve them manually.
### Upgrade go.mod
In go.mod file, find this item:
```text
github.com/oam-dev/kubevela v1.x.y
```
Then change the `v1.x.y` to version you want to upgrade to, then run:
```shell
go mod tidy -compat=1.17
```
### Upgrade vela version in makefile ### Upgrade vela version in makefile
@ -53,8 +13,8 @@ In `Makefile`, find this two variables, upgrade them to right version.
> VelaUX sometimes don't release new version together with KubeVela, make sure VelaUX version is right. > VelaUX sometimes don't release new version together with KubeVela, make sure VelaUX version is right.
```makefile ```makefile
VELA_VERSION ?= v1.4.2 VELAUX_VERSION ?= v1.6.0
VELAUX_VERSION ?= v1.4.2 VELAUX_IMAGE_VERSION ?= ${VELAUX_VERSION}
``` ```
### After upgrade ### After upgrade

View File

@ -13,7 +13,7 @@ This is quite easy. Depends on your system, run one of scripts below.
- **Linux/macOS** - **Linux/macOS**
```shell ```shell
curl -fsSl https://static.kubevela.net/script/install-velad.sh | bash -s 1.4.0 curl -fsSl https://static.kubevela.net/script/install-velad.sh | bash
``` ```
- **Windows** - **Windows**

View File

@ -4,7 +4,7 @@ You can use VelaD to build KubeVela control plane with higher availability. It c
1. More than two nodes as server nodes. 1. More than two nodes as server nodes.
2. One database (Could be MySQL/MariaDB, PostgreSQL, etcd) 2. One database (Could be MySQL/MariaDB, PostgreSQL, etcd)
3. One linux node as load balancer. 3. One linux node as load balancer. (Or you can use a cloud load balancer)
![arch](resources/04.arch.png) ![arch](resources/04.arch.png)
@ -17,7 +17,7 @@ We only need run several commands on different nodes.
On the first server node, run On the first server node, run
```shell ```shell
velad install --bind-ip=<LB_IP> --database-endpoint=<DB_ENNDPOINT> --token=<TOKEN> velad install --bind-ip=<LB_IP> --database-endpoint=<DB_ENNDPOINT> --token=<TOKEN> --node-ip=<IP>
``` ```
`<LB_IP>` is IP of load balancer node. We'll setup it later. Passing it to `bind-ip` helps VelaD generate right `<LB_IP>` is IP of load balancer node. We'll setup it later. Passing it to `bind-ip` helps VelaD generate right
@ -26,32 +26,69 @@ kubeconfig.
`<TOKEN>` is optional. Token will be generated if you don't use this argument. VelaD will print generated or given token `<TOKEN>` is optional. Token will be generated if you don't use this argument. VelaD will print generated or given token
after install. after install.
`<DB_ENDPOINT>` is the database connection string. The format is [here](db-connect-format.md). `<IP>` is optional. If the node have a public IP, you can pass it to `node-ip`.
`<DB_ENDPOINT>` is the database connection string. The format is [here](db-connect-format.md).
> You need to setup database before and make sure all your server nodes can access it. > You need to setup database before and make sure all your server nodes can access it.
### Other nodes ### Other nodes
On the other node, you need to run `velad install` with the same arguments and **one more**: `--start`. On the other node, you need to run `velad install` with the same arguments and **one more**: `--cluster-only`.
`--start` means skip install KubeVela and only start node. These nodes belong to one cluster and don't install KubeVela repeatedly. `--cluster-only` means skip install KubeVela and only start node. These nodes belong to one cluster and don't install
KubeVela repeatedly.
```shell ```shell
velad install --bind-ip=<LB_IP> --database-endpoint=<DB_ENNDPOINT>\ velad install --bind-ip=<LB_IP> --database-endpoint=<DB_ENNDPOINT>\
--token=<TOKEN> \ --token=<TOKEN> \
--start --cluster-only
--node-ip=<IP>
``` ```
`<TOKEN>` should be the same with that in first node. `<TOKEN>` should be the same with that in first node.
`--node-ip=<IP>` is optional. If the node have a public IP, you can pass it to `node-ip`.
## Setup load balancer ## Setup load balancer
On load balancer node, run On any master node, run
```shell ```shell
velad load-balancer install --host=<IP1>,<IP2>,<IP3> velad load-balancer wizard
``` ```
`<IPx>` is IPs of server nodes. This will call package manager of system It will show you the command to install nginx and setup it for forwarding the network traffic to master nodes. For
to install nginx and setup it for forwarding the network traffic to server nodes. example:
```shell
To setup load-balancer, run the following command on node acts as load-balancer:
velad load-balancer install --http-port 32196 --https-port 30297 --host=<IP1>,<IP2>
```
### Option1: Use another node as load balancer
Paste the command to the load balancer node and run it.
```shell
velad load-balancer install --http-port 32196 --https-port 30297 --host=<IP1>,<IP2>
```
`<IPx>` is IPs of server nodes. It can be public IP or private IP. As long as the load balancer node can access it.
This will call package manager of system to install nginx and setup it for forwarding the network traffic to server
nodes.
### Option2: Use cloud load balancer
If you prefer to use cloud load balancer, you can configure it to forward the network traffic to server nodes. For
example you can configure the port-forwarding of Alibaba Cloud SLB like this. The `6443` is required to access the
cluster. The `80` and `443` are optional. You can pick other ports or don't forward them. They help to access the
Ingress in the cluster. The `32196` and `30297` are the ports printed by `velad load-balancer wizard`. It's decided
when `velad install` is called and can be different in different clusters.
```text
6443 -> 6443
80 -> 32196
443 -> 30297
```
## Access cluster ## Access cluster
@ -62,5 +99,5 @@ the load balancer.
velad kubeconfig --external velad kubeconfig --external
``` ```
Boom! You can access the KubeVela control plane with this kubeconfig. Failure of any single server won't Boom! You can access the KubeVela control plane with this kubeconfig. Failure of any single server won't
affect the availability of the control plane. affect the availability of the control plane.

View File

@ -0,0 +1,131 @@
# Access Service in VelaD
This document will show you how to access the service running in VelaD.
## Background
Typically, you can expose service in cluster in several ways.
1. LoadBalancer type Service
2. NodePort type Service
3. Ingress API
First two types both have some limitations. In VelaD cluster, exposing service through Ingress API is out of box.
In KubeVela, we can use the `gateway` trait to expose service through Ingress API.
## Using gateway trait
In VelaD, we have installed a default Ingress Controller, which is needed to use Ingress API.
The default Ingress controller is [**Traefik**](https://github.com/traefik/traefik). If you want to switch to other like
Nginx Ingress Controller, see [Switch to Nginx Ingress Controller](#switch-to-nginx-ingress-controller).
After running `velad install` command, there is one hint printed to the screen.
```shell
💻 When using gateway trait, you can access with 127.0.0.1:8090
```
It means you can access the Application with `gateway` trait through http://127.0.0.1:8090.
For example, Run command below to apply app in VelaD cluster:
```shell
cat << EOF | vela up -f -
apiVersion: core.oam.dev/v1beta1
kind: Application
metadata:
name: example
spec:
components:
- name: hello-world
type: webservice
properties:
image: crccheck/hello-world
traits:
- type: gateway
properties:
domain: testsvc.example.com
class: traefik
http:
"/": 8000
EOF
```
Then access this app by:
```shell
curl -H "Host: testsvc.example.com" http://localhost:8090/
```
The output like:
```text
<pre>
Hello World
## .
## ## ## ==
## ## ## ## ## ===
/""""""""""""""""\___/ ===
~~~ {~~ ~~~~ ~~~ ~~~~ ~~ ~ / ===- ~~~
\______ o _,/
\ \ _,'
`'--.._\..--''
</pre>
```
## Switch To Nginx Ingress Controller
There are three steps to switch to nginx ingress controller and using `gateway` trait.
1. Uninstall Traefik
> [Helm CLI](https://helm.sh/docs/intro/install/) is needed
```shell
helm uninstall traefik --namespace kube-system
```
2. Enable Ingress-nginx Addon and dependent FluxCD addon
```shell
vela addon enable fluxcd
vela addon enable ingress-nginx
```
3. Port-forward Nginx Ingress Controller To Localhost
```shell
vela port-forward addon-ingress-nginx -n vela-system
```
> We don't need to do port-forwarding for Traefik in the last section because we when `velad install`, a container is created for that.
Using the app above, only change `class: traefik` to `class: nginx` in the `gateway` trait section, run the command below:
```shell
cat << EOF | vela up -f -
apiVersion: core.oam.dev/v1beta1
kind: Application
metadata:
name: example
spec:
components:
- name: hello-world
type: webservice
properties:
image: crccheck/hello-world
traits:
- type: gateway
properties:
domain: testsvc.example.com
class: nginx
http:
"/": 8000
EOF
```
Now you can access the services through Ingress like:
```shell
curl -H "Host: testsvc.example.com" http://localhost:8080/
```

View File

@ -0,0 +1,34 @@
# Joining a New Worker Node to VelaD Control Plane
This guide describes the steps for joining a new worker node to an existing VelaD control plane.
## Prerequisites
Before proceeding with the steps below, ensure that:
- Have a VelaD control plane running.
- You have the token for the VelaD control plane. You can get the token by running the `velad token` command on the VelaD control plane master node.
- New worker node is **Linux machine** and can access the VelaD control plane master node.
- You have SSH access to the new worker node
## Steps
1. Download VelaD to the new worker node.
```shell
curl -fsSl https://static.kubevela.net/script/install-velad.sh | bash
```
2. Run the `velad join` command on the new worker node.
```
velad join --master-ip <master-ip> --token <token> --worker-name <worker-name>
```
- `<master-ip>` is the IP address of the VelaD control plane master node. (Required)
- `<token>` is the token for the VelaD control plane. (Required)
- `<worker-name>` is the name of the new worker node. (Optional)
3. Verify the new node has joined the control plane.
- Use `kubectl get nodes` to check the new worker node has joined the VelaD control plane.
## Delete a Worker Node
Run the `velad uninstall` command on the VelaD on the worker node to be deleted.

View File

@ -4,27 +4,31 @@ This guild helps you get started developing VelaD
### Prerequisites ### Prerequisites
1. Golang version 1.17+ 1. Golang version 1.19+
2. Docker (for non-linux user) 2. Docker (for non-linux user)
3. golangci-lint 1.38.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. 3. golangci-lint 1.38.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 ### Build
1. Clone this project 1. Clone this project
```shell ```shell
git clone https://github.com/kubevela/velad.git git clone https://github.com/kubevela/velad.git
cd velad cd velad
``` ```
2. Build VelaD 2. Build VelaD
```shell ```shell
make make
``` ```
This will build amd64-linux version of VelaD by default. To build other version, you need to specify `GOOS` and `GOARCH`
and the target. For example, you can build a darwin-amd64 version by: This will build the VelaD version corresponding to your machines architecture and OS by default. To cross build other
version, you can the target. For example, you can build a darwin-amd64 version by:
```shell ```shell
GOOS=darwin GOARCH=amd64 make darwin-amd64 make darwin-amd64
``` ```
### Debug ### Debug
@ -33,11 +37,12 @@ When use IDE to debug VelaD, you need to do several things
1. Download resources needed 1. Download resources needed
If you want build linux version, run If you want build linux version, run
```shell ```shell
VELAUX_VERSION=v1.x.y VELA_VERSION=v1.z.w make download_vela_images_addons VELAUX_VERSION=v1.x.y VELA_VERSION=v1.z.w make download_vela_images_addons
make download_k3s make download_k3s_bin_script
make pack_vela_chart make download_k3s_images
``` ```
If you want to build non-linux version, run If you want to build non-linux version, run
@ -45,18 +50,18 @@ If you want to build non-linux version, run
```shell ```shell
VELAUX_VERSION=v1.x.y VELA_VERSION=v1.z.w make download_vela_images_addons VELAUX_VERSION=v1.x.y VELA_VERSION=v1.z.w make download_vela_images_addons
make download_k3d make download_k3d
make pack_vela_chart
make download_k3s_images make download_k3s_images
``` ```
`VELAUX_VERSION=v1.x.y VELA_VERSION=v1.z.w` is optional environment variables if you want to change the default version in makefile. `VELAUX_VERSION=v1.x.y VELA_VERSION=v1.z.w` is optional environment variables if you want to change the default version
in makefile.
2. Build VelaD 2. Build VelaD
If you are using macOS with intel chip, the complete build command is like: If you are using macOS with intel chip, the complete build command is like:
```shell ```shell
GOOS=darwin GOARCH=amd64 \ OS=darwin ARCH=amd64 \
go build -ldflags="-X github.com/oam-dev/velad/version.VelaVersion=v1.x.y -X github.com/oam-dev/velad/version.VelaUXVersion=v1.x.y" \ go build -ldflags="-X github.com/oam-dev/velad/version.VelaVersion=v1.x.y -X github.com/oam-dev/velad/version.VelaUXVersion=v1.x.y" \
-o bin/velad \ -o bin/velad \
cmd/velad/main.go cmd/velad/main.go
@ -65,7 +70,6 @@ cmd/velad/main.go
> Ldflags can help to inject vela-core and VelaUX version. (Can be different) > Ldflags can help to inject vela-core and VelaUX version. (Can be different)
> If you are using IDE to debug, remember to add `-ldflags="-X github.com...` part to build option. > If you are using IDE to debug, remember to add `-ldflags="-X github.com...` part to build option.
### Create a pull request ### Create a pull request
Before you submit a PR, run this command to ensure it is ready: Before you submit a PR, run this command to ensure it is ready:
@ -73,4 +77,6 @@ Before you submit a PR, run this command to ensure it is ready:
```shell ```shell
make reviewable make reviewable
``` ```
For other PR things you can check the document [here](https://kubevela.net/docs/contributor/code-contribute#create-a-pull-request).
For other PR things you can check the
document [here](https://kubevela.net/docs/contributor/code-contribute#create-a-pull-request).

View File

@ -172,10 +172,10 @@ Services:
假设你现在使用 `--database-endpoint` 参数安装了控制平面,并且希望迁移控制平面。你可以这样做: 假设你现在使用 `--database-endpoint` 参数安装了控制平面,并且希望迁移控制平面。你可以这样做:
1. 在原机器上运行 `velad uninstall` 1. 在原机器上运行 `velad uninstall`
2. 在新机器上运行 `velad install --database-endpoint=<ENDPOINT> --token=<TOKEN> --start` 2. 在新机器上运行 `velad install --database-endpoint=<ENDPOINT> --token=<TOKEN> --cluster-only`
在新机器上运行的命令,需要使用与原机器上启动控制平面时相同的 `database-endpoint`,而且使用当时启动后, 在新机器上运行的命令,需要使用与原机器上启动控制平面时相同的 `database-endpoint`,而且使用当时启动后,
提示你保存的token。最后的 `--start` 参数表示仅启动,跳过 KubeVela 安装过程,因为在数据库所保存的控制平面元数据中, 提示你保存的token。最后的 `--cluster-only` 参数表示仅启动,跳过 KubeVela 安装过程,因为在数据库所保存的控制平面元数据中,
KubeVela 已经安装了,无需重复安装。 KubeVela 已经安装了,无需重复安装。
以上就是本次的全部内容感谢你的阅读和尝试。Velad 还在持续开发,下一步将支持在 Mac/Windows 上面启动 以上就是本次的全部内容感谢你的阅读和尝试。Velad 还在持续开发,下一步将支持在 Mac/Windows 上面启动

469
go.mod
View File

@ -1,309 +1,334 @@
module github.com/oam-dev/velad module github.com/oam-dev/velad
go 1.17 go 1.22.0
toolchain go1.22.4
require ( require (
github.com/docker/docker v20.10.16+incompatible github.com/docker/docker v26.0.0+incompatible
github.com/docker/go-connections v0.4.0 github.com/docker/go-connections v0.5.0
github.com/fatih/color v1.13.0 github.com/fatih/color v1.16.0
github.com/k3d-io/k3d/v5 v5.4.1 github.com/k3d-io/k3d/v5 v5.4.7
github.com/kyokomi/emoji/v2 v2.2.9 github.com/oam-dev/kubevela v1.10.1
github.com/oam-dev/kubevela v1.5.0-alpha.3 github.com/onsi/ginkgo v1.16.5
github.com/onsi/gomega v1.34.1
github.com/pkg/errors v0.9.1 github.com/pkg/errors v0.9.1
github.com/spf13/cobra v1.4.0 github.com/spf13/cobra v1.8.0
github.com/stretchr/testify v1.7.1 github.com/stretchr/testify v1.10.0
helm.sh/helm/v3 v3.7.2 github.com/tufanbarisyildirim/gonginx v0.0.0-20230104065106-9ae864d29eed
k8s.io/client-go v0.23.6 helm.sh/helm/v3 v3.14.4
k8s.io/klog/v2 v2.60.1 k8s.io/api v0.29.2
k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9 k8s.io/apimachinery v0.29.2
sigs.k8s.io/controller-runtime v0.11.2 k8s.io/client-go v0.29.2
k8s.io/klog/v2 v2.120.1
sigs.k8s.io/controller-runtime v0.17.6
) )
require ( require (
cloud.google.com/go/compute v1.7.0 // indirect github.com/ProtonMail/go-crypto v1.1.3 // indirect
cuelang.org/go v0.2.2 // indirect github.com/cenkalti/backoff/v4 v4.2.1 // indirect
github.com/cloudflare/circl v1.3.7 // indirect
github.com/containerd/stargz-snapshotter/estargz v0.15.1 // indirect
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
github.com/go-git/go-billy/v5 v5.6.1 // indirect
github.com/go-git/go-git/v5 v5.13.1 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/google/cel-go v0.17.7 // indirect
github.com/google/go-containerregistry v0.18.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0 // indirect
github.com/invopop/yaml v0.1.0 // indirect
github.com/jellydator/ttlcache/v3 v3.0.1 // indirect
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect
github.com/perimeterx/marshmallow v1.1.4 // indirect
github.com/pjbgf/sha1cd v0.3.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/skeema/knownhosts v1.3.0 // indirect
github.com/stoewer/go-strcase v1.2.0 // indirect
github.com/vbatts/tar-split v0.11.5 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.19.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.19.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect
k8s.io/kms v0.29.3 // indirect
)
require (
cuelang.org/go v0.9.2 // indirect
dario.cat/mergo v1.0.0 // indirect
github.com/AlecAivazis/survey/v2 v2.1.1 // indirect github.com/AlecAivazis/survey/v2 v2.1.1 // indirect
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect
github.com/Azure/go-autorest v14.2.0+incompatible // indirect github.com/BurntSushi/toml v1.3.2 // indirect
github.com/Azure/go-autorest/autorest v0.11.18 // indirect
github.com/Azure/go-autorest/autorest/adal v0.9.13 // indirect
github.com/Azure/go-autorest/autorest/date v0.3.0 // indirect
github.com/Azure/go-autorest/logger v0.2.1 // indirect
github.com/Azure/go-autorest/tracing v0.6.0 // indirect
github.com/BurntSushi/toml v0.4.1 // indirect
github.com/FogDong/uitable v0.0.5 // indirect github.com/FogDong/uitable v0.0.5 // indirect
github.com/MakeNowJust/heredoc v0.0.0-20170808103936-bb23615498cd // indirect github.com/MakeNowJust/heredoc v1.0.0 // indirect
github.com/Masterminds/goutils v1.1.1 // indirect github.com/Masterminds/goutils v1.1.1 // indirect
github.com/Masterminds/semver v1.5.0 // indirect github.com/Masterminds/semver v1.5.0 // indirect
github.com/Masterminds/semver/v3 v3.1.1 // indirect github.com/Masterminds/semver/v3 v3.2.1 // indirect
github.com/Masterminds/sprig v2.22.0+incompatible // indirect github.com/Masterminds/sprig v2.22.0+incompatible // indirect
github.com/Masterminds/sprig/v3 v3.2.2 // indirect github.com/Masterminds/sprig/v3 v3.2.3 // indirect
github.com/Masterminds/squirrel v1.5.2 // indirect github.com/Masterminds/squirrel v1.5.4 // indirect
github.com/Microsoft/go-winio v0.5.2 // indirect github.com/Microsoft/go-winio v0.6.1 // indirect
github.com/Microsoft/hcsshim v0.9.2 // indirect github.com/Microsoft/hcsshim v0.12.2 // indirect
github.com/NYTimes/gziphandler v1.1.1 // indirect github.com/NYTimes/gziphandler v1.1.1 // indirect
github.com/PuerkitoBio/purell v1.1.1 // indirect github.com/agext/levenshtein v1.2.3 // indirect
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect github.com/alessio/shellescape v1.4.1 // indirect
github.com/agext/levenshtein v1.2.2 // indirect github.com/aliyun/alibaba-cloud-sdk-go v1.61.1704 // indirect
github.com/alessio/shellescape v1.2.2 // indirect github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230305170008-8188dc5388df // indirect
github.com/alibabacloud-go/cs-20151215/v2 v2.4.5 // indirect
github.com/alibabacloud-go/darabonba-openapi v0.1.4 // indirect
github.com/alibabacloud-go/debug v0.0.0-20190504072949-9472017b5c68 // indirect
github.com/alibabacloud-go/endpoint-util v1.1.0 // indirect
github.com/alibabacloud-go/openapi-util v0.0.7 // indirect
github.com/alibabacloud-go/tea v1.1.15 // indirect
github.com/alibabacloud-go/tea-utils v1.3.9 // indirect
github.com/aliyun/credentials-go v1.1.2 // indirect
github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect
github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect
github.com/aryann/difflib v0.0.0-20210328193216-ff5ff6dc229b // indirect github.com/aryann/difflib v0.0.0-20210328193216-ff5ff6dc229b // indirect
github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d // indirect github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
github.com/beorn7/perks v1.0.1 // indirect github.com/beorn7/perks v1.0.1 // indirect
github.com/blang/semver v3.5.1+incompatible // indirect github.com/blang/semver/v4 v4.0.0 // indirect
github.com/briandowns/spinner v1.11.1 // indirect github.com/bluele/gcache v0.0.2 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect github.com/briandowns/spinner v1.23.0 // indirect
github.com/chai2010/gettext-go v0.0.0-20160711120539-c6fed771bfd5 // indirect github.com/buger/jsonparser v1.1.1 // indirect
github.com/chartmuseum/helm-push v0.10.2 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/cloudtty/cloudtty v0.2.0 // indirect github.com/chai2010/gettext-go v1.0.2 // indirect
github.com/cockroachdb/apd/v2 v2.0.1 // indirect github.com/chartmuseum/helm-push v0.10.4 // indirect
github.com/containerd/cgroups v1.0.3 // indirect github.com/cockroachdb/apd/v3 v3.2.1 // indirect
github.com/containerd/containerd v1.6.2 // indirect github.com/containerd/cgroups/v3 v3.0.2 // indirect
github.com/containerd/continuity v0.2.1 // indirect github.com/containerd/containerd v1.7.14 // indirect
github.com/coreos/go-oidc v2.1.0+incompatible // indirect github.com/containerd/errdefs v0.1.0 // indirect
github.com/coreos/go-semver v0.3.0 // indirect github.com/coreos/go-semver v0.3.1 // indirect
github.com/coreos/go-systemd/v22 v22.3.2 // indirect github.com/coreos/go-systemd/v22 v22.5.0 // indirect
github.com/coreos/prometheus-operator v0.41.1 // indirect github.com/crossplane/crossplane-runtime v1.16.0 // indirect
github.com/crossplane/crossplane-runtime v0.14.1-0.20210722005935-0b469fcc77cd // indirect github.com/cue-exp/kubevelafix v0.0.0-20220922150317-aead819d979d // indirect
github.com/cyphar/filepath-securejoin v0.2.3 // indirect github.com/cyphar/filepath-securejoin v0.3.6 // indirect
github.com/dave/jennifer v1.6.1 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect github.com/davecgh/go-spew v1.1.1 // indirect
github.com/deckarep/golang-set v1.7.1 // indirect
github.com/dimchansky/utfbom v1.1.1 // indirect github.com/dimchansky/utfbom v1.1.1 // indirect
github.com/docker/cli v20.10.16+incompatible // indirect github.com/distribution/reference v0.5.0 // indirect
github.com/docker/distribution v2.8.1+incompatible // indirect github.com/docker/cli v26.0.0+incompatible // indirect
github.com/docker/docker-credential-helpers v0.6.4 // indirect github.com/docker/distribution v2.8.3+incompatible // indirect
github.com/docker/docker-credential-helpers v0.8.1 // indirect
github.com/docker/go v1.5.1-1.0.20160303222718-d30aec9fd63c // indirect github.com/docker/go v1.5.1-1.0.20160303222718-d30aec9fd63c // indirect
github.com/docker/go-metrics v0.0.1 // indirect github.com/docker/go-metrics v0.0.1 // indirect
github.com/docker/go-units v0.4.0 // indirect github.com/docker/go-units v0.5.0 // indirect
github.com/emicklei/go-restful v2.9.5+incompatible // indirect github.com/emicklei/go-restful/v3 v3.12.0 // indirect
github.com/emicklei/go-restful/v3 v3.8.0 // indirect github.com/emirpasic/gods v1.18.1 // indirect
github.com/emirpasic/gods v1.12.0 // indirect github.com/ettle/strcase v0.2.0 // indirect
github.com/evanphx/json-patch v4.12.0+incompatible // indirect github.com/evanphx/json-patch v5.9.0+incompatible // indirect
github.com/evanphx/json-patch/v5 v5.1.0 // indirect github.com/evanphx/json-patch/v5 v5.8.0 // indirect
github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d // indirect github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d // indirect
github.com/fatih/camelcase v1.0.0 // indirect github.com/fatih/camelcase v1.0.0 // indirect
github.com/felixge/httpsnoop v1.0.1 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/fluxcd/helm-controller/api v0.21.0 // indirect github.com/fluxcd/helm-controller/api v0.32.2 // indirect
github.com/fluxcd/pkg/apis/acl v0.0.3 // indirect github.com/fluxcd/pkg/apis/acl v0.0.3 // indirect
github.com/fluxcd/pkg/apis/kustomize v0.3.3 // indirect github.com/fluxcd/pkg/apis/kustomize v1.0.0 // indirect
github.com/fluxcd/pkg/apis/meta v0.13.0 // indirect github.com/fluxcd/pkg/apis/meta v1.0.0 // indirect
github.com/fluxcd/source-controller/api v0.24.4 // indirect github.com/fluxcd/source-controller/api v0.24.4 // indirect
github.com/form3tech-oss/jwt-go v3.2.5+incompatible // indirect github.com/form3tech-oss/jwt-go v3.2.5+incompatible // indirect
github.com/fsnotify/fsnotify v1.5.1 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/fvbommel/sortorder v1.0.2 // indirect github.com/fvbommel/sortorder v1.1.0 // indirect
github.com/garyburd/redigo v0.0.0-20150301180006-535138d7bcd7 // indirect github.com/gdamore/encoding v1.0.0 // indirect
github.com/gertd/go-pluralize v0.1.7 // indirect github.com/gdamore/tcell/v2 v2.6.0 // indirect
github.com/getkin/kin-openapi v0.94.0 // indirect github.com/getkin/kin-openapi v0.118.0 // indirect
github.com/ghodss/yaml v1.0.0 // indirect github.com/ghodss/yaml v1.0.0 // indirect
github.com/go-errors/errors v1.0.1 // indirect github.com/go-errors/errors v1.5.1 // indirect
github.com/go-logr/logr v1.2.2 // indirect github.com/go-gorp/gorp/v3 v3.1.0 // indirect
github.com/go-openapi/jsonpointer v0.19.5 // indirect github.com/go-logr/logr v1.4.1 // indirect
github.com/go-openapi/jsonreference v0.19.5 // indirect github.com/go-openapi/jsonpointer v0.21.0 // indirect
github.com/go-openapi/swag v0.19.14 // indirect github.com/go-openapi/jsonreference v0.21.0 // indirect
github.com/go-playground/locales v0.14.0 // indirect github.com/go-openapi/swag v0.23.0 // indirect
github.com/go-playground/universal-translator v0.18.0 // indirect github.com/go-resty/resty/v2 v2.8.0 // indirect
github.com/go-playground/validator/v10 v10.9.0 // indirect github.com/go-stack/stack v1.8.1 // indirect
github.com/go-resty/resty/v2 v2.7.0 // indirect github.com/go-test/deep v1.1.0 // indirect
github.com/go-test/deep v1.0.8 // indirect
github.com/gobwas/glob v0.2.3 // indirect github.com/gobwas/glob v0.2.3 // indirect
github.com/gogo/protobuf v1.3.2 // indirect github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.2 // indirect github.com/golang/mock v1.6.0 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/goodhosts/hostsfile v0.1.1 // indirect github.com/goodhosts/hostsfile v0.1.1 // indirect
github.com/google/btree v1.0.1 // indirect github.com/google/btree v1.1.2 // indirect
github.com/google/go-cmp v0.5.8 // indirect github.com/google/gnostic-models v0.6.9-0.20230804172637-c7be7c783f49 // indirect
github.com/google/go-containerregistry v0.9.0 // indirect github.com/google/go-cmp v0.6.0 // indirect
github.com/google/go-github/v32 v32.1.0 // indirect github.com/google/go-github/v32 v32.1.0 // indirect
github.com/google/go-querystring v1.1.0 // indirect github.com/google/go-querystring v1.1.0 // indirect
github.com/google/gofuzz v1.2.0 // indirect github.com/google/gofuzz v1.2.0 // indirect
github.com/google/safetext v0.0.0-20220905092116-b49f7bc46da2 // indirect
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
github.com/google/uuid v1.3.0 // indirect github.com/google/uuid v1.6.0 // indirect
github.com/googleapis/gnostic v0.5.5 // indirect github.com/gorilla/mux v1.8.1 // indirect
github.com/gorilla/mux v1.8.0 // indirect github.com/gorilla/websocket v1.5.0 // indirect
github.com/gosuri/uilive v0.0.4 // indirect
github.com/gosuri/uitable v0.0.4 // indirect github.com/gosuri/uitable v0.0.4 // indirect
github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 // indirect github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 // indirect
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect
github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/go-retryablehttp v0.7.0 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/go-version v1.3.0 // indirect github.com/hashicorp/go-retryablehttp v0.7.2 // indirect
github.com/hashicorp/go-version v1.6.0 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect github.com/hashicorp/hcl v1.0.0 // indirect
github.com/hashicorp/hcl/v2 v2.9.1 // indirect github.com/hashicorp/hcl/v2 v2.18.0 // indirect
github.com/huandu/xstrings v1.3.2 // indirect github.com/huandu/xstrings v1.4.0 // indirect
github.com/imdario/mergo v0.3.12 // indirect github.com/imdario/mergo v0.3.16 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
github.com/jmoiron/sqlx v1.3.1 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/jmoiron/sqlx v1.3.5 // indirect
github.com/josharian/intern v1.0.0 // indirect github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect github.com/json-iterator/go v1.1.12 // indirect
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351 // indirect github.com/kevinburke/ssh_config v1.2.0 // indirect
github.com/klauspost/compress v1.15.4 // indirect github.com/klauspost/compress v1.17.7 // indirect
github.com/kubevela/prism v1.4.1-0.20220613123457-94f1190f87c2 // indirect github.com/kubevela/pkg v1.9.3-0.20241203070234-2cf98778c0a9 // indirect
github.com/kubevela/workflow v0.6.1-0.20241210074645-d8a85b26c862 // indirect
github.com/kyokomi/emoji v2.2.4+incompatible // indirect github.com/kyokomi/emoji v2.2.4+incompatible // indirect
github.com/lann/builder v0.0.0-20180802200727-47ae307949d0 // indirect github.com/lann/builder v0.0.0-20180802200727-47ae307949d0 // indirect
github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0 // indirect github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0 // indirect
github.com/leodido/go-urn v1.2.1 // indirect github.com/lib/pq v1.10.9 // indirect
github.com/lib/pq v1.10.3 // indirect
github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect
github.com/magiconair/properties v1.8.5 // indirect github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
github.com/mailru/easyjson v0.7.6 // indirect github.com/magiconair/properties v1.8.7 // indirect
github.com/mattn/go-colorable v0.1.12 // indirect github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-isatty v0.0.14 // indirect github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-runewidth v0.0.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect github.com/mattn/go-runewidth v0.0.15 // indirect
github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect
github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b // indirect github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b // indirect
github.com/miekg/pkcs11 v1.0.3 // indirect github.com/miekg/pkcs11 v1.1.1 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/go-wordwrap v1.0.0 // indirect github.com/mitchellh/go-wordwrap v1.0.1 // indirect
github.com/mitchellh/hashstructure/v2 v2.0.1 // indirect github.com/mitchellh/hashstructure/v2 v2.0.2 // indirect
github.com/mitchellh/mapstructure v1.4.3 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/moby/locker v1.0.1 // indirect github.com/moby/locker v1.0.1 // indirect
github.com/moby/spdystream v0.2.0 // indirect github.com/moby/spdystream v0.2.0 // indirect
github.com/moby/sys/mount v0.3.0 // indirect github.com/moby/sys/mount v0.3.3 // indirect
github.com/moby/sys/mountinfo v0.5.0 // indirect github.com/moby/sys/mountinfo v0.6.2 // indirect
github.com/moby/term v0.0.0-20210619224110-3f7ff695adc6 // indirect github.com/moby/term v0.5.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect
github.com/morikuni/aec v1.0.0 // indirect github.com/morikuni/aec v1.0.0 // indirect
github.com/mpvl/unique v0.0.0-20150818121801-cbe035fff7de // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect
github.com/oam-dev/cluster-gateway v1.4.0 // indirect github.com/nacos-group/nacos-sdk-go/v2 v2.2.2 // indirect
github.com/oam-dev/cluster-register v1.0.4-0.20220325092210-cee4a3d3fb7d // indirect github.com/nxadm/tail v1.4.8 // indirect
github.com/oam-dev/cluster-gateway v1.9.1-0.20241120140625-33c8891b781c // indirect
github.com/oam-dev/cluster-register v1.0.4-0.20230424040021-147f7c1fefe5 // indirect
github.com/oam-dev/terraform-config-inspect v0.0.0-20210418082552-fc72d929aa28 // indirect github.com/oam-dev/terraform-config-inspect v0.0.0-20210418082552-fc72d929aa28 // indirect
github.com/oam-dev/terraform-controller v0.7.0 // indirect github.com/oam-dev/terraform-controller v0.8.0 // indirect
github.com/olekukonko/tablewriter v0.0.5 // indirect github.com/olekukonko/tablewriter v0.0.5 // indirect
github.com/onsi/gomega v1.19.0 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.0.3-0.20220114050600-8b9d41f48198 // indirect github.com/opencontainers/image-spec v1.1.0 // indirect
github.com/opencontainers/runc v1.1.3 // indirect github.com/opencontainers/runc v1.1.12 // indirect
github.com/openkruise/kruise-api v1.1.0 // indirect github.com/openkruise/kruise-api v1.4.0 // indirect
github.com/openkruise/rollouts v0.1.1-0.20220622054609-149e5a48da5e // indirect github.com/openkruise/rollouts v0.3.0 // indirect
github.com/openshift/library-go v0.0.0-20220112153822-ac82336bd076 // indirect github.com/openshift/library-go v0.0.0-20230327085348-8477ec72b725 // indirect
github.com/pelletier/go-toml v1.9.4 // indirect github.com/pelletier/go-toml v1.9.5 // indirect
github.com/pelletier/go-toml/v2 v2.2.2 // indirect
github.com/peterbourgon/diskv v2.0.1+incompatible // indirect github.com/peterbourgon/diskv v2.0.1+incompatible // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021 // indirect github.com/prometheus/client_golang v1.18.0 // indirect
github.com/prometheus/client_golang v1.12.1 // indirect github.com/prometheus/client_model v0.5.0 // indirect
github.com/prometheus/client_model v0.2.0 // indirect github.com/prometheus/common v0.45.0 // indirect
github.com/prometheus/common v0.34.0 // indirect github.com/prometheus/procfs v0.12.0 // indirect
github.com/prometheus/procfs v0.7.3 // indirect github.com/rivo/tview v0.0.0-20221128165837-db36428c92d9 // indirect
github.com/rivo/uniseg v0.2.0 // indirect github.com/rivo/uniseg v0.4.3 // indirect
github.com/rubenv/sql-migrate v0.0.0-20210614095031-55d5740dbbcc // indirect github.com/robfig/cron/v3 v3.0.1 // indirect
github.com/russross/blackfriday v1.6.0 // indirect github.com/rubenv/sql-migrate v1.5.2 // indirect
github.com/sergi/go-diff v1.2.0 // indirect github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 // indirect
github.com/shopspring/decimal v1.2.0 // indirect github.com/shopspring/decimal v1.3.1 // indirect
github.com/sirupsen/logrus v1.8.1 // indirect github.com/sirupsen/logrus v1.9.3 // indirect
github.com/spf13/afero v1.6.0 // indirect github.com/spf13/afero v1.11.0 // indirect
github.com/spf13/cast v1.4.1 // indirect github.com/spf13/cast v1.5.0 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect github.com/spf13/pflag v1.0.5 // indirect
github.com/spf13/viper v1.10.1 // indirect github.com/spf13/viper v1.15.0 // indirect
github.com/src-d/gcfg v1.4.0 // indirect github.com/subosito/gotenv v1.4.2 // indirect
github.com/subosito/gotenv v1.2.0 // indirect
github.com/theupdateframework/notary v0.7.0 // indirect github.com/theupdateframework/notary v0.7.0 // indirect
github.com/tjfoc/gmsm v1.3.2 // indirect github.com/tidwall/gjson v1.14.4 // indirect
github.com/tidwall/match v1.1.1 // indirect
github.com/tidwall/pretty v1.2.0 // indirect
github.com/wercker/stern v0.0.0-20190705090245-4fa46dd6987f // indirect github.com/wercker/stern v0.0.0-20190705090245-4fa46dd6987f // indirect
github.com/wonderflow/cert-manager-api v1.0.3 // indirect github.com/xanzy/go-gitlab v0.91.1 // indirect
github.com/xanzy/go-gitlab v0.60.0 // indirect github.com/xanzy/ssh-agent v0.3.3 // indirect
github.com/xanzy/ssh-agent v0.3.0 // indirect
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
github.com/xeipuuv/gojsonschema v1.2.0 // indirect github.com/xeipuuv/gojsonschema v1.2.0 // indirect
github.com/xlab/treeprint v1.1.0 // indirect github.com/xlab/treeprint v1.2.0 // indirect
github.com/zclconf/go-cty v1.8.0 // indirect github.com/zclconf/go-cty v1.13.0 // indirect
go.etcd.io/etcd/api/v3 v3.5.4 // indirect go.etcd.io/etcd/api/v3 v3.5.10 // indirect
go.etcd.io/etcd/client/pkg/v3 v3.5.4 // indirect go.etcd.io/etcd/client/pkg/v3 v3.5.10 // indirect
go.etcd.io/etcd/client/v3 v3.5.4 // indirect go.etcd.io/etcd/client/v3 v3.5.10 // indirect
go.opencensus.io v0.23.0 // indirect go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/contrib v1.6.0 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.45.0 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.20.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.45.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.20.0 // indirect go.opentelemetry.io/otel v1.19.0 // indirect
go.opentelemetry.io/otel v0.20.0 // indirect go.opentelemetry.io/otel/metric v1.19.0 // indirect
go.opentelemetry.io/otel/exporters/otlp v0.20.0 // indirect go.opentelemetry.io/otel/sdk v1.19.0 // indirect
go.opentelemetry.io/otel/metric v0.20.0 // indirect go.opentelemetry.io/otel/trace v1.19.0 // indirect
go.opentelemetry.io/otel/sdk v0.20.0 // indirect go.opentelemetry.io/proto/otlp v1.0.0 // indirect
go.opentelemetry.io/otel/sdk/export/metric v0.20.0 // indirect go.starlark.net v0.0.0-20240329153429-e6e8e7ce1b7a // indirect
go.opentelemetry.io/otel/sdk/metric v0.20.0 // indirect go.uber.org/automaxprocs v1.5.3 // indirect
go.opentelemetry.io/otel/trace v0.20.0 // indirect go.uber.org/multierr v1.11.0 // indirect
go.opentelemetry.io/proto/otlp v0.7.0 // indirect go.uber.org/zap v1.26.0 // indirect
go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5 // indirect go4.org/intern v0.0.0-20220617035311-6925f38cc365 // indirect
go.uber.org/atomic v1.9.0 // indirect go4.org/unsafe/assume-no-moving-gc v0.0.0-20231121144256-b99613f794b6 // indirect
go.uber.org/multierr v1.8.0 // indirect golang.org/x/crypto v0.32.0 // indirect
go.uber.org/zap v1.21.0 // indirect golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect
go4.org/intern v0.0.0-20211027215823-ae77deb06f29 // indirect golang.org/x/mod v0.19.0 // indirect
go4.org/unsafe/assume-no-moving-gc v0.0.0-20211027215541-db492cf91b37 // indirect golang.org/x/net v0.33.0 // indirect
golang.org/x/crypto v0.0.0-20220507011949-2cf3adece122 // indirect golang.org/x/oauth2 v0.20.0 // indirect
golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e // indirect golang.org/x/sync v0.10.0 // indirect
golang.org/x/oauth2 v0.0.0-20220622183110-fd043fe589d2 // indirect golang.org/x/sys v0.29.0 // indirect
golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f // indirect golang.org/x/term v0.28.0 // indirect
golang.org/x/sys v0.0.0-20220624220833-87e55d714810 // indirect golang.org/x/text v0.21.0 // indirect
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect golang.org/x/time v0.5.0 // indirect
golang.org/x/text v0.3.7 // indirect golang.org/x/tools v0.23.0 // indirect
golang.org/x/time v0.0.0-20220411224347-583f2d630306 // indirect gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f // indirect google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect
gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect google.golang.org/grpc v1.63.0 // indirect
google.golang.org/appengine v1.6.7 // indirect google.golang.org/protobuf v1.34.1 // indirect
google.golang.org/genproto v0.0.0-20220628213854-d9e0b6570c03 // indirect
google.golang.org/grpc v1.47.0 // indirect
google.golang.org/protobuf v1.28.0 // indirect
gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect
gopkg.in/evanphx/json-patch.v5 v5.9.0 // indirect
gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df // indirect gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df // indirect
gopkg.in/gorp.v1 v1.7.2 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/ini.v1 v1.66.2 // indirect gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/square/go-jose.v2 v2.5.1 // indirect gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
gopkg.in/src-d/go-billy.v4 v4.3.2 // indirect gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
gopkg.in/src-d/go-git.v4 v4.13.1 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect gopkg.in/warnings.v0 v0.1.2 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect gopkg.in/yaml.v3 v3.0.1 // indirect
inet.af/netaddr v0.0.0-20211027220019-c74959edd3b6 // indirect inet.af/netaddr v0.0.0-20220811202034-502d2d690317 // indirect
istio.io/api v0.0.0-20220512212136-561ffec82582 // indirect k8s.io/apiextensions-apiserver v0.29.2 // indirect
istio.io/client-go v1.13.4 // indirect k8s.io/apiserver v0.29.2 // indirect
istio.io/gogo-genproto v0.0.0-20211208193508-5ab4acc9eb1e // indirect k8s.io/cli-runtime v0.29.2 // indirect
k8s.io/api v0.23.6 // indirect k8s.io/component-base v0.29.2 // indirect
k8s.io/apiextensions-apiserver v0.23.6 // indirect
k8s.io/apimachinery v0.23.6 // indirect
k8s.io/apiserver v0.23.6 // indirect
k8s.io/cli-runtime v0.23.6 // indirect
k8s.io/component-base v0.23.6 // indirect
k8s.io/helm v2.17.0+incompatible // indirect k8s.io/helm v2.17.0+incompatible // indirect
k8s.io/klog v1.0.0 // indirect k8s.io/klog v1.0.0 // indirect
k8s.io/kube-aggregator v0.23.0 // indirect k8s.io/kube-aggregator v0.27.2 // indirect
k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65 // indirect k8s.io/kube-openapi v0.0.0-20240403164606-bc84c2ddaf99 // indirect
k8s.io/kubectl v0.23.6 // indirect k8s.io/kubectl v0.29.2 // indirect
k8s.io/metrics v0.23.6 // indirect k8s.io/metrics v0.29.2 // indirect
open-cluster-management.io/api v0.7.0 // indirect k8s.io/utils v0.0.0-20240310230437-4693a0247e57 // indirect
oras.land/oras-go v0.4.0 // indirect open-cluster-management.io/api v0.11.0 // indirect
oras.land/oras-go v1.2.5 // indirect
sigs.k8s.io/apiserver-network-proxy v0.0.30 // indirect sigs.k8s.io/apiserver-network-proxy v0.0.30 // indirect
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.30 // indirect sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.28.0 // indirect
sigs.k8s.io/apiserver-runtime v1.1.1 // indirect sigs.k8s.io/apiserver-runtime v1.1.2-0.20221118041430-0a6394f6dda3 // indirect
sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2 // indirect sigs.k8s.io/gateway-api v0.7.1 // indirect
sigs.k8s.io/kind v0.9.0 // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/kustomize/api v0.10.1 // indirect sigs.k8s.io/kind v0.20.0 // indirect
sigs.k8s.io/kustomize/kyaml v0.13.0 // indirect sigs.k8s.io/kustomize/api v0.16.0 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.1 // indirect sigs.k8s.io/kustomize/kyaml v0.16.0 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
sigs.k8s.io/yaml v1.4.0 // indirect
) )
replace ( replace (
github.com/containerd/containerd => github.com/containerd/containerd v1.5.0 cuelang.org/go => cuelang.org/go v0.9.2
github.com/docker/cli => github.com/docker/cli v20.10.9+incompatible github.com/docker/cli => github.com/docker/cli v20.10.9+incompatible
github.com/docker/docker => github.com/moby/moby v20.10.25+incompatible
github.com/google/certificate-transparency-go => github.com/google/certificate-transparency-go v1.1.3 github.com/google/certificate-transparency-go => github.com/google/certificate-transparency-go v1.1.3
github.com/k3d-io/k3d/v5 => github.com/chivalryq/k3d/v5 v5.0.0-20230115105251-1b3833ce38cc
github.com/wercker/stern => github.com/oam-dev/stern v1.13.2 github.com/wercker/stern => github.com/oam-dev/stern v1.13.2
sigs.k8s.io/apiserver-network-proxy/konnectivity-client => sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.24 go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc => go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.42.0
google.golang.org/grpc => google.golang.org/grpc v1.53.0
oras.land/oras-go => oras.land/oras-go v1.2.2
sigs.k8s.io/apiserver-runtime => github.com/kmodules/apiserver-runtime v1.1.2-0.20240303184316-6365e03bf9ac
) )
replace github.com/containerd/containerd => github.com/containerd/containerd v1.6.18

3095
go.sum

File diff suppressed because it is too large Load Diff

View File

@ -20,5 +20,5 @@ echo "downloading addons"
addons=("velaux-$velaux_version.tgz") addons=("velaux-$velaux_version.tgz")
for addon in ${addons[*]}; do for addon in ${addons[*]}; do
echo saving "$addon" to "$VELA_ADDON_DIR"/"$addon" echo saving "$addon" to "$VELA_ADDON_DIR"/"$addon"
curl -L "http://addons.kubevela.net/$addon" -o "$VELA_ADDON_DIR"/"$addon" curl -L "https://kubevela.github.io/catalog/official/$addon" -o "$VELA_ADDON_DIR"/"$addon"
done done

View File

@ -1,16 +1,34 @@
#!/bin/bash #!/bin/bash
set -e
set -x
K3D_IMAGE_DIR=pkg/resources/static/k3d/images K3D_IMAGE_DIR=pkg/resources/static/k3d/images
mkdir -p "$K3D_IMAGE_DIR" mkdir -p "$K3D_IMAGE_DIR"
vela_images=("ghcr.io/k3d-io/k3d-tools:5.4.1" ARCH=$1
"ghcr.io/k3d-io/k3d-proxy:5.4.1"
"docker.io/rancher/k3s:v1.21.10-k3s1")
for IMG in ${vela_images[*]}; do function download_k3d_images() {
IMAGE_NAME=$(echo "$IMG" | cut -f1 -d: | cut -f3 -d/) k3d_images=(
echo saving "$IMG" to "$K3D_IMAGE_DIR"/"$IMAGE_NAME".tar "$(cat pkg/apis/types.go| grep "K3dImageK3s" |tail -n1 | cut -f2 -d'"')"
docker pull "$IMG" "$(cat pkg/apis/types.go| grep "K3dImageTools" |tail -n1 | cut -f2 -d'"')"
docker save -o "$K3D_IMAGE_DIR"/"$IMAGE_NAME".tar "$IMG" "$(cat pkg/apis/types.go| grep "K3dImageProxy" |tail -n1 | cut -f2 -d'"')"
gzip -f "$K3D_IMAGE_DIR"/"$IMAGE_NAME".tar )
done
for IMG in ${k3d_images[*]}; do
IMAGE_NAME=$(echo "$IMG" | cut -f1 -d: | awk -F '/' '{print $NF}')
echo saving "$IMG" to "$K3D_IMAGE_DIR"/"$IMAGE_NAME".tar
$DOCKER_PULL "$IMG"
docker save -o "$K3D_IMAGE_DIR"/"$IMAGE_NAME".tar "$IMG"
gzip -f "$K3D_IMAGE_DIR"/"$IMAGE_NAME".tar
done
}
function determine_pull_command() {
DOCKER_PULL="docker pull --platform=linux/amd64"
if [ "$1" == "arm64" ]; then
DOCKER_PULL="docker pull --platform=linux/arm64"
fi
}
determine_pull_command "$ARCH"
download_k3d_images

View File

@ -1,6 +1,7 @@
#!/bin/bash #!/bin/bash
set -e set -e
set -x
VELA_IMAGE_DIR=pkg/resources/static/vela/images VELA_IMAGE_DIR=pkg/resources/static/vela/images
rm -rf "$VELA_IMAGE_DIR" rm -rf "$VELA_IMAGE_DIR"
@ -24,6 +25,9 @@ else
velaux_version=v$2 velaux_version=v$2
fi fi
# optional, amd64 if not set
ARCH=$3
function set_cluster_gateway_version() { function set_cluster_gateway_version() {
cluster_gateway_version=UNKNOWN cluster_gateway_version=UNKNOWN
image_tag=$(cat pkg/resources/static/vela/charts/vela-core/values.yaml | grep -A 1 oamdev/cluster-gateway | grep tag) image_tag=$(cat pkg/resources/static/vela/charts/vela-core/values.yaml | grep -A 1 oamdev/cluster-gateway | grep tag)
@ -42,19 +46,27 @@ function download_images() {
vela_images=("oamdev/vela-core:${vela_version}" vela_images=("oamdev/vela-core:${vela_version}"
"oamdev/cluster-gateway:${cluster_gateway_version}" "oamdev/cluster-gateway:${cluster_gateway_version}"
"oamdev/kube-webhook-certgen:${certgen_version}" "oamdev/kube-webhook-certgen:${certgen_version}"
"oamdev/velaux:${velaux_version}" "oamdev/velaux:${velaux_version}")
"oamdev/vela-apiserver:${vela_version}")
for IMG in ${vela_images[*]}; for IMG in ${vela_images[*]};
do do
IMAGE_NAME=$(echo "$IMG" | cut -f1 -d: | cut -f2 -d/) IMAGE_NAME=$(echo "$IMG" | cut -f1 -d: | cut -f2 -d/)
echo saving "$IMG" to "$VELA_IMAGE_DIR"/"$IMAGE_NAME".tar.gz echo saving "$IMG" to "$VELA_IMAGE_DIR"/"$IMAGE_NAME".tar.gz
docker pull "$IMG" $DOCKER_PULL "$IMG"
docker save -o "$VELA_IMAGE_DIR"/"$IMAGE_NAME".tar "$IMG" docker save -o "$VELA_IMAGE_DIR"/"$IMAGE_NAME".tar "$IMG"
gzip -f "$VELA_IMAGE_DIR"/"$IMAGE_NAME".tar gzip -f "$VELA_IMAGE_DIR"/"$IMAGE_NAME".tar
done done
} }
function determine_pull_command() {
DOCKER_PULL="docker pull --platform=linux/amd64"
if [ "$1" == "arm64" ]; then
DOCKER_PULL="docker pull --platform=linux/arm64"
fi
}
determine_pull_command "$ARCH"
set_cluster_gateway_version set_cluster_gateway_version
set_certgen_version set_certgen_version
download_images download_images

View File

@ -30,7 +30,7 @@ if ((Get-ExecutionPolicy) -gt 'RemoteSigned' -or (Get-ExecutionPolicy) -eq 'ByPa
# Check if VelaD is installed. # Check if VelaD is installed.
if (Test-Path $VelaDFilePath -PathType Leaf) { if (Test-Path $VelaDFilePath -PathType Leaf) {
Write-Warning "velad is detected - $VelaDFilePath" Write-Warning "velad is detected - $VelaDFilePath"
Invoke-Expression "$VelaDFilePath --version" Invoke-Expression "$VelaDFilePath version"
Write-Output "Reinstalling VelaD..." Write-Output "Reinstalling VelaD..."
} }
else { else {
@ -76,7 +76,7 @@ if (!(Test-Path $VelaDFilePath -PathType Leaf)) {
} }
# Check the VelaD version # Check the VelaD version
Invoke-Expression "$VelaDFilePath --version" Invoke-Expression "$VelaDFilePath version"
# Clean up zipfile # Clean up zipfile
Write-Output "Clean up $zipFilePath..." Write-Output "Clean up $zipFilePath..."

View File

@ -37,7 +37,7 @@ getSystemInfo() {
} }
verifySupported() { verifySupported() {
local supported=(darwin-amd64 darwin-arm64 linux-amd64 linux-arm linux-arm64) local supported=(darwin-amd64 linux-amd64 linux-arm64 darwin-arm64)
local current_osarch="${OS}-${ARCH}" local current_osarch="${OS}-${ARCH}"
for osarch in "${supported[@]}"; do for osarch in "${supported[@]}"; do

View File

@ -1,7 +0,0 @@
CHART_FILE=pkg/resources/static/vela/charts/vela-core/Chart.yaml
VERSION_TO=$1
# Works on Mac: see https://stackoverflow.com/questions/2320564/sed-i-command-for-in-place-editing-to-work-with-both-gnu-sed-and-bsd-osx
sed -i "" -e "s/version: v.*/version: $VERSION_TO/g" $CHART_FILE
sed -i "" -e "s/appVersion: v.*/appVersion: $VERSION_TO/g" $CHART_FILE

View File

@ -3,33 +3,39 @@
# This script is for upgrade kubevela helm charts maintained in velad repo # This script is for upgrade kubevela helm charts maintained in velad repo
# Chart in this repo have one more argument(deployByPod) than that in kubevela repo. # Chart in this repo have one more argument(deployByPod) than that in kubevela repo.
# usage: ./hack/upgrade_vela.sh version_now version_upgrade_to # usage: ./hack/upgrade_vela.sh version_upgrade_to
# e.g. ./hack/upgrade_vela.sh v1.3.3 v1.3.4 # e.g. ./hack/upgrade_vela.sh v1.3.4
set -e set -e
[ $# = 2 ] || { echo "Usage: "$0" version_now version_to" >&2; exit 1; } [ $# = 1 ] || { echo "Usage: "$0" version_to" >&2; exit 1; }
VERSION_NOW=$1 VERSION_NOW=$(cat Makefile |grep "VELA_VERSION ?=" |grep -o "v.*")
VERSION_TO=$2 VERSION_TO=$1
PATCH_FILE_NAME=$VERSION_NOW-$VERSION_TO.patch PATCH_FILE_NAME=$VERSION_NOW-$VERSION_TO.patch
WORKDIR=pkg/resources/static/vela WORKDIR=pkg/resources/static/vela
echo "Upgrading chart version..." echo "Upgrading KubeVela version From: "$VERSION_NOW" --> TO: "$VERSION_TO
./hack/upgrade_chart_version.sh $VERSION_TO echo "Upgrading go.mod version..."
git clone https://github.com/kubevela/kubevela.git
pushd kubevela if [ "$(uname)" == "Darwin" ]; then
git diff refs/tags/"$VERSION_NOW"...refs/tags/"$VERSION_TO" charts/vela-core > "$PATCH_FILE_NAME" # macOS
popd sed -i "" -e "s/github.com\/oam-dev\/kubevela v.*/github.com\/oam-dev\/kubevela $VERSION_TO/g" go.mod
else
# Linux
sed -i -e "s/github.com\/oam-dev\/kubevela v.*/github.com\/oam-dev\/kubevela $VERSION_TO/g" go.mod
fi
mv kubevela/"$PATCH_FILE_NAME" . go mod tidy
echo "Patching charts..." echo "Upgrading version variable in Makefile"
git apply -v --check --reject --apply --directory $WORKDIR "$PATCH_FILE_NAME"
echo "Patching done"
rm "$PATCH_FILE_NAME" if [ "$(uname)" == "Darwin" ]; then
rm -rf kubevela # macOS
sed -i "" -e "s/VELA_VERSION ?= v.*/VELA_VERSION ?= $VERSION_TO/g" Makefile
else
# Linux
sed -i -e "s/VELA_VERSION ?= v.*/VELA_VERSION ?= $VERSION_TO/g" Makefile
fi

47
hack/upgrade_velaux.sh Executable file
View File

@ -0,0 +1,47 @@
#! /bin/bash
# This script is for upgrade VelaUX
set -e
# If one parameter is passed, use it as the version to upgrade to.
# If two parameters are passed, use the second one as VelaUX image version. Sometimes, we skip the VelaUX image, only upgrade the VelaUX addon.
if [ $# = 1 ]; then
VERSION_TO=$1
IMAGE_VERSION=$1
elif [ $# = 2 ]; then
VERSION_TO=$1
IMAGE_VERSION=$2
else
echo "Usage: "$0" version_to [image_version]" >&2
exit 1
fi
VERION_TO=$1
IMAGE_VERSION=$2
VERSION_NOW=$(cat Makefile |grep "VELAUX_VERSION ?=" |grep -o "v.*")
PATCH_FILE_NAME=$VERSION_NOW-$VERSION_TO.patch
WORKDIR=pkg/resources/static/vela
echo "Upgrading VelaUX version From: "$VERSION_NOW" --> TO: "$VERSION_TO,
if [ -n "$IMAGE_VERSION" ]; then
echo "Upgrading VelaUX image version to: ""$IMAGE_VERSION"
else
echo "VelaUX image version is the same as VelaUX addon version"
IMAGE_VERSION=$VERSION_TO
fi
if [ "$(uname)" == "Darwin" ]; then
# macOS
sed -i "" -e "s/VELAUX_VERSION ?= v.*/VELAUX_VERSION ?= $VERSION_TO/g" Makefile
sed -i "" -e "s/VELAUX_IMAGE_VERSION ?= .*/VELAUX_IMAGE_VERSION ?= $IMAGE_VERSION/g" Makefile
else
# Linux
sed -i -e "s/VELAUX_VERSION ?= v.*/VELAUX_VERSION ?= $VERSION_TO/g" Makefile
sed -i -e "s/VELAUX_IMAGE_VERSION ?= .*/VELAUX_IMAGE_VERSION ?= $IMAGE_VERSION/g" Makefile
fi

View File

@ -6,7 +6,7 @@ GOBIN=$(shell go env GOBIN)
endif endif
GOLANGCILINT_VERSION ?= v1.38.0 GOLANGCILINT_VERSION ?= v1.54.2
.PHONY: golangci .PHONY: golangci
golangci: golangci:
@ -32,7 +32,7 @@ ifeq (, $(shell which staticcheck))
@{ \ @{ \
set -e ;\ set -e ;\
echo 'installing honnef.co/go/tools/cmd/staticcheck ' ;\ echo 'installing honnef.co/go/tools/cmd/staticcheck ' ;\
go install honnef.co/go/tools/cmd/staticcheck@v0.3.0 ;\ go install honnef.co/go/tools/cmd/staticcheck@v0.5.1 ;\
} }
STATICCHECK=$(GOBIN)/staticcheck STATICCHECK=$(GOBIN)/staticcheck
else else

View File

@ -8,15 +8,18 @@ import (
// InstallArgs defines arguments for velad install command // InstallArgs defines arguments for velad install command
type InstallArgs struct { type InstallArgs struct {
BindIP string BindIP string
DBEndpoint string NodePublicIP string
ClusterOnly bool MasterIP string
Token string DBEndpoint string
Controllers string ClusterOnly bool
Token string
Controllers string
// InstallArgs is parameters passed to vela install command // InstallArgs is parameters passed to vela install command
InstallArgs cli.InstallArgs InstallArgs cli.InstallArgs
Name string Name string
DryRun bool DryRun bool
Worker bool
} }
// UninstallArgs defines arguments for velad uninstall command // UninstallArgs defines arguments for velad uninstall command
@ -37,10 +40,20 @@ type TokenArgs struct {
Name string Name string
} }
// JoinArgs defines arguments for velad join command
type JoinArgs struct {
Token string
Name string
MasterIP string
DryRun bool
}
// LoadBalancerArgs defines arguments for load balancer command // LoadBalancerArgs defines arguments for load balancer command
type LoadBalancerArgs struct { type LoadBalancerArgs struct {
Hosts []string Hosts []string
Configuration string Configuration string
PortHTTP int
PortHTTPS int
} }
// ControlPlaneStatus defines the status of control plane // ControlPlaneStatus defines the status of control plane
@ -118,11 +131,11 @@ var (
VelaDDockerNetwork = "k3d-velad" VelaDDockerNetwork = "k3d-velad"
// K3dImageK3s is k3s image tag // K3dImageK3s is k3s image tag
K3dImageK3s = "rancher/k3s:v1.21.10-k3s1" K3dImageK3s = "rancher/k3s:v1.29.13-k3s1"
// K3dImageTools is k3d tools image tag // K3dImageTools is k3d tools image tag
K3dImageTools = "ghcr.io/k3d-io/k3d-tools:5.4.1" K3dImageTools = "ghcr.io/k3d-io/k3d-tools:latest"
// K3dImageProxy is k3d proxy image tag // K3dImageProxy is k3d proxy image tag
K3dImageProxy = "ghcr.io/k3d-io/k3d-proxy:5.4.1" K3dImageProxy = "ghcr.io/k3d-io/k3d-proxy:5.5.1"
// KubeVelaHelmRelease is helm release name for vela // KubeVelaHelmRelease is helm release name for vela
KubeVelaHelmRelease = "kubevela" KubeVelaHelmRelease = "kubevela"

View File

@ -9,11 +9,9 @@ import (
var newErr = errors.New var newErr = errors.New
// Validate validates the `install` argument // Validate validates the `install` argument
func (a InstallArgs) Validate() error { func (a *InstallArgs) Validate() error {
if runtime.GOOS == GoosLinux { if a.NodePublicIP != "" && a.BindIP == "" {
if a.Name != DefaultVelaDClusterName { a.BindIP = a.NodePublicIP
return newErr("name flag not works in linux")
}
} }
return nil return nil
} }
@ -50,3 +48,11 @@ func (a TokenArgs) Validate() error {
} }
return nil return nil
} }
// Validate validates the join arguments
func (a JoinArgs) Validate() error {
if runtime.GOOS != GoosLinux {
return newErr("join command only works in linux")
}
return nil
}

View File

@ -2,7 +2,6 @@ package cluster
import ( import (
"github.com/oam-dev/velad/pkg/apis" "github.com/oam-dev/velad/pkg/apis"
"github.com/oam-dev/velad/pkg/utils"
) )
// GetK3sServerArgs convert install args to ones passed to k3s server // GetK3sServerArgs convert install args to ones passed to k3s server
@ -12,18 +11,19 @@ func GetK3sServerArgs(args apis.InstallArgs) []string {
serverArgs = append(serverArgs, "--datastore-endpoint="+args.DBEndpoint) serverArgs = append(serverArgs, "--datastore-endpoint="+args.DBEndpoint)
} }
if args.BindIP != "" { if args.BindIP != "" {
serverArgs = append(serverArgs, "--tls-san="+args.BindIP, "--node-external-ip="+args.BindIP) serverArgs = append(serverArgs, "--tls-san="+args.BindIP)
} }
if args.Token != "" { if args.NodePublicIP != "" {
serverArgs = append(serverArgs, "--token="+args.Token) serverArgs = append(serverArgs, "--node-external-ip="+args.NodePublicIP)
} }
if args.Controllers != "*" { // K3s install script requires to provide token using K3S_TOKEN env var when install agent, so skip it here
serverArgs = append(serverArgs, "--kube-controller-manager-arg=controllers="+args.Controllers) if !args.Worker {
// TODO : deal with coredns/local-path-provisioner/metrics-server Deployment when no deployment controllers if args.Token != "" {
if !utils.HaveController(args.Controllers, "job") { serverArgs = append(serverArgs, "--token="+args.Token)
// Traefik use Job to install, which is impossible without Job Controller
serverArgs = append(serverArgs, "--disable", "traefik")
} }
} }
if args.Name != "" {
serverArgs = append(serverArgs, "--node-name="+args.Name)
}
return serverArgs return serverArgs
} }

View File

@ -10,4 +10,5 @@ type Handler interface {
SetKubeconfig() error SetKubeconfig() error
LoadImage(image string) error LoadImage(image string) error
GetStatus() apis.ClusterStatus GetStatus() apis.ClusterStatus
Join(args apis.JoinArgs) error
} }

View File

@ -6,7 +6,6 @@ import (
"context" "context"
"fmt" "fmt"
"io" "io"
"io/ioutil"
"net" "net"
"os" "os"
"os/exec" "os/exec"
@ -51,7 +50,7 @@ type k3dSetupOptions struct {
const ( const (
// K3dImageTag is image tag of k3d // K3dImageTag is image tag of k3d
K3dImageTag = "v1.21.10-k3s1" K3dImageTag = "v1.27.2-k3s1"
) )
func init() { func init() {
@ -68,6 +67,11 @@ type K3dHandler struct {
cfg config.ClusterConfig cfg config.ClusterConfig
} }
// Join -
func (d *K3dHandler) Join(_ apis.JoinArgs) error {
return errors.New("not implemented")
}
// Install will install a k3d cluster // Install will install a k3d cluster
func (d *K3dHandler) Install(args apis.InstallArgs) error { func (d *K3dHandler) Install(args apis.InstallArgs) error {
var err error var err error
@ -123,40 +127,26 @@ func (d *K3dHandler) GenKubeconfig(ctx apis.Context, bindIP string) error {
var err error var err error
var cluster = d.cfg.Cluster.Name var cluster = d.cfg.Cluster.Name
// 1. kubeconfig for access from host // 1. kubeconfig for access from host
cfg := configPath(cluster) cfgHost := configPath(cluster)
info("Generating host kubeconfig into", cfg) info("Generating host kubeconfig into", cfgHost)
if !ctx.DryRun { if !ctx.DryRun {
if _, err := k3dClient.KubeconfigGetWrite(context.Background(), runtimes.SelectedRuntime, &d.cfg.Cluster, cfg, if _, err := k3dClient.KubeconfigGetWrite(context.Background(), runtimes.SelectedRuntime, &d.cfg.Cluster, cfgHost,
&k3dClient.WriteKubeConfigOptions{UpdateExisting: true, OverwriteExisting: false, UpdateCurrentContext: true}); err != nil { &k3dClient.WriteKubeConfigOptions{UpdateExisting: true, OverwriteExisting: false, UpdateCurrentContext: true}); err != nil {
return errors.Wrap(err, "failed to gen kubeconfig") return errors.Wrap(err, "failed to gen kubeconfig")
} }
} }
// #nosec
cfgContent, err := os.ReadFile(cfg) _cfgContent, err := os.ReadFile(cfgHost)
if err != nil { if err != nil {
return errors.Wrap(err, "read kubeconfig") return errors.Wrap(err, "read kubeconfig")
} }
// 2. kubeconfig for access from other VelaD cluster var (
// Basically we replace the IP with IP inside the docker network hostToReplace string
var hostToReplace string kubeConfig = string(_cfgContent)
cfgIn := configPathInternal(cluster) )
info("Generating internal kubeconfig into", cfgIn)
if !ctx.DryRun { if !ctx.DryRun {
networks, err := dockerCli.NetworkInspect(d.ctx, apis.VelaDDockerNetwork, types.NetworkInspectOptions{})
if err != nil {
klog.ErrorS(err, "inspect docker network")
return err
}
var containerIP string
cs := networks.Containers
for _, c := range cs {
if c.Name == fmt.Sprintf("k3d-%s-server-0", d.cfg.Cluster.Name) {
containerIP = strings.TrimSuffix(c.IPv4Address, "/16")
}
}
kubeConfig := string(cfgContent)
var re *regexp.Regexp
switch { switch {
case strings.Contains(kubeConfig, "0.0.0.0"): case strings.Contains(kubeConfig, "0.0.0.0"):
hostToReplace = "0.0.0.0" hostToReplace = "0.0.0.0"
@ -165,9 +155,37 @@ func (d *K3dHandler) GenKubeconfig(ctx apis.Context, bindIP string) error {
default: default:
return errors.Wrap(err, "unrecognized kubeconfig format") return errors.Wrap(err, "unrecognized kubeconfig format")
} }
re = regexp.MustCompile(hostToReplace + `:\d{4}`) }
// Replace host config with loop back address
if !ctx.DryRun {
cfgHostContent := strings.ReplaceAll(kubeConfig, hostToReplace, "127.0.0.1")
err = os.WriteFile(cfgHost, []byte(cfgHostContent), 0600)
if err != nil {
errf("Fail to re-write host kubeconfig")
}
}
// 2. kubeconfig for access from other VelaD cluster
// Basically we replace the IP with IP inside the docker network
cfgIn := configPathInternal(cluster)
info("Generating internal kubeconfig into", cfgIn)
if !ctx.DryRun {
var containerIP string
networks, err := dockerCli.NetworkInspect(d.ctx, apis.VelaDDockerNetwork, types.NetworkInspectOptions{})
if err != nil {
klog.ErrorS(err, "inspect docker network")
return err
}
cs := networks.Containers
for _, c := range cs {
if c.Name == fmt.Sprintf("k3d-%s-server-0", d.cfg.Cluster.Name) {
containerIP = strings.TrimSuffix(c.IPv4Address, "/16")
}
}
re := regexp.MustCompile(hostToReplace + `:\d{4}`)
cfgInContent := re.ReplaceAllString(kubeConfig, fmt.Sprintf("%s:6443", containerIP)) cfgInContent := re.ReplaceAllString(kubeConfig, fmt.Sprintf("%s:6443", containerIP))
err = ioutil.WriteFile(cfgIn, []byte(cfgInContent), 0600) err = os.WriteFile(cfgIn, []byte(cfgInContent), 0600)
if err != nil { if err != nil {
errf("Fail to write internal kubeconfig") errf("Fail to write internal kubeconfig")
} else { } else {
@ -180,7 +198,7 @@ func (d *K3dHandler) GenKubeconfig(ctx apis.Context, bindIP string) error {
cfgOut := configPathExternal(cluster) cfgOut := configPathExternal(cluster)
info("Generating external kubeconfig for remote access into ", cfgOut) info("Generating external kubeconfig for remote access into ", cfgOut)
if !ctx.DryRun { if !ctx.DryRun {
cfgOutContent := strings.Replace(string(cfgContent), hostToReplace, bindIP, 1) cfgOutContent := strings.Replace(kubeConfig, hostToReplace, bindIP, 1)
err = os.WriteFile(cfgOut, []byte(cfgOutContent), 0600) err = os.WriteFile(cfgOut, []byte(cfgOutContent), 0600)
if err != nil { if err != nil {
return err return err
@ -199,7 +217,7 @@ func (d *K3dHandler) SetKubeconfig() error {
// LoadImage loads image from local path // LoadImage loads image from local path
func (d *K3dHandler) LoadImage(image string) error { func (d *K3dHandler) LoadImage(image string) error {
err := k3dClient.ImageImportIntoClusterMulti(d.ctx, runtimes.SelectedRuntime, []string{image}, &d.cfg.Cluster, k3d.ImageImportOpts{}) err := k3dClient.ImageImportIntoClusterMulti(d.ctx, runtimes.SelectedRuntime, []string{image}, &d.cfg.Cluster, k3d.ImageImportOpts{Mode: k3d.ImportModeAutoDetect})
return errors.Wrap(err, "failed to import image") return errors.Wrap(err, "failed to import image")
} }
@ -429,7 +447,7 @@ func (o k3dSetupOptions) runClusterIfNotExist(ctx context.Context, cluster confi
// prepareK3sImages extracts k3s images to ~/.vela/velad/k3s/images.tg // prepareK3sImages extracts k3s images to ~/.vela/velad/k3s/images.tg
func (o k3dSetupOptions) prepareK3sImages() error { func (o k3dSetupOptions) prepareK3sImages() error {
embedK3sImage, err := resources.K3sImage.Open("static/k3s/images/k3s-airgap-images-amd64.tar.gz") embedK3sImage, err := resources.K3sImage.Open("static/k3s/images/k3s-airgap-images.tar.gz")
if err != nil { if err != nil {
return err return err
} }
@ -439,7 +457,7 @@ func (o k3dSetupOptions) prepareK3sImages() error {
if err != nil { if err != nil {
return err return err
} }
k3sImagesPath := filepath.Join(k3sImagesDir, "k3s-airgap-images-amd64.tgz") k3sImagesPath := filepath.Join(k3sImagesDir, "k3s-airgap-images.tgz")
info("Saving k3s image airgap install tarball to", k3sImagesPath) info("Saving k3s image airgap install tarball to", k3sImagesPath)
if !o.dryRun { if !o.dryRun {
@ -486,7 +504,6 @@ func (o k3dSetupOptions) loadK3dImages() error {
var ( var (
format = "k3d-image-" + name + "-*.tar.gz" format = "k3d-image-" + name + "-*.tar.gz"
imageTgz string imageTgz string
imageTar string
) )
if o.dryRun { if o.dryRun {
info("Saving and temporary image file:", format) info("Saving and temporary image file:", format)
@ -495,21 +512,13 @@ func (o k3dSetupOptions) loadK3dImages() error {
if err != nil { if err != nil {
return err return err
} }
// #nosec
unzipCmd := exec.Command("gzip", "-d", imageTgz)
output, err := unzipCmd.CombinedOutput()
utils.InfoBytes(output)
if err != nil {
return err
}
imageTar = strings.TrimSuffix(imageTgz, ".gz")
} }
if o.dryRun { if o.dryRun {
infof("Importing image to docker using temporary file: %s\n", format) infof("Importing image to docker using temporary file: %s\n", format)
} else { } else {
// #nosec // #nosec
importCmd := exec.Command("docker", "image", "load", "-i", imageTar) importCmd := exec.Command("docker", "image", "load", "-i", imageTgz)
output, err := importCmd.CombinedOutput() output, err := importCmd.CombinedOutput()
utils.InfoBytes(output) utils.InfoBytes(output)
if err != nil { if err != nil {

View File

@ -27,10 +27,32 @@ var (
// K3sHandler handle k3s in linux // K3sHandler handle k3s in linux
type K3sHandler struct{} type K3sHandler struct{}
// Join a worker node to k3s cluster
func (l K3sHandler) Join(args apis.JoinArgs) error {
info("Join k3s cluster...")
// #nosec
err := SetupK3s(apis.InstallArgs{
Worker: true,
DryRun: args.DryRun,
Token: args.Token,
Name: args.Name,
MasterIP: args.MasterIP,
})
if err != nil {
return errors.Wrap(err, "fail to join k3s cluster")
}
info("🎉 Successfully join worker node")
return nil
}
var _ Handler = &K3sHandler{} var _ Handler = &K3sHandler{}
type k3sSetupOptions struct { type k3sSetupOptions struct {
DryRun bool DryRun bool
Worker bool
MasterIP string
Token string
} }
// Install install k3s cluster // Install install k3s cluster
@ -46,9 +68,13 @@ func (l K3sHandler) Install(args apis.InstallArgs) error {
// Uninstall uninstall k3s cluster // Uninstall uninstall k3s cluster
func (l K3sHandler) Uninstall(name string) error { func (l K3sHandler) Uninstall(name string) error {
info("Uninstall k3s...") info("Uninstall k3s...")
script, err := decideUninstallScript()
if err != nil {
return err
}
// #nosec // #nosec
uCmd := exec.Command("/usr/local/bin/k3s-uninstall.sh") uCmd := exec.Command(script)
err := uCmd.Run() err = uCmd.Run()
if err != nil { if err != nil {
return errors.Wrap(err, "Fail to uninstall k3s") return errors.Wrap(err, "Fail to uninstall k3s")
} }
@ -58,7 +84,7 @@ func (l K3sHandler) Uninstall(name string) error {
dCmd := exec.Command("rm", apis.VelaLinkPos) dCmd := exec.Command("rm", apis.VelaLinkPos)
err = dCmd.Run() err = dCmd.Run()
if err != nil { if err != nil {
return errors.Wrap(err, "Fail to delete vela link") info("No vela in /usr/local/bin, skip uninstall")
} }
info("Successfully uninstall vela CLI") info("Successfully uninstall vela CLI")
return nil return nil
@ -72,7 +98,7 @@ func (l K3sHandler) SetKubeconfig() error {
// LoadImage load imageTar to k3s cluster // LoadImage load imageTar to k3s cluster
func (l K3sHandler) LoadImage(imageTar string) error { func (l K3sHandler) LoadImage(imageTar string) error {
// #nosec // #nosec
importCmd := exec.Command("k3s", "ctr", "images", "import", imageTar) importCmd := exec.Command("k3s", "ctr", "images", "import", "--all-platforms", imageTar)
output, err := importCmd.CombinedOutput() output, err := importCmd.CombinedOutput()
utils.InfoBytes(output) utils.InfoBytes(output)
if err != nil { if err != nil {
@ -154,7 +180,11 @@ func fillVelaStatus(status *apis.ClusterStatus) {
// prepareK3sImages Write embed images // prepareK3sImages Write embed images
func (o k3sSetupOptions) prepareK3sImages() error { func (o k3sSetupOptions) prepareK3sImages() error {
embedK3sImage, err := resources.K3sImage.Open("static/k3s/images/k3s-airgap-images-amd64.tar.gz") if o.Worker {
info("Skipping image unpacking on worker node")
return nil
}
embedK3sImage, err := resources.K3sImage.Open("static/k3s/images/k3s-airgap-images.tar.gz")
if err != nil { if err != nil {
return err return err
} }
@ -192,6 +222,16 @@ func (o k3sSetupOptions) prepareK3sImages() error {
return nil return nil
} }
func (o k3sSetupOptions) prepareEnv(cmd *exec.Cmd) {
masterURL := fmt.Sprintf("https://%s:%d", o.MasterIP, 6443)
cmd.Env = os.Environ()
cmd.Env = append(cmd.Env, "INSTALL_K3S_SKIP_DOWNLOAD=true")
if o.Worker {
cmd.Env = append(cmd.Env, "K3S_URL="+masterURL, "K3S_TOKEN="+o.Token)
}
}
// prepareK3sScript Write k3s install script to local // prepareK3sScript Write k3s install script to local
func (o k3sSetupOptions) prepareK3sScript() (string, error) { func (o k3sSetupOptions) prepareK3sScript() (string, error) {
var ( var (
@ -239,7 +279,12 @@ func (o k3sSetupOptions) prepareK3sBin() error {
// SetupK3s will set up K3s as control plane. // SetupK3s will set up K3s as control plane.
func SetupK3s(cArgs apis.InstallArgs) error { func SetupK3s(cArgs apis.InstallArgs) error {
o := k3sSetupOptions{DryRun: cArgs.DryRun} o := k3sSetupOptions{
DryRun: cArgs.DryRun,
Worker: cArgs.Worker,
MasterIP: cArgs.MasterIP,
Token: cArgs.Token,
}
info("Preparing cluster setup script...") info("Preparing cluster setup script...")
script, err := o.prepareK3sScript() script, err := o.prepareK3sScript()
if err != nil { if err != nil {
@ -266,11 +311,10 @@ func SetupK3s(cArgs apis.InstallArgs) error {
if !o.DryRun { if !o.DryRun {
/* #nosec */ /* #nosec */
cmd := exec.Command("/bin/bash", args...) cmd := exec.Command("/bin/bash", args...)
o.prepareEnv(cmd)
cmd.Env = os.Environ() info(cmd.String())
cmd.Env = append(cmd.Env, "INSTALL_K3S_SKIP_DOWNLOAD=true")
output, err = cmd.CombinedOutput() output, err = cmd.CombinedOutput()
fmt.Print(string(output)) infof(string(output))
} }
return errors.Wrap(err, "K3s install script failed") return errors.Wrap(err, "K3s install script failed")
} }
@ -296,3 +340,15 @@ func (l K3sHandler) GenKubeconfig(ctx apis.Context, bindIP string) error {
info("Successfully generate kubeconfig at ", apis.K3sExternalKubeConfigLocation) info("Successfully generate kubeconfig at ", apis.K3sExternalKubeConfigLocation)
return err return err
} }
func decideUninstallScript() (string, error) {
serverUninstallFile := "/usr/local/bin/k3s-uninstall.sh"
agentUninstallFile := "/usr/local/bin/k3s-agent-uninstall.sh"
if _, err := os.Stat(serverUninstallFile); err == nil {
return serverUninstallFile, nil
}
if _, err := os.Stat(agentUninstallFile); err == nil {
return agentUninstallFile, nil
}
return "", errors.New("can not find k3s uninstall script")
}

View File

@ -31,7 +31,7 @@ func (a App) Run() {
var cmd *cobra.Command var cmd *cobra.Command
if utils.IsVelaCommand(a.args[0]) { if utils.IsVelaCommand(a.args[0]) {
utils.SetDefaultKubeConfigEnv() _ = utils.SetDefaultKubeConfigEnv()
cmd = cli.NewCommand() cmd = cli.NewCommand()
version.VelaVersion = veladVersion.VelaVersion version.VelaVersion = veladVersion.VelaVersion
version.GitRevision = veladVersion.VelaGitRevision version.GitRevision = veladVersion.VelaGitRevision

View File

@ -33,6 +33,7 @@ func NewVeladCommand() *cobra.Command {
} }
cmd.AddCommand( cmd.AddCommand(
NewInstallCmd(c, ioStreams), NewInstallCmd(c, ioStreams),
NewJoinCmd(),
NewStatusCmd(), NewStatusCmd(),
NewLoadBalancerCmd(), NewLoadBalancerCmd(),
NewKubeConfigCmd(), NewKubeConfigCmd(),
@ -64,17 +65,36 @@ func NewInstallCmd(c common.Args, ioStreams cmdutil.IOStreams) *cobra.Command {
cmd := &cobra.Command{ cmd := &cobra.Command{
Use: "install", Use: "install",
Short: "Quickly setup a KubeVela control plane", Short: "Quickly setup a KubeVela control plane",
Long: "Quickly setup a KubeVela control plane, using K3s and only for Linux now", Long: "Quickly setup a KubeVela control plane.",
Example: `
# Simply install a control plane
velad install
# Install a high-availability control plane with external database.
# Requires at least 2 nodes.
# 1. Setup first master node
velad install --token=<TOKEN> --database-endpoint="mysql://<USER>:@tcp(<HOST>:<PORT>)/velad_ha" --bind-ip=<LB_IP> --node-ip=<FIRST_NODE_IP>
# 2. Join other master nodes
velad install --token=<TOKEN> --database-endpoint="mysql://<USER>:@tcp(<HOST>:<PORT>)/velad_ha" --bind-ip=<LB_IP> --node-ip=<SECOND_NODE_IP>
# 3. On any master node, start wizard to get command to setup load balancer. Or you can use a load balancer service provided by cloud vendor.
velad load-balancer wizard
# 4. On another node, setup load balancer
<Run command from step 3>
`,
RunE: func(cmd *cobra.Command, args []string) error { RunE: func(cmd *cobra.Command, args []string) error {
return installCmd(c, ioStreams, iArgs) return installCmd(c, ioStreams, iArgs)
}, },
} }
cmd.Flags().BoolVar(&iArgs.ClusterOnly, "cluster-only", false, "If set, start cluster without installing vela-core, typically used when restart a control plane where vela-core has been installed") cmd.Flags().BoolVar(&iArgs.ClusterOnly, "cluster-only", false, "If set, start cluster without installing vela-core, typically used when restart a control plane where vela-core has been installed")
cmd.Flags().StringVar(&iArgs.DBEndpoint, "database-endpoint", "", "Use an external database to store control plane metadata, please ref https://rancher.com/docs/k3s/latest/en/installation/datastore/#datastore-endpoint-format-and-functionality for the format") cmd.Flags().StringVar(&iArgs.DBEndpoint, "database-endpoint", "", "Use an external database to store control plane metadata, please ref https://rancher.com/docs/k3s/latest/en/installation/datastore/#datastore-endpoint-format-and-functionality for the format")
cmd.Flags().StringVar(&iArgs.BindIP, "bind-ip", "", "Bind additional hostname or IP in the kubeconfig TLS cert") cmd.Flags().StringVar(&iArgs.BindIP, "bind-ip", "", "Bind additional hostname or IP to the cluster (e.g. IP of load balancer for multi-nodes VelaD cluster). This is used to generate kubeconfig access from remote (`velad kubeconfig --external`). If not set, will use node-ip")
cmd.Flags().StringVar(&iArgs.NodePublicIP, "node-ip", "", "Set the public IP of the node")
cmd.Flags().StringVar(&iArgs.Token, "token", "", "Token for identify the cluster. Can be used to restart the control plane or register other node. If not set, random token will be generated") cmd.Flags().StringVar(&iArgs.Token, "token", "", "Token for identify the cluster. Can be used to restart the control plane or register other node. If not set, random token will be generated")
cmd.Flags().StringVar(&iArgs.Controllers, "controllers", "*", "A list of controllers to enable, check \"--controllers\" argument for more spec in https://kubernetes.io/docs/reference/command-line-tools-reference/kube-controller-manager/") cmd.Flags().StringVar(&iArgs.Name, "name", apis.DefaultVelaDClusterName, "In Mac/Windows environment, use this to specify the name of the cluster. In Linux environment, use this to specify the name of node")
cmd.Flags().StringVar(&iArgs.Name, "name", apis.DefaultVelaDClusterName, "The name of the cluster. only works when NOT in linux environment")
cmd.Flags().BoolVar(&iArgs.DryRun, "dry-run", false, "Dry run the install process") cmd.Flags().BoolVar(&iArgs.DryRun, "dry-run", false, "Dry run the install process")
// inherit args from `vela install` // inherit args from `vela install`
@ -86,6 +106,26 @@ func NewInstallCmd(c common.Args, ioStreams cmdutil.IOStreams) *cobra.Command {
return cmd return cmd
} }
// NewJoinCmd create join cmd
func NewJoinCmd() *cobra.Command {
jArgs := apis.JoinArgs{}
cmd := &cobra.Command{
Use: "join",
Short: "Join a worker node to a control plane, only works in linux environment",
Long: "Join a worker node to a control plane, only works in linux environment",
RunE: func(cmd *cobra.Command, args []string) error {
return joinCmd(jArgs)
},
}
cmd.Flags().StringVar(&jArgs.Token, "token", "", "Token for identify the cluster. Can be used to restart the control plane or register other node. If not set, random token will be generated")
cmd.Flags().StringVarP(&jArgs.Name, "worker-name", "n", "", "The name of worker node, default to hostname")
cmd.Flags().StringVar(&jArgs.MasterIP, "master-ip", "", "Set the public IP of the master node")
cmd.Flags().BoolVar(&jArgs.DryRun, "dry-run", false, "Dry run the join process")
_ = cmd.MarkFlagRequired("token")
_ = cmd.MarkFlagRequired("master-ip")
return cmd
}
// NewStatusCmd create status command // NewStatusCmd create status command
func NewStatusCmd() *cobra.Command { func NewStatusCmd() *cobra.Command {
cmd := &cobra.Command{ cmd := &cobra.Command{
@ -121,7 +161,8 @@ func NewUninstallCmd() *cobra.Command {
uArgs := apis.UninstallArgs{} uArgs := apis.UninstallArgs{}
cmd := &cobra.Command{ cmd := &cobra.Command{
Use: "uninstall", Use: "uninstall",
Short: "uninstall control plane", Short: "Uninstall control plane or detach worker node",
Long: "Remove master node if it's the only one, or remove this worker node from the cluster",
RunE: func(cmd *cobra.Command, args []string) error { RunE: func(cmd *cobra.Command, args []string) error {
return uninstallCmd(uArgs) return uninstallCmd(uArgs)
}, },

View File

@ -24,14 +24,20 @@ func tokenCmd(ctx context.Context, args apis.TokenArgs) error {
switch runtime.GOOS { switch runtime.GOOS {
case apis.GoosLinux: case apis.GoosLinux:
_, err := os.Stat(apis.K3sTokenPath) _, err := os.Stat(apis.K3sTokenPath)
if err == nil { if err != nil {
file, err := os.ReadFile("/var/lib/rancher/k3s/server/token") if os.IsNotExist(err) {
if err != nil { info("No token found, control plane not set up yet.")
return errors.Wrapf(err, "fail to read token file: %s", apis.K3sTokenPath) return nil
} }
fmt.Println(string(file)) return errors.Wrapf(err, "fail to stat token file: %s", apis.K3sTokenPath)
} }
info("No token found, control plane not set up yet.") file, err := os.ReadFile("/var/lib/rancher/k3s/server/token")
if err != nil {
return errors.Wrapf(err, "fail to read token file: %s", apis.K3sTokenPath)
}
fmt.Println(string(file))
return nil
default: default:
token, err := utils.GetTokenFromCluster(ctx, args.Name) token, err := utils.GetTokenFromCluster(ctx, args.Name)
if err != nil { if err != nil {
@ -131,9 +137,9 @@ func uninstallCmd(uArgs apis.UninstallArgs) error {
} }
err = h.Uninstall(uArgs.Name) err = h.Uninstall(uArgs.Name)
if err != nil { if err != nil {
return errors.Wrap(err, "Failed to uninstall KubeVela control plane") return errors.Wrap(err, "Failed to uninstall KubeVela control plane/worker node")
} }
info("Successfully uninstall KubeVela control plane!") info("Successfully uninstall KubeVela control plane/worker node")
return nil return nil
} }
@ -148,3 +154,11 @@ func statusCmd() {
vStatus := vela.GetStatus() vStatus := vela.GetStatus()
PrintVelaStatus(vStatus) PrintVelaStatus(vStatus)
} }
func joinCmd(args apis.JoinArgs) error {
if err := args.Validate(); err != nil {
return err
}
return h.Join(args)
}

View File

@ -18,20 +18,32 @@ func NewLoadBalancerCmd() *cobra.Command {
Use: "load-balancer", Use: "load-balancer",
Short: "Configure load balancer between nodes set up by VelaD", Short: "Configure load balancer between nodes set up by VelaD",
Long: "Configure load balancer between nodes set up by VelaD", Long: "Configure load balancer between nodes set up by VelaD",
PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
if runtime.GOOS != apis.GoosLinux {
return errors.New("Load balancer is only supported on linux")
}
return nil
},
} }
cmd.AddCommand( cmd.AddCommand(
NewLBInstallCmd(), NewLBInstallCmd(),
NewLBUninstallCmd(), NewLBUninstallCmd(),
NewLBWizardCmd(),
) )
return cmd return cmd
} }
// NewLBWizardCmd returns load-balancer wizard command
func NewLBWizardCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "wizard",
Short: "Wizard for load-balancer install command",
Long: "Wizard for load-balancer install command, run this on the node that you have run `velad install`. Or anywhere if you have set KUBECONFIG env",
RunE: func(cmd *cobra.Command, args []string) error {
err := utils.SetDefaultKubeConfigEnv()
if err != nil {
return errors.Wrap(err, "No KUBECONFIG env set and fail to get kubeconfig from default location, please set KUBECONFIG env")
}
return lb.Wizard()
},
}
return cmd
}
// NewLBInstallCmd returns load-balancer install command // NewLBInstallCmd returns load-balancer install command
func NewLBInstallCmd() *cobra.Command { func NewLBInstallCmd() *cobra.Command {
var LBArgs apis.LoadBalancerArgs var LBArgs apis.LoadBalancerArgs
@ -39,6 +51,13 @@ func NewLBInstallCmd() *cobra.Command {
Use: "install", Use: "install",
Short: "Setup load balancer between nodes set up by VelaD", Short: "Setup load balancer between nodes set up by VelaD",
Long: "Setup load balancer between nodes set up by VelaD", Long: "Setup load balancer between nodes set up by VelaD",
PreRunE: func(cmd *cobra.Command, args []string) error {
if runtime.GOOS != apis.GoosLinux {
return errors.New("Installing load balancer is only supported on linux")
}
return nil
},
Run: func(cmd *cobra.Command, args []string) { Run: func(cmd *cobra.Command, args []string) {
defer func() { defer func() {
err := utils.Cleanup() err := utils.Cleanup()
@ -54,12 +73,15 @@ func NewLBInstallCmd() *cobra.Command {
err := lb.ConfigureNginx(LBArgs) err := lb.ConfigureNginx(LBArgs)
if err != nil { if err != nil {
errf("Fail to setup load balancer (nginx): %v\n", err) errf("Fail to setup load balancer (nginx): %v\n", err)
os.Exit(1)
} }
info("Successfully setup load balancer!") info("Successfully setup load balancer!")
}, },
} }
cmd.Flags().StringSliceVar(&LBArgs.Hosts, "host", []string{}, "Host IPs of control plane node installed by velad, can be specified multiple or separate value by comma like: IP1,IP2") cmd.Flags().StringSliceVar(&LBArgs.Hosts, "host", []string{}, "Host IPs of control plane node installed by velad, can be specified multiple or separate value by comma like: IP1,IP2")
cmd.Flags().StringVarP(&LBArgs.Configuration, "conf", "c", "", "(Optional) Specify the nginx configuration file place, this file will be overwrite") cmd.Flags().StringVarP(&LBArgs.Configuration, "conf", "c", "", "(Optional) Specify the nginx configuration file place, this file will be overwrite")
cmd.Flags().IntVar(&LBArgs.PortHTTP, "http-port", 0, "Specify the ingress port for HTTP. See velad load-balancer get-port on master node to get the command ")
cmd.Flags().IntVar(&LBArgs.PortHTTPS, "https-port", 0, "Specify the ingress port for HTTPS. See velad load-balancer get-port on master node to get the command ")
return cmd return cmd
} }
@ -69,6 +91,12 @@ func NewLBUninstallCmd() *cobra.Command {
Use: "uninstall", Use: "uninstall",
Short: "Uninstall load balancer", Short: "Uninstall load balancer",
Long: "Uninstall load balancer installed by VelaD", Long: "Uninstall load balancer installed by VelaD",
PreRunE: func(cmd *cobra.Command, args []string) error {
if runtime.GOOS != apis.GoosLinux {
return errors.New("Uninstalling load balancer is only supported on linux")
}
return nil
},
Run: func(cmd *cobra.Command, args []string) { Run: func(cmd *cobra.Command, args []string) {
err := lb.UninstallNginx() err := lb.UninstallNginx()
if err != nil { if err != nil {

View File

@ -1,17 +1,17 @@
package loadbalancer package loadbalancer
import ( import (
"bytes"
"fmt" "fmt"
"io/ioutil"
"os" "os"
"os/exec" "os/exec"
"os/user" "os/user"
"regexp" "regexp"
"runtime" "runtime"
"text/template" "strings"
"time"
"github.com/pkg/errors" "github.com/pkg/errors"
g "github.com/tufanbarisyildirim/gonginx"
"github.com/oam-dev/velad/pkg/apis" "github.com/oam-dev/velad/pkg/apis"
"github.com/oam-dev/velad/pkg/resources" "github.com/oam-dev/velad/pkg/resources"
@ -78,27 +78,15 @@ func installNginx() error {
} }
func setNginxConf(args apis.LoadBalancerArgs) (string, error) { func setNginxConf(args apis.LoadBalancerArgs) (string, error) {
var conf string var conf strings.Builder
clause, err := getNginxStreamModClause() clause, err := getNginxStreamModClause()
if err != nil { if err != nil {
return "", err return "", err
} }
conf += clause conf.WriteString(clause)
tmpl, err := template.ParseFS(resources.Nginx, "static/nginx/nginx.conf.tmpl") other := getOther(args)
if err != nil { conf.WriteString(other)
return "", errors.Wrap(err, "parse tmpl") loc, err := writeNginxConf(conf.String(), args.Configuration)
}
buf := &bytes.Buffer{}
err = tmpl.ExecuteTemplate(buf, "nginx.conf.tmpl", args)
if err != nil {
return "", errors.Wrap(err, "execute template")
}
all, err := ioutil.ReadAll(buf)
if err != nil {
return "", errors.Wrap(err, "read template result")
}
conf += string(all)
loc, err := writeNginxConf(conf, args.Configuration)
if err != nil { if err != nil {
return "", errors.Wrap(err, "write nginx conf") return "", errors.Wrap(err, "write nginx conf")
} }
@ -106,14 +94,18 @@ func setNginxConf(args apis.LoadBalancerArgs) (string, error) {
} }
func startNginx(conf string) error { func startNginx(conf string) error {
info("Starting nginx") info("Starting/Restarting nginx")
cmd := exec.Command("nginx", "-s", "quit") cmd := exec.Command("pkill", "-9", "nginx")
_ = cmd.Run() // pkill will return error if nginx is not running, so we ignore it
output, _ := cmd.CombinedOutput()
utils.InfoBytes(output)
// wait for nginx to stop
time.Sleep(1 * time.Second)
// #nosec // #nosec
reloadCmd := exec.Command("nginx", "-c", conf) reloadCmd := exec.Command("nginx", "-c", conf)
output, err := reloadCmd.CombinedOutput() output, err := reloadCmd.CombinedOutput()
utils.InfoBytes(output) utils.InfoBytes(output)
return err return errors.Wrap(err, "fail to start nginx")
} }
func writeNginxConf(conf string, confLocation string) (string, error) { func writeNginxConf(conf string, confLocation string) (string, error) {
@ -154,6 +146,107 @@ func getNginxStreamModClause() (string, error) {
return "", errors.New("Nginx stream mod lib not found") return "", errors.New("Nginx stream mod lib not found")
} }
func getOther(args apis.LoadBalancerArgs) string {
hosts := args.Hosts
type streamPort struct {
from int
to int
}
streamBlockMap := map[string]streamPort{
"rancher_servers_k3s": {from: 6443, to: 6443},
}
if args.PortHTTP != 0 {
streamBlockMap["ingress_http"] = streamPort{from: args.PortHTTP, to: 80}
}
if args.PortHTTPS != 0 {
streamBlockMap["ingress_https"] = streamPort{from: args.PortHTTPS, to: 443}
}
streamBlock := g.Block{
Directives: []g.IDirective{},
}
serversDis := func(port streamPort) []g.IDirective {
ds := make([]g.IDirective, 0)
for _, h := range hosts {
ds = append(ds, &g.Directive{
Name: "server",
Parameters: []string{fmt.Sprintf("%s:%d", h, port.from)},
})
}
return ds
}
for name, port := range streamBlockMap {
sds := serversDis(port)
upstreamBlock := &g.Directive{
Name: "upstream",
Block: &g.Block{
Directives: func() []g.IDirective {
return append(sds, &g.Directive{
Name: "least_conn",
})
}(),
},
Parameters: []string{name},
}
serverBlock := &g.Directive{
Name: "server",
Block: &g.Block{
Directives: []g.IDirective{
&g.Directive{
Name: "listen",
Parameters: []string{fmt.Sprintf("%d", port.to)},
},
&g.Directive{
Name: "proxy_pass",
Parameters: []string{name},
},
},
},
}
streamBlock.Directives = append(streamBlock.Directives, upstreamBlock, serverBlock)
}
block := g.Block{
Directives: []g.IDirective{
&g.Directive{
Name: "user",
Parameters: []string{"nginx"},
},
&g.Directive{
Name: "worker_processes",
Parameters: []string{"auto"},
},
&g.Directive{
Name: "error_log",
Parameters: []string{"/var/log/nginx/error.log"},
},
&g.Directive{
Name: "pid",
Parameters: []string{"/run/nginx.pid"},
},
&g.Directive{
Name: "events",
Block: &g.Block{
Directives: []g.IDirective{
&g.Directive{
Name: "worker_connections",
Parameters: []string{"1024"},
},
},
},
},
&g.Directive{
Name: "stream",
Block: &streamBlock,
},
},
}
cfg := g.Config{
Block: &block,
FilePath: "-",
}
return g.DumpConfig(&cfg, &g.Style{Indent: 2})
}
func getNginxDefaultConfLoc() (string, error) { func getNginxDefaultConfLoc() (string, error) {
cmd := exec.Command("nginx", "-t") cmd := exec.Command("nginx", "-t")
output, err := cmd.CombinedOutput() output, err := cmd.CombinedOutput()

51
pkg/loadbalancer/port.go Normal file
View File

@ -0,0 +1,51 @@
package loadbalancer
import (
"context"
"strings"
v1 "k8s.io/api/core/v1"
"sigs.k8s.io/controller-runtime/pkg/client"
"github.com/oam-dev/velad/pkg/utils"
)
// Wizard for load balancer installation
func Wizard() error {
cli, err := utils.GetClient()
if err != nil {
return err
}
svc := v1.Service{}
err = cli.Get(context.Background(), client.ObjectKey{
Namespace: "kube-system",
Name: "traefik",
}, &svc)
if err != nil {
return err
}
portHTTP := 0
portHTTPS := 0
for _, port := range svc.Spec.Ports {
switch port.Port {
case 80:
portHTTP = int(port.NodePort)
case 443:
portHTTPS = int(port.NodePort)
}
}
if portHTTP == 0 {
utils.Errf("http port is not found\n")
}
if portHTTPS == 0 {
utils.Errf("https port is not found\n")
}
hosts := []string{}
for _, i := range svc.Status.LoadBalancer.Ingress {
// todo(chivalryq) support hostname
hosts = append(hosts, i.IP)
}
utils.Infof("To setup load-balancer, run the following command on node acts as load-balancer:\n")
utils.Infof(" velad load-balancer install --http-port %d --https-port %d --host=%s\n", portHTTP, portHTTPS, strings.Join(hosts, ","))
return nil
}

View File

@ -10,7 +10,7 @@ var (
// K3sImageDir is the directory to save the k3s air-gap image // K3sImageDir is the directory to save the k3s air-gap image
K3sImageDir = "/var/lib/rancher/k3s/agent/images/" K3sImageDir = "/var/lib/rancher/k3s/agent/images/"
// K3sImageLocation is where to save k3s air-gap images // K3sImageLocation is where to save k3s air-gap images
K3sImageLocation = "/var/lib/rancher/k3s/agent/images/k3s-airgap-images-amd64.tar.gz" K3sImageLocation = "/var/lib/rancher/k3s/agent/images/k3s-airgap-images.tar.gz"
) )
var ( var (

View File

@ -1,23 +0,0 @@
# load_module /usr/lib64/nginx/modules/ngx_stream_module.so;
# load_module /usr/lib/nginx/modules/ngx_stream_module.so;
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;
events {
worker_connections 1024;
}
stream {
upstream rancher_servers_k3s {
least_conn;
{{ range .Hosts }}
server {{ . }}:6443 max_fails=3 fail_timeout=5s;
{{ end }}
}
server {
listen 6443;
proxy_pass rancher_servers_k3s;
}
}

View File

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

@ -1,24 +0,0 @@
apiVersion: v2
name: vela-core
description: A Helm chart for KubeVela core
# 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: v1.5.0-alpha.3
# 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: v1.5.0-alpha.3
home: https://kubevela.io
icon: https://kubevela.io/img/logo.svg

View File

@ -1,191 +0,0 @@
<div style="text-align: center">
<p align="center">
<img src="https://raw.githubusercontent.com/kubevela/kubevela.io/main/docs/resources/KubeVela-03.png">
<br><br>
<i>Make shipping applications more enjoyable.</i>
</p>
</div>
![Build status](https://github.com/kubevela/kubevela/workflows/E2E/badge.svg)
[![Go Report Card](https://goreportcard.com/badge/github.com/kubevela/kubevela)](https://goreportcard.com/report/github.com/kubevela/kubevela)
![Docker Pulls](https://img.shields.io/docker/pulls/oamdev/vela-core)
[![codecov](https://codecov.io/gh/kubevela/kubevela/branch/master/graph/badge.svg)](https://codecov.io/gh/kubevela/kubevela)
[![LICENSE](https://img.shields.io/github/license/kubevela/kubevela.svg?style=flat-square)](/LICENSE)
[![Releases](https://img.shields.io/github/release/kubevela/kubevela/all.svg?style=flat-square)](https://github.com/kubevela/kubevela/releases)
[![TODOs](https://img.shields.io/endpoint?url=https://api.tickgit.com/badge?repo=github.com/kubevela/kubevela)](https://www.tickgit.com/browse?repo=github.com/oam-dev/kubevela)
[![Twitter](https://img.shields.io/twitter/url?style=social&url=https%3A%2F%2Ftwitter.com%2Foam_dev)](https://twitter.com/oam_dev)
[![Artifact HUB](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/kubevela)](https://artifacthub.io/packages/search?repo=kubevela)
[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/4602/badge)](https://bestpractices.coreinfrastructure.org/projects/4602)
# KubeVela helm chart
KubeVela is a modern application platform that makes it easier and faster to deliver and manage applications across hybrid,
multi-cloud environments. At the mean time, it is highly extensible and programmable, which can adapt to your needs as they grow.
## TL;DR
```bash
helm repo add kubevela https://charts.kubevela.net/core
helm repo update
helm install --create-namespace -n vela-system kubevela kubevela/vela-core --wait
```
## Prerequisites
- Kubernetes >= v1.19 && < v1.22
## Parameters
### KubeVela core parameters
| Name | Description | Value |
| ----------------------------- | --------------------------------------------------------------------------------------------- | --------- |
| `systemDefinitionNamespace` | System definition namespace, if unspecified, will use built-in variable `.Release.Namespace`. | `nil` |
| `applicationRevisionLimit` | Application revision limit | `10` |
| `definitionRevisionLimit` | Definition revision limit | `20` |
| `concurrentReconciles` | concurrentReconciles is the concurrent reconcile number of the controller | `4` |
| `controllerArgs.reSyncPeriod` | The period for resync the applications | `5m` |
| `OAMSpecVer` | OAMSpecVer is the oam spec version controller want to setup | `v0.3` |
| `disableCaps` | Disable capability | `rollout` |
| `enableFluxcdAddon` | Whether to enable fluxcd addon | `false` |
| `dependCheckWait` | dependCheckWait is the time to wait for ApplicationConfiguration's dependent-resource ready | `30s` |
### KubeVela workflow parameters
| Name | Description | Value |
| -------------------------------------- | ------------------------------------------------------ | ------- |
| `workflow.enableSuspendOnFailure` | Enable suspend on workflow failure | `false` |
| `workflow.backoff.maxTime.waitState` | The max backoff time of workflow in a wait condition | `60` |
| `workflow.backoff.maxTime.failedState` | The max backoff time of workflow in a failed condition | `300` |
| `workflow.step.errorRetryTimes` | The max retry times of a failed workflow step | `10` |
### KubeVela controller parameters
| Name | Description | Value |
| --------------------------- | ------------------------------------ | ------------------ |
| `replicaCount` | KubeVela controller replica count | `1` |
| `imageRegistry` | Image registry | `""` |
| `image.repository` | Image repository | `oamdev/vela-core` |
| `image.tag` | Image tag | `latest` |
| `image.pullPolicy` | Image pull policy | `Always` |
| `resources.limits.cpu` | KubeVela controller's cpu limit | `500m` |
| `resources.limits.memory` | KubeVela controller's memory limit | `1Gi` |
| `resources.requests.cpu` | KubeVela controller's cpu request | `50m` |
| `resources.requests.memory` | KubeVela controller's memory request | `20Mi` |
| `webhookService.type` | KubeVela webhook service type | `ClusterIP` |
| `webhookService.port` | KubeVela webhook service port | `9443` |
| `healthCheck.port` | KubeVela health check port | `9440` |
### KubeVela controller optimization parameters
| Name | Description | Value |
| ------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------- |
| `optimize.cachedGvks` | Optimize types of resources to be cached. | `""` |
| `optimize.resourceTrackerListOp` | Optimize ResourceTracker List Op by adding index. | `true` |
| `optimize.controllerReconcileLoopReduction` | Optimize ApplicationController reconcile by reducing the number of loops to reconcile application. | `false` |
| `optimize.markWithProb` | Optimize ResourceTracker GC by only run mark with probability. Side effect: outdated ResourceTracker might not be able to be removed immediately. | `0.1` |
| `optimize.disableComponentRevision` | Optimize componentRevision by disabling the creation and gc | `false` |
| `optimize.disableApplicationRevision` | Optimize ApplicationRevision by disabling the creation and gc. | `false` |
| `optimize.disableWorkflowRecorder` | Optimize workflow recorder by disabling the creation and gc. | `false` |
| `optimize.enableInMemoryWorkflowContext` | Optimize workflow by use in-memory context. | `false` |
| `optimize.disableResourceApplyDoubleCheck` | Optimize workflow by ignoring resource double check after apply. | `false` |
| `optimize.enableResourceTrackerDeleteOnlyTrigger` | Optimize resourcetracker by only trigger reconcile when resourcetracker is deleted. | `true` |
| `featureGates.enableLegacyComponentRevision` | if disabled, only component with rollout trait will create component revisions | `false` |
### MultiCluster parameters
| Name | Description | Value |
| ----------------------------------------------------------- | ----------------------------------------------- | -------------------------------- |
| `multicluster.enabled` | Whether to enable multi-cluster | `true` |
| `multicluster.metrics.enabled` | Whether to enable multi-cluster metrics collect | `false` |
| `multicluster.clusterGateway.replicaCount` | ClusterGateway replica count | `1` |
| `multicluster.clusterGateway.port` | ClusterGateway port | `9443` |
| `multicluster.clusterGateway.image.repository` | ClusterGateway image repository | `oamdev/cluster-gateway` |
| `multicluster.clusterGateway.image.tag` | ClusterGateway image tag | `v1.4.0` |
| `multicluster.clusterGateway.image.pullPolicy` | ClusterGateway image pull policy | `IfNotPresent` |
| `multicluster.clusterGateway.resources.limits.cpu` | ClusterGateway cpu limit | `100m` |
| `multicluster.clusterGateway.resources.limits.memory` | ClusterGateway memory limit | `200Mi` |
| `multicluster.clusterGateway.secureTLS.enabled` | Whether to enable secure TLS | `true` |
| `multicluster.clusterGateway.secureTLS.certPath` | Path to the certificate file | `/etc/k8s-cluster-gateway-certs` |
| `multicluster.clusterGateway.secureTLS.certManager.enabled` | Whether to enable cert-manager | `false` |
### Test parameters
| Name | Description | Value |
| --------------------- | ------------------- | -------------------- |
| `test.app.repository` | Test app repository | `oamdev/hello-world` |
| `test.app.tag` | Test app tag | `v1` |
| `test.k8s.repository` | Test k8s repository | `oamdev/alpine-k8s` |
| `test.k8s.tag` | Test k8s tag | `1.18.2` |
### Common parameters
| Name | Description | Value |
| ----------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------- |
| `imagePullSecrets` | Image pull secrets | `[]` |
| `nameOverride` | Override name | `""` |
| `fullnameOverride` | Fullname override | `""` |
| `serviceAccount.create` | Specifies whether a service account should be created | `true` |
| `serviceAccount.annotations` | Annotations to add to the service account | `{}` |
| `serviceAccount.name` | The name of the service account to use. If not set and create is true, a name is generated using the fullname template | `nil` |
| `nodeSelector` | Node selector | `{}` |
| `tolerations` | Tolerations | `[]` |
| `affinity` | Affinity | `{}` |
| `rbac.create` | Specifies whether a RBAC role should be created | `true` |
| `logDebug` | Enable debug logs for development purpose | `false` |
| `logFilePath` | If non-empty, write log files in this path | `""` |
| `logFileMaxSize` | Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. | `1024` |
| `kubeClient.qps` | The qps for reconcile clients, default is 50 | `50` |
| `kubeClient.burst` | The burst for reconcile clients, default is 100 | `100` |
| `authentication.enabled` | Enable authentication for application | `false` |
| `authentication.withUser` | Application authentication will impersonate as the request User | `false` |
| `authentication.defaultUser` | Application authentication will impersonate as the User if no user provided in Application | `kubevela:vela-core` |
| `authentication.groupPattern` | Application authentication will impersonate as the request Group that matches the pattern | `kubevela:*` |
## Uninstallation
### Vela CLI
To uninstall KubeVela, you can just run the following command by vela CLI:
```shell
vela uninstall --force
```
### Helm CLI
**Notice**: You must disable all the addons before uninstallation, this is a script for convenience.
```shell
#! /bin/sh
addon=$(vela addon list|grep enabled|awk {'print $1'})
fluxcd=false
for var in ${addon[*]}
do
if [ $var == "fluxcd" ]; then
fluxcd=true
continue
else
vela addon disable $var
fi
done
if [ $fluxcd ]; then
vela addon disable fluxcd
fi
```
To uninstall the KubeVela helm release:
```shell
$ helm uninstall -n vela-system kubevela
```
Finally, this command will remove all the Kubernetes resources associated with KubeVela and remove this chart release.

View File

@ -1,653 +0,0 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.6.2
name: componentdefinitions.core.oam.dev
spec:
group: core.oam.dev
names:
categories:
- oam
kind: ComponentDefinition
listKind: ComponentDefinitionList
plural: componentdefinitions
shortNames:
- comp
singular: componentdefinition
scope: Namespaced
versions:
- additionalPrinterColumns:
- jsonPath: .spec.workload.definition.kind
name: WORKLOAD-KIND
type: string
- jsonPath: .metadata.annotations.definition\.oam\.dev/description
name: DESCRIPTION
type: string
name: v1alpha2
schema:
openAPIV3Schema:
description: ComponentDefinition is the Schema for the componentdefinitions
API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: ComponentDefinitionSpec defines the desired state of ComponentDefinition
properties:
childResourceKinds:
description: ChildResourceKinds are the list of GVK of the child resources
this workload generates
items:
description: A ChildResourceKind defines a child Kubernetes resource
kind with a selector
properties:
apiVersion:
description: APIVersion of the child resource
type: string
kind:
description: Kind of the child resource
type: string
selector:
additionalProperties:
type: string
description: Selector to select the child resources that the
workload wants to expose to traits
type: object
required:
- apiVersion
- kind
type: object
type: array
extension:
description: Extension is used for extension needs by OAM platform
builders
type: object
x-kubernetes-preserve-unknown-fields: true
podSpecPath:
description: PodSpecPath indicates where/if this workload has K8s
podSpec field if one workload has podSpec, trait can do lot's of
assumption such as port, env, volume fields.
type: string
revisionLabel:
description: RevisionLabel indicates which label for underlying resources(e.g.
pods) of this workload can be used by trait to create resource selectors(e.g.
label selector for pods).
type: string
schematic:
description: Schematic defines the data format and template of the
encapsulation of the workload
properties:
cue:
description: CUE defines the encapsulation in CUE format
properties:
template:
description: Template defines the abstraction template data
of the capability, it will replace the old CUE template
in extension field. Template is a required field if CUE
is defined in Capability Definition.
type: string
required:
- template
type: object
helm:
description: A Helm represents resources used by a Helm module
properties:
release:
description: Release records a Helm release used by a Helm
module workload.
type: object
x-kubernetes-preserve-unknown-fields: true
repository:
description: HelmRelease records a Helm repository used by
a Helm module workload.
type: object
x-kubernetes-preserve-unknown-fields: true
required:
- release
- repository
type: object
kube:
description: Kube defines the encapsulation in raw Kubernetes
resource format
properties:
parameters:
description: Parameters defines configurable parameters
items:
description: A KubeParameter defines a configurable parameter
of a component.
properties:
description:
description: Description of this parameter.
type: string
fieldPaths:
description: "FieldPaths specifies an array of fields
within this workload that will be overwritten by the
value of this parameter. \tAll fields must be of the
same type. Fields are specified as JSON field paths
without a leading dot, for example 'spec.replicas'."
items:
type: string
type: array
name:
description: Name of this parameter
type: string
required:
default: false
description: Required specifies whether or not a value
for this parameter must be supplied when authoring
an Application.
type: boolean
type:
description: 'ValueType indicates the type of the parameter
value, and only supports basic data types: string,
number, boolean.'
enum:
- string
- number
- boolean
type: string
required:
- fieldPaths
- name
- type
type: object
type: array
template:
description: Template defines the raw Kubernetes resource
type: object
x-kubernetes-preserve-unknown-fields: true
required:
- template
type: object
terraform:
description: Terraform is the struct to describe cloud resources
managed by Hashicorp Terraform
properties:
configuration:
description: Configuration is Terraform Configuration
type: string
customRegion:
description: Region is cloud provider's region. It will override
the region in the region field of ProviderReference
type: string
deleteResource:
default: true
description: DeleteResource will determine whether provisioned
cloud resources will be deleted when CR is deleted
type: boolean
path:
description: Path is the sub-directory of remote git repository.
It's valid when remote is set
type: string
providerRef:
description: ProviderReference specifies the reference to
Provider
properties:
name:
description: Name of the referenced object.
type: string
namespace:
default: default
description: Namespace of the referenced object.
type: string
required:
- name
type: object
type:
default: hcl
description: Type specifies which Terraform configuration
it is, HCL or JSON syntax
enum:
- hcl
- json
- remote
type: string
writeConnectionSecretToRef:
description: WriteConnectionSecretToReference specifies the
namespace and name of a Secret to which any connection details
for this managed resource should be written. Connection
details frequently include the endpoint, username, and password
required to connect to the managed resource.
properties:
name:
description: Name of the secret.
type: string
namespace:
description: Namespace of the secret.
type: string
required:
- name
type: object
required:
- configuration
type: object
type: object
status:
description: Status defines the custom health policy and status message
for workload
properties:
customStatus:
description: CustomStatus defines the custom status message that
could display to user
type: string
healthPolicy:
description: HealthPolicy defines the health check policy for
the abstraction
type: string
type: object
workload:
description: Workload is a workload type descriptor
properties:
definition:
description: Definition mutually exclusive to workload.type, a
embedded WorkloadDefinition
properties:
apiVersion:
type: string
kind:
type: string
required:
- apiVersion
- kind
type: object
type:
description: Type ref to a WorkloadDefinition via name
type: string
type: object
required:
- workload
type: object
status:
description: ComponentDefinitionStatus is the status of ComponentDefinition
properties:
conditions:
description: Conditions of the resource.
items:
description: A Condition that may apply to a resource.
properties:
lastTransitionTime:
description: LastTransitionTime is the last time this condition
transitioned from one status to another.
format: date-time
type: string
message:
description: A Message containing details about this condition's
last transition from one status to another, if any.
type: string
reason:
description: A Reason for this condition's last transition from
one status to another.
type: string
status:
description: Status of this condition; is it currently True,
False, or Unknown?
type: string
type:
description: Type of this condition. At most one of each condition
type may apply to a resource at any point in time.
type: string
required:
- lastTransitionTime
- reason
- status
- type
type: object
type: array
configMapRef:
description: ConfigMapRef refer to a ConfigMap which contains OpenAPI
V3 JSON schema of Component parameters.
type: string
latestRevision:
description: LatestRevision of the component definition
properties:
name:
type: string
revision:
format: int64
type: integer
revisionHash:
description: RevisionHash record the hash value of the spec of
ApplicationRevision object.
type: string
required:
- name
- revision
type: object
type: object
type: object
served: true
storage: false
subresources:
status: {}
- additionalPrinterColumns:
- jsonPath: .spec.workload.definition.kind
name: WORKLOAD-KIND
type: string
- jsonPath: .metadata.annotations.definition\.oam\.dev/description
name: DESCRIPTION
type: string
name: v1beta1
schema:
openAPIV3Schema:
description: ComponentDefinition is the Schema for the componentdefinitions
API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: ComponentDefinitionSpec defines the desired state of ComponentDefinition
properties:
childResourceKinds:
description: ChildResourceKinds are the list of GVK of the child resources
this workload generates
items:
description: A ChildResourceKind defines a child Kubernetes resource
kind with a selector
properties:
apiVersion:
description: APIVersion of the child resource
type: string
kind:
description: Kind of the child resource
type: string
selector:
additionalProperties:
type: string
description: Selector to select the child resources that the
workload wants to expose to traits
type: object
required:
- apiVersion
- kind
type: object
type: array
extension:
description: Extension is used for extension needs by OAM platform
builders
type: object
x-kubernetes-preserve-unknown-fields: true
podSpecPath:
description: PodSpecPath indicates where/if this workload has K8s
podSpec field if one workload has podSpec, trait can do lot's of
assumption such as port, env, volume fields.
type: string
revisionLabel:
description: RevisionLabel indicates which label for underlying resources(e.g.
pods) of this workload can be used by trait to create resource selectors(e.g.
label selector for pods).
type: string
schematic:
description: Schematic defines the data format and template of the
encapsulation of the workload
properties:
cue:
description: CUE defines the encapsulation in CUE format
properties:
template:
description: Template defines the abstraction template data
of the capability, it will replace the old CUE template
in extension field. Template is a required field if CUE
is defined in Capability Definition.
type: string
required:
- template
type: object
helm:
description: A Helm represents resources used by a Helm module
properties:
release:
description: Release records a Helm release used by a Helm
module workload.
type: object
x-kubernetes-preserve-unknown-fields: true
repository:
description: HelmRelease records a Helm repository used by
a Helm module workload.
type: object
x-kubernetes-preserve-unknown-fields: true
required:
- release
- repository
type: object
kube:
description: Kube defines the encapsulation in raw Kubernetes
resource format
properties:
parameters:
description: Parameters defines configurable parameters
items:
description: A KubeParameter defines a configurable parameter
of a component.
properties:
description:
description: Description of this parameter.
type: string
fieldPaths:
description: "FieldPaths specifies an array of fields
within this workload that will be overwritten by the
value of this parameter. \tAll fields must be of the
same type. Fields are specified as JSON field paths
without a leading dot, for example 'spec.replicas'."
items:
type: string
type: array
name:
description: Name of this parameter
type: string
required:
default: false
description: Required specifies whether or not a value
for this parameter must be supplied when authoring
an Application.
type: boolean
type:
description: 'ValueType indicates the type of the parameter
value, and only supports basic data types: string,
number, boolean.'
enum:
- string
- number
- boolean
type: string
required:
- fieldPaths
- name
- type
type: object
type: array
template:
description: Template defines the raw Kubernetes resource
type: object
x-kubernetes-preserve-unknown-fields: true
required:
- template
type: object
terraform:
description: Terraform is the struct to describe cloud resources
managed by Hashicorp Terraform
properties:
configuration:
description: Configuration is Terraform Configuration
type: string
customRegion:
description: Region is cloud provider's region. It will override
the region in the region field of ProviderReference
type: string
deleteResource:
default: true
description: DeleteResource will determine whether provisioned
cloud resources will be deleted when CR is deleted
type: boolean
path:
description: Path is the sub-directory of remote git repository.
It's valid when remote is set
type: string
providerRef:
description: ProviderReference specifies the reference to
Provider
properties:
name:
description: Name of the referenced object.
type: string
namespace:
default: default
description: Namespace of the referenced object.
type: string
required:
- name
type: object
type:
default: hcl
description: Type specifies which Terraform configuration
it is, HCL or JSON syntax
enum:
- hcl
- json
- remote
type: string
writeConnectionSecretToRef:
description: WriteConnectionSecretToReference specifies the
namespace and name of a Secret to which any connection details
for this managed resource should be written. Connection
details frequently include the endpoint, username, and password
required to connect to the managed resource.
properties:
name:
description: Name of the secret.
type: string
namespace:
description: Namespace of the secret.
type: string
required:
- name
type: object
required:
- configuration
type: object
type: object
status:
description: Status defines the custom health policy and status message
for workload
properties:
customStatus:
description: CustomStatus defines the custom status message that
could display to user
type: string
healthPolicy:
description: HealthPolicy defines the health check policy for
the abstraction
type: string
type: object
workload:
description: Workload is a workload type descriptor
properties:
definition:
description: Definition mutually exclusive to workload.type, a
embedded WorkloadDefinition
properties:
apiVersion:
type: string
kind:
type: string
required:
- apiVersion
- kind
type: object
type:
description: Type ref to a WorkloadDefinition via name
type: string
type: object
required:
- workload
type: object
status:
description: ComponentDefinitionStatus is the status of ComponentDefinition
properties:
conditions:
description: Conditions of the resource.
items:
description: A Condition that may apply to a resource.
properties:
lastTransitionTime:
description: LastTransitionTime is the last time this condition
transitioned from one status to another.
format: date-time
type: string
message:
description: A Message containing details about this condition's
last transition from one status to another, if any.
type: string
reason:
description: A Reason for this condition's last transition from
one status to another.
type: string
status:
description: Status of this condition; is it currently True,
False, or Unknown?
type: string
type:
description: Type of this condition. At most one of each condition
type may apply to a resource at any point in time.
type: string
required:
- lastTransitionTime
- reason
- status
- type
type: object
type: array
configMapRef:
description: ConfigMapRef refer to a ConfigMap which contains OpenAPI
V3 JSON schema of Component parameters.
type: string
latestRevision:
description: LatestRevision of the component definition
properties:
name:
type: string
revision:
format: int64
type: integer
revisionHash:
description: RevisionHash record the hash value of the spec of
ApplicationRevision object.
type: string
required:
- name
- revision
type: object
type: object
type: object
served: true
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []

View File

@ -1,319 +0,0 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.6.2
name: envbindings.core.oam.dev
spec:
group: core.oam.dev
names:
categories:
- oam
kind: EnvBinding
listKind: EnvBindingList
plural: envbindings
shortNames:
- envbind
singular: envbinding
scope: Namespaced
versions:
- additionalPrinterColumns:
- jsonPath: .spec.engine
name: ENGINE
type: string
- jsonPath: .status.phase
name: PHASE
type: string
- jsonPath: .metadata.creationTimestamp
name: AGE
type: date
name: v1alpha1
schema:
openAPIV3Schema:
description: EnvBinding is the Schema for the EnvBinding 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: A EnvBindingSpec defines the desired state of a EnvBinding.
properties:
appTemplate:
description: AppTemplate indicates the application template.
type: object
x-kubernetes-embedded-resource: true
x-kubernetes-preserve-unknown-fields: true
engine:
description: ClusterManagementEngine represents a multi-cluster management
solution
type: string
envs:
items:
description: EnvConfig is the configuration for different environments.
properties:
name:
type: string
patch:
description: EnvPatch specify the parameter configuration for
different environments
properties:
components:
items:
description: ApplicationComponent describe the component
of application
properties:
dependsOn:
items:
type: string
type: array
externalRevision:
description: ExternalRevision specified the component
revisionName
type: string
inputs:
description: StepInputs defines variable input of
WorkflowStep
items:
properties:
from:
type: string
parameterKey:
type: string
required:
- from
- parameterKey
type: object
type: array
name:
type: string
outputs:
description: StepOutputs defines output variable of
WorkflowStep
items:
properties:
name:
type: string
valueFrom:
type: string
required:
- name
- valueFrom
type: object
type: array
properties:
type: object
x-kubernetes-preserve-unknown-fields: true
scopes:
additionalProperties:
type: string
description: scopes in ApplicationComponent defines
the component-level scopes the format is <scope-type:scope-instance-name>
pairs, the key represents type of `ScopeDefinition`
while the value represent the name of scope instance.
type: object
x-kubernetes-preserve-unknown-fields: true
traits:
description: Traits define the trait of one component,
the type must be array to keep the order.
items:
description: ApplicationTrait defines the trait
of application
properties:
properties:
type: object
x-kubernetes-preserve-unknown-fields: true
type:
type: string
required:
- type
type: object
type: array
type:
type: string
required:
- name
- type
type: object
type: array
required:
- components
type: object
placement:
description: EnvPlacement defines the placement rules for an
app.
properties:
clusterSelector:
description: ClusterSelector defines the rules to select
a Cluster resource. Either name or labels is needed.
properties:
labels:
additionalProperties:
type: string
description: Labels defines the label selector to select
the cluster.
type: object
name:
description: Name is the name of the cluster.
type: string
type: object
namespaceSelector:
description: NamespaceSelector defines the rules to select
a Namespace resource. Either name or labels is needed.
properties:
labels:
additionalProperties:
type: string
description: Labels defines the label selector to select
the namespace.
type: object
name:
description: Name is the name of the namespace.
type: string
type: object
type: object
selector:
description: EnvSelector defines which components should this
env contains
properties:
components:
items:
type: string
type: array
type: object
required:
- name
- patch
type: object
type: array
outputResourcesTo:
description: OutputResourcesTo specifies the namespace and name of
a ConfigMap which store the resources rendered after differentiated
configuration
properties:
name:
description: Name of the secret.
type: string
namespace:
description: Namespace of the secret.
type: string
required:
- name
type: object
required:
- appTemplate
- envs
type: object
status:
description: A EnvBindingStatus is the status of EnvBinding
properties:
clusterDecisions:
items:
description: ClusterDecision recorded the mapping of environment
and cluster
properties:
cluster:
type: string
env:
type: string
namespace:
type: string
required:
- env
type: object
type: array
conditions:
description: Conditions of the resource.
items:
description: A Condition that may apply to a resource.
properties:
lastTransitionTime:
description: LastTransitionTime is the last time this condition
transitioned from one status to another.
format: date-time
type: string
message:
description: A Message containing details about this condition's
last transition from one status to another, if any.
type: string
reason:
description: A Reason for this condition's last transition from
one status to another.
type: string
status:
description: Status of this condition; is it currently True,
False, or Unknown?
type: string
type:
description: Type of this condition. At most one of each condition
type may apply to a resource at any point in time.
type: string
required:
- lastTransitionTime
- reason
- status
- type
type: object
type: array
phase:
description: EnvBindingPhase is a label for the condition of a EnvBinding
at the current time
type: string
resourceTracker:
description: ResourceTracker record the status of the ResourceTracker
properties:
apiVersion:
description: API version of the referent.
type: string
fieldPath:
description: 'If referring to a piece of an object instead of
an entire object, this string should contain a valid JSON/Go
field access statement, such as desiredState.manifest.containers[2].
For example, if the object reference is to a container within
a pod, this would take on a value like: "spec.containers{name}"
(where "name" refers to the name of the container that triggered
the event) or if no container name is specified "spec.containers[2]"
(container with index 2 in this pod). This syntax is chosen
only to have some well-defined way of referencing a part of
an object. TODO: this design is not final and this field is
subject to change in the future.'
type: string
kind:
description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
type: string
namespace:
description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/'
type: string
resourceVersion:
description: 'Specific resourceVersion to which this reference
is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency'
type: string
uid:
description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
type: string
type: object
type: object
type: object
served: true
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []

View File

@ -1,590 +0,0 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.6.2
name: healthscopes.core.oam.dev
spec:
group: core.oam.dev
names:
categories:
- 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:
appReferences:
description: AppRefs records references of applications' components
items:
description: AppReference records references of an application's
components
properties:
appName:
type: string
compReferences:
items:
description: CompReference records references of a component's
resources
properties:
compName:
type: string
traits:
items:
description: 'ObjectReference contains enough information
to let you inspect or modify the referred object.
--- New uses of this type are discouraged because
of difficulty describing its usage when embedded in
APIs. 1. Ignored fields. It includes many fields
which are not generally honored. For instance, ResourceVersion
and FieldPath are both very rarely valid in actual
usage. 2. Invalid usage help. It is impossible to
add specific help for individual usage. In most embedded
usages, there are particular restrictions like,
"must refer only to types A and B" or "UID not honored"
or "name must be restricted". Those cannot be
well described when embedded. 3. Inconsistent validation. Because
the usages are different, the validation rules are
different by usage, which makes it hard for users
to predict what will happen. 4. The fields are both
imprecise and overly precise. Kind is not a precise
mapping to a URL. This can produce ambiguity during
interpretation and require a REST mapping. In most
cases, the dependency is on the group,resource tuple and
the version of the actual struct is irrelevant. 5.
We cannot easily change it. Because this type is
embedded in many locations, updates to this type will
affect numerous schemas. Don''t make new APIs embed
an underspecified API type they do not control. Instead
of using this type, create a locally provided and
used type that is well-focused on your reference.
For example, ServiceReferences for admission registration:
https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533
.'
properties:
apiVersion:
description: API version of the referent.
type: string
fieldPath:
description: 'If referring to a piece of an object
instead of an entire object, this string should
contain a valid JSON/Go field access statement,
such as desiredState.manifest.containers[2]. For
example, if the object reference is to a container
within a pod, this would take on a value like:
"spec.containers{name}" (where "name" refers to
the name of the container that triggered the event)
or if no container name is specified "spec.containers[2]"
(container with index 2 in this pod). This syntax
is chosen only to have some well-defined way of
referencing a part of an object. TODO: this design
is not final and this field is subject to change
in the future.'
type: string
kind:
description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
type: string
namespace:
description: 'Namespace of the referent. More info:
https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/'
type: string
resourceVersion:
description: 'Specific resourceVersion to which
this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency'
type: string
uid:
description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
type: string
type: object
type: array
workload:
description: 'ObjectReference contains enough information
to let you inspect or modify the referred object. ---
New uses of this type are discouraged because of difficulty
describing its usage when embedded in APIs. 1. Ignored
fields. It includes many fields which are not generally
honored. For instance, ResourceVersion and FieldPath
are both very rarely valid in actual usage. 2. Invalid
usage help. It is impossible to add specific help for
individual usage. In most embedded usages, there are
particular restrictions like, "must refer only to
types A and B" or "UID not honored" or "name must be
restricted". Those cannot be well described when
embedded. 3. Inconsistent validation. Because the
usages are different, the validation rules are different
by usage, which makes it hard for users to predict what
will happen. 4. The fields are both imprecise and overly
precise. Kind is not a precise mapping to a URL. This
can produce ambiguity during interpretation and
require a REST mapping. In most cases, the dependency
is on the group,resource tuple and the version of
the actual struct is irrelevant. 5. We cannot easily
change it. Because this type is embedded in many locations,
updates to this type will affect numerous schemas. Don''t
make new APIs embed an underspecified API type they
do not control. Instead of using this type, create a
locally provided and used type that is well-focused
on your reference. For example, ServiceReferences for
admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533
.'
properties:
apiVersion:
description: API version of the referent.
type: string
fieldPath:
description: 'If referring to a piece of an object
instead of an entire object, this string should
contain a valid JSON/Go field access statement,
such as desiredState.manifest.containers[2]. For
example, if the object reference is to a container
within a pod, this would take on a value like: "spec.containers{name}"
(where "name" refers to the name of the container
that triggered the event) or if no container name
is specified "spec.containers[2]" (container with
index 2 in this pod). This syntax is chosen only
to have some well-defined way of referencing a part
of an object. TODO: this design is not final and
this field is subject to change in the future.'
type: string
kind:
description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
type: string
namespace:
description: 'Namespace of the referent. More info:
https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/'
type: string
resourceVersion:
description: 'Specific resourceVersion to which this
reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency'
type: string
uid:
description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
type: string
type: object
type: object
type: array
type: object
type: array
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: 'ObjectReference contains enough information to let
you inspect or modify the referred object. --- New uses of this
type are discouraged because of difficulty describing its usage
when embedded in APIs. 1. Ignored fields. It includes many fields
which are not generally honored. For instance, ResourceVersion
and FieldPath are both very rarely valid in actual usage. 2.
Invalid usage help. It is impossible to add specific help for
individual usage. In most embedded usages, there are particular restrictions
like, "must refer only to types A and B" or "UID not honored"
or "name must be restricted". Those cannot be well described
when embedded. 3. Inconsistent validation. Because the usages
are different, the validation rules are different by usage, which
makes it hard for users to predict what will happen. 4. The fields
are both imprecise and overly precise. Kind is not a precise
mapping to a URL. This can produce ambiguity during interpretation
and require a REST mapping. In most cases, the dependency is
on the group,resource tuple and the version of the actual
struct is irrelevant. 5. We cannot easily change it. Because
this type is embedded in many locations, updates to this type will
affect numerous schemas. Don''t make new APIs embed an underspecified
API type they do not control. Instead of using this type, create
a locally provided and used type that is well-focused on your
reference. For example, ServiceReferences for admission registration:
https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533
.'
properties:
apiVersion:
description: API version of the referent.
type: string
fieldPath:
description: 'If referring to a piece of an object instead of
an entire object, this string should contain a valid JSON/Go
field access statement, such as desiredState.manifest.containers[2].
For example, if the object reference is to a container within
a pod, this would take on a value like: "spec.containers{name}"
(where "name" refers to the name of the container that triggered
the event) or if no container name is specified "spec.containers[2]"
(container with index 2 in this pod). This syntax is chosen
only to have some well-defined way of referencing a part of
an object. TODO: this design is not final and this field is
subject to change in the future.'
type: string
kind:
description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
type: string
namespace:
description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/'
type: string
resourceVersion:
description: 'Specific resourceVersion to which this reference
is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency'
type: string
uid:
description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
type: string
type: object
type: array
required:
- workloadRefs
type: object
status:
description: A HealthScopeStatus represents the observed state of a HealthScope.
properties:
appHealthConditions:
description: AppHealthConditions represents health condition of applications
in the scope
items:
description: AppHealthCondition represents health condition of an
application
properties:
appName:
type: string
components:
items:
description: WorkloadHealthCondition represents informative
health condition of a workload.
properties:
componentName:
description: ComponentName represents the component name
if target is a workload
type: string
customStatusMsg:
type: string
diagnosis:
type: string
healthStatus:
description: HealthStatus represents health status strings.
type: string
targetWorkload:
description: 'ObjectReference contains enough information
to let you inspect or modify the referred object. ---
New uses of this type are discouraged because of difficulty
describing its usage when embedded in APIs. 1. Ignored
fields. It includes many fields which are not generally
honored. For instance, ResourceVersion and FieldPath
are both very rarely valid in actual usage. 2. Invalid
usage help. It is impossible to add specific help for
individual usage. In most embedded usages, there are
particular restrictions like, "must refer only to
types A and B" or "UID not honored" or "name must be
restricted". Those cannot be well described when
embedded. 3. Inconsistent validation. Because the
usages are different, the validation rules are different
by usage, which makes it hard for users to predict what
will happen. 4. The fields are both imprecise and overly
precise. Kind is not a precise mapping to a URL. This
can produce ambiguity during interpretation and
require a REST mapping. In most cases, the dependency
is on the group,resource tuple and the version of
the actual struct is irrelevant. 5. We cannot easily
change it. Because this type is embedded in many locations,
updates to this type will affect numerous schemas. Don''t
make new APIs embed an underspecified API type they
do not control. Instead of using this type, create a
locally provided and used type that is well-focused
on your reference. For example, ServiceReferences for
admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533
.'
properties:
apiVersion:
description: API version of the referent.
type: string
fieldPath:
description: 'If referring to a piece of an object
instead of an entire object, this string should
contain a valid JSON/Go field access statement,
such as desiredState.manifest.containers[2]. For
example, if the object reference is to a container
within a pod, this would take on a value like: "spec.containers{name}"
(where "name" refers to the name of the container
that triggered the event) or if no container name
is specified "spec.containers[2]" (container with
index 2 in this pod). This syntax is chosen only
to have some well-defined way of referencing a part
of an object. TODO: this design is not final and
this field is subject to change in the future.'
type: string
kind:
description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
type: string
namespace:
description: 'Namespace of the referent. More info:
https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/'
type: string
resourceVersion:
description: 'Specific resourceVersion to which this
reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency'
type: string
uid:
description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
type: string
type: object
traits:
items:
description: TraitHealthCondition represents informative
health condition of a trait.
properties:
customStatusMsg:
type: string
diagnosis:
type: string
healthStatus:
description: HealthStatus represents health status
strings.
type: string
resource:
type: string
type:
type: string
required:
- healthStatus
- resource
- type
type: object
type: array
workloadStatus:
description: WorkloadStatus represents status of workloads
whose HealthStatus is UNKNOWN.
type: string
required:
- healthStatus
type: object
type: array
envName:
type: string
required:
- appName
type: object
type: array
conditions:
description: Conditions of the resource.
items:
description: A Condition that may apply to a resource.
properties:
lastTransitionTime:
description: LastTransitionTime is the last time this condition
transitioned from one status to another.
format: date-time
type: string
message:
description: A Message containing details about this condition's
last transition from one status to another, if any.
type: string
reason:
description: A Reason for this condition's last transition from
one status to another.
type: string
status:
description: Status of this condition; is it currently True,
False, or Unknown?
type: string
type:
description: Type of this condition. At most one of each condition
type may apply to a resource at any point in time.
type: string
required:
- lastTransitionTime
- reason
- status
- type
type: object
type: array
healthConditions:
description: WorkloadHealthConditions represents health condition
of workloads in the scope Use AppHealthConditions to provide app
level status
items:
description: WorkloadHealthCondition represents informative health
condition of a workload.
properties:
componentName:
description: ComponentName represents the component name if
target is a workload
type: string
customStatusMsg:
type: string
diagnosis:
type: string
healthStatus:
description: HealthStatus represents health status strings.
type: string
targetWorkload:
description: 'ObjectReference contains enough information to
let you inspect or modify the referred object. --- New uses
of this type are discouraged because of difficulty describing
its usage when embedded in APIs. 1. Ignored fields. It includes
many fields which are not generally honored. For instance,
ResourceVersion and FieldPath are both very rarely valid in
actual usage. 2. Invalid usage help. It is impossible to
add specific help for individual usage. In most embedded
usages, there are particular restrictions like, "must
refer only to types A and B" or "UID not honored" or "name
must be restricted". Those cannot be well described when
embedded. 3. Inconsistent validation. Because the usages
are different, the validation rules are different by usage,
which makes it hard for users to predict what will happen. 4.
The fields are both imprecise and overly precise. Kind is
not a precise mapping to a URL. This can produce ambiguity during
interpretation and require a REST mapping. In most cases,
the dependency is on the group,resource tuple and the
version of the actual struct is irrelevant. 5. We cannot
easily change it. Because this type is embedded in many locations,
updates to this type will affect numerous schemas. Don''t
make new APIs embed an underspecified API type they do not
control. Instead of using this type, create a locally provided
and used type that is well-focused on your reference. For
example, ServiceReferences for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533
.'
properties:
apiVersion:
description: API version of the referent.
type: string
fieldPath:
description: 'If referring to a piece of an object instead
of an entire object, this string should contain a valid
JSON/Go field access statement, such as desiredState.manifest.containers[2].
For example, if the object reference is to a container
within a pod, this would take on a value like: "spec.containers{name}"
(where "name" refers to the name of the container that
triggered the event) or if no container name is specified
"spec.containers[2]" (container with index 2 in this pod).
This syntax is chosen only to have some well-defined way
of referencing a part of an object. TODO: this design
is not final and this field is subject to change in the
future.'
type: string
kind:
description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
type: string
namespace:
description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/'
type: string
resourceVersion:
description: 'Specific resourceVersion to which this reference
is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency'
type: string
uid:
description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
type: string
type: object
traits:
items:
description: TraitHealthCondition represents informative health
condition of a trait.
properties:
customStatusMsg:
type: string
diagnosis:
type: string
healthStatus:
description: HealthStatus represents health status strings.
type: string
resource:
type: string
type:
type: string
required:
- healthStatus
- resource
- type
type: object
type: array
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

@ -1,134 +0,0 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.6.2
name: manualscalertraits.core.oam.dev
spec:
group: core.oam.dev
names:
categories:
- 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: API version of the referent.
type: string
fieldPath:
description: 'If referring to a piece of an object instead of
an entire object, this string should contain a valid JSON/Go
field access statement, such as desiredState.manifest.containers[2].
For example, if the object reference is to a container within
a pod, this would take on a value like: "spec.containers{name}"
(where "name" refers to the name of the container that triggered
the event) or if no container name is specified "spec.containers[2]"
(container with index 2 in this pod). This syntax is chosen
only to have some well-defined way of referencing a part of
an object. TODO: this design is not final and this field is
subject to change in the future.'
type: string
kind:
description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
type: string
namespace:
description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/'
type: string
resourceVersion:
description: 'Specific resourceVersion to which this reference
is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency'
type: string
uid:
description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
type: string
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

@ -1,57 +0,0 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.6.2
name: policies.core.oam.dev
spec:
group: core.oam.dev
names:
categories:
- oam
kind: Policy
listKind: PolicyList
plural: policies
singular: policy
scope: Namespaced
versions:
- additionalPrinterColumns:
- jsonPath: .type
name: TYPE
type: string
name: v1alpha1
schema:
openAPIV3Schema:
description: Policy is the Schema for the policy 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
properties:
type: object
x-kubernetes-preserve-unknown-fields: true
type:
type: string
required:
- type
type: object
served: true
storage: true
subresources: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []

View File

@ -1,278 +0,0 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.6.2
name: policydefinitions.core.oam.dev
spec:
group: core.oam.dev
names:
categories:
- oam
kind: PolicyDefinition
listKind: PolicyDefinitionList
plural: policydefinitions
shortNames:
- def-policy
singular: policydefinition
scope: Namespaced
versions:
- name: v1beta1
schema:
openAPIV3Schema:
description: PolicyDefinition is the Schema for the policydefinitions 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: PolicyDefinitionSpec defines the desired state of PolicyDefinition
properties:
definitionRef:
description: Reference to the CustomResourceDefinition that defines
this trait kind.
properties:
name:
description: Name of the referenced CustomResourceDefinition.
type: string
version:
description: Version indicate which version should be used if
CRD has multiple versions by default it will use the first one
if not specified
type: string
required:
- name
type: object
manageHealthCheck:
description: ManageHealthCheck means the policy will handle health
checking and skip application controller built-in health checking.
type: boolean
schematic:
description: Schematic defines the data format and template of the
encapsulation of the policy definition
properties:
cue:
description: CUE defines the encapsulation in CUE format
properties:
template:
description: Template defines the abstraction template data
of the capability, it will replace the old CUE template
in extension field. Template is a required field if CUE
is defined in Capability Definition.
type: string
required:
- template
type: object
helm:
description: A Helm represents resources used by a Helm module
properties:
release:
description: Release records a Helm release used by a Helm
module workload.
type: object
x-kubernetes-preserve-unknown-fields: true
repository:
description: HelmRelease records a Helm repository used by
a Helm module workload.
type: object
x-kubernetes-preserve-unknown-fields: true
required:
- release
- repository
type: object
kube:
description: Kube defines the encapsulation in raw Kubernetes
resource format
properties:
parameters:
description: Parameters defines configurable parameters
items:
description: A KubeParameter defines a configurable parameter
of a component.
properties:
description:
description: Description of this parameter.
type: string
fieldPaths:
description: "FieldPaths specifies an array of fields
within this workload that will be overwritten by the
value of this parameter. \tAll fields must be of the
same type. Fields are specified as JSON field paths
without a leading dot, for example 'spec.replicas'."
items:
type: string
type: array
name:
description: Name of this parameter
type: string
required:
default: false
description: Required specifies whether or not a value
for this parameter must be supplied when authoring
an Application.
type: boolean
type:
description: 'ValueType indicates the type of the parameter
value, and only supports basic data types: string,
number, boolean.'
enum:
- string
- number
- boolean
type: string
required:
- fieldPaths
- name
- type
type: object
type: array
template:
description: Template defines the raw Kubernetes resource
type: object
x-kubernetes-preserve-unknown-fields: true
required:
- template
type: object
terraform:
description: Terraform is the struct to describe cloud resources
managed by Hashicorp Terraform
properties:
configuration:
description: Configuration is Terraform Configuration
type: string
customRegion:
description: Region is cloud provider's region. It will override
the region in the region field of ProviderReference
type: string
deleteResource:
default: true
description: DeleteResource will determine whether provisioned
cloud resources will be deleted when CR is deleted
type: boolean
path:
description: Path is the sub-directory of remote git repository.
It's valid when remote is set
type: string
providerRef:
description: ProviderReference specifies the reference to
Provider
properties:
name:
description: Name of the referenced object.
type: string
namespace:
default: default
description: Namespace of the referenced object.
type: string
required:
- name
type: object
type:
default: hcl
description: Type specifies which Terraform configuration
it is, HCL or JSON syntax
enum:
- hcl
- json
- remote
type: string
writeConnectionSecretToRef:
description: WriteConnectionSecretToReference specifies the
namespace and name of a Secret to which any connection details
for this managed resource should be written. Connection
details frequently include the endpoint, username, and password
required to connect to the managed resource.
properties:
name:
description: Name of the secret.
type: string
namespace:
description: Namespace of the secret.
type: string
required:
- name
type: object
required:
- configuration
type: object
type: object
type: object
status:
description: PolicyDefinitionStatus is the status of PolicyDefinition
properties:
conditions:
description: Conditions of the resource.
items:
description: A Condition that may apply to a resource.
properties:
lastTransitionTime:
description: LastTransitionTime is the last time this condition
transitioned from one status to another.
format: date-time
type: string
message:
description: A Message containing details about this condition's
last transition from one status to another, if any.
type: string
reason:
description: A Reason for this condition's last transition from
one status to another.
type: string
status:
description: Status of this condition; is it currently True,
False, or Unknown?
type: string
type:
description: Type of this condition. At most one of each condition
type may apply to a resource at any point in time.
type: string
required:
- lastTransitionTime
- reason
- status
- type
type: object
type: array
configMapRef:
description: ConfigMapRef refer to a ConfigMap which contains OpenAPI
V3 JSON schema of Component parameters.
type: string
latestRevision:
description: LatestRevision of the component definition
properties:
name:
type: string
revision:
format: int64
type: integer
revisionHash:
description: RevisionHash record the hash value of the spec of
ApplicationRevision object.
type: string
required:
- name
- revision
type: object
type: object
type: object
served: true
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []

View File

@ -1,181 +0,0 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.6.2
name: resourcetrackers.core.oam.dev
spec:
group: core.oam.dev
names:
categories:
- oam
kind: ResourceTracker
listKind: ResourceTrackerList
plural: resourcetrackers
shortNames:
- rt
singular: resourcetracker
scope: Cluster
versions:
- additionalPrinterColumns:
- jsonPath: .spec.type
name: TYPE
type: string
- jsonPath: .metadata.labels['app\.oam\.dev\/name']
name: APP
type: string
- jsonPath: .metadata.labels['app\.oam\.dev\/namespace']
name: APP-NS
type: string
- jsonPath: .spec.applicationGeneration
name: APP-GEN
type: number
name: v1beta1
schema:
openAPIV3Schema:
description: An ResourceTracker represents a tracker for track cross namespace
resources
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: ResourceTrackerSpec define the spec of resourceTracker
properties:
applicationGeneration:
format: int64
type: integer
managedResources:
items:
description: ManagedResource define the resource to be managed by
ResourceTracker
properties:
apiVersion:
description: API version of the referent.
type: string
cluster:
type: string
component:
type: string
creator:
description: ResourceCreatorRole defines the resource creator.
type: string
deleted:
description: Deleted marks the resource to be deleted
type: boolean
env:
type: string
fieldPath:
description: 'If referring to a piece of an object instead of
an entire object, this string should contain a valid JSON/Go
field access statement, such as desiredState.manifest.containers[2].
For example, if the object reference is to a container within
a pod, this would take on a value like: "spec.containers{name}"
(where "name" refers to the name of the container that triggered
the event) or if no container name is specified "spec.containers[2]"
(container with index 2 in this pod). This syntax is chosen
only to have some well-defined way of referencing a part of
an object. TODO: this design is not final and this field is
subject to change in the future.'
type: string
kind:
description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
type: string
namespace:
description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/'
type: string
raw:
type: object
x-kubernetes-preserve-unknown-fields: true
resourceVersion:
description: 'Specific resourceVersion to which this reference
is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency'
type: string
trait:
type: string
uid:
description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
type: string
type: object
type: array
type:
description: ResourceTrackerType defines the type of resourceTracker
type: string
required:
- applicationGeneration
type: object
status:
description: ResourceTrackerStatus define the status of resourceTracker
For backward-compatibility
properties:
trackedResources:
description: Deprecated
items:
description: ClusterObjectReference defines the object reference
with cluster.
properties:
apiVersion:
description: API version of the referent.
type: string
cluster:
type: string
creator:
description: ResourceCreatorRole defines the resource creator.
type: string
fieldPath:
description: 'If referring to a piece of an object instead of
an entire object, this string should contain a valid JSON/Go
field access statement, such as desiredState.manifest.containers[2].
For example, if the object reference is to a container within
a pod, this would take on a value like: "spec.containers{name}"
(where "name" refers to the name of the container that triggered
the event) or if no container name is specified "spec.containers[2]"
(container with index 2 in this pod). This syntax is chosen
only to have some well-defined way of referencing a part of
an object. TODO: this design is not final and this field is
subject to change in the future.'
type: string
kind:
description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
type: string
namespace:
description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/'
type: string
resourceVersion:
description: 'Specific resourceVersion to which this reference
is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency'
type: string
uid:
description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
type: string
type: object
type: array
type: object
type: object
served: true
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []

View File

@ -1,153 +0,0 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.6.2
name: scopedefinitions.core.oam.dev
spec:
group: core.oam.dev
names:
categories:
- oam
kind: ScopeDefinition
listKind: ScopeDefinitionList
plural: scopedefinitions
shortNames:
- scope
singular: scopedefinition
scope: Namespaced
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
version:
description: Version indicate which version should be used if
CRD has multiple versions by default it will use the first one
if not specified
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: false
subresources: {}
- additionalPrinterColumns:
- jsonPath: .spec.definitionRef.name
name: DEFINITION-NAME
type: string
name: v1beta1
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
version:
description: Version indicate which version should be used if
CRD has multiple versions by default it will use the first one
if not specified
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

@ -1,649 +0,0 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.6.2
name: traitdefinitions.core.oam.dev
spec:
group: core.oam.dev
names:
categories:
- oam
kind: TraitDefinition
listKind: TraitDefinitionList
plural: traitdefinitions
shortNames:
- trait
singular: traitdefinition
scope: Namespaced
versions:
- additionalPrinterColumns:
- jsonPath: .spec.appliesToWorkloads
name: APPLIES-TO
type: string
- jsonPath: .metadata.annotations.definition\.oam\.dev/description
name: DESCRIPTION
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
conflictsWith:
description: 'ConflictsWith specifies the list of traits(CRD name,
Definition name, CRD group) which could not apply to the same workloads
with this trait. Traits that omit this field can work with any other
traits. Example rules: "service" # Trait definition name "services.k8s.io"
# API resource/crd name "*.networking.k8s.io" # API group "labelSelector:foo=bar"
# label selector labelSelector format: https://pkg.go.dev/k8s.io/apimachinery/pkg/labels#Parse'
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
version:
description: Version indicate which version should be used if
CRD has multiple versions by default it will use the first one
if not specified
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
podDisruptive:
description: PodDisruptive specifies whether using the trait will
cause the pod to restart or not.
type: boolean
revisionEnabled:
description: Revision indicates whether a trait is aware of component
revision
type: boolean
schematic:
description: Schematic defines the data format and template of the
encapsulation of the trait
properties:
cue:
description: CUE defines the encapsulation in CUE format
properties:
template:
description: Template defines the abstraction template data
of the capability, it will replace the old CUE template
in extension field. Template is a required field if CUE
is defined in Capability Definition.
type: string
required:
- template
type: object
helm:
description: A Helm represents resources used by a Helm module
properties:
release:
description: Release records a Helm release used by a Helm
module workload.
type: object
x-kubernetes-preserve-unknown-fields: true
repository:
description: HelmRelease records a Helm repository used by
a Helm module workload.
type: object
x-kubernetes-preserve-unknown-fields: true
required:
- release
- repository
type: object
kube:
description: Kube defines the encapsulation in raw Kubernetes
resource format
properties:
parameters:
description: Parameters defines configurable parameters
items:
description: A KubeParameter defines a configurable parameter
of a component.
properties:
description:
description: Description of this parameter.
type: string
fieldPaths:
description: "FieldPaths specifies an array of fields
within this workload that will be overwritten by the
value of this parameter. \tAll fields must be of the
same type. Fields are specified as JSON field paths
without a leading dot, for example 'spec.replicas'."
items:
type: string
type: array
name:
description: Name of this parameter
type: string
required:
default: false
description: Required specifies whether or not a value
for this parameter must be supplied when authoring
an Application.
type: boolean
type:
description: 'ValueType indicates the type of the parameter
value, and only supports basic data types: string,
number, boolean.'
enum:
- string
- number
- boolean
type: string
required:
- fieldPaths
- name
- type
type: object
type: array
template:
description: Template defines the raw Kubernetes resource
type: object
x-kubernetes-preserve-unknown-fields: true
required:
- template
type: object
terraform:
description: Terraform is the struct to describe cloud resources
managed by Hashicorp Terraform
properties:
configuration:
description: Configuration is Terraform Configuration
type: string
customRegion:
description: Region is cloud provider's region. It will override
the region in the region field of ProviderReference
type: string
deleteResource:
default: true
description: DeleteResource will determine whether provisioned
cloud resources will be deleted when CR is deleted
type: boolean
path:
description: Path is the sub-directory of remote git repository.
It's valid when remote is set
type: string
providerRef:
description: ProviderReference specifies the reference to
Provider
properties:
name:
description: Name of the referenced object.
type: string
namespace:
default: default
description: Namespace of the referenced object.
type: string
required:
- name
type: object
type:
default: hcl
description: Type specifies which Terraform configuration
it is, HCL or JSON syntax
enum:
- hcl
- json
- remote
type: string
writeConnectionSecretToRef:
description: WriteConnectionSecretToReference specifies the
namespace and name of a Secret to which any connection details
for this managed resource should be written. Connection
details frequently include the endpoint, username, and password
required to connect to the managed resource.
properties:
name:
description: Name of the secret.
type: string
namespace:
description: Namespace of the secret.
type: string
required:
- name
type: object
required:
- configuration
type: object
type: object
status:
description: Status defines the custom health policy and status message
for trait
properties:
customStatus:
description: CustomStatus defines the custom status message that
could display to user
type: string
healthPolicy:
description: HealthPolicy defines the health check policy for
the abstraction
type: string
type: object
workloadRefPath:
description: WorkloadRefPath indicates where/if a trait accepts a
workloadRef object
type: string
type: object
status:
description: TraitDefinitionStatus is the status of TraitDefinition
properties:
conditions:
description: Conditions of the resource.
items:
description: A Condition that may apply to a resource.
properties:
lastTransitionTime:
description: LastTransitionTime is the last time this condition
transitioned from one status to another.
format: date-time
type: string
message:
description: A Message containing details about this condition's
last transition from one status to another, if any.
type: string
reason:
description: A Reason for this condition's last transition from
one status to another.
type: string
status:
description: Status of this condition; is it currently True,
False, or Unknown?
type: string
type:
description: Type of this condition. At most one of each condition
type may apply to a resource at any point in time.
type: string
required:
- lastTransitionTime
- reason
- status
- type
type: object
type: array
configMapRef:
description: ConfigMapRef refer to a ConfigMap which contains OpenAPI
V3 JSON schema of Component parameters.
type: string
latestRevision:
description: LatestRevision of the trait definition
properties:
name:
type: string
revision:
format: int64
type: integer
revisionHash:
description: RevisionHash record the hash value of the spec of
ApplicationRevision object.
type: string
required:
- name
- revision
type: object
type: object
type: object
served: true
storage: false
subresources:
status: {}
- additionalPrinterColumns:
- jsonPath: .spec.appliesToWorkloads
name: APPLIES-TO
type: string
- jsonPath: .metadata.annotations.definition\.oam\.dev/description
name: DESCRIPTION
type: string
name: v1beta1
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
conflictsWith:
description: 'ConflictsWith specifies the list of traits(CRD name,
Definition name, CRD group) which could not apply to the same workloads
with this trait. Traits that omit this field can work with any other
traits. Example rules: "service" # Trait definition name "services.k8s.io"
# API resource/crd name "*.networking.k8s.io" # API group "labelSelector:foo=bar"
# label selector labelSelector format: https://pkg.go.dev/k8s.io/apimachinery/pkg/labels#Parse'
items:
type: string
type: array
controlPlaneOnly:
description: ControlPlaneOnly defines which cluster is dispatched
to
type: boolean
definitionRef:
description: Reference to the CustomResourceDefinition that defines
this trait kind.
properties:
name:
description: Name of the referenced CustomResourceDefinition.
type: string
version:
description: Version indicate which version should be used if
CRD has multiple versions by default it will use the first one
if not specified
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
manageWorkload:
description: ManageWorkload defines the trait would be responsible
for creating the workload
type: boolean
podDisruptive:
description: PodDisruptive specifies whether using the trait will
cause the pod to restart or not.
type: boolean
revisionEnabled:
description: Revision indicates whether a trait is aware of component
revision
type: boolean
schematic:
description: Schematic defines the data format and template of the
encapsulation of the trait
properties:
cue:
description: CUE defines the encapsulation in CUE format
properties:
template:
description: Template defines the abstraction template data
of the capability, it will replace the old CUE template
in extension field. Template is a required field if CUE
is defined in Capability Definition.
type: string
required:
- template
type: object
helm:
description: A Helm represents resources used by a Helm module
properties:
release:
description: Release records a Helm release used by a Helm
module workload.
type: object
x-kubernetes-preserve-unknown-fields: true
repository:
description: HelmRelease records a Helm repository used by
a Helm module workload.
type: object
x-kubernetes-preserve-unknown-fields: true
required:
- release
- repository
type: object
kube:
description: Kube defines the encapsulation in raw Kubernetes
resource format
properties:
parameters:
description: Parameters defines configurable parameters
items:
description: A KubeParameter defines a configurable parameter
of a component.
properties:
description:
description: Description of this parameter.
type: string
fieldPaths:
description: "FieldPaths specifies an array of fields
within this workload that will be overwritten by the
value of this parameter. \tAll fields must be of the
same type. Fields are specified as JSON field paths
without a leading dot, for example 'spec.replicas'."
items:
type: string
type: array
name:
description: Name of this parameter
type: string
required:
default: false
description: Required specifies whether or not a value
for this parameter must be supplied when authoring
an Application.
type: boolean
type:
description: 'ValueType indicates the type of the parameter
value, and only supports basic data types: string,
number, boolean.'
enum:
- string
- number
- boolean
type: string
required:
- fieldPaths
- name
- type
type: object
type: array
template:
description: Template defines the raw Kubernetes resource
type: object
x-kubernetes-preserve-unknown-fields: true
required:
- template
type: object
terraform:
description: Terraform is the struct to describe cloud resources
managed by Hashicorp Terraform
properties:
configuration:
description: Configuration is Terraform Configuration
type: string
customRegion:
description: Region is cloud provider's region. It will override
the region in the region field of ProviderReference
type: string
deleteResource:
default: true
description: DeleteResource will determine whether provisioned
cloud resources will be deleted when CR is deleted
type: boolean
path:
description: Path is the sub-directory of remote git repository.
It's valid when remote is set
type: string
providerRef:
description: ProviderReference specifies the reference to
Provider
properties:
name:
description: Name of the referenced object.
type: string
namespace:
default: default
description: Namespace of the referenced object.
type: string
required:
- name
type: object
type:
default: hcl
description: Type specifies which Terraform configuration
it is, HCL or JSON syntax
enum:
- hcl
- json
- remote
type: string
writeConnectionSecretToRef:
description: WriteConnectionSecretToReference specifies the
namespace and name of a Secret to which any connection details
for this managed resource should be written. Connection
details frequently include the endpoint, username, and password
required to connect to the managed resource.
properties:
name:
description: Name of the secret.
type: string
namespace:
description: Namespace of the secret.
type: string
required:
- name
type: object
required:
- configuration
type: object
type: object
skipRevisionAffect:
description: SkipRevisionAffect defines the update this trait will
not generate a new application Revision
type: boolean
status:
description: Status defines the custom health policy and status message
for trait
properties:
customStatus:
description: CustomStatus defines the custom status message that
could display to user
type: string
healthPolicy:
description: HealthPolicy defines the health check policy for
the abstraction
type: string
type: object
workloadRefPath:
description: WorkloadRefPath indicates where/if a trait accepts a
workloadRef object
type: string
type: object
status:
description: TraitDefinitionStatus is the status of TraitDefinition
properties:
conditions:
description: Conditions of the resource.
items:
description: A Condition that may apply to a resource.
properties:
lastTransitionTime:
description: LastTransitionTime is the last time this condition
transitioned from one status to another.
format: date-time
type: string
message:
description: A Message containing details about this condition's
last transition from one status to another, if any.
type: string
reason:
description: A Reason for this condition's last transition from
one status to another.
type: string
status:
description: Status of this condition; is it currently True,
False, or Unknown?
type: string
type:
description: Type of this condition. At most one of each condition
type may apply to a resource at any point in time.
type: string
required:
- lastTransitionTime
- reason
- status
- type
type: object
type: array
configMapRef:
description: ConfigMapRef refer to a ConfigMap which contains OpenAPI
V3 JSON schema of Component parameters.
type: string
latestRevision:
description: LatestRevision of the component definition
properties:
name:
type: string
revision:
format: int64
type: integer
revisionHash:
description: RevisionHash record the hash value of the spec of
ApplicationRevision object.
type: string
required:
- name
- revision
type: object
type: object
type: object
served: true
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []

View File

@ -1,299 +0,0 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.6.2
name: workflows.core.oam.dev
spec:
group: core.oam.dev
names:
categories:
- oam
kind: Workflow
listKind: WorkflowList
plural: workflows
singular: workflow
scope: Namespaced
versions:
- name: v1alpha1
schema:
openAPIV3Schema:
description: Workflow is the Schema for the policy 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
steps:
items:
description: WorkflowStep defines how to execute a workflow step.
properties:
dependsOn:
items:
type: string
type: array
if:
type: string
inputs:
description: StepInputs defines variable input of WorkflowStep
items:
properties:
from:
type: string
parameterKey:
type: string
required:
- from
- parameterKey
type: object
type: array
meta:
description: WorkflowStepMeta contains the meta data of a workflow
step
properties:
alias:
type: string
type: object
name:
description: Name is the unique name of the workflow step.
type: string
outputs:
description: StepOutputs defines output variable of WorkflowStep
items:
properties:
name:
type: string
valueFrom:
type: string
required:
- name
- valueFrom
type: object
type: array
properties:
type: object
x-kubernetes-preserve-unknown-fields: true
subSteps:
items:
description: WorkflowSubStep defines how to execute a workflow
subStep.
properties:
dependsOn:
items:
type: string
type: array
if:
type: string
inputs:
description: StepInputs defines variable input of WorkflowStep
items:
properties:
from:
type: string
parameterKey:
type: string
required:
- from
- parameterKey
type: object
type: array
meta:
description: WorkflowStepMeta contains the meta data of a
workflow step
properties:
alias:
type: string
type: object
name:
description: Name is the unique name of the workflow step.
type: string
outputs:
description: StepOutputs defines output variable of WorkflowStep
items:
properties:
name:
type: string
valueFrom:
type: string
required:
- name
- valueFrom
type: object
type: array
properties:
type: object
x-kubernetes-preserve-unknown-fields: true
timeout:
type: string
type:
type: string
required:
- name
- type
type: object
type: array
timeout:
type: string
type:
type: string
required:
- name
- type
type: object
type: array
type: object
served: true
storage: true
- name: v1beta1
schema:
openAPIV3Schema:
description: Workflow defines workflow steps and other attributes
properties:
mode:
description: WorkflowExecuteMode defines the mode of workflow execution
properties:
steps:
description: WorkflowMode describes the mode of workflow
type: string
subSteps:
description: WorkflowMode describes the mode of workflow
type: string
type: object
ref:
type: string
steps:
items:
description: WorkflowStep defines how to execute a workflow step.
properties:
dependsOn:
items:
type: string
type: array
if:
type: string
inputs:
description: StepInputs defines variable input of WorkflowStep
items:
properties:
from:
type: string
parameterKey:
type: string
required:
- from
- parameterKey
type: object
type: array
meta:
description: WorkflowStepMeta contains the meta data of a workflow
step
properties:
alias:
type: string
type: object
name:
description: Name is the unique name of the workflow step.
type: string
outputs:
description: StepOutputs defines output variable of WorkflowStep
items:
properties:
name:
type: string
valueFrom:
type: string
required:
- name
- valueFrom
type: object
type: array
properties:
type: object
x-kubernetes-preserve-unknown-fields: true
subSteps:
items:
description: WorkflowSubStep defines how to execute a workflow
subStep.
properties:
dependsOn:
items:
type: string
type: array
if:
type: string
inputs:
description: StepInputs defines variable input of WorkflowStep
items:
properties:
from:
type: string
parameterKey:
type: string
required:
- from
- parameterKey
type: object
type: array
meta:
description: WorkflowStepMeta contains the meta data of a
workflow step
properties:
alias:
type: string
type: object
name:
description: Name is the unique name of the workflow step.
type: string
outputs:
description: StepOutputs defines output variable of WorkflowStep
items:
properties:
name:
type: string
valueFrom:
type: string
required:
- name
- valueFrom
type: object
type: array
properties:
type: object
x-kubernetes-preserve-unknown-fields: true
timeout:
type: string
type:
type: string
required:
- name
- type
type: object
type: array
timeout:
type: string
type:
type: string
required:
- name
- type
type: object
type: array
type: object
served: true
storage: false
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []

View File

@ -1,275 +0,0 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.6.2
name: workflowstepdefinitions.core.oam.dev
spec:
group: core.oam.dev
names:
categories:
- oam
kind: WorkflowStepDefinition
listKind: WorkflowStepDefinitionList
plural: workflowstepdefinitions
shortNames:
- workflowstep
singular: workflowstepdefinition
scope: Namespaced
versions:
- name: v1beta1
schema:
openAPIV3Schema:
description: WorkflowStepDefinition is the Schema for the workflowstepdefinitions
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: WorkflowStepDefinitionSpec defines the desired state of WorkflowStepDefinition
properties:
definitionRef:
description: Reference to the CustomResourceDefinition that defines
this trait kind.
properties:
name:
description: Name of the referenced CustomResourceDefinition.
type: string
version:
description: Version indicate which version should be used if
CRD has multiple versions by default it will use the first one
if not specified
type: string
required:
- name
type: object
schematic:
description: Schematic defines the data format and template of the
encapsulation of the workflow step definition
properties:
cue:
description: CUE defines the encapsulation in CUE format
properties:
template:
description: Template defines the abstraction template data
of the capability, it will replace the old CUE template
in extension field. Template is a required field if CUE
is defined in Capability Definition.
type: string
required:
- template
type: object
helm:
description: A Helm represents resources used by a Helm module
properties:
release:
description: Release records a Helm release used by a Helm
module workload.
type: object
x-kubernetes-preserve-unknown-fields: true
repository:
description: HelmRelease records a Helm repository used by
a Helm module workload.
type: object
x-kubernetes-preserve-unknown-fields: true
required:
- release
- repository
type: object
kube:
description: Kube defines the encapsulation in raw Kubernetes
resource format
properties:
parameters:
description: Parameters defines configurable parameters
items:
description: A KubeParameter defines a configurable parameter
of a component.
properties:
description:
description: Description of this parameter.
type: string
fieldPaths:
description: "FieldPaths specifies an array of fields
within this workload that will be overwritten by the
value of this parameter. \tAll fields must be of the
same type. Fields are specified as JSON field paths
without a leading dot, for example 'spec.replicas'."
items:
type: string
type: array
name:
description: Name of this parameter
type: string
required:
default: false
description: Required specifies whether or not a value
for this parameter must be supplied when authoring
an Application.
type: boolean
type:
description: 'ValueType indicates the type of the parameter
value, and only supports basic data types: string,
number, boolean.'
enum:
- string
- number
- boolean
type: string
required:
- fieldPaths
- name
- type
type: object
type: array
template:
description: Template defines the raw Kubernetes resource
type: object
x-kubernetes-preserve-unknown-fields: true
required:
- template
type: object
terraform:
description: Terraform is the struct to describe cloud resources
managed by Hashicorp Terraform
properties:
configuration:
description: Configuration is Terraform Configuration
type: string
customRegion:
description: Region is cloud provider's region. It will override
the region in the region field of ProviderReference
type: string
deleteResource:
default: true
description: DeleteResource will determine whether provisioned
cloud resources will be deleted when CR is deleted
type: boolean
path:
description: Path is the sub-directory of remote git repository.
It's valid when remote is set
type: string
providerRef:
description: ProviderReference specifies the reference to
Provider
properties:
name:
description: Name of the referenced object.
type: string
namespace:
default: default
description: Namespace of the referenced object.
type: string
required:
- name
type: object
type:
default: hcl
description: Type specifies which Terraform configuration
it is, HCL or JSON syntax
enum:
- hcl
- json
- remote
type: string
writeConnectionSecretToRef:
description: WriteConnectionSecretToReference specifies the
namespace and name of a Secret to which any connection details
for this managed resource should be written. Connection
details frequently include the endpoint, username, and password
required to connect to the managed resource.
properties:
name:
description: Name of the secret.
type: string
namespace:
description: Namespace of the secret.
type: string
required:
- name
type: object
required:
- configuration
type: object
type: object
type: object
status:
description: WorkflowStepDefinitionStatus is the status of WorkflowStepDefinition
properties:
conditions:
description: Conditions of the resource.
items:
description: A Condition that may apply to a resource.
properties:
lastTransitionTime:
description: LastTransitionTime is the last time this condition
transitioned from one status to another.
format: date-time
type: string
message:
description: A Message containing details about this condition's
last transition from one status to another, if any.
type: string
reason:
description: A Reason for this condition's last transition from
one status to another.
type: string
status:
description: Status of this condition; is it currently True,
False, or Unknown?
type: string
type:
description: Type of this condition. At most one of each condition
type may apply to a resource at any point in time.
type: string
required:
- lastTransitionTime
- reason
- status
- type
type: object
type: array
configMapRef:
description: ConfigMapRef refer to a ConfigMap which contains OpenAPI
V3 JSON schema of Component parameters.
type: string
latestRevision:
description: LatestRevision of the component definition
properties:
name:
type: string
revision:
format: int64
type: integer
revisionHash:
description: RevisionHash record the hash value of the spec of
ApplicationRevision object.
type: string
required:
- name
- revision
type: object
type: object
type: object
served: true
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []

View File

@ -1,604 +0,0 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.6.2
name: workloaddefinitions.core.oam.dev
spec:
group: core.oam.dev
names:
categories:
- oam
kind: WorkloadDefinition
listKind: WorkloadDefinitionList
plural: workloaddefinitions
shortNames:
- workload
singular: workloaddefinition
scope: Namespaced
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
version:
description: Version indicate which version should be used if
CRD has multiple versions by default it will use the first one
if not specified
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
podSpecPath:
description: PodSpecPath indicates where/if this workload has K8s
podSpec field if one workload has podSpec, trait can do lot's of
assumption such as port, env, volume fields.
type: string
revisionLabel:
description: RevisionLabel indicates which label for underlying resources(e.g.
pods) of this workload can be used by trait to create resource selectors(e.g.
label selector for pods).
type: string
schematic:
description: Schematic defines the data format and template of the
encapsulation of the workload
properties:
cue:
description: CUE defines the encapsulation in CUE format
properties:
template:
description: Template defines the abstraction template data
of the capability, it will replace the old CUE template
in extension field. Template is a required field if CUE
is defined in Capability Definition.
type: string
required:
- template
type: object
helm:
description: A Helm represents resources used by a Helm module
properties:
release:
description: Release records a Helm release used by a Helm
module workload.
type: object
x-kubernetes-preserve-unknown-fields: true
repository:
description: HelmRelease records a Helm repository used by
a Helm module workload.
type: object
x-kubernetes-preserve-unknown-fields: true
required:
- release
- repository
type: object
kube:
description: Kube defines the encapsulation in raw Kubernetes
resource format
properties:
parameters:
description: Parameters defines configurable parameters
items:
description: A KubeParameter defines a configurable parameter
of a component.
properties:
description:
description: Description of this parameter.
type: string
fieldPaths:
description: "FieldPaths specifies an array of fields
within this workload that will be overwritten by the
value of this parameter. \tAll fields must be of the
same type. Fields are specified as JSON field paths
without a leading dot, for example 'spec.replicas'."
items:
type: string
type: array
name:
description: Name of this parameter
type: string
required:
default: false
description: Required specifies whether or not a value
for this parameter must be supplied when authoring
an Application.
type: boolean
type:
description: 'ValueType indicates the type of the parameter
value, and only supports basic data types: string,
number, boolean.'
enum:
- string
- number
- boolean
type: string
required:
- fieldPaths
- name
- type
type: object
type: array
template:
description: Template defines the raw Kubernetes resource
type: object
x-kubernetes-preserve-unknown-fields: true
required:
- template
type: object
terraform:
description: Terraform is the struct to describe cloud resources
managed by Hashicorp Terraform
properties:
configuration:
description: Configuration is Terraform Configuration
type: string
customRegion:
description: Region is cloud provider's region. It will override
the region in the region field of ProviderReference
type: string
deleteResource:
default: true
description: DeleteResource will determine whether provisioned
cloud resources will be deleted when CR is deleted
type: boolean
path:
description: Path is the sub-directory of remote git repository.
It's valid when remote is set
type: string
providerRef:
description: ProviderReference specifies the reference to
Provider
properties:
name:
description: Name of the referenced object.
type: string
namespace:
default: default
description: Namespace of the referenced object.
type: string
required:
- name
type: object
type:
default: hcl
description: Type specifies which Terraform configuration
it is, HCL or JSON syntax
enum:
- hcl
- json
- remote
type: string
writeConnectionSecretToRef:
description: WriteConnectionSecretToReference specifies the
namespace and name of a Secret to which any connection details
for this managed resource should be written. Connection
details frequently include the endpoint, username, and password
required to connect to the managed resource.
properties:
name:
description: Name of the secret.
type: string
namespace:
description: Namespace of the secret.
type: string
required:
- name
type: object
required:
- configuration
type: object
type: object
status:
description: Status defines the custom health policy and status message
for workload
properties:
customStatus:
description: CustomStatus defines the custom status message that
could display to user
type: string
healthPolicy:
description: HealthPolicy defines the health check policy for
the abstraction
type: string
type: object
required:
- definitionRef
type: object
status:
description: WorkloadDefinitionStatus is the status of WorkloadDefinition
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: false
subresources: {}
- additionalPrinterColumns:
- jsonPath: .spec.definitionRef.name
name: DEFINITION-NAME
type: string
- jsonPath: .metadata.annotations.definition\.oam\.dev/description
name: DESCRIPTION
type: string
name: v1beta1
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
version:
description: Version indicate which version should be used if
CRD has multiple versions by default it will use the first one
if not specified
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
podSpecPath:
description: PodSpecPath indicates where/if this workload has K8s
podSpec field if one workload has podSpec, trait can do lot's of
assumption such as port, env, volume fields.
type: string
revisionLabel:
description: RevisionLabel indicates which label for underlying resources(e.g.
pods) of this workload can be used by trait to create resource selectors(e.g.
label selector for pods).
type: string
schematic:
description: Schematic defines the data format and template of the
encapsulation of the workload
properties:
cue:
description: CUE defines the encapsulation in CUE format
properties:
template:
description: Template defines the abstraction template data
of the capability, it will replace the old CUE template
in extension field. Template is a required field if CUE
is defined in Capability Definition.
type: string
required:
- template
type: object
helm:
description: A Helm represents resources used by a Helm module
properties:
release:
description: Release records a Helm release used by a Helm
module workload.
type: object
x-kubernetes-preserve-unknown-fields: true
repository:
description: HelmRelease records a Helm repository used by
a Helm module workload.
type: object
x-kubernetes-preserve-unknown-fields: true
required:
- release
- repository
type: object
kube:
description: Kube defines the encapsulation in raw Kubernetes
resource format
properties:
parameters:
description: Parameters defines configurable parameters
items:
description: A KubeParameter defines a configurable parameter
of a component.
properties:
description:
description: Description of this parameter.
type: string
fieldPaths:
description: "FieldPaths specifies an array of fields
within this workload that will be overwritten by the
value of this parameter. \tAll fields must be of the
same type. Fields are specified as JSON field paths
without a leading dot, for example 'spec.replicas'."
items:
type: string
type: array
name:
description: Name of this parameter
type: string
required:
default: false
description: Required specifies whether or not a value
for this parameter must be supplied when authoring
an Application.
type: boolean
type:
description: 'ValueType indicates the type of the parameter
value, and only supports basic data types: string,
number, boolean.'
enum:
- string
- number
- boolean
type: string
required:
- fieldPaths
- name
- type
type: object
type: array
template:
description: Template defines the raw Kubernetes resource
type: object
x-kubernetes-preserve-unknown-fields: true
required:
- template
type: object
terraform:
description: Terraform is the struct to describe cloud resources
managed by Hashicorp Terraform
properties:
configuration:
description: Configuration is Terraform Configuration
type: string
customRegion:
description: Region is cloud provider's region. It will override
the region in the region field of ProviderReference
type: string
deleteResource:
default: true
description: DeleteResource will determine whether provisioned
cloud resources will be deleted when CR is deleted
type: boolean
path:
description: Path is the sub-directory of remote git repository.
It's valid when remote is set
type: string
providerRef:
description: ProviderReference specifies the reference to
Provider
properties:
name:
description: Name of the referenced object.
type: string
namespace:
default: default
description: Namespace of the referenced object.
type: string
required:
- name
type: object
type:
default: hcl
description: Type specifies which Terraform configuration
it is, HCL or JSON syntax
enum:
- hcl
- json
- remote
type: string
writeConnectionSecretToRef:
description: WriteConnectionSecretToReference specifies the
namespace and name of a Secret to which any connection details
for this managed resource should be written. Connection
details frequently include the endpoint, username, and password
required to connect to the managed resource.
properties:
name:
description: Name of the secret.
type: string
namespace:
description: Namespace of the secret.
type: string
required:
- name
type: object
required:
- configuration
type: object
type: object
status:
description: Status defines the custom health policy and status message
for workload
properties:
customStatus:
description: CustomStatus defines the custom status message that
could display to user
type: string
healthPolicy:
description: HealthPolicy defines the health check policy for
the abstraction
type: string
type: object
required:
- definitionRef
type: object
status:
description: WorkloadDefinitionStatus is the status of WorkloadDefinition
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:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []

View File

@ -1,482 +0,0 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.6.2
name: rollouts.standard.oam.dev
spec:
group: standard.oam.dev
names:
categories:
- oam
kind: Rollout
listKind: RolloutList
plural: rollouts
shortNames:
- rollout
singular: rollout
scope: Namespaced
versions:
- additionalPrinterColumns:
- jsonPath: .status.rolloutTargetSize
name: TARGET
type: string
- jsonPath: .status.upgradedReplicas
name: UPGRADED
type: string
- jsonPath: .status.upgradedReadyReplicas
name: READY
type: string
- jsonPath: .status.batchRollingState
name: BATCH-STATE
type: string
- jsonPath: .status.rollingState
name: ROLLING-STATE
type: string
- jsonPath: .metadata.creationTimestamp
name: AGE
type: date
name: v1alpha1
schema:
openAPIV3Schema:
description: Rollout is the Schema for the Rollout 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: RolloutSpec defines how to describe an update between different
compRevision
properties:
componentName:
description: ComponentName specify the component name
type: string
rolloutPlan:
description: RolloutPlan is the details on how to rollout the resources
properties:
batchPartition:
description: All pods in the batches up to the batchPartition
(included) will have the target resource specification while
the rest still have the source resource This is designed for
the operators to manually rollout Default is the the number
of batches which will rollout all the batches
format: int32
type: integer
canaryMetric:
description: CanaryMetric provides a way for the rollout process
to automatically check certain metrics before complete the process
items:
description: CanaryMetric holds the reference to metrics used
for canary analysis
properties:
interval:
description: Interval represents the windows size
type: string
metricsRange:
description: Range value accepted for this metric
properties:
max:
anyOf:
- type: integer
- type: string
description: Maximum value
x-kubernetes-int-or-string: true
min:
anyOf:
- type: integer
- type: string
description: Minimum value
x-kubernetes-int-or-string: true
type: object
name:
description: Name of the metric
type: string
templateRef:
description: TemplateRef references a metric template object
properties:
apiVersion:
description: API version of the referent.
type: string
fieldPath:
description: 'If referring to a piece of an object instead
of an entire object, this string should contain a
valid JSON/Go field access statement, such as desiredState.manifest.containers[2].
For example, if the object reference is to a container
within a pod, this would take on a value like: "spec.containers{name}"
(where "name" refers to the name of the container
that triggered the event) or if no container name
is specified "spec.containers[2]" (container with
index 2 in this pod). This syntax is chosen only to
have some well-defined way of referencing a part of
an object. TODO: this design is not final and this
field is subject to change in the future.'
type: string
kind:
description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
type: string
namespace:
description: 'Namespace of the referent. More info:
https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/'
type: string
resourceVersion:
description: 'Specific resourceVersion to which this
reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency'
type: string
uid:
description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
type: string
type: object
required:
- name
type: object
type: array
numBatches:
description: The number of batches, default = 1
format: int32
type: integer
paused:
description: Paused the rollout, default is false
type: boolean
rolloutBatches:
description: The exact distribution among batches. its size has
to be exactly the same as the NumBatches (if set) The total
number cannot exceed the targetSize or the size of the source
resource We will IGNORE the last batch's replica field if it's
a percentage since round errors can lead to inaccurate sum We
highly recommend to leave the last batch's replica field empty
items:
description: RolloutBatch is used to describe how the each batch
rollout should be
properties:
batchRolloutWebhooks:
description: RolloutWebhooks provides a way for the batch
rollout to interact with an external process
items:
description: RolloutWebhook holds the reference to external
checks used for canary analysis
properties:
expectedStatus:
description: ExpectedStatus contains all the expected
http status code that we will accept as success
items:
type: integer
type: array
metadata:
additionalProperties:
type: string
description: Metadata (key-value pairs) for this webhook
type: object
method:
description: Method the HTTP call method, default
is POST
type: string
name:
description: Name of this webhook
type: string
type:
description: Type of this webhook
type: string
url:
description: URL address of this webhook
type: string
required:
- name
- type
- url
type: object
type: array
canaryMetric:
description: CanaryMetric provides a way for the batch rollout
process to automatically check certain metrics before
moving to the next batch
items:
description: CanaryMetric holds the reference to metrics
used for canary analysis
properties:
interval:
description: Interval represents the windows size
type: string
metricsRange:
description: Range value accepted for this metric
properties:
max:
anyOf:
- type: integer
- type: string
description: Maximum value
x-kubernetes-int-or-string: true
min:
anyOf:
- type: integer
- type: string
description: Minimum value
x-kubernetes-int-or-string: true
type: object
name:
description: Name of the metric
type: string
templateRef:
description: TemplateRef references a metric template
object
properties:
apiVersion:
description: API version of the referent.
type: string
fieldPath:
description: 'If referring to a piece of an object
instead of an entire object, this string should
contain a valid JSON/Go field access statement,
such as desiredState.manifest.containers[2].
For example, if the object reference is to a
container within a pod, this would take on a
value like: "spec.containers{name}" (where "name"
refers to the name of the container that triggered
the event) or if no container name is specified
"spec.containers[2]" (container with index 2
in this pod). This syntax is chosen only to
have some well-defined way of referencing a
part of an object. TODO: this design is not
final and this field is subject to change in
the future.'
type: string
kind:
description: 'Kind of the referent. More info:
https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
name:
description: 'Name of the referent. More info:
https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
type: string
namespace:
description: 'Namespace of the referent. More
info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/'
type: string
resourceVersion:
description: 'Specific resourceVersion to which
this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency'
type: string
uid:
description: 'UID of the referent. More info:
https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
type: string
type: object
required:
- name
type: object
type: array
instanceInterval:
description: The wait time, in seconds, between instances
upgrades, default = 0
format: int32
type: integer
maxUnavailable:
anyOf:
- type: integer
- type: string
description: MaxUnavailable is the max allowed number of
pods that is unavailable during the upgrade. We will mark
the batch as ready as long as there are less or equal
number of pods unavailable than this number. default =
0
x-kubernetes-int-or-string: true
podList:
description: The list of Pods to get upgraded it is mutually
exclusive with the Replicas field
items:
type: string
type: array
replicas:
anyOf:
- type: integer
- type: string
description: 'Replicas is the number of pods to upgrade
in this batch it can be an absolute number (ex: 5) or
a percentage of total pods we will ignore the percentage
of the last batch to just fill the gap it is mutually
exclusive with the PodList field'
x-kubernetes-int-or-string: true
type: object
type: array
rolloutStrategy:
description: RolloutStrategy defines strategies for the rollout
plan The default is IncreaseFirstRolloutStrategyType
type: string
rolloutWebhooks:
description: RolloutWebhooks provide a way for the rollout to
interact with an external process
items:
description: RolloutWebhook holds the reference to external
checks used for canary analysis
properties:
expectedStatus:
description: ExpectedStatus contains all the expected http
status code that we will accept as success
items:
type: integer
type: array
metadata:
additionalProperties:
type: string
description: Metadata (key-value pairs) for this webhook
type: object
method:
description: Method the HTTP call method, default is POST
type: string
name:
description: Name of this webhook
type: string
type:
description: Type of this webhook
type: string
url:
description: URL address of this webhook
type: string
required:
- name
- type
- url
type: object
type: array
targetSize:
description: The size of the target resource. The default is the
same as the size of the source resource.
format: int32
type: integer
type: object
sourceRevisionName:
description: SourceRevisionName contains the name of the componentRevisionName that
we need to upgrade from. it can be empty only when it's the first
time to deploy the application
type: string
targetRevisionName:
description: TargetRevisionName contains the name of the componentRevisionName
that we need to upgrade to.
type: string
required:
- componentName
- rolloutPlan
- targetRevisionName
type: object
status:
description: CompRolloutStatus defines the observed state of rollout
properties:
LastSourceRevision:
description: LastSourceRevision contains the name of the componentRevisionName
that we need to upgrade from. We will restart the rollout if this
is not the same as the spec
type: string
batchRollingState:
description: BatchRollingState only meaningful when the Status is
rolling
type: string
conditions:
description: Conditions of the resource.
items:
description: A Condition that may apply to a resource.
properties:
lastTransitionTime:
description: LastTransitionTime is the last time this condition
transitioned from one status to another.
format: date-time
type: string
message:
description: A Message containing details about this condition's
last transition from one status to another, if any.
type: string
reason:
description: A Reason for this condition's last transition from
one status to another.
type: string
status:
description: Status of this condition; is it currently True,
False, or Unknown?
type: string
type:
description: Type of this condition. At most one of each condition
type may apply to a resource at any point in time.
type: string
required:
- lastTransitionTime
- reason
- status
- type
type: object
type: array
currentBatch:
description: The current batch the rollout is working on/blocked it
starts from 0
format: int32
type: integer
lastAppliedPodTemplateIdentifier:
description: lastAppliedPodTemplateIdentifier is a string that uniquely
represent the last pod template each workload type could use different
ways to identify that so we cannot compare between resources We
update this field only after a successful rollout
type: string
lastTargetRevision:
description: LastUpgradedTargetRevision contains the name of the componentRevisionName
that we upgraded to We will restart the rollout if this is not the
same as the spec
type: string
rollingState:
description: RollingState is the Rollout State
type: string
rolloutOriginalSize:
description: RolloutTargetSize is the size of the target resources.
This is determined once the initial spec verification and does not
change until the rollout is restarted
format: int32
type: integer
rolloutTargetSize:
description: RolloutTargetSize is the size of the target resources.
This is determined once the initial spec verification and does not
change until the rollout is restarted
format: int32
type: integer
targetGeneration:
description: NewPodTemplateIdentifier is a string that uniquely represent
the new pod template each workload type could use different ways
to identify that so we cannot compare between resources
type: string
upgradedReadyReplicas:
description: UpgradedReadyReplicas is the number of Pods upgraded
by the rollout controller that have a Ready Condition.
format: int32
type: integer
upgradedReplicas:
description: UpgradedReplicas is the number of Pods upgraded by the
rollout controller
format: int32
type: integer
required:
- currentBatch
- lastTargetRevision
- rollingState
- upgradedReadyReplicas
- upgradedReplicas
type: object
type: object
served: true
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []

View File

@ -1,31 +0,0 @@
Welcome to use the KubeVela! Enjoy your shipping application journey!
,
//,
////
./ /////*
,/// ///////
.///// ////////
/////// /////////
//////// //////////
,///////// ///////////
,////////// ///////////.
./////////// ////////////
//////////// ////////////.
*//////////// ////////////*
#@@@@@@@@@@@* ..,,***/ /////////////
/@@@@@@@@@@@#
*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&
.@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@.
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
.&@@@* *@@@& ,@@@&.
_ __ _ __ __ _
| |/ /_ _ | |__ ___\ \ / /___ | | __ _
| ' /| | | || '_ \ / _ \\ \ / // _ \| | / _` |
| . \| |_| || |_) || __/ \ V /| __/| || (_| |
|_|\_\\__,_||_.__/ \___| \_/ \___||_| \__,_|
You can refer to https://kubevela.io for more details.

View File

@ -1,312 +0,0 @@
{{/* 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 -}}
{{- define "kubevela-cluster-gateway.selectorLabels" -}}
app.kubernetes.io/name: {{ include "kubevela.name" . }}-cluster-gateway
app.kubernetes.io/instance: {{ .Release.Name }}-cluster-gateway
{{- 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 -}}
{{/*
systemDefinitionNamespace value defaulter
*/}}
{{- define "systemDefinitionNamespace" -}}
{{- if .Values.systemDefinitionNamespace -}}
{{ .Values.systemDefinitionNamespace }}
{{- else -}}
{{ .Release.Namespace }}
{{- end -}}
{{- end -}}
{{/*
PodSpec for both Deployment and Pod
*/}}
{{- define "kubevela.podSpec" -}}
{{- with .Values.imagePullSecrets -}}
imagePullSecrets:
{{- toYaml . | nindent 6 -}}
{{- end -}}
serviceAccountName: {{ include "kubevela.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 2 }}
containers:
- name: {{ .Release.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 4 }}
args:
- "--metrics-addr=:8080"
- "--enable-leader-election"
{{- if ne .Values.logFilePath "" }}
- "--log-file-path={{ .Values.logFilePath }}"
- "--log-file-max-size={{ .Values.logFileMaxSize }}"
{{ end -}}
{{ if .Values.logDebug }}
- "--log-debug=true"
{{ end }}
{{ if .Values.admissionWebhooks.enabled }}
- "--use-webhook=true"
- "--webhook-port={{ .Values.webhookService.port }}"
- "--webhook-cert-dir={{ .Values.admissionWebhooks.certificate.mountPath }}"
{{ end }}
- "--health-addr=:{{ .Values.healthCheck.port }}"
{{ if ne .Values.disableCaps "" }}
- "--disable-caps={{ .Values.disableCaps }}"
{{ end }}
- "--system-definition-namespace={{ include "systemDefinitionNamespace" . }}"
- "--application-revision-limit={{ .Values.applicationRevisionLimit }}"
- "--definition-revision-limit={{ .Values.definitionRevisionLimit }}"
- "--oam-spec-ver={{ .Values.OAMSpecVer }}"
{{ if .Values.multicluster.enabled }}
- "--enable-cluster-gateway"
{{ end }}
- "--application-re-sync-period={{ .Values.controllerArgs.reSyncPeriod }}"
- "--concurrent-reconciles={{ .Values.concurrentReconciles }}"
- "--kube-api-qps={{ .Values.kubeClient.qps }}"
- "--kube-api-burst={{ .Values.kubeClient.burst }}"
- "--max-workflow-wait-backoff-time={{ .Values.workflow.backoff.maxTime.waitState }}"
- "--max-workflow-failed-backoff-time={{ .Values.workflow.backoff.maxTime.failedState }}"
- "--max-workflow-step-error-retry-times={{ .Values.workflow.step.errorRetryTimes }}"
image: {{ .Values.imageRegistry }}{{ .Values.image.repository }}:{{ .Values.image.tag }}
imagePullPolicy: {{ quote .Values.image.pullPolicy }}
resources:
{{- toYaml .Values.resources | nindent 4 -}}
{{ if .Values.admissionWebhooks.enabled }}
ports:
- containerPort: {{ .Values.webhookService.port }}
name: webhook-server
protocol: TCP
- containerPort: {{ .Values.healthCheck.port }}
name: healthz
protocol: TCP
readinessProbe:
httpGet:
path: /readyz
port: healthz
initialDelaySeconds: 30
periodSeconds: 5
livenessProbe:
httpGet:
path: /healthz
port: healthz
initialDelaySeconds: 90
periodSeconds: 5
volumeMounts:
- mountPath: {{ .Values.admissionWebhooks.certificate.mountPath }}
name: tls-cert-vol
readOnly: true
{{ end }}
{{ if .Values.admissionWebhooks.enabled }}
volumes:
- name: tls-cert-vol
secret:
defaultMode: 420
secretName: {{ template "kubevela.fullname" . }}-admission
{{ end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 6 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{ end }}
{{/*
Cluster Gateway podSpec for both Deployment and Pod
*/}}
{{- define "kubevela-cluster-gateway.podSpec" -}}
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 2 }}
{{- end }}
serviceAccountName: {{ include "kubevela.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 2 }}
containers:
- name: {{ include "kubevela.fullname" . }}-cluster-gateway
securityContext:
{{- toYaml .Values.securityContext | nindent 6 }}
args:
- "apiserver"
- "--secure-port={{ .Values.multicluster.clusterGateway.port }}"
- "--secret-namespace={{ .Release.Namespace }}"
- "--feature-gates=APIPriorityAndFairness=false,ClientIdentityPenetration={{ .Values.authentication.enabled }}"
{{ if .Values.multicluster.clusterGateway.secureTLS.enabled }}
- "--tls-cert-file={{ .Values.multicluster.clusterGateway.secureTLS.certPath }}/tls.crt"
- "--tls-private-key-file={{ .Values.multicluster.clusterGateway.secureTLS.certPath }}/tls.key"
{{ end }}
image: {{ .Values.imageRegistry }}{{ .Values.multicluster.clusterGateway.image.repository }}:{{ .Values.multicluster.clusterGateway.image.tag }}
imagePullPolicy: {{ .Values.multicluster.clusterGateway.image.pullPolicy }}
resources:
{{- toYaml .Values.multicluster.clusterGateway.resources | nindent 6 }}
ports:
- containerPort: {{ .Values.multicluster.clusterGateway.port }}
{{ if .Values.multicluster.clusterGateway.secureTLS.enabled }}
volumeMounts:
- mountPath: {{ .Values.multicluster.clusterGateway.secureTLS.certPath }}
name: tls-cert-vol
readOnly: true
{{- end }}
{{ if .Values.multicluster.clusterGateway.secureTLS.enabled }}
volumes:
- name: tls-cert-vol
secret:
defaultMode: 420
secretName: {{ template "kubevela.fullname" . }}-cluster-gateway-tls-v2
{{ end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 2 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 2 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 2 }}
{{- end }}
{{ end }}
{{ define "kubevela-cluster-gateway-tls-secret-patch.name-labels" }}
name: {{ template "kubevela.fullname" . }}-cluster-gateway-tls-secret-patch
labels:
app: {{ template "kubevela.fullname" . }}-cluster-gateway-tls-secret-patch
{{- include "kubevela.labels" . | nindent 2 }}
{{ end }}
{{ define "kubevela-cluster-gateway-tls-secret-patch.annotations" }}
annotations:
"helm.sh/hook": post-install,post-upgrade
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded
{{ end }}
{{/*
Cluster Gateway TLS secret patch podSpec for both Job and Pod
*/}}
{{ define "kubevela-cluster-gateway-tls-secret-patch.podSpec" }}
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 2 }}
{{- end }}
containers:
- name: patch
image: {{ .Values.imageRegistry }}{{ .Values.multicluster.clusterGateway.image.repository }}:{{ .Values.multicluster.clusterGateway.image.tag }}
imagePullPolicy: {{ .Values.multicluster.clusterGateway.image.pullPolicy }}
command:
- /patch
args:
- --secret-namespace={{ .Release.Namespace }}
- --secret-name={{ template "kubevela.fullname" . }}-cluster-gateway-tls-v2
restartPolicy: OnFailure
serviceAccountName: {{ include "kubevela.serviceAccountName" . }}
securityContext:
runAsGroup: 2000
runAsNonRoot: true
runAsUser: 2000
{{ end }}
{{ define "kubevela-cluster-gateway-tls-secret-create.name-labels" }}
name: {{ template "kubevela.fullname" . }}-cluster-gateway-tls-secret-create
labels:
app: {{ template "kubevela.fullname" . }}-cluster-gateway-tls-secret-create
{{- include "kubevela.labels" . | nindent 2 }}
{{ end }}
{{ define "kubevela-cluster-gateway-tls-secret-create.annotations" }}
annotations:
"helm.sh/hook": pre-install,pre-upgrade
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded
{{ end }}
{{/*
Cluster Gateway TLS secret create podSpec for both Job and Pod
*/}}
{{ define "kubevela-cluster-gateway-tls-secret-create.podSpec" }}
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 2 }}
{{- end }}
containers:
- name: create
image: {{ .Values.imageRegistry }}{{ .Values.admissionWebhooks.patch.image.repository }}:{{ .Values.admissionWebhooks.patch.image.tag }}
imagePullPolicy: {{ .Values.admissionWebhooks.patch.image.pullPolicy }}
args:
- create
- --host={{ .Release.Name }}-cluster-gateway-service,{{ .Release.Name }}-cluster-gateway-service.{{ .Release.Namespace }}.svc
- --namespace={{ .Release.Namespace }}
- --secret-name={{ template "kubevela.fullname" . }}-cluster-gateway-tls-v2
- --cert-name=tls.crt
- --key-name=tls.key
restartPolicy: OnFailure
serviceAccountName: {{ template "kubevela.fullname" . }}-cluster-gateway-admission
securityContext:
runAsGroup: 2000
runAsNonRoot: true
runAsUser: 2000
{{ end }}

View File

@ -1,270 +0,0 @@
{{- if .Values.enableFluxcdAddon -}}
apiVersion: core.oam.dev/v1beta1
kind: Application
metadata:
labels:
addons.oam.dev/name: fluxcd-def
name: addon-fluxcd-def
namespace: {{ .Release.Namespace }}
annotations:
"helm.sh/resource-policy": keep
spec:
components:
- name: fluxc-def-resources
properties:
objects:
- apiVersion: core.oam.dev/v1beta1
kind: ComponentDefinition
metadata:
annotations:
definition.oam.dev/description: helm release is a group of K8s resources
from either git repository or helm repo
name: helm
namespace: {{.Values.systemDefinitionNamespace}}
spec:
schematic:
cue:
template: "output: {\n\tapiVersion: \"source.toolkit.fluxcd.io/v1beta1\"\n\tmetadata:
{\n\t\tname: context.name\n\t}\n\tif parameter.repoType == \"git\"
{\n\t\tkind: \"GitRepository\"\n\t\tspec: {\n\t\t\turl: parameter.url\n\t\t\tif
parameter.git.branch != _|_ {\n\t\t\t\tref: branch: parameter.git.branch\n\t\t\t}\n\t\t\t_secret\n\t\t\t_sourceCommonArgs\n\t\t}\n\t}\n\tif
parameter.repoType == \"oss\" {\n\t\tkind: \"Bucket\"\n\t\tspec: {\n\t\t\tendpoint:
\ parameter.url\n\t\t\tbucketName: parameter.oss.bucketName\n\t\t\tprovider:
\ parameter.oss.provider\n\t\t\tif parameter.oss.region != _|_ {\n\t\t\t\tregion:
parameter.oss.region\n\t\t\t}\n\t\t\t_secret\n\t\t\t_sourceCommonArgs\n\t\t}\n\t}\n\tif
parameter.repoType == \"helm\" {\n\t\tkind: \"HelmRepository\"\n\t\tspec:
{\n\t\t\turl: parameter.url\n\t\t\t_secret\n\t\t\t_sourceCommonArgs\n\t\t}\n\t}\n}\n\noutputs:
release: {\n\tapiVersion: \"helm.toolkit.fluxcd.io/v2beta1\"\n\tkind:
\ \"HelmRelease\"\n\tmetadata: {\n\t\tname: context.name\n\t}\n\tspec:
{\n\t\ttimeout: parameter.installTimeout\n\t\tinterval: parameter.interval\n\t\tchart:
{\n\t\t\tspec: {\n\t\t\t\tchart: parameter.chart\n\t\t\t\tversion:
parameter.version\n\t\t\t\tsourceRef: {\n\t\t\t\t\tif parameter.repoType
== \"git\" {\n\t\t\t\t\t\tkind: \"GitRepository\"\n\t\t\t\t\t}\n\t\t\t\t\tif
parameter.repoType == \"helm\" {\n\t\t\t\t\t\tkind: \"HelmRepository\"\n\t\t\t\t\t}\n\t\t\t\t\tif
parameter.repoType == \"oss\" {\n\t\t\t\t\t\tkind: \"Bucket\"\n\t\t\t\t\t}\n\t\t\t\t\tname:
\ context.name\n\t\t\t\t}\n\t\t\t\tinterval: parameter.interval\n\t\t\t}\n\t\t}\n\t\tif
parameter.targetNamespace != _|_ {\n\t\t\ttargetNamespace: parameter.targetNamespace\n\t\t}\n\t\tif
parameter.releaseName != _|_ {\n\t\t\treleaseName: parameter.releaseName\n\t\t}\n\t\tif
parameter.values != _|_ {\n\t\t\tvalues: parameter.values\n\t\t}\n\t}\n}\n\n_secret:
{\n\tif parameter.secretRef != _|_ {\n\t\tsecretRef: {\n\t\t\tname:
parameter.secretRef\n\t\t}\n\t}\n}\n\n_sourceCommonArgs: {\n\tinterval:
parameter.pullInterval\n\tif parameter.timeout != _|_ {\n\t\ttimeout:
parameter.timeout\n\t}\n}\n\nparameter: {\n\trepoType: *\"helm\" |
\"git\" | \"oss\"\n\t// +usage=The interval at which to check for
repository/bucket and relese updates, default to 5m\n\tpullInterval:
*\"5m\" | string\n // +usage=The Interval at which to reconcile
the Helm release, default to 30s\n interval: *\"30s\" | string\n\t//
+usage=The Git or Helm repository URL, OSS endpoint, accept HTTP/S
or SSH address as git url,\n\turl: string\n\t// +usage=The name of
the secret containing authentication credentials\n\tsecretRef?: string\n\t//
+usage=The timeout for operations like download index/clone repository,
optional\n\ttimeout?: string\n\t// +usage=The timeout for operation
`helm install`, optional\n\tinstallTimeout: *\"10m\" | string\n\n\tgit?:
{\n\t\t// +usage=The Git reference to checkout and monitor for changes,
defaults to master branch\n\t\tbranch: string\n\t}\n\toss?: {\n\t\t//
+usage=The bucket's name, required if repoType is oss\n\t\tbucketName:
string\n\t\t// +usage=\"generic\" for Minio, Amazon S3, Google Cloud
Storage, Alibaba Cloud OSS, \"aws\" for retrieve credentials from
the EC2 service when credentials not specified, default \"generic\"\n\t\tprovider:
*\"generic\" | \"aws\"\n\t\t// +usage=The bucket region, optional\n\t\tregion?:
string\n\t}\n\n\t// +usage=1.The relative path to helm chart for git/oss
source. 2. chart name for helm resource 3. relative path for chart
package(e.g. ./charts/podinfo-1.2.3.tgz)\n\tchart: string\n\t// +usage=Chart
version\n\tversion: *\"*\" | string\n\t// +usage=The namespace for
helm chart, optional\n\ttargetNamespace?: string\n\t// +usage=The
release name\n\treleaseName?: string\n\t// +usage=Chart values\n\tvalues?:
#nestedmap\n}\n\n#nestedmap: {\n\t...\n}\n"
status:
customStatus: "repoMessage: string\nreleaseMessage: string\nif context.output.status
== _|_ {\n\trepoMessage: \"Fetching repository\"\n\treleaseMessage:
\"Wating repository ready\"\n}\nif context.output.status != _|_ {\n\trepoStatus:
context.output.status\n\tif repoStatus.conditions[0][\"type\"] != \"Ready\"
{\n\t\trepoMessage: \"Fetch repository fail\"\n\t}\n\tif repoStatus.conditions[0][\"type\"]
== \"Ready\" {\n\t\trepoMessage: \"Fetch repository successfully\"\n\t}\n\n\tif
context.outputs.release.status == _|_ {\n\t\treleaseMessage: \"Creating
helm release\"\n\t}\n\tif context.outputs.release.status != _|_ {\n\t\tif
context.outputs.release.status.conditions[0][\"message\"] == \"Release
reconciliation succeeded\" {\n\t\t\treleaseMessage: \"Create helm release
successfully\"\n\t\t}\n\t\tif context.outputs.release.status.conditions[0][\"message\"]
!= \"Release reconciliation succeeded\" {\n\t\t\treleaseBasicMessage:
\"Delivery helm release in progress, message: \" + context.outputs.release.status.conditions[0][\"message\"]\n\t\t\tif
len(context.outputs.release.status.conditions) == 1 {\n\t\t\t\treleaseMessage:
releaseBasicMessage\n\t\t\t}\n\t\t\tif len(context.outputs.release.status.conditions)
> 1 {\n\t\t\t\treleaseMessage: releaseBasicMessage + \", \" + context.outputs.release.status.conditions[1][\"message\"]\n\t\t\t}\n\t\t}\n\t}\n\n}\nmessage:
repoMessage + \", \" + releaseMessage"
healthPolicy: 'isHealth: len(context.outputs.release.status.conditions)
!= 0 && context.outputs.release.status.conditions[0]["status"]=="True"'
workload:
type: autodetects.core.oam.dev
- apiVersion: core.oam.dev/v1beta1
kind: TraitDefinition
metadata:
annotations:
definition.oam.dev/description: A list of JSON6902 patch to selected target
name: kustomize-json-patch
namespace: {{.Values.systemDefinitionNamespace}}
spec:
schematic:
cue:
template: "patch: {\n\tspec: {\n\t\tpatchesJson6902: parameter.patchesJson\n\t}\n}\n\nparameter:
{\n\t// +usage=A list of JSON6902 patch.\n\tpatchesJson: [...#jsonPatchItem]\n}\n\n//
+usage=Contains a JSON6902 patch\n#jsonPatchItem: {\n\ttarget: #selector\n\tpatch:
[...{\n\t\t// +usage=operation to perform\n\t\top: string | \"add\"
| \"remove\" | \"replace\" | \"move\" | \"copy\" | \"test\"\n\t\t//
+usage=operate path e.g. /foo/bar\n\t\tpath: string\n\t\t// +usage=specify
source path when op is copy/move\n\t\tfrom?: string\n\t\t// +usage=specify
opraation value when op is test/add/replace\n\t\tvalue?: string\n\t}]\n}\n\n//
+usage=Selector specifies a set of resources\n#selector: {\n\tgroup?:
\ string\n\tversion?: string\n\tkind?: string\n\tnamespace?:
\ string\n\tname?: string\n\tannotationSelector?:
string\n\tlabelSelector?: string\n}\n"
- apiVersion: core.oam.dev/v1beta1
kind: TraitDefinition
metadata:
annotations:
definition.oam.dev/description: A list of StrategicMerge or JSON6902 patch
to selected target
name: kustomize-patch
namespace: {{.Values.systemDefinitionNamespace}}
spec:
schematic:
cue:
template: "patch: {\n\tspec: {\n\t\tpatches: parameter.patches\n\t}\n}\nparameter:
{\n\t// +usage=a list of StrategicMerge or JSON6902 patch to selected
target\n\tpatches: [...#patchItem]\n}\n\n// +usage=Contains a strategicMerge
or JSON6902 patch\n#patchItem: {\n\t// +usage=Inline patch string,
in yaml style\n\tpatch: string\n\t// +usage=Specify the target the
patch should be applied to\n\ttarget: #selector\n}\n\n// +usage=Selector
specifies a set of resources\n#selector: {\n\tgroup?: string\n\tversion?:
\ string\n\tkind?: string\n\tnamespace?: string\n\tname?:
\ string\n\tannotationSelector?: string\n\tlabelSelector?:
\ string\n}\n"
- apiVersion: core.oam.dev/v1beta1
kind: ComponentDefinition
metadata:
annotations:
definition.oam.dev/description: kustomize can fetching, building, updating
and applying Kustomize manifests from git repo.
name: kustomize
namespace: {{.Values.systemDefinitionNamespace}}
spec:
schematic:
cue:
template: "output: {\n\tapiVersion: \"kustomize.toolkit.fluxcd.io/v1beta1\"\n\tkind:
\ \"Kustomization\"\n\tmetadata: {\n\t\tname: context.name\n
\ namespace: context.namespace\n\t}\n\tspec: {\n\t\tinterval: parameter.pullInterval\n\t\tsourceRef:
{\n\t\t\tif parameter.repoType == \"git\" {\n\t\t\t\tkind: \"GitRepository\"\n\t\t\t}\n\t\t\tif
parameter.repoType == \"oss\" {\n\t\t\t\tkind: \"Bucket\"\n\t\t\t}\n\t\t\tname:
\ context.name\n\t\t\tnamespace: context.namespace\n\t\t}\n\t\tpath:
\ parameter.path\n\t\tprune: true\n\t\tvalidation: \"client\"\n\t}\n}\n\noutputs:
{\n repo: {\n\t apiVersion: \"source.toolkit.fluxcd.io/v1beta1\"\n\t
\ metadata: {\n\t\t name: context.name\n namespace: context.namespace\n\t
\ }\n\t if parameter.repoType == \"git\" {\n\t\t kind: \"GitRepository\"\n\t\t
\ spec: {\n\t\t\t url: parameter.url\n\t\t\t if parameter.git.branch
!= _|_ {\n\t\t\t\t ref: branch: parameter.git.branch\n\t\t\t }\n
\ if parameter.git.provider != _|_ {\n if parameter.git.provider
== \"GitHub\" {\n gitImplementation: \"go-git\"\n }\n
\ if parameter.git.provider == \"AzureDevOps\" {\n gitImplementation:
\"libgit2\"\n }\n }\n\t\t\t _secret\n\t\t\t _sourceCommonArgs\n\t\t
\ }\n\t }\n\t if parameter.repoType == \"oss\" {\n\t\t kind: \"Bucket\"\n\t\t
\ spec: {\n\t\t\t endpoint: parameter.url\n\t\t\t bucketName:
parameter.oss.bucketName\n\t\t\t provider: parameter.oss.provider\n\t\t\t
\ if parameter.oss.region != _|_ {\n\t\t\t\t region: parameter.oss.region\n\t\t\t
\ }\n\t\t\t _secret\n\t\t\t _sourceCommonArgs\n\t\t }\n\t }\n
\ }\n\n if parameter.imageRepository != _|_ {\n imageRepo: {\n
\ apiVersion: \"image.toolkit.fluxcd.io/v1beta1\"\n kind:
\"ImageRepository\"\n\t metadata: {\n\t\t name: context.name\n
\ namespace: context.namespace\n\t }\n spec: {\n image:
parameter.imageRepository.image\n interval: parameter.pullInterval\n
\ if parameter.imageRepository.secretRef != _|_ {\n secretRef:
name: parameter.imageRepository.secretRef\n }\n }\n }\n\n
\ imagePolicy: {\n apiVersion: \"image.toolkit.fluxcd.io/v1beta1\"\n
\ kind: \"ImagePolicy\"\n\t metadata: {\n\t\t name: context.name\n
\ namespace: context.namespace\n\t }\n spec: {\n imageRepositoryRef:
name: context.name\n policy: parameter.imageRepository.policy\n
\ if parameter.imageRepository.filterTags != _|_ {\n filterTags:
parameter.imageRepository.filterTags\n }\n }\n }\n\n
\ imageUpdate: {\n apiVersion: \"image.toolkit.fluxcd.io/v1beta1\"\n
\ kind: \"ImageUpdateAutomation\"\n\t metadata: {\n\t\t name:
context.name\n namespace: context.namespace\n\t }\n spec:
{\n interval: parameter.pullInterval\n sourceRef: {\n
\ kind: \"GitRepository\"\n name: context.name\n
\ }\n git: {\n checkout: ref: branch: parameter.git.branch\n
\ commit: {\n author: {\n email: \"kubevelabot@users.noreply.github.com\"\n
\ name: \"kubevelabot\"\n }\n if
parameter.imageRepository.commitMessage != _|_ {\n messageTemplate:
\"Update image automatically.\\n\" + parameter.imageRepository.commitMessage\n
\ }\n if parameter.imageRepository.commitMessage
== _|_ {\n messageTemplate: \"Update image automatically.\"\n
\ }\n }\n push: branch: parameter.git.branch\n
\ }\n update: {\n path:\tparameter.path\n strategy:
\"Setters\"\n }\n }\n }\n }\n}\n\n_secret: {\n\tif
parameter.secretRef != _|_ {\n\t\tsecretRef: {\n\t\t\tname: parameter.secretRef\n\t\t}\n\t}\n}\n\n_sourceCommonArgs:
{\n\tinterval: parameter.pullInterval\n\tif parameter.timeout != _|_
{\n\t\ttimeout: parameter.timeout\n\t}\n}\n\nparameter: {\n\trepoType:
*\"git\" | \"oss\"\n // +usage=The image repository for automatically
update image to git\n imageRepository?: {\n // +usage=The image
url\n image: string\n // +usage=The name of the secret containing
authentication credentials\n secretRef?: string\n // +usage=Policy
gives the particulars of the policy to be followed in selecting the
most recent image.\n policy: {\n // +usage=Alphabetical set
of rules to use for alphabetical ordering of the tags.\n alphabetical?:
{\n // +usage=Order specifies the sorting order of the tags.\n
\ // +usage=Given the letters of the alphabet as tags, ascending
order would select Z, and descending order would select A.\n order?:
\"asc\" | \"desc\"\n }\n // +usage=Numerical set of rules
to use for numerical ordering of the tags.\n numerical?: {\n
\ // +usage=Order specifies the sorting order of the tags.\n
\ // +usage=Given the integer values from 0 to 9 as tags, ascending
order would select 9, and descending order would select 0.\n order:
\"asc\" | \"desc\"\n }\n // +usage=SemVer gives a semantic
version range to check against the tags available.\n semver?:
{\n // +usage=Range gives a semver range for the image tag;
the highest version within the range that's a tag yields the latest
image.\n range: string\n }\n }\n // +usage=FilterTags
enables filtering for only a subset of tags based on a set of rules.
If no rules are provided, all the tags from the repository will be
ordered and compared.\n filterTags?: {\n // +usage=Extract
allows a capture group to be extracted from the specified regular
expression pattern, useful before tag evaluation.\n extract?:
string\n // +usage=Pattern specifies a regular expression pattern
used to filter for image tags.\n pattern?: string\n }\n //
+usage=The image url\n commitMessage?: string\n }\n\t// +usage=The
interval at which to check for repository/bucket and release updates,
default to 5m\n\tpullInterval: *\"5m\" | string\n\t// +usage=The Git
or Helm repository URL, OSS endpoint, accept HTTP/S or SSH address
as git url,\n\turl: string\n\t// +usage=The name of the secret containing
authentication credentials\n\tsecretRef?: string\n\t// +usage=The
timeout for operations like download index/clone repository, optional\n\ttimeout?:
string\n\tgit?: {\n\t\t// +usage=The Git reference to checkout and
monitor for changes, defaults to master branch\n\t\tbranch: string\n
\ // +usage=Determines which git client library to use. Defaults
to GitHub, it will pick go-git. AzureDevOps will pick libgit2.\n provider?:
*\"GitHub\" | \"AzureDevOps\"\n\t}\n\toss?: {\n\t\t// +usage=The bucket's
name, required if repoType is oss\n\t\tbucketName: string\n\t\t//
+usage=\"generic\" for Minio, Amazon S3, Google Cloud Storage, Alibaba
Cloud OSS, \"aws\" for retrieve credentials from the EC2 service when
credentials not specified, default \"generic\"\n\t\tprovider: *\"generic\"
| \"aws\"\n\t\t// +usage=The bucket region, optional\n\t\tregion?:
string\n\t}\n\t//+usage=Path to the directory containing the kustomization.yaml
file, or the set of plain YAMLs a kustomization.yaml should be generated
for.\n\tpath: string\n}"
workload:
type: autodetects.core.oam.dev
- apiVersion: core.oam.dev/v1beta1
kind: TraitDefinition
metadata:
annotations:
definition.oam.dev/description: A list of strategic merge to kustomize
config
name: kustomize-strategy-merge
namespace: {{.Values.systemDefinitionNamespace}}
spec:
schematic:
cue:
template: "patch: {\n\tspec: {\n\t\tpatchesStrategicMerge: parameter.patchesStrategicMerge\n\t}\n}\n\nparameter:
{\n\t// +usage=a list of strategicmerge, defined as inline yaml objects.\n\tpatchesStrategicMerge:
[...#nestedmap]\n}\n\n#nestedmap: {\n\t...\n}\n"
type: k8s-objects
{{- end }}

View File

@ -1,14 +0,0 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: vela-addon-registry
namespace: {{ .Release.Namespace }}
data:
registries: '{
"KubeVela":{
"name": "KubeVela",
"helm": {
"url": "https://addons.kubevela.net"
}
}
}'

View File

@ -1,55 +0,0 @@
{{- if and .Values.admissionWebhooks.certManager.enabled -}}
# 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/v1
kind: Issuer
metadata:
name: {{ template "kubevela.fullname" . }}-self-signed-issuer
spec:
selfSigned: {}
---
# Generate a CA Certificate used to sign certificates for the webhook
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: {{ template "kubevela.fullname" . }}-root-cert
spec:
secretName: {{ template "kubevela.fullname" . }}-root-cert
duration: 43800h # 5y
revisionHistoryLimit: {{ .Values.admissionWebhooks.certManager.revisionHistoryLimit }}
issuerRef:
name: {{ template "kubevela.fullname" . }}-self-signed-issuer
commonName: "ca.webhook.kubevela"
isCA: true
---
# Create an Issuer that uses the above generated CA certificate to issue certs
apiVersion: cert-manager.io/v1
kind: Issuer
metadata:
name: {{ template "kubevela.fullname" . }}-root-issuer
namespace: {{ .Release.Namespace }}
spec:
ca:
secretName: {{ template "kubevela.fullname" . }}-root-cert
---
# generate a serving certificate for the apiservices to use
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: {{ template "kubevela.fullname" . }}-admission
namespace: {{ .Release.Namespace }}
spec:
secretName: {{ template "kubevela.fullname" . }}-admission
duration: 8760h # 1y
revisionHistoryLimit: {{ .Values.admissionWebhooks.certManager.revisionHistoryLimit }}
issuerRef:
name: {{ template "kubevela.fullname" . }}-root-issuer
dnsNames:
- {{ template "kubevela.name" . }}-webhook.{{ .Release.Namespace }}.svc
- {{ template "kubevela.name" . }}-webhook.{{ .Release.Namespace }}.svc.cluster.local
{{- end }}

View File

@ -1,67 +0,0 @@
{{ define "kubevela-admission-webhook-patch.Podspec" }}
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 2 }}
{{- end }}
containers:
- name: patch
image: {{ .Values.imageRegistry }}{{ .Values.admissionWebhooks.patch.image.repository }}:{{ .Values.admissionWebhooks.patch.image.tag }}
imagePullPolicy: {{ .Values.admissionWebhooks.patch.image.pullPolicy }}
args:
- patch
- --webhook-name={{ template "kubevela.fullname" . }}-admission
- --namespace={{ .Release.Namespace }}
- --secret-name={{ template "kubevela.fullname" . }}-admission
- --patch-failure-policy={{ .Values.admissionWebhooks.failurePolicy }}
- --crds=applications.core.oam.dev
restartPolicy: OnFailure
serviceAccountName: {{ template "kubevela.fullname" . }}-admission
{{- with .Values.admissionWebhooks.patch.affinity }}
affinity:
{{ toYaml . | indent 2 }}
{{- end }}
{{- with .Values.admissionWebhooks.patch.tolerations }}
tolerations:
{{ toYaml . | indent 2 }}
{{- end }}
securityContext:
runAsGroup: 2000
runAsNonRoot: true
runAsUser: 2000
{{ end }}
{{ define "kubevela-admission-webhook-create.podSpec" }}
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 2 }}
{{- end }}
containers:
- name: create
image: {{ .Values.imageRegistry }}{{ .Values.admissionWebhooks.patch.image.repository }}:{{ .Values.admissionWebhooks.patch.image.tag }}
imagePullPolicy: {{ .Values.admissionWebhooks.patch.image.pullPolicy }}
args:
- create
- --host={{ template "kubevela.name" . }}-webhook,{{ template "kubevela.name" . }}-webhook.{{ .Release.Namespace }}.svc
- --namespace={{ .Release.Namespace }}
- --secret-name={{ template "kubevela.fullname" . }}-admission
- --key-name=tls.key
- --cert-name=tls.crt
restartPolicy: OnFailure
serviceAccountName: {{ template "kubevela.fullname" . }}-admission
{{- with .Values.admissionWebhooks.patch.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 2 }}
{{- end }}
{{- with .Values.admissionWebhooks.patch.affinity }}
affinity:
{{ toYaml . | indent 2 }}
{{- end }}
{{- with .Values.admissionWebhooks.patch.tolerations }}
tolerations:
{{ toYaml . | indent 2 }}
{{- end }}
securityContext:
runAsGroup: 2000
runAsNonRoot: true
runAsUser: 2000
{{ end }}

View File

@ -1,28 +0,0 @@
{{- if and .Values.admissionWebhooks.enabled .Values.admissionWebhooks.patch.enabled .Values.rbac.create (not .Values.admissionWebhooks.certManager.enabled) }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ template "kubevela.fullname" . }}-admission
annotations:
"helm.sh/hook": pre-install,pre-upgrade,post-install,post-upgrade
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded
labels:
app: {{ template "kubevela.name" . }}-admission
{{- include "kubevela.labels" . | nindent 4 }}
rules:
- apiGroups:
- admissionregistration.k8s.io
resources:
- validatingwebhookconfigurations
- mutatingwebhookconfigurations
verbs:
- get
- update
- apiGroups:
- apiextensions.k8s.io
resources:
- customresourcedefinitions
verbs:
- get
- update
{{- end }}

View File

@ -1,20 +0,0 @@
{{- if and .Values.admissionWebhooks.enabled .Values.admissionWebhooks.patch.enabled .Values.rbac.create (not .Values.admissionWebhooks.certManager.enabled) }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: {{ template "kubevela.fullname" . }}-admission
annotations:
"helm.sh/hook": pre-install,pre-upgrade,post-install,post-upgrade
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded
labels:
app: {{ template "kubevela.name" . }}-admission
{{- include "kubevela.labels" . | nindent 4 }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: {{ template "kubevela.fullname" . }}-admission
subjects:
- kind: ServiceAccount
name: {{ template "kubevela.fullname" . }}-admission
namespace: {{ .Release.Namespace }}
{{- end }}

View File

@ -1,28 +0,0 @@
{{- if and .Values.admissionWebhooks.enabled .Values.admissionWebhooks.patch.enabled (not .Values.admissionWebhooks.certManager.enabled) }}
{{ if not .Values.deployByPod }}
apiVersion: batch/v1
kind: Job
metadata:
name: {{ template "kubevela.fullname" . }}-admission-create
namespace: {{ .Release.Namespace }}
annotations:
"helm.sh/hook": pre-install,pre-upgrade
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded
labels:
app: {{ template "kubevela.name" . }}-admission-create
{{- include "kubevela.labels" . | nindent 4 }}
spec:
{{- if .Capabilities.APIVersions.Has "batch/v1alpha1" }}
# Alpha feature since k8s 1.12
ttlSecondsAfterFinished: 0
{{- end }}
template:
metadata:
name: {{ template "kubevela.fullname" . }}-admission-create
labels:
app: {{ template "kubevela.name" . }}-admission-create
{{- include "kubevela.labels" . | nindent 8 }}
spec:
{{ include "kubevela-admission-webhook-create.podSpec" . | indent 6 }}
{{- end }}
{{ end }}

View File

@ -1,56 +0,0 @@
{{- if and .Values.admissionWebhooks.enabled .Values.admissionWebhooks.patch.enabled (not .Values.admissionWebhooks.certManager.enabled) }}
apiVersion: batch/v1
kind: Job
metadata:
name: {{ template "kubevela.fullname" . }}-admission-patch
namespace: {{ .Release.Namespace }}
annotations:
"helm.sh/hook": post-install,post-upgrade
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded
labels:
app: {{ template "kubevela.name" . }}-admission-patch
{{- include "kubevela.labels" . | nindent 4 }}
spec:
{{- if .Capabilities.APIVersions.Has "batch/v1alpha1" }}
# Alpha feature since k8s 1.12
ttlSecondsAfterFinished: 0
{{- end }}
template:
metadata:
name: {{ template "kubevela.fullname" . }}-admission-patch
labels:
app: {{ template "kubevela.name" . }}-admission-patch
{{- include "kubevela.labels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: patch
image: {{ .Values.imageRegistry }}{{ .Values.admissionWebhooks.patch.image.repository }}:{{ .Values.admissionWebhooks.patch.image.tag }}
imagePullPolicy: {{ .Values.admissionWebhooks.patch.image.pullPolicy }}
args:
- patch
- --webhook-name={{ template "kubevela.fullname" . }}-admission
- --namespace={{ .Release.Namespace }}
- --secret-name={{ template "kubevela.fullname" . }}-admission
- --patch-failure-policy={{ .Values.admissionWebhooks.failurePolicy }}
{{- if .Values.admissionWebhooks.appConversion.enabled }}
- --crds={"name":"applications.core.oam.dev","conversion":{"strategy":"Webhook","webhook":{"clientConfig":{"service":{"name":"vela-core-webhook","namespace":"vela-system","path":"/convert","port":443}},"conversionReviewVersions":["v1beta1","v1alpha2"]}}}
{{- end }}
restartPolicy: OnFailure
serviceAccountName: {{ template "kubevela.fullname" . }}-admission
{{- with .Values.admissionWebhooks.patch.affinity }}
affinity:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.admissionWebhooks.patch.tolerations }}
tolerations:
{{ toYaml . | indent 8 }}
{{- end }}
securityContext:
runAsGroup: 2000
runAsNonRoot: true
runAsUser: 2000
{{- end }}

View File

@ -1,21 +0,0 @@
{{- if and .Values.admissionWebhooks.enabled .Values.admissionWebhooks.patch.enabled .Values.rbac.create (not .Values.admissionWebhooks.certManager.enabled) }}
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: {{ template "kubevela.fullname" . }}-admission
namespace: {{ .Release.Namespace }}
annotations:
"helm.sh/hook": pre-install,pre-upgrade,post-install,post-upgrade
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded
labels:
app: {{ template "kubevela.name" . }}-admission
{{- include "kubevela.labels" . | nindent 4 }}
rules:
- apiGroups:
- ""
resources:
- secrets
verbs:
- get
- create
{{- end }}

View File

@ -1,21 +0,0 @@
{{- if and .Values.admissionWebhooks.enabled .Values.admissionWebhooks.patch.enabled .Values.rbac.create (not .Values.admissionWebhooks.certManager.enabled) }}
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: {{ template "kubevela.fullname" . }}-admission
namespace: {{ .Release.Namespace }}
annotations:
"helm.sh/hook": pre-install,pre-upgrade,post-install,post-upgrade
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded
labels:
app: {{ template "kubevela.name" . }}-admission
{{- include "kubevela.labels" . | nindent 4 }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: {{ template "kubevela.fullname" . }}-admission
subjects:
- kind: ServiceAccount
name: {{ template "kubevela.fullname" . }}-admission
namespace: {{ .Release.Namespace }}
{{- end }}

View File

@ -1,13 +0,0 @@
{{- if and .Values.admissionWebhooks.enabled .Values.admissionWebhooks.patch.enabled .Values.rbac.create (not .Values.admissionWebhooks.certManager.enabled) }}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ template "kubevela.fullname" . }}-admission
namespace: {{ .Release.Namespace }}
annotations:
"helm.sh/hook": pre-install,pre-upgrade,post-install,post-upgrade
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded
labels:
app: {{ template "kubevela.name" . }}-admission
{{- include "kubevela.labels" . | nindent 4 }}
{{- end }}

View File

@ -1,176 +0,0 @@
{{- if .Values.admissionWebhooks.enabled -}}
apiVersion: admissionregistration.k8s.io/v1
kind: MutatingWebhookConfiguration
metadata:
name: {{ template "kubevela.fullname" . }}-admission
namespace: {{ .Release.Namespace }}
{{- if .Values.admissionWebhooks.certManager.enabled }}
annotations:
cert-manager.io/inject-ca-from: {{ printf "%s/%s-root-cert" .Release.Namespace (include "kubevela.fullname" .) | quote }}
{{- end }}
webhooks:
{{- if eq .Values.OAMSpecVer "all"}}
- clientConfig:
caBundle: Cg==
service:
name: {{ template "kubevela.name" . }}-webhook
namespace: {{ .Release.Namespace }}
path: /mutating-core-oam-dev-v1alpha2-applicationconfigurations
{{- if .Values.admissionWebhooks.patch.enabled }}
failurePolicy: Ignore
{{- else }}
failurePolicy: Fail
{{- end }}
name: mutating.core.oam.dev.v1alpha2.applicationconfigurations
sideEffects: None
rules:
- apiGroups:
- core.oam.dev
apiVersions:
- v1alpha2
operations:
- CREATE
- UPDATE
resources:
- applicationconfigurations
scope: Namespaced
admissionReviewVersions:
- v1beta1
- v1
timeoutSeconds: 5
- clientConfig:
caBundle: Cg==
service:
name: {{ template "kubevela.name" . }}-webhook
namespace: {{ .Release.Namespace }}
path: /mutating-core-oam-dev-v1alpha2-components
{{- if .Values.admissionWebhooks.patch.enabled }}
failurePolicy: Ignore
{{- else }}
failurePolicy: Fail
{{- end }}
name: mutating.core.oam-dev.v1alpha2.components
sideEffects: None
rules:
- apiGroups:
- core.oam.dev
apiVersions:
- v1alpha2
operations:
- CREATE
- UPDATE
resources:
- components
scope: Namespaced
admissionReviewVersions:
- v1beta1
- v1
timeoutSeconds: 5
{{- end }}
- clientConfig:
caBundle: Cg==
service:
name: {{ template "kubevela.name" . }}-webhook
namespace: {{ .Release.Namespace }}
path: /mutating-core-oam-dev-v1beta1-approllout
{{- if .Values.admissionWebhooks.patch.enabled }}
failurePolicy: Ignore
{{- else }}
failurePolicy: Fail
{{- end }}
name: mutating.core.oam.dev.v1beta1.approllouts
sideEffects: None
rules:
- apiGroups:
- core.oam.dev
apiVersions:
- v1beta1
operations:
- CREATE
- UPDATE
resources:
- approllouts
scope: Namespaced
admissionReviewVersions:
- v1beta1
- v1
timeoutSeconds: 5
- clientConfig:
caBundle: Cg==
service:
name: {{ template "kubevela.name" . }}-webhook
namespace: {{ .Release.Namespace }}
path: /mutate-standard-oam-dev-v1alpha1-podspecworkload
{{- if .Values.admissionWebhooks.patch.enabled }}
failurePolicy: Ignore
{{- else }}
failurePolicy: Fail
{{- end }}
name: mcontainerized.kb.io
sideEffects: None
admissionReviewVersions:
- v1beta1
rules:
- apiGroups:
- standard.oam.dev
apiVersions:
- v1alpha1
operations:
- CREATE
- UPDATE
resources:
- podspecworkloads
- clientConfig:
caBundle: Cg==
service:
name: {{ template "kubevela.name" . }}-webhook
namespace: {{ .Release.Namespace }}
path: /mutating-core-oam-dev-v1beta1-applications
{{- if .Values.admissionWebhooks.patch.enabled }}
failurePolicy: Ignore
{{- else }}
failurePolicy: Fail
{{- end }}
name: mutating.core.oam.dev.v1beta1.applications
admissionReviewVersions:
- v1beta1
- v1
sideEffects: None
rules:
- apiGroups:
- core.oam.dev
apiVersions:
- v1beta1
operations:
- CREATE
- UPDATE
resources:
- applications
- clientConfig:
caBundle: Cg==
service:
name: {{ template "kubevela.name" . }}-webhook
namespace: {{ .Release.Namespace }}
path: /mutating-core-oam-dev-v1beta1-componentdefinitions
{{- if .Values.admissionWebhooks.patch.enabled }}
failurePolicy: Ignore
{{- else }}
failurePolicy: Fail
{{- end }}
name: mutating.core.oam-dev.v1beta1.componentdefinitions
sideEffects: None
admissionReviewVersions:
- v1beta1
- v1
rules:
- apiGroups:
- core.oam.dev
apiVersions:
- v1beta1
operations:
- CREATE
- UPDATE
resources:
- componentdefinitions
{{- end -}}

View File

@ -1,227 +0,0 @@
{{- if .Values.admissionWebhooks.enabled -}}
apiVersion: admissionregistration.k8s.io/v1
kind: ValidatingWebhookConfiguration
metadata:
name: {{ template "kubevela.fullname" . }}-admission
namespace: {{ .Release.Namespace }}
{{- if .Values.admissionWebhooks.certManager.enabled }}
annotations:
cert-manager.io/inject-ca-from: {{ printf "%s/%s-root-cert" .Release.Namespace (include "kubevela.fullname" .) | quote }}
{{- end }}
webhooks:
{{- if eq .Values.OAMSpecVer "all"}}
- clientConfig:
caBundle: Cg==
service:
name: {{ template "kubevela.name" . }}-webhook
namespace: {{ .Release.Namespace }}
path: /validating-core-oam-dev-v1alpha2-applicationconfigurations
{{- if .Values.admissionWebhooks.patch.enabled }}
failurePolicy: Ignore
{{- else }}
failurePolicy: {{ .Values.admissionWebhooks.failurePolicy }}
{{- end }}
name: validating.core.oam.dev.v1alpha2.applicationconfigurations
sideEffects: None
rules:
- apiGroups:
- core.oam.dev
apiVersions:
- v1alpha2
operations:
- CREATE
- UPDATE
resources:
- applicationconfigurations
scope: Namespaced
admissionReviewVersions:
- v1beta1
- v1
timeoutSeconds: 5
- clientConfig:
caBundle: Cg==
service:
name: {{ template "kubevela.name" . }}-webhook
namespace: {{ .Release.Namespace }}
path: /validating-core-oam-dev-v1alpha2-components
{{- if .Values.admissionWebhooks.patch.enabled }}
failurePolicy: Ignore
{{- else }}
failurePolicy: {{ .Values.admissionWebhooks.failurePolicy }}
{{- end }}
name: validating.core.oam.dev.v1alpha2.components
sideEffects: None
rules:
- apiGroups:
- core.oam.dev
apiVersions:
- v1alpha2
operations:
- CREATE
- UPDATE
resources:
- components
scope: Namespaced
admissionReviewVersions:
- v1beta1
- v1
timeoutSeconds: 5
{{- end }}
- clientConfig:
caBundle: Cg==
service:
name: {{ template "kubevela.name" . }}-webhook
namespace: {{ .Release.Namespace }}
path: /validating-core-oam-dev-v1beta1-approllout
{{- if .Values.admissionWebhooks.patch.enabled }}
failurePolicy: Ignore
{{- else }}
failurePolicy: {{ .Values.admissionWebhooks.failurePolicy }}
{{- end }}
name: validating.core.oam.dev.v1beta1.approllouts
sideEffects: None
rules:
- apiGroups:
- core.oam.dev
apiVersions:
- v1beta1
operations:
- CREATE
- UPDATE
resources:
- approllouts
scope: Namespaced
admissionReviewVersions:
- v1beta1
- v1
timeoutSeconds: 5
- clientConfig:
caBundle: Cg==
service:
name: {{ template "kubevela.name" . }}-webhook
namespace: {{ .Release.Namespace }}
path: /validating-core-oam-dev-v1alpha2-traitdefinitions
{{- if .Values.admissionWebhooks.patch.enabled }}
failurePolicy: Ignore
{{- else }}
failurePolicy: {{ .Values.admissionWebhooks.failurePolicy }}
{{- end }}
name: validating.core.oam.dev.v1alpha2.traitdefinitions
sideEffects: None
admissionReviewVersions:
- v1beta1
- v1
rules:
- apiGroups:
- core.oam.dev
apiVersions:
- v1alpha2
operations:
- CREATE
- UPDATE
resources:
- traitdefinitions
scope: Cluster
timeoutSeconds: 5
- clientConfig:
caBundle: Cg==
service:
name: {{ template "kubevela.name" . }}-webhook
namespace: {{ .Release.Namespace }}
path: /validate-standard-oam-dev-v1alpha1-podspecworkload
failurePolicy: Fail
name: vcontainerized.kb.io
admissionReviewVersions:
- v1beta1
- v1
sideEffects: None
rules:
- apiGroups:
- standard.oam.dev
apiVersions:
- v1alpha1
operations:
- CREATE
- UPDATE
resources:
- podspecworkloads
- clientConfig:
caBundle: Cg==
service:
name: {{ template "kubevela.name" . }}-webhook
namespace: {{ .Release.Namespace }}
path: /validating-core-oam-dev-v1beta1-applications
{{- if .Values.admissionWebhooks.patch.enabled }}
failurePolicy: Ignore
{{- else }}
failurePolicy: {{ .Values.admissionWebhooks.failurePolicy }}
{{- end }}
name: validating.core.oam.dev.v1beta1.applications
admissionReviewVersions:
- v1beta1
- v1
sideEffects: None
rules:
- apiGroups:
- core.oam.dev
apiVersions:
- v1beta1
operations:
- CREATE
- UPDATE
resources:
- applications
- clientConfig:
caBundle: Cg==
service:
name: {{ template "kubevela.name" . }}-webhook
namespace: {{ .Release.Namespace }}
path: /validating-core-oam-dev-v1beta1-componentdefinitions
{{- if .Values.admissionWebhooks.patch.enabled }}
failurePolicy: Ignore
{{- else }}
failurePolicy: Fail
{{- end }}
name: validating.core.oam-dev.v1beta1.componentdefinitions
sideEffects: None
admissionReviewVersions:
- v1beta1
- v1
rules:
- apiGroups:
- core.oam.dev
apiVersions:
- v1beta1
operations:
- CREATE
- UPDATE
resources:
- componentdefinitions
- clientConfig:
caBundle: Cg==
service:
name: {{ template "kubevela.name" . }}-webhook
namespace: {{ .Release.Namespace }}
path: /validating-core-oam-dev-v1beta1-initializers
{{- if .Values.admissionWebhooks.patch.enabled }}
failurePolicy: Ignore
{{- else }}
failurePolicy: Fail
{{- end }}
name: validating.core.oam-dev.v1beta1.initializers
sideEffects: None
admissionReviewVersions:
- v1beta1
- v1
rules:
- apiGroups:
- core.oam.dev
apiVersions:
- v1beta1
operations:
- CREATE
- UPDATE
- DELETE
resources:
- initializers
{{- end -}}

View File

@ -1,19 +0,0 @@
{{- if .Values.admissionWebhooks.enabled -}}
apiVersion: v1
kind: Service
metadata:
name: {{ template "kubevela.name" . }}-webhook
namespace: {{ .Release.Namespace }}
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 }}
{{- end -}}

View File

@ -1,24 +0,0 @@
{{- if and .Values.multicluster.enabled .Values.multicluster.clusterGateway.secureTLS.enabled .Values.multicluster.clusterGateway.secureTLS.certManager.enabled }}
apiVersion: cert-manager.io/v1
kind: Issuer
metadata:
name: {{ template "kubevela.fullname" . }}-cluster-gateway-issuer
namespace: {{ .Release.Namespace }}
spec:
selfSigned: {}
---
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: {{ template "kubevela.fullname" . }}-cluster-gateway-tls
namespace: {{ .Release.Namespace }}
spec:
secretName: {{ template "kubevela.fullname" . }}-cluster-gateway-tls-v2
duration: 8760h # 1y
issuerRef:
name: {{ template "kubevela.fullname" . }}-cluster-gateway-issuer
dnsNames:
- {{ .Release.Name }}-cluster-gateway-service
- {{ .Release.Name }}-cluster-gateway-service.{{ .Release.Namespace }}.svc
- {{ .Release.Name }}-cluster-gateway-service.{{ .Release.Namespace }}.svc.cluster.local
{{- end }}

View File

@ -1,105 +0,0 @@
{{ if .Values.multicluster.enabled }}
{{ if not .Values.deployByPod }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Release.Name }}-cluster-gateway
namespace: {{ .Release.Namespace }}
labels:
{{- include "kubevela.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.multicluster.clusterGateway.replicaCount }}
selector:
matchLabels:
{{- include "kubevela-cluster-gateway.selectorLabels" . | nindent 6 }}
template:
metadata:
labels:
{{- include "kubevela-cluster-gateway.selectorLabels" . | nindent 8 }}
spec:
{{- include "kubevela-cluster-gateway.podSpec" . | nindent 6}}
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 1
maxUnavailable: 1
{{ end }}
---
apiVersion: v1
kind: Service
metadata:
name: {{ .Release.Name }}-cluster-gateway-service
namespace: {{ .Release.Namespace }}
spec:
selector:
{{- include "kubevela-cluster-gateway.selectorLabels" . | nindent 4 }}
ports:
- protocol: TCP
port: {{ .Values.multicluster.clusterGateway.port }}
targetPort: {{ .Values.multicluster.clusterGateway.port }}
---
# 1. Check whether APIService ""v1alpha1.cluster.core.oam.dev" is already present in the cluster
# 2.a If the APIService doesn't exist, create it.
# 2.b If the APIService exists without helm-chart related annotation, skip creating it to the
# cluster because the APIService can be managed by an external controller.
# 2.c If the APIService exists with valid helm-chart annotations, which means that the APIService
# is previously managed by helm commands, hence update the APIService consistently.
{{ $apiSvc := (lookup "apiregistration.k8s.io/v1" "APIService" "" "v1alpha1.cluster.core.oam.dev") }}
{{ $shouldAdopt := (not $apiSvc) }}
{{ if not $shouldAdopt }}
{{ if $apiSvc.metadata.annotations }}
{{ $shouldAdopt = (index ($apiSvc).metadata.annotations "meta.helm.sh/release-name") }}
{{ end }}
{{ end }}
{{ if $shouldAdopt }}
apiVersion: apiregistration.k8s.io/v1
kind: APIService
metadata:
name: v1alpha1.cluster.core.oam.dev
annotations:
{{- if and .Values.multicluster.clusterGateway.secureTLS.enabled .Values.multicluster.clusterGateway.secureTLS.certManager.enabled }}
cert-manager.io/inject-ca-from: "{{ .Release.Namespace }}/{{ template "kubevela.fullname" . }}-cluster-gateway-tls-v2"
{{- end }}
labels:
api: cluster-extension-apiserver
apiserver: "true"
spec:
version: v1alpha1
group: cluster.core.oam.dev
groupPriorityMinimum: 2000
service:
name: {{ .Release.Name }}-cluster-gateway-service
namespace: {{ .Release.Namespace }}
port: {{ .Values.multicluster.clusterGateway.port }}
versionPriority: 10
insecureSkipTLSVerify: {{ not .Values.multicluster.clusterGateway.secureTLS.enabled }}
{{ if .Values.multicluster.clusterGateway.secureTLS.enabled }}
caBundle: Cg==
{{ end }}
{{ end }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ include "kubevela.fullname" . }}:cluster-gateway:proxy
rules:
- apiGroups: [ "cluster.core.oam.dev" ]
resources: [ "clustergateways/proxy" ]
verbs: [ "get", "list", "watch", "create", "update", "patch", "delete" ]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: {{ include "kubevela.fullname" . }}:cluster-gateway:proxy
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: {{ include "kubevela.fullname" . }}:cluster-gateway:proxy
subjects:
- kind: Group
name: kubevela:client
apiGroup: rbac.authorization.k8s.io
- kind: ServiceAccount
name: {{ include "kubevela.serviceAccountName" . }}
namespace: {{ .Release.Namespace }}
{{ end }}

View File

@ -1,91 +0,0 @@
{{- if and .Values.multicluster.enabled .Values.multicluster.clusterGateway.secureTLS.enabled (not .Values.multicluster.clusterGateway.secureTLS.certManager.enabled) }}
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: {{ template "kubevela.fullname" . }}-cluster-gateway-admission
namespace: {{ .Release.Namespace }}
annotations:
"helm.sh/hook": pre-install,pre-upgrade,post-install,post-upgrade
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded
labels:
app: {{ template "kubevela.name" . }}-cluster-gateway-admission
{{- include "kubevela.labels" . | nindent 4 }}
rules:
- apiGroups:
- ""
resources:
- secrets
verbs:
- get
- create
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: {{ template "kubevela.fullname" . }}-cluster-gateway-admission
namespace: {{ .Release.Namespace }}
annotations:
"helm.sh/hook": pre-install,pre-upgrade,post-install,post-upgrade
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded
labels:
app: {{ template "kubevela.name" . }}-cluster-gateway-admission
{{- include "kubevela.labels" . | nindent 4 }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: {{ template "kubevela.fullname" . }}-cluster-gateway-admission
subjects:
- kind: ServiceAccount
name: {{ template "kubevela.fullname" . }}-cluster-gateway-admission
namespace: {{ .Release.Namespace }}
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ template "kubevela.fullname" . }}-cluster-gateway-admission
namespace: {{ .Release.Namespace }}
annotations:
"helm.sh/hook": pre-install,pre-upgrade,post-install,post-upgrade
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded
labels:
app: {{ template "kubevela.name" . }}-cluster-gateway-admission
{{- include "kubevela.labels" . | nindent 4 }}
---
{{ if not .Values.deployByPod }}
apiVersion: batch/v1
kind: Job
metadata:
namespace: {{ .Release.Namespace }}
{{ include "kubevela-cluster-gateway-tls-secret-create.annotations" . | indent 2 }}
{{ include "kubevela-cluster-gateway-tls-secret-create.name-labels" . | indent 2 }}
spec:
{{- if .Capabilities.APIVersions.Has "batch/v1alpha1" }}
# Alpha feature since k8s 1.12
ttlSecondsAfterFinished: 0
{{- end }}
template:
metadata:
{{ include "kubevela-cluster-gateway-tls-secret-create.name-labels" . | indent 6 }}
spec:
{{ include "kubevela-cluster-gateway-tls-secret-create.podSpec" . | indent 6}}
{{ end }}
---
{{ if not .Values.deployByPod }}
apiVersion: batch/v1
kind: Job
metadata:
namespace: {{ .Release.Namespace }}
{{ include "kubevela-cluster-gateway-tls-secret-patch.name-labels" . | indent 2 }}
{{ include "kubevela-cluster-gateway-tls-secret-patch.annotations" . | indent 2 }}
spec:
{{- if .Capabilities.APIVersions.Has "batch/v1alpha1" }}
# Alpha feature since k8s 1.12
ttlSecondsAfterFinished: 0
{{- end }}
template:
metadata:
{{ include "kubevela-cluster-gateway-tls-secret-patch.name-labels" . | indent 6 }}
spec:
{{ include "kubevela-cluster-gateway-tls-secret-patch.podSpec" . | indent 6}}
{{ end }}
{{ end }}

View File

@ -1,10 +0,0 @@
apiVersion: core.oam.dev/v1beta1
kind: WorkloadDefinition
metadata:
annotations:
definition.oam.dev/description: "autodetects.core.oam.dev is the default workload type of ComponentDefinition"
name: autodetects.core.oam.dev
namespace: {{ include "systemDefinitionNamespace" . }}
spec:
definitionRef:
name: autodetects.core.oam.dev

View File

@ -1,10 +0,0 @@
apiVersion: core.oam.dev/v1beta1
kind: ScopeDefinition
metadata:
name: healthscopes.core.oam.dev
namespace: {{ include "systemDefinitionNamespace" . }}
spec:
workloadRefsPath: spec.workloadRefs
allowComponentOverlap: true
definitionRef:
name: healthscopes.core.oam.dev

View File

@ -1,186 +0,0 @@
# Code generated by KubeVela templates. DO NOT EDIT. Please edit the original cue file.
# Definition source cue file: vela-templates/definitions/internal/affinity.cue
apiVersion: core.oam.dev/v1beta1
kind: TraitDefinition
metadata:
annotations:
definition.oam.dev/description: affinity specify affinity and tolerationon K8s pod for your workload which follows the pod spec in path 'spec.template'.
labels:
custom.definition.oam.dev/ui-hidden: "true"
name: affinity
namespace: {{ include "systemDefinitionNamespace" . }}
spec:
appliesToWorkloads:
- '*'
podDisruptive: true
schematic:
cue:
template: |
patch: spec: template: spec: {
if parameter.podAffinity != _|_ {
affinity: podAffinity: {
if parameter.podAffinity.required != _|_ {
requiredDuringSchedulingIgnoredDuringExecution: [
for k in parameter.podAffinity.required {
if k.labelSelector != _|_ {
labelSelector: k.labelSelector
}
if k.namespace != _|_ {
namespace: k.namespace
}
topologyKey: k.topologyKey
if k.namespaceSelector != _|_ {
namespaceSelector: k.namespaceSelector
}
}]
}
if parameter.podAffinity.preferred != _|_ {
preferredDuringSchedulingIgnoredDuringExecution: [
for k in parameter.podAffinity.preferred {
weight: k.weight
podAffinityTerm: k.podAffinityTerm
}]
}
}
}
if parameter.podAntiAffinity != _|_ {
affinity: podAntiAffinity: {
if parameter.podAntiAffinity.required != _|_ {
requiredDuringSchedulingIgnoredDuringExecution: [
for k in parameter.podAntiAffinity.required {
if k.labelSelector != _|_ {
labelSelector: k.labelSelector
}
if k.namespace != _|_ {
namespace: k.namespace
}
topologyKey: k.topologyKey
if k.namespaceSelector != _|_ {
namespaceSelector: k.namespaceSelector
}
}]
}
if parameter.podAntiAffinity.preferred != _|_ {
preferredDuringSchedulingIgnoredDuringExecution: [
for k in parameter.podAntiAffinity.preferred {
weight: k.weight
podAffinityTerm: k.podAffinityTerm
}]
}
}
}
if parameter.nodeAffinity != _|_ {
affinity: nodeAffinity: {
if parameter.nodeAffinity.required != _|_ {
requiredDuringSchedulingIgnoredDuringExecution: nodeSelectorTerms: [
for k in parameter.nodeAffinity.required.nodeSelectorTerms {
if k.matchExpressions != _|_ {
matchExpressions: k.matchExpressions
}
if k.matchFields != _|_ {
matchFields: k.matchFields
}
}]
}
if parameter.nodeAffinity.preferred != _|_ {
preferredDuringSchedulingIgnoredDuringExecution: [
for k in parameter.nodeAffinity.preferred {
weight: k.weight
preference: k.preference
}]
}
}
}
if parameter.tolerations != _|_ {
tolerations: [
for k in parameter.tolerations {
if k.key != _|_ {
key: k.key
}
if k.effect != _|_ {
effect: k.effect
}
if k.value != _|_ {
value: k.value
}
operator: k.operator
if k.tolerationSeconds != _|_ {
tolerationSeconds: k.tolerationSeconds
}
}]
}
}
#labelSelector: {
matchLabels?: [string]: string
matchExpressions?: [...{
key: string
operator: *"In" | "NotIn" | "Exists" | "DoesNotExist"
values?: [...string]
}]
}
#podAffinityTerm: {
labelSelector?: #labelSelector
namespaces?: [...string]
topologyKey: string
namespaceSelector?: #labelSelector
}
#nodeSelecor: {
key: string
operator: *"In" | "NotIn" | "Exists" | "DoesNotExist" | "Gt" | "Lt"
values?: [...string]
}
#nodeSelectorTerm: {
matchExpressions?: [...#nodeSelecor]
matchFields?: [...#nodeSelecor]
}
parameter: {
// +usage=Specify the pod affinity scheduling rules
podAffinity?: {
// +usage=Specify the required during scheduling ignored during execution
required?: [...#podAffinityTerm]
// +usage=Specify the preferred during scheduling ignored during execution
preferred?: [...{
// +usage=Specify weight associated with matching the corresponding podAffinityTerm
weight: int & >=1 & <=100
// +usage=Specify a set of pods
podAffinityTerm: #podAffinityTerm
}]
}
// +usage=Specify the pod anti-affinity scheduling rules
podAntiAffinity?: {
// +usage=Specify the required during scheduling ignored during execution
required?: [...#podAffinityTerm]
// +usage=Specify the preferred during scheduling ignored during execution
preferred?: [...{
// +usage=Specify weight associated with matching the corresponding podAffinityTerm
weight: int & >=1 & <=100
// +usage=Specify a set of pods
podAffinityTerm: #podAffinityTerm
}]
}
// +usage=Specify the node affinity scheduling rules for the pod
nodeAffinity?: {
// +usage=Specify the required during scheduling ignored during execution
required?: {
// +usage=Specify a list of node selector
nodeSelectorTerms: [...#nodeSelectorTerm]
}
// +usage=Specify the preferred during scheduling ignored during execution
preferred?: [...{
// +usage=Specify weight associated with matching the corresponding nodeSelector
weight: int & >=1 & <=100
// +usage=Specify a node selector
preference: #nodeSelectorTerm
}]
}
// +usage=Specify tolerant taint
tolerations?: [...{
key?: string
operator: *"Equal" | "Exists"
value?: string
effect?: "NoSchedule" | "PreferNoSchedule" | "NoExecute"
// +usage=Specify the period of time the toleration
tolerationSeconds?: int
}]
}

View File

@ -1,35 +0,0 @@
# Code generated by KubeVela templates. DO NOT EDIT. Please edit the original cue file.
# Definition source cue file: vela-templates/definitions/internal/annotations.cue
apiVersion: core.oam.dev/v1beta1
kind: TraitDefinition
metadata:
annotations:
definition.oam.dev/description: Add annotations on K8s pod for your workload which follows the pod spec in path 'spec.template'.
labels:
custom.definition.oam.dev/ui-hidden: "true"
name: annotations
namespace: {{ include "systemDefinitionNamespace" . }}
spec:
appliesToWorkloads:
- '*'
podDisruptive: true
schematic:
cue:
template: |
// +patchStrategy=jsonMergePatch
patch: {
metadata: annotations: {
for k, v in parameter {
"\(k)": v
}
}
if context.output.spec != _|_ && context.output.spec.template != _|_ {
spec: template: metadata: annotations: {
for k, v in parameter {
"\(k)": v
}
}
}
}
parameter: [string]: string | null

View File

@ -1,21 +0,0 @@
# Code generated by KubeVela templates. DO NOT EDIT. Please edit the original cue file.
# Definition source cue file: vela-templates/definitions/internal/apply-application-in-parallel.cue
apiVersion: core.oam.dev/v1beta1
kind: WorkflowStepDefinition
metadata:
annotations:
definition.oam.dev/description: Apply components of an application in parallel for your workflow steps
labels:
custom.definition.oam.dev/ui-hidden: "true"
name: apply-application-in-parallel
namespace: {{ include "systemDefinitionNamespace" . }}
spec:
schematic:
cue:
template: |
import (
"vela/op"
)
output: op.#ApplyApplicationInParallel & {}

View File

@ -1,22 +0,0 @@
# Code generated by KubeVela templates. DO NOT EDIT. Please edit the original cue file.
# Definition source cue file: vela-templates/definitions/internal/apply-application.cue
apiVersion: core.oam.dev/v1beta1
kind: WorkflowStepDefinition
metadata:
annotations:
definition.oam.dev/description: Apply application for your workflow steps
labels:
custom.definition.oam.dev/ui-hidden: "true"
name: apply-application
namespace: {{ include "systemDefinitionNamespace" . }}
spec:
schematic:
cue:
template: |
import (
"vela/op"
)
// apply application
output: op.#ApplyApplication & {}

View File

@ -1,30 +0,0 @@
# Code generated by KubeVela templates. DO NOT EDIT. Please edit the original cue file.
# Definition source cue file: vela-templates/definitions/internal/apply-object.cue
apiVersion: core.oam.dev/v1beta1
kind: WorkflowStepDefinition
metadata:
annotations:
definition.oam.dev/description: Apply raw kubernetes objects for your workflow steps
labels:
custom.definition.oam.dev/ui-hidden: "true"
name: apply-object
namespace: {{ include "systemDefinitionNamespace" . }}
spec:
schematic:
cue:
template: |
import (
"vela/op"
)
apply: op.#Apply & {
value: parameter.value
cluster: parameter.cluster
}
parameter: {
// +usage=Specify the value of the object
value: {...}
// +usage=Specify the cluster of the object
cluster: *"" | string
}

View File

@ -1,28 +0,0 @@
# Code generated by KubeVela templates. DO NOT EDIT. Please edit the original cue file.
# Definition source cue file: vela-templates/definitions/internal/apply-remaining.cue
apiVersion: core.oam.dev/v1beta1
kind: WorkflowStepDefinition
metadata:
annotations:
definition.oam.dev/description: Apply remaining components and traits
labels:
custom.definition.oam.dev/ui-hidden: "true"
name: apply-remaining
namespace: {{ include "systemDefinitionNamespace" . }}
spec:
schematic:
cue:
template: |
import (
"vela/op"
)
// apply remaining components and traits
apply: op.#ApplyRemaining & {
parameter
}
parameter: {
// +usage=Declare the name of the component
exceptions?: [...string]
}

View File

@ -1,114 +0,0 @@
# Code generated by KubeVela templates. DO NOT EDIT. Please edit the original cue file.
# Definition source cue file: vela-templates/definitions/internal/command.cue
apiVersion: core.oam.dev/v1beta1
kind: TraitDefinition
metadata:
annotations:
definition.oam.dev/description: Add command on K8s pod for your workload which follows the pod spec in path 'spec.template'
labels:
custom.definition.oam.dev/ui-hidden: "true"
name: command
namespace: {{ include "systemDefinitionNamespace" . }}
spec:
appliesToWorkloads:
- '*'
schematic:
cue:
template: |
#PatchParams: {
// +usage=Specify the name of the target container, if not set, use the component name
containerName: *"" | string
// +usage=Specify the command to use in the target container, if not set, it will not be changed
command: *null | [...string]
// +usage=Specify the args to use in the target container, if set, it will override existing args
args: *null | [...string]
// +usage=Specify the args to add in the target container, existing args will be kept, cannot be used with `args`
addArgs: *null | [...string]
// +usage=Specify the existing args to delete in the target container, cannot be used with `args`
delArgs: *null | [...string]
}
PatchContainer: {
_params: #PatchParams
name: _params.containerName
_baseContainers: context.output.spec.template.spec.containers
_matchContainers_: [ for _container_ in _baseContainers if _container_.name == name {_container_}]
_baseContainer: *_|_ | {...}
if len(_matchContainers_) == 0 {
err: "container \(name) not found"
}
if len(_matchContainers_) > 0 {
_baseContainer: _matchContainers_[0]
if _params.command != null {
// +patchStrategy=replace
command: _params.command
}
if (_params.addArgs != null || _params.delArgs != null) && _params.args != null {
err: "cannot set addArgs/delArgs and args at the same time"
}
_delArgs: {...}
if _params.delArgs != null {
_delArgs: {for k in _params.delArgs {"\(k)": ""}}
}
if _params.delArgs == null {
_delArgs: {}
}
_args: [...string]
if _params.args != null {
_args: _params.args
}
if _params.args == null && _baseContainer.args != _|_ {
_args: _baseContainer.args
}
if _params.args == null && _baseContainer.args == _|_ {
_args: []
}
_argsMap: {for a in _args {"\(a)": ""}}
_addArgs: [...string]
if _params.addArgs != null {
_addArgs: _params.addArgs
}
if _params.addArgs == null {
_addArgs: []
}
// +patchStrategy=replace
args: [ for a in _args if _delArgs[a] == _|_ {a}] + [ for a in _addArgs if _delArgs[a] == _|_ && _argsMap[a] == _|_ {a}]
}
}
// +patchStrategy=open
patch: spec: template: spec: {
if parameter.containers == _|_ {
// +patchKey=name
containers: [{
PatchContainer & {_params: {
if parameter.containerName == "" {
containerName: context.name
}
if parameter.containerName != "" {
containerName: parameter.containerName
}
command: parameter.command
args: parameter.args
addArgs: parameter.addArgs
delArgs: parameter.delArgs
}}
}]
}
if parameter.containers != _|_ {
// +patchKey=name
containers: [ for c in parameter.containers {
if c.containerName == "" {
err: "container name must be set for containers"
}
if c.containerName != "" {
PatchContainer & {_params: c}
}
}]
}
}
parameter: *#PatchParams | close({
// +usage=Specify the commands for multiple containers
containers: [...#PatchParams]
})
errs: [ for c in patch.spec.template.spec.containers if c.err != _|_ {c.err}]

View File

@ -1,86 +0,0 @@
# Code generated by KubeVela templates. DO NOT EDIT. Please edit the original cue file.
# Definition source cue file: vela-templates/definitions/internal/config-image-registry.cue
apiVersion: core.oam.dev/v1beta1
kind: ComponentDefinition
metadata:
annotations:
custom.definition.oam.dev/alias.config.oam.dev: Image Registry
definition.oam.dev/description: Config information to authenticate image registry
labels:
custom.definition.oam.dev/catalog.config.oam.dev: velacore-config
custom.definition.oam.dev/multi-cluster.config.oam.dev: "true"
custom.definition.oam.dev/type.config.oam.dev: image-registry
custom.definition.oam.dev/ui-hidden: "true"
name: config-image-registry
namespace: {{ include "systemDefinitionNamespace" . }}
spec:
schematic:
cue:
template: |
import (
"encoding/base64"
"encoding/json"
"strconv"
)
output: {
apiVersion: "v1"
kind: "Secret"
metadata: {
name: context.name
namespace: context.namespace
labels: {
"config.oam.dev/catalog": "velacore-config"
"config.oam.dev/type": "image-registry"
"config.oam.dev/multi-cluster": "true"
"config.oam.dev/identifier": parameter.registry
"config.oam.dev/sub-type": "auth"
}
}
if parameter.auth != _|_ {
type: "kubernetes.io/dockerconfigjson"
}
if parameter.auth == _|_ {
type: "Opaque"
}
stringData: {
if parameter.auth != _|_ && parameter.auth.username != _|_ {
".dockerconfigjson": json.Marshal({
auths: "\(parameter.registry)": {
username: parameter.auth.username
password: parameter.auth.password
if parameter.auth.email != _|_ {
email: parameter.auth.email
}
auth: base64.Encode(null, (parameter.auth.username + ":" + parameter.auth.password))
}
})
}
if parameter.insecure != _|_ {
"insecure-skip-verify": strconv.FormatBool(parameter.insecure)
}
if parameter.useHTTP != _|_ {
"protocol-use-http": strconv.FormatBool(parameter.useHTTP)
}
}
}
parameter: {
// +usage=Image registry FQDN, such as: index.docker.io
registry: string
// +usage=Authenticate the image registry
auth?: {
// +usage=Private Image registry username
username: string
// +usage=Private Image registry password
password: string
// +usage=Private Image registry email
email?: string
}
// +usage=For the registry server that uses the self-signed certificate
insecure?: bool
// +usage=For the registry server that uses the HTTP protocol
useHTTP?: bool
}
workload:
type: autodetects.core.oam.dev

View File

@ -1,63 +0,0 @@
# Code generated by KubeVela templates. DO NOT EDIT. Please edit the original cue file.
# Definition source cue file: vela-templates/definitions/deprecated/configmap.cue
apiVersion: core.oam.dev/v1beta1
kind: TraitDefinition
metadata:
annotations:
definition.oam.dev/description: Create/Attach configmaps on K8s pod for your workload which follows the pod spec in path 'spec.template'. This definition is DEPRECATED, please specify configmap in 'storage' instead.
labels:
custom.definition.oam.dev/deprecated: "true"
name: configmap
namespace: {{ include "systemDefinitionNamespace" . }}
spec:
appliesToWorkloads:
- '*'
podDisruptive: true
schematic:
cue:
template: |
patch: spec: template: spec: {
containers: [{
// +patchKey=name
volumeMounts: [
for v in parameter.volumes {
{
name: "volume-\(v.name)"
mountPath: v.mountPath
readOnly: v.readOnly
}
},
]
}, ...]
// +patchKey=name
volumes: [
for v in parameter.volumes {
{
name: "volume-\(v.name)"
configMap: name: v.name
}
},
]
}
outputs: {
for v in parameter.volumes {
if v.data != _|_ {
"\(v.name)": {
apiVersion: "v1"
kind: "ConfigMap"
metadata: name: v.name
data: v.data
}
}
}
}
parameter: {
// +usage=Specify mounted configmap names and their mount paths in the container
volumes: [...{
name: string
mountPath: string
readOnly: *false | bool
data?: [string]: string
}]
}

View File

@ -1,79 +0,0 @@
# Code generated by KubeVela templates. DO NOT EDIT. Please edit the original cue file.
# Definition source cue file: vela-templates/definitions/internal/container-image.cue
apiVersion: core.oam.dev/v1beta1
kind: TraitDefinition
metadata:
annotations:
definition.oam.dev/description: Set the image of the container.
labels:
custom.definition.oam.dev/ui-hidden: "true"
name: container-image
namespace: {{ include "systemDefinitionNamespace" . }}
spec:
appliesToWorkloads:
- '*'
podDisruptive: true
schematic:
cue:
template: |
#PatchParams: {
// +usage=Specify the name of the target container, if not set, use the component name
containerName: *"" | string
// +usage=Specify the image of the container
image: string
// +usage=Specify the image pull policy of the container
imagePullPolicy: *"" | "IfNotPresent" | "Always" | "Never"
}
PatchContainer: {
_params: #PatchParams
name: _params.containerName
_baseContainers: context.output.spec.template.spec.containers
_matchContainers_: [ for _container_ in _baseContainers if _container_.name == name {_container_}]
_baseContainer: *_|_ | {...}
if len(_matchContainers_) == 0 {
err: "container \(name) not found"
}
if len(_matchContainers_) > 0 {
// +patchStrategy=retainKeys
image: _params.image
if _params.imagePullPolicy != "" {
// +patchStrategy=retainKeys
imagePullPolicy: _params.imagePullPolicy
}
}
}
patch: spec: template: spec: {
if parameter.containers == _|_ {
// +patchKey=name
containers: [{
PatchContainer & {_params: {
if parameter.containerName == "" {
containerName: context.name
}
if parameter.containerName != "" {
containerName: parameter.containerName
}
image: parameter.image
imagePullPolicy: parameter.imagePullPolicy
}}
}]
}
if parameter.containers != _|_ {
// +patchKey=name
containers: [ for c in parameter.containers {
if c.containerName == "" {
err: "containerName must be set for containers"
}
if c.containerName != "" {
PatchContainer & {_params: c}
}
}]
}
}
parameter: *#PatchParams | close({
// +usage=Specify the container image for multiple containers
containers: [...#PatchParams]
})
errs: [ for c in patch.spec.template.spec.containers if c.err != _|_ {c.err}]

View File

@ -1,45 +0,0 @@
# Code generated by KubeVela templates. DO NOT EDIT. Please edit the original cue file.
# Definition source cue file: vela-templates/definitions/internal/cpuscaler.cue
apiVersion: core.oam.dev/v1beta1
kind: TraitDefinition
metadata:
annotations:
definition.oam.dev/description: Automatically scale the component based on CPU usage.
labels:
custom.definition.oam.dev/ui-hidden: "true"
name: cpuscaler
namespace: {{ include "systemDefinitionNamespace" . }}
spec:
appliesToWorkloads:
- deployments.apps
schematic:
cue:
template: |
outputs: cpuscaler: {
apiVersion: "autoscaling/v1"
kind: "HorizontalPodAutoscaler"
metadata: name: context.name
spec: {
scaleTargetRef: {
apiVersion: parameter.targetAPIVersion
kind: parameter.targetKind
name: context.name
}
minReplicas: parameter.min
maxReplicas: parameter.max
targetCPUUtilizationPercentage: parameter.cpuUtil
}
}
parameter: {
// +usage=Specify the minimal number of replicas to which the autoscaler can scale down
min: *1 | int
// +usage=Specify the maximum number of of replicas to which the autoscaler can scale up
max: *10 | int
// +usage=Specify the average CPU utilization, for example, 50 means the CPU usage is 50%
cpuUtil: *50 | int
// +usage=Specify the apiVersion of scale target
targetAPIVersion: *"apps/v1" | string
// +usage=Specify the kind of scale target
targetKind: *"Deployment" | string
}

View File

@ -1,320 +0,0 @@
# Code generated by KubeVela templates. DO NOT EDIT. Please edit the original cue file.
# Definition source cue file: vela-templates/definitions/internal/cron-task.cue
apiVersion: core.oam.dev/v1beta1
kind: ComponentDefinition
metadata:
annotations:
definition.oam.dev/description: Describes cron jobs that run code or a script to completion.
name: cron-task
namespace: {{ include "systemDefinitionNamespace" . }}
spec:
schematic:
cue:
template: |
output: {
apiVersion: "batch/v1beta1"
kind: "CronJob"
spec: {
schedule: parameter.schedule
concurrencyPolicy: parameter.concurrencyPolicy
suspend: parameter.suspend
successfulJobsHistoryLimit: parameter.successfulJobsHistoryLimit
failedJobsHistoryLimit: parameter.failedJobsHistoryLimit
if parameter.startingDeadlineSeconds != _|_ {
startingDeadlineSeconds: parameter.startingDeadlineSeconds
}
jobTemplate: {
metadata: {
labels: {
if parameter.labels != _|_ {
parameter.labels
}
"app.oam.dev/name": context.appName
"app.oam.dev/component": context.name
}
if parameter.annotations != _|_ {
annotations: parameter.annotations
}
}
spec: {
parallelism: parameter.count
completions: parameter.count
if parameter.ttlSecondsAfterFinished != _|_ {
ttlSecondsAfterFinished: parameter.ttlSecondsAfterFinished
}
if parameter.activeDeadlineSeconds != _|_ {
activeDeadlineSeconds: parameter.activeDeadlineSeconds
}
backoffLimit: parameter.backoffLimit
template: {
metadata: {
labels: {
if parameter.labels != _|_ {
parameter.labels
}
"app.oam.dev/name": context.appName
"app.oam.dev/component": context.name
}
if parameter.annotations != _|_ {
annotations: parameter.annotations
}
}
spec: {
restartPolicy: parameter.restart
containers: [{
name: context.name
image: parameter.image
if parameter["imagePullPolicy"] != _|_ {
imagePullPolicy: parameter.imagePullPolicy
}
if parameter["cmd"] != _|_ {
command: parameter.cmd
}
if parameter["env"] != _|_ {
env: parameter.env
}
if parameter["cpu"] != _|_ {
resources: {
limits: cpu: parameter.cpu
requests: cpu: parameter.cpu
}
}
if parameter["memory"] != _|_ {
resources: {
limits: memory: parameter.memory
requests: memory: parameter.memory
}
}
if parameter["volumes"] != _|_ {
volumeMounts: [ for v in parameter.volumes {
{
mountPath: v.mountPath
name: v.name
}}]
}
}]
if parameter["volumes"] != _|_ {
volumes: [ for v in parameter.volumes {
{
name: v.name
if v.type == "pvc" {
persistentVolumeClaim: claimName: v.claimName
}
if v.type == "configMap" {
configMap: {
defaultMode: v.defaultMode
name: v.cmName
if v.items != _|_ {
items: v.items
}
}
}
if v.type == "secret" {
secret: {
defaultMode: v.defaultMode
secretName: v.secretName
if v.items != _|_ {
items: v.items
}
}
}
if v.type == "emptyDir" {
emptyDir: medium: v.medium
}
}}]
}
if parameter["imagePullSecrets"] != _|_ {
imagePullSecrets: [ for v in parameter.imagePullSecrets {
name: v
},
]
}
if parameter.hostAliases != _|_ {
hostAliases: [ for v in parameter.hostAliases {
ip: v.ip
hostnames: v.hostnames
},
]
}
}
}
}
}
}
}
parameter: {
// +usage=Specify the labels in the workload
labels?: [string]: string
// +usage=Specify the annotations in the workload
annotations?: [string]: string
// +usage=Specify the schedule in Cron format, see https://en.wikipedia.org/wiki/Cron
schedule: string
// +usage=Specify deadline in seconds for starting the job if it misses scheduled
startingDeadlineSeconds?: int
// +usage=suspend subsequent executions
suspend: *false | bool
// +usage=Specifies how to treat concurrent executions of a Job
concurrencyPolicy: *"Allow" | "Allow" | "Forbid" | "Replace"
// +usage=The number of successful finished jobs to retain
successfulJobsHistoryLimit: *3 | int
// +usage=The number of failed finished jobs to retain
failedJobsHistoryLimit: *1 | int
// +usage=Specify number of tasks to run in parallel
// +short=c
count: *1 | int
// +usage=Which image would you like to use for your service
// +short=i
image: string
// +usage=Specify image pull policy for your service
imagePullPolicy?: "Always" | "Never" | "IfNotPresent"
// +usage=Specify image pull secrets for your service
imagePullSecrets?: [...string]
// +usage=Define the job restart policy, the value can only be Never or OnFailure. By default, it's Never.
restart: *"Never" | string
// +usage=Commands to run in the container
cmd?: [...string]
// +usage=Define arguments by using environment variables
env?: [...{
// +usage=Environment variable name
name: string
// +usage=The value of the environment variable
value?: string
// +usage=Specifies a source the value of this var should come from
valueFrom?: {
// +usage=Selects a key of a secret in the pod's namespace
secretKeyRef?: {
// +usage=The name of the secret in the pod's namespace to select from
name: string
// +usage=The key of the secret to select from. Must be a valid secret key
key: string
}
// +usage=Selects a key of a config map in the pod's namespace
configMapKeyRef?: {
// +usage=The name of the config map in the pod's namespace to select from
name: string
// +usage=The key of the config map to select from. Must be a valid secret key
key: string
}
}
}]
// +usage=Number of CPU units for the service, like `0.5` (0.5 CPU core), `1` (1 CPU core)
cpu?: string
// +usage=Specifies the attributes of the memory resource required for the container.
memory?: string
// +usage=Declare volumes and volumeMounts
volumes?: [...{
name: string
mountPath: string
// +usage=Specify volume type, options: "pvc","configMap","secret","emptyDir"
type: "pvc" | "configMap" | "secret" | "emptyDir"
if type == "pvc" {
claimName: string
}
if type == "configMap" {
defaultMode: *420 | int
cmName: string
items?: [...{
key: string
path: string
mode: *511 | int
}]
}
if type == "secret" {
defaultMode: *420 | int
secretName: string
items?: [...{
key: string
path: string
mode: *511 | int
}]
}
if type == "emptyDir" {
medium: *"" | "Memory"
}
}]
// +usage=An optional list of hosts and IPs that will be injected into the pod's hosts file
hostAliases?: [...{
ip: string
hostnames: [...string]
}]
// +usage=Limits the lifetime of a Job that has finished
ttlSecondsAfterFinished?: int
// +usage=The duration in seconds relative to the startTime that the job may be continuously active before the system tries to terminate it
activeDeadlineSeconds?: int
// +usage=The number of retries before marking this job failed
backoffLimit: *6 | int
// +usage=Instructions for assessing whether the container is alive.
livenessProbe?: #HealthProbe
// +usage=Instructions for assessing whether the container is in a suitable state to serve traffic.
readinessProbe?: #HealthProbe
}
#HealthProbe: {
// +usage=Instructions for assessing container health by executing a command. Either this attribute or the httpGet attribute or the tcpSocket attribute MUST be specified. This attribute is mutually exclusive with both the httpGet attribute and the tcpSocket attribute.
exec?: {
// +usage=A command to be executed inside the container to assess its health. Each space delimited token of the command is a separate array element. Commands exiting 0 are considered to be successful probes, whilst all other exit codes are considered failures.
command: [...string]
}
// +usage=Instructions for assessing container health by executing an HTTP GET request. Either this attribute or the exec attribute or the tcpSocket attribute MUST be specified. This attribute is mutually exclusive with both the exec attribute and the tcpSocket attribute.
httpGet?: {
// +usage=The endpoint, relative to the port, to which the HTTP GET request should be directed.
path: string
// +usage=The TCP socket within the container to which the HTTP GET request should be directed.
port: int
httpHeaders?: [...{
name: string
value: string
}]
}
// +usage=Instructions for assessing container health by probing a TCP socket. Either this attribute or the exec attribute or the httpGet attribute MUST be specified. This attribute is mutually exclusive with both the exec attribute and the httpGet attribute.
tcpSocket?: {
// +usage=The TCP socket within the container that should be probed to assess container health.
port: int
}
// +usage=Number of seconds after the container is started before the first probe is initiated.
initialDelaySeconds: *0 | int
// +usage=How often, in seconds, to execute the probe.
periodSeconds: *10 | int
// +usage=Number of seconds after which the probe times out.
timeoutSeconds: *1 | int
// +usage=Minimum consecutive successes for the probe to be considered successful after having failed.
successThreshold: *1 | int
// +usage=Number of consecutive failures required to determine the container is not alive (liveness probe) or not ready (readiness probe).
failureThreshold: *3 | int
}
workload:
definition:
apiVersion: batch/v1beta1
kind: CronJob
type: cronjobs.batch

View File

@ -1,574 +0,0 @@
# Code generated by KubeVela templates. DO NOT EDIT. Please edit the original cue file.
# Definition source cue file: vela-templates/definitions/internal/daemon.cue
apiVersion: core.oam.dev/v1beta1
kind: ComponentDefinition
metadata:
annotations:
definition.oam.dev/description: Describes daemonset services in Kubernetes.
name: daemon
namespace: {{ include "systemDefinitionNamespace" . }}
spec:
schematic:
cue:
template: |
import (
"strconv"
)
mountsArray: {
pvc: *[
for v in parameter.volumeMounts.pvc {
{
mountPath: v.mountPath
name: v.name
}
},
] | []
configMap: *[
for v in parameter.volumeMounts.configMap {
{
mountPath: v.mountPath
name: v.name
}
},
] | []
secret: *[
for v in parameter.volumeMounts.secret {
{
mountPath: v.mountPath
name: v.name
}
},
] | []
emptyDir: *[
for v in parameter.volumeMounts.emptyDir {
{
mountPath: v.mountPath
name: v.name
}
},
] | []
hostPath: *[
for v in parameter.volumeMounts.hostPath {
{
mountPath: v.mountPath
if v.mountPropagation != _|_ {
mountPropagation: v.mountPropagation
}
name: v.name
if v.readOnly != _|_ {
readOnly: v.readOnly
}
}
},
] | []
}
volumesArray: {
pvc: *[
for v in parameter.volumeMounts.pvc {
{
name: v.name
persistentVolumeClaim: claimName: v.claimName
}
},
] | []
configMap: *[
for v in parameter.volumeMounts.configMap {
{
name: v.name
configMap: {
defaultMode: v.defaultMode
name: v.cmName
if v.items != _|_ {
items: v.items
}
}
}
},
] | []
secret: *[
for v in parameter.volumeMounts.secret {
{
name: v.name
secret: {
defaultMode: v.defaultMode
secretName: v.secretName
if v.items != _|_ {
items: v.items
}
}
}
},
] | []
emptyDir: *[
for v in parameter.volumeMounts.emptyDir {
{
name: v.name
emptyDir: medium: v.medium
}
},
] | []
hostPath: *[
for v in parameter.volumeMounts.hostPath {
{
name: v.name
hostPath: path: v.path
}
},
] | []
}
output: {
apiVersion: "apps/v1"
kind: "DaemonSet"
spec: {
selector: matchLabels: "app.oam.dev/component": context.name
template: {
metadata: {
labels: {
if parameter.labels != _|_ {
parameter.labels
}
if parameter.addRevisionLabel {
"app.oam.dev/revision": context.revision
}
"app.oam.dev/name": context.appName
"app.oam.dev/component": context.name
}
if parameter.annotations != _|_ {
annotations: parameter.annotations
}
}
spec: {
containers: [{
name: context.name
image: parameter.image
if parameter["port"] != _|_ && parameter["ports"] == _|_ {
ports: [{
containerPort: parameter.port
}]
}
if parameter["ports"] != _|_ {
ports: [ for v in parameter.ports {
{
containerPort: v.port
protocol: v.protocol
if v.name != _|_ {
name: v.name
}
if v.name == _|_ {
name: "port-" + strconv.FormatInt(v.port, 10)
}
}}]
}
if parameter["imagePullPolicy"] != _|_ {
imagePullPolicy: parameter.imagePullPolicy
}
if parameter["cmd"] != _|_ {
command: parameter.cmd
}
if parameter["env"] != _|_ {
env: parameter.env
}
if context["config"] != _|_ {
env: context.config
}
if parameter["cpu"] != _|_ {
resources: {
limits: cpu: parameter.cpu
requests: cpu: parameter.cpu
}
}
if parameter["memory"] != _|_ {
resources: {
limits: memory: parameter.memory
requests: memory: parameter.memory
}
}
if parameter["volumes"] != _|_ && parameter["volumeMounts"] == _|_ {
volumeMounts: [ for v in parameter.volumes {
{
mountPath: v.mountPath
name: v.name
}}]
}
if parameter["volumeMounts"] != _|_ {
volumeMounts: mountsArray.pvc + mountsArray.configMap + mountsArray.secret + mountsArray.emptyDir + mountsArray.hostPath
}
if parameter["livenessProbe"] != _|_ {
livenessProbe: parameter.livenessProbe
}
if parameter["readinessProbe"] != _|_ {
readinessProbe: parameter.readinessProbe
}
}]
if parameter["hostAliases"] != _|_ {
// +patchKey=ip
hostAliases: parameter.hostAliases
}
if parameter["imagePullSecrets"] != _|_ {
imagePullSecrets: [ for v in parameter.imagePullSecrets {
name: v
},
]
}
if parameter["volumes"] != _|_ && parameter["volumeMounts"] == _|_ {
volumes: [ for v in parameter.volumes {
{
name: v.name
if v.type == "pvc" {
persistentVolumeClaim: claimName: v.claimName
}
if v.type == "configMap" {
configMap: {
defaultMode: v.defaultMode
name: v.cmName
if v.items != _|_ {
items: v.items
}
}
}
if v.type == "secret" {
secret: {
defaultMode: v.defaultMode
secretName: v.secretName
if v.items != _|_ {
items: v.items
}
}
}
if v.type == "emptyDir" {
emptyDir: medium: v.medium
}
}
}]
}
if parameter["volumeMounts"] != _|_ {
volumes: volumesArray.pvc + volumesArray.configMap + volumesArray.secret + volumesArray.emptyDir + volumesArray.hostPath
}
}
}
}
}
exposePorts: [
for v in parameter.ports if v.expose == true {
port: v.port
targetPort: v.port
if v.name != _|_ {
name: v.name
}
if v.name == _|_ {
name: "port-" + strconv.FormatInt(v.port, 10)
}
},
]
outputs: {
if len(exposePorts) != 0 {
webserviceExpose: {
apiVersion: "v1"
kind: "Service"
metadata: name: context.name
spec: {
selector: "app.oam.dev/component": context.name
ports: exposePorts
type: parameter.exposeType
}
}
}
}
parameter: {
// +usage=Specify the labels in the workload
labels?: [string]: string
// +usage=Specify the annotations in the workload
annotations?: [string]: string
// +usage=Which image would you like to use for your service
// +short=i
image: string
// +usage=Specify image pull policy for your service
imagePullPolicy?: "Always" | "Never" | "IfNotPresent"
// +usage=Specify image pull secrets for your service
imagePullSecrets?: [...string]
// +ignore
// +usage=Deprecated field, please use ports instead
// +short=p
port?: int
// +usage=Which ports do you want customer traffic sent to, defaults to 80
ports?: [...{
// +usage=Number of port to expose on the pod's IP address
port: int
// +usage=Name of the port
name?: string
// +usage=Protocol for port. Must be UDP, TCP, or SCTP
protocol: *"TCP" | "UDP" | "SCTP"
// +usage=Specify if the port should be exposed
expose: *false | bool
}]
// +ignore
// +usage=Specify what kind of Service you want. options: "ClusterIP", "NodePort", "LoadBalancer", "ExternalName"
exposeType: *"ClusterIP" | "NodePort" | "LoadBalancer" | "ExternalName"
// +ignore
// +usage=If addRevisionLabel is true, the revision label will be added to the underlying pods
addRevisionLabel: *false | bool
// +usage=Commands to run in the container
cmd?: [...string]
// +usage=Define arguments by using environment variables
env?: [...{
// +usage=Environment variable name
name: string
// +usage=The value of the environment variable
value?: string
// +usage=Specifies a source the value of this var should come from
valueFrom?: {
// +usage=Selects a key of a secret in the pod's namespace
secretKeyRef?: {
// +usage=The name of the secret in the pod's namespace to select from
name: string
// +usage=The key of the secret to select from. Must be a valid secret key
key: string
}
// +usage=Selects a key of a config map in the pod's namespace
configMapKeyRef?: {
// +usage=The name of the config map in the pod's namespace to select from
name: string
// +usage=The key of the config map to select from. Must be a valid secret key
key: string
}
}
}]
// +usage=Number of CPU units for the service, like `0.5` (0.5 CPU core), `1` (1 CPU core)
cpu?: string
// +usage=Specifies the attributes of the memory resource required for the container.
memory?: string
volumeMounts?: {
// +usage=Mount PVC type volume
pvc?: [...{
name: string
mountPath: string
// +usage=The name of the PVC
claimName: string
}]
// +usage=Mount ConfigMap type volume
configMap?: [...{
name: string
mountPath: string
defaultMode: *420 | int
cmName: string
items?: [...{
key: string
path: string
mode: *511 | int
}]
}]
// +usage=Mount Secret type volume
secret?: [...{
name: string
mountPath: string
defaultMode: *420 | int
secretName: string
items?: [...{
key: string
path: string
mode: *511 | int
}]
}]
// +usage=Mount EmptyDir type volume
emptyDir?: [...{
name: string
mountPath: string
medium: *"" | "Memory"
}]
// +usage=Mount HostPath type volume
hostPath?: [...{
name: string
mountPath: string
mountPropagation?: "None" | "HostToContainer" | "Bidirectional"
path: string
readOnly?: bool
}]
}
// +usage=Deprecated field, use volumeMounts instead.
volumes?: [...{
name: string
mountPath: string
// +usage=Specify volume type, options: "pvc","configMap","secret","emptyDir"
type: "pvc" | "configMap" | "secret" | "emptyDir"
if type == "pvc" {
claimName: string
}
if type == "configMap" {
defaultMode: *420 | int
cmName: string
items?: [...{
key: string
path: string
mode: *511 | int
}]
}
if type == "secret" {
defaultMode: *420 | int
secretName: string
items?: [...{
key: string
path: string
mode: *511 | int
}]
}
if type == "emptyDir" {
medium: *"" | "Memory"
}
}]
// +usage=Instructions for assessing whether the container is alive.
livenessProbe?: #HealthProbe
// +usage=Instructions for assessing whether the container is in a suitable state to serve traffic.
readinessProbe?: #HealthProbe
// +usage=Specify the hostAliases to add
hostAliases?: [...{
ip: string
hostnames: [...string]
}]
}
#HealthProbe: {
// +usage=Instructions for assessing container health by executing a command. Either this attribute or the httpGet attribute or the tcpSocket attribute MUST be specified. This attribute is mutually exclusive with both the httpGet attribute and the tcpSocket attribute.
exec?: {
// +usage=A command to be executed inside the container to assess its health. Each space delimited token of the command is a separate array element. Commands exiting 0 are considered to be successful probes, whilst all other exit codes are considered failures.
command: [...string]
}
// +usage=Instructions for assessing container health by executing an HTTP GET request. Either this attribute or the exec attribute or the tcpSocket attribute MUST be specified. This attribute is mutually exclusive with both the exec attribute and the tcpSocket attribute.
httpGet?: {
// +usage=The endpoint, relative to the port, to which the HTTP GET request should be directed.
path: string
// +usage=The TCP socket within the container to which the HTTP GET request should be directed.
port: int
host?: string
scheme?: *"HTTP" | string
httpHeaders?: [...{
name: string
value: string
}]
}
// +usage=Instructions for assessing container health by probing a TCP socket. Either this attribute or the exec attribute or the httpGet attribute MUST be specified. This attribute is mutually exclusive with both the exec attribute and the httpGet attribute.
tcpSocket?: {
// +usage=The TCP socket within the container that should be probed to assess container health.
port: int
}
// +usage=Number of seconds after the container is started before the first probe is initiated.
initialDelaySeconds: *0 | int
// +usage=How often, in seconds, to execute the probe.
periodSeconds: *10 | int
// +usage=Number of seconds after which the probe times out.
timeoutSeconds: *1 | int
// +usage=Minimum consecutive successes for the probe to be considered successful after having failed.
successThreshold: *1 | int
// +usage=Number of consecutive failures required to determine the container is not alive (liveness probe) or not ready (readiness probe).
failureThreshold: *3 | int
}
status:
customStatus: |-
ready: {
replicas: *0 | int
} & {
if context.output.status.numberReady != _|_ {
replicas: context.output.status.numberReady
}
}
desired: {
replicas: *0 | int
} & {
if context.output.status.desiredNumberScheduled != _|_ {
replicas: context.output.status.desiredNumberScheduled
}
}
message: "Ready:\(ready.replicas)/\(desired.replicas)"
healthPolicy: |-
ready: {
replicas: *0 | int
} & {
if context.output.status.numberReady != _|_ {
replicas: context.output.status.numberReady
}
}
desired: {
replicas: *0 | int
} & {
if context.output.status.desiredNumberScheduled != _|_ {
replicas: context.output.status.desiredNumberScheduled
}
}
current: {
replicas: *0 | int
} & {
if context.output.status.currentNumberScheduled != _|_ {
replicas: context.output.status.currentNumberScheduled
}
}
updated: {
replicas: *0 | int
} & {
if context.output.status.updatedNumberScheduled != _|_ {
replicas: context.output.status.updatedNumberScheduled
}
}
generation: {
metadata: context.output.metadata.generation
observed: *0 | int
} & {
if context.output.status.observedGeneration != _|_ {
observed: context.output.status.observedGeneration
}
}
isHealth: (desired.replicas == ready.replicas) && (desired.replicas == updated.replicas) && (desired.replicas == current.replicas) && (generation.observed == generation.metadata || generation.observed > generation.metadata)
workload:
definition:
apiVersion: apps/v1
kind: DaemonSet
type: daemonsets.apps

View File

@ -1,64 +0,0 @@
# Code generated by KubeVela templates. DO NOT EDIT. Please edit the original cue file.
# Definition source cue file: vela-templates/definitions/internal/depends-on-app.cue
apiVersion: core.oam.dev/v1beta1
kind: WorkflowStepDefinition
metadata:
annotations:
definition.oam.dev/description: check or install depends-on Application
labels:
custom.definition.oam.dev/ui-hidden: "true"
name: depends-on-app
namespace: {{ include "systemDefinitionNamespace" . }}
spec:
schematic:
cue:
template: |
import (
"vela/op"
"encoding/yaml"
)
dependsOn: op.#Read & {
value: {
apiVersion: "core.oam.dev/v1beta1"
kind: "Application"
metadata: {
name: parameter.name
namespace: parameter.namespace
}
}
}
load: op.#Steps & {
if dependsOn.err != _|_ {
configMap: op.#Read & {
value: {
apiVersion: "v1"
kind: "ConfigMap"
metadata: {
name: parameter.name
namespace: parameter.namespace
}
}
} @step(1)
template: configMap.value.data["application"]
apply: op.#Apply & {
value: yaml.Unmarshal(template)
} @step(2)
wait: op.#ConditionalWait & {
continue: apply.value.status.status == "running"
} @step(3)
}
if dependsOn.err == _|_ {
wait: op.#ConditionalWait & {
continue: dependsOn.value.status.status == "running"
}
}
}
parameter: {
// +usage=Specify the name of the dependent Application
name: string
// +usage=Specify the namespace of the dependent Application
namespace: string
}

View File

@ -1,32 +0,0 @@
# Code generated by KubeVela templates. DO NOT EDIT. Please edit the original cue file.
# Definition source cue file: vela-templates/definitions/internal/deploy-cloud-resource.cue
apiVersion: core.oam.dev/v1beta1
kind: WorkflowStepDefinition
metadata:
annotations:
definition.oam.dev/description: Deploy cloud resource and bind secret to clusters
name: deploy-cloud-resource
namespace: {{ include "systemDefinitionNamespace" . }}
spec:
schematic:
cue:
template: |
import (
"vela/op"
)
app: op.#DeployCloudResource & {
env: parameter.env
policy: parameter.policy
// context.namespace indicates the namespace of the app
namespace: context.namespace
// context.namespace indicates the name of the app
name: context.name
}
parameter: {
// +usage=Declare the name of the env-binding policy, if empty, the first env-binding policy will be used
policy: *"" | string
// +usage=Declare the name of the env in policy
env: string
}

View File

@ -1,33 +0,0 @@
# Code generated by KubeVela templates. DO NOT EDIT. Please edit the original cue file.
# Definition source cue file: vela-templates/definitions/internal/deploy.cue
apiVersion: core.oam.dev/v1beta1
kind: WorkflowStepDefinition
metadata:
annotations:
definition.oam.dev/description: Deploy components with policies.
name: deploy
namespace: {{ include "systemDefinitionNamespace" . }}
spec:
schematic:
cue:
template: |
import (
"vela/op"
)
deploy: op.#Deploy & {
policies: parameter.policies
parallelism: parameter.parallelism
ignoreTerraformComponent: parameter.ignoreTerraformComponent
}
parameter: {
//+usage=If set false, the workflow will be suspend before this step.
auto: *true | bool
//+usage=Declare the policies used for this step.
policies?: [...string]
//+usage=Maximum number of concurrent delivered components.
parallelism: *5 | int
//+usage=If set false, this step will apply the components with the terraform workload.
ignoreTerraformComponent: *true | bool
}

View File

@ -1,36 +0,0 @@
# Code generated by KubeVela templates. DO NOT EDIT. Please edit the original cue file.
# Definition source cue file: vela-templates/definitions/internal/deploy2env.cue
apiVersion: core.oam.dev/v1beta1
kind: WorkflowStepDefinition
metadata:
annotations:
definition.oam.dev/description: Deploy env binding component to target env
labels:
custom.definition.oam.dev/ui-hidden: "true"
name: deploy2env
namespace: {{ include "systemDefinitionNamespace" . }}
spec:
schematic:
cue:
template: |
import (
"vela/op"
)
app: op.#ApplyEnvBindApp & {
env: parameter.env
policy: parameter.policy
parallel: parameter.parallel
app: context.name
// context.namespace indicates the namespace of the app
namespace: context.namespace
}
parameter: {
// +usage=Declare the name of the env-binding policy, if empty, the first env-binding policy will be used
policy: *"" | string
// +usage=Declare the name of the env in policy
env: string
// +usage=components are applied in parallel
parallel: *false | bool
}

View File

@ -1,46 +0,0 @@
# Code generated by KubeVela templates. DO NOT EDIT. Please edit the original cue file.
# Definition source cue file: vela-templates/definitions/internal/deploy2runtime.cue
apiVersion: core.oam.dev/v1beta1
kind: WorkflowStepDefinition
metadata:
annotations:
definition.oam.dev/description: Deploy application to runtime clusters
labels:
custom.definition.oam.dev/ui-hidden: "true"
name: deploy2runtime
namespace: {{ include "systemDefinitionNamespace" . }}
spec:
schematic:
cue:
template: |
import (
"vela/op"
)
app: op.#Steps & {
load: op.#Load @step(1)
clusters: [...string]
if parameter.clusters == _|_ {
listClusters: op.#ListClusters @step(2)
clusters: listClusters.outputs.clusters
}
if parameter.clusters != _|_ {
clusters: parameter.clusters
}
apply: op.#Steps & {
for _, cluster_ in clusters {
for name, c in load.value {
"\(cluster_)-\(name)": op.#ApplyComponent & {
value: c
cluster: cluster_
}
}
}
} @step(3)
}
parameter: {
// +usage=Declare the runtime clusters to apply, if empty, all runtime clusters will be used
clusters?: [...string]
}

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