mirror of
https://github.com/kubevela/kubevela.git
synced 2026-02-25 15:23:53 +00:00
Compare commits
180 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
44e8352d1e | ||
|
|
5d9b3fbce6 | ||
|
|
6c0364453f | ||
|
|
2aa5b47e45 | ||
|
|
efa60a67a1 | ||
|
|
89b479e1bc | ||
|
|
d591d6ad64 | ||
|
|
916b3b52de | ||
|
|
df0eaaa74a | ||
|
|
2740067eb5 | ||
|
|
53b49aca53 | ||
|
|
b75de8aa94 | ||
|
|
2fc6971261 | ||
|
|
27a5630652 | ||
|
|
14334dd954 | ||
|
|
8948518d9f | ||
|
|
368dd687c2 | ||
|
|
34bee10bc3 | ||
|
|
d6aadacc9b | ||
|
|
ea738c119a | ||
|
|
7cf425969a | ||
|
|
b5cd647876 | ||
|
|
d2a28cbb8e | ||
|
|
a350a44982 | ||
|
|
e01ff21d30 | ||
|
|
2fdd33a80a | ||
|
|
7cee9cef98 | ||
|
|
01dfedfac2 | ||
|
|
a05a983a9a | ||
|
|
53b28d61a9 | ||
|
|
a8605a02f9 | ||
|
|
acb6f3ba04 | ||
|
|
0d264c16f7 | ||
|
|
675b0e24db | ||
|
|
7ed1c66578 | ||
|
|
5079659404 | ||
|
|
b3302b318c | ||
|
|
e1dfe40794 | ||
|
|
0571ae3a54 | ||
|
|
29744a6f18 | ||
|
|
fbd4565115 | ||
|
|
3543cb9b23 | ||
|
|
1d731b808a | ||
|
|
bba6e056a5 | ||
|
|
7787fe8e6a | ||
|
|
6a956f9343 | ||
|
|
b76a3f3f42 | ||
|
|
fd44069a21 | ||
|
|
cd8f31c4d8 | ||
|
|
f625877eb1 | ||
|
|
396f244af1 | ||
|
|
ed3e8d384a | ||
|
|
5f34a0c658 | ||
|
|
c40108f413 | ||
|
|
63855abed9 | ||
|
|
4dd00ac536 | ||
|
|
55b6ef1846 | ||
|
|
737b4dc2e4 | ||
|
|
60b8ec3ff2 | ||
|
|
fed2d13d98 | ||
|
|
85d6c77fad | ||
|
|
a488a24af4 | ||
|
|
00a4e4ca01 | ||
|
|
ef0888f256 | ||
|
|
0519c1ea8c | ||
|
|
467506c498 | ||
|
|
0ac7f02fc9 | ||
|
|
662a791e71 | ||
|
|
b726c5291f | ||
|
|
7377e17f8f | ||
|
|
1867436174 | ||
|
|
a3c97ecf31 | ||
|
|
4be93ad8b8 | ||
|
|
ee7dac354d | ||
|
|
21c631ac26 | ||
|
|
90f7d11787 | ||
|
|
b1ad5574b8 | ||
|
|
290b6c0815 | ||
|
|
b9a56aeb17 | ||
|
|
3800a700b0 | ||
|
|
75f081f248 | ||
|
|
ba68e33e23 | ||
|
|
fb6d505e6e | ||
|
|
1a267bc6d1 | ||
|
|
8643558f6b | ||
|
|
d063cd3b78 | ||
|
|
c4fa81b703 | ||
|
|
ebc8476a31 | ||
|
|
0333b9e891 | ||
|
|
3be63bba91 | ||
|
|
f9f2c3b119 | ||
|
|
34684650c3 | ||
|
|
e76992df87 | ||
|
|
3a68ec77fd | ||
|
|
199e747865 | ||
|
|
c6b65cbd5b | ||
|
|
9fa237721e | ||
|
|
b90fffad43 | ||
|
|
1ad6dcc1a7 | ||
|
|
1659528015 | ||
|
|
ce20f55382 | ||
|
|
384c5ab6a9 | ||
|
|
b3fd25cae1 | ||
|
|
a7bfb2fb6f | ||
|
|
8703950da6 | ||
|
|
f7cfe6fbae | ||
|
|
e8ed4d78cf | ||
|
|
0c8e22ef4d | ||
|
|
e9004d7478 | ||
|
|
282efa2893 | ||
|
|
580157df6a | ||
|
|
6ecb0567f5 | ||
|
|
dcf79a9b57 | ||
|
|
b411d79ed0 | ||
|
|
d8eb7d687c | ||
|
|
63b348f4d8 | ||
|
|
2e43a6dc78 | ||
|
|
26163aacdc | ||
|
|
5164efeb4a | ||
|
|
2254777523 | ||
|
|
389722a94e | ||
|
|
4b86689d63 | ||
|
|
2b07ec49d4 | ||
|
|
7edfbde2f5 | ||
|
|
bc6a60dde2 | ||
|
|
1407fc5125 | ||
|
|
2d6f2083db | ||
|
|
c619b7b290 | ||
|
|
bc6000f794 | ||
|
|
2e92a66fa5 | ||
|
|
e5a9be8de9 | ||
|
|
5d40f121ea | ||
|
|
58c3283411 | ||
|
|
6d65169449 | ||
|
|
9bf6cc2659 | ||
|
|
ecbb5f56ca | ||
|
|
7ede0746c1 | ||
|
|
e8e45dd7d3 | ||
|
|
08a1dc5a22 | ||
|
|
d2a46322c0 | ||
|
|
7d31d84ec3 | ||
|
|
f59341f667 | ||
|
|
a446aab46b | ||
|
|
f2de6de6f8 | ||
|
|
0f23f6eb09 | ||
|
|
473164efbd | ||
|
|
7dec0afc16 | ||
|
|
a44257e153 | ||
|
|
1261e2678f | ||
|
|
325a4cdb0e | ||
|
|
b33b6fbead | ||
|
|
15b1bd2660 | ||
|
|
8c73ea5d8a | ||
|
|
4b25ed4ba1 | ||
|
|
f47ca0f4da | ||
|
|
5b1b054cca | ||
|
|
35376bd396 | ||
|
|
06069d3580 | ||
|
|
43057161bf | ||
|
|
50ded65805 | ||
|
|
1444376b0c | ||
|
|
04486f89bb | ||
|
|
d6d19a7c5a | ||
|
|
6b8875012d | ||
|
|
7ae6a148a0 | ||
|
|
bbea29c8e5 | ||
|
|
6e6c4c76a6 | ||
|
|
1bf673c3c1 | ||
|
|
352fe1ba5b | ||
|
|
3bdf7a044f | ||
|
|
3cb9fa79bf | ||
|
|
20f6e0ab02 | ||
|
|
438ab96f95 | ||
|
|
b5bf7a4f62 | ||
|
|
d473e41f20 | ||
|
|
96c1d0786a | ||
|
|
f7196e10ca | ||
|
|
a2997a070d | ||
|
|
0629049e1f | ||
|
|
553b5d19eb |
1
.github/ISSUE_TEMPLATE/config.yaml
vendored
1
.github/ISSUE_TEMPLATE/config.yaml
vendored
@@ -1 +0,0 @@
|
||||
blank_issues_enabled: true
|
||||
5
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
5
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
blank_issues_enabled: true
|
||||
contact_links:
|
||||
- name: Questions & Help
|
||||
url: https://github.com/oam-dev/kubevela/discussions
|
||||
about: Please ask and answer questions here.
|
||||
9
.github/workflows/check-docs.yml
vendored
9
.github/workflows/check-docs.yml
vendored
@@ -14,6 +14,13 @@ jobs:
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: '12.x'
|
||||
- uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: '3.7'
|
||||
- name: Clean md files
|
||||
run: python ./hack/website/clean-md.py ./docs/en
|
||||
- name: Test Build
|
||||
env:
|
||||
VERSION: ${{ github.ref }}
|
||||
run: |
|
||||
sh ./hack/website/test-build.sh
|
||||
bash ./hack/website/test-build.sh
|
||||
30
.github/workflows/codeql-analysis.yml
vendored
Normal file
30
.github/workflows/codeql-analysis.yml
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
name: "CodeQL"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master, release-* ]
|
||||
|
||||
jobs:
|
||||
analyze:
|
||||
name: Analyze
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
language: [ 'go' ]
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v1
|
||||
with:
|
||||
languages: ${{ matrix.language }}
|
||||
|
||||
- name: Autobuild
|
||||
uses: github/codeql-action/autobuild@v1
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v1
|
||||
33
.github/workflows/go.yml
vendored
33
.github/workflows/go.yml
vendored
@@ -15,7 +15,6 @@ env:
|
||||
# Common versions
|
||||
GO_VERSION: '1.14'
|
||||
GOLANGCI_VERSION: 'v1.38'
|
||||
DOCKER_BUILDX_VERSION: 'v0.4.2'
|
||||
KIND_VERSION: 'v0.7.0'
|
||||
|
||||
jobs:
|
||||
@@ -30,7 +29,7 @@ jobs:
|
||||
uses: fkirc/skip-duplicate-actions@v3.3.0
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
paths_ignore: '["**.md", "**.png", "**.jpg"]'
|
||||
paths_ignore: '["**.md", "**.mdx", "**.png", "**.jpg"]'
|
||||
do_not_skip: '["workflow_dispatch", "schedule", "push"]'
|
||||
concurrent_skipping: false
|
||||
|
||||
@@ -150,7 +149,7 @@ jobs:
|
||||
- name: Setup Kind Cluster
|
||||
run: |
|
||||
kind delete cluster
|
||||
kind create cluster
|
||||
kind create cluster --image kindest/node:v1.18.15@sha256:5c1b980c4d0e0e8e7eb9f36f7df525d079a96169c8a8f20d8bd108c0d0889cc4
|
||||
kubectl version
|
||||
kubectl cluster-info
|
||||
|
||||
@@ -167,6 +166,8 @@ jobs:
|
||||
run: |
|
||||
make e2e-cleanup
|
||||
make e2e-setup
|
||||
helm lint ./charts/vela-core
|
||||
helm test -n vela-system kubevela --timeout 5m
|
||||
|
||||
- name: Wait for e2e preparation ready
|
||||
run: |
|
||||
@@ -178,6 +179,20 @@ jobs:
|
||||
- name: Run e2e tests
|
||||
run: make e2e-test
|
||||
|
||||
- name: Stop kubevela, get profile
|
||||
run: make end-e2e
|
||||
|
||||
- name: Upload coverage report
|
||||
uses: codecov/codecov-action@v1
|
||||
with:
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
file: /tmp/e2e-profile.out
|
||||
flags: e2etests
|
||||
name: codecov-umbrella
|
||||
|
||||
- name: Clean e2e profile
|
||||
run: rm /tmp/e2e-profile.out
|
||||
|
||||
- name: Cleanup image
|
||||
if: ${{ always() }}
|
||||
run: make image-cleanup
|
||||
@@ -188,6 +203,11 @@ jobs:
|
||||
if: needs.detect-noop.outputs.noop != 'true'
|
||||
|
||||
steps:
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
@@ -200,8 +220,11 @@ jobs:
|
||||
key: ${{ runner.os }}-pkg-${{ hashFiles('**/go.sum') }}
|
||||
restore-keys: ${{ runner.os }}-pkg-
|
||||
|
||||
- name: Install StaticCheck
|
||||
run: GO111MODULE=off go get honnef.co/go/tools/cmd/staticcheck
|
||||
|
||||
- name: Static Check
|
||||
run: go run honnef.co/go/tools/cmd/staticcheck -- ./...
|
||||
run: staticcheck ./...
|
||||
|
||||
- name: License Header Check
|
||||
run: make check-license-header
|
||||
@@ -278,4 +301,4 @@ jobs:
|
||||
- name: Run cross-build
|
||||
run: make cross-build
|
||||
- name: Run compress binary
|
||||
run: make compress
|
||||
run: make compress
|
||||
|
||||
2
.github/workflows/registry.yml
vendored
2
.github/workflows/registry.yml
vendored
@@ -37,7 +37,7 @@ jobs:
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
password: ${{ secrets.CR_PAT }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Login docker.io
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
|
||||
15
.github/workflows/release-docs.yaml
vendored
15
.github/workflows/release-docs.yaml
vendored
@@ -11,11 +11,18 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: '12.x'
|
||||
- uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: '3.7'
|
||||
- name: Clean md files
|
||||
run: python ./hack/website/clean-md.py ./docs/en
|
||||
- name: Sync to kubevela.io Repo
|
||||
uses: wonderflow/auto-docs-action@v0.2.3
|
||||
env:
|
||||
SSH_PRIVATE_KEY: ${{ secrets.GH_PAGES_DEPLOY }}
|
||||
SSH_DEPLOY_KEY: ${{ secrets.GH_PAGES_DEPLOY }}
|
||||
VERSION: ${{ github.ref }}
|
||||
COMMIT_ID: ${{ github.sha }}
|
||||
with:
|
||||
gh-page: git@github.com:oam-dev/kubevela.io.git
|
||||
run: |
|
||||
bash ./hack/website/release.sh
|
||||
80
.github/workflows/release.yml
vendored
80
.github/workflows/release.yml
vendored
@@ -34,52 +34,106 @@ jobs:
|
||||
- name: Get release
|
||||
id: get_release
|
||||
uses: bruceadams/get-release@v1.2.2
|
||||
- name: Upload Linux amd64 tar.gz
|
||||
- name: Upload Vela Linux amd64 tar.gz
|
||||
uses: actions/upload-release-asset@v1.0.2
|
||||
with:
|
||||
upload_url: ${{ steps.get_release.outputs.upload_url }}
|
||||
asset_path: ./_bin/vela-linux-amd64.tar.gz
|
||||
asset_path: ./_bin/vela/vela-linux-amd64.tar.gz
|
||||
asset_name: vela-${{ steps.get_version.outputs.VERSION }}-linux-amd64.tar.gz
|
||||
asset_content_type: binary/octet-stream
|
||||
- name: Upload Linux amd64 zip
|
||||
- name: Upload Vela Linux amd64 zip
|
||||
uses: actions/upload-release-asset@v1.0.2
|
||||
with:
|
||||
upload_url: ${{ steps.get_release.outputs.upload_url }}
|
||||
asset_path: ./_bin/vela-linux-amd64.zip
|
||||
asset_path: ./_bin/vela/vela-linux-amd64.zip
|
||||
asset_name: vela-${{ steps.get_version.outputs.VERSION }}-linux-amd64.zip
|
||||
asset_content_type: binary/octet-stream
|
||||
- name: Upload MacOS tar.gz
|
||||
- name: Upload Vela MacOS tar.gz
|
||||
uses: actions/upload-release-asset@v1.0.2
|
||||
with:
|
||||
upload_url: ${{ steps.get_release.outputs.upload_url }}
|
||||
asset_path: ./_bin/vela-darwin-amd64.tar.gz
|
||||
asset_path: ./_bin/vela/vela-darwin-amd64.tar.gz
|
||||
asset_name: vela-${{ steps.get_version.outputs.VERSION }}-darwin-amd64.tar.gz
|
||||
asset_content_type: binary/octet-stream
|
||||
- name: Upload MacOS zip
|
||||
- name: Upload Vela MacOS zip
|
||||
uses: actions/upload-release-asset@v1.0.2
|
||||
with:
|
||||
upload_url: ${{ steps.get_release.outputs.upload_url }}
|
||||
asset_path: ./_bin/vela-darwin-amd64.zip
|
||||
asset_path: ./_bin/vela/vela-darwin-amd64.zip
|
||||
asset_name: vela-${{ steps.get_version.outputs.VERSION }}-darwin-amd64.zip
|
||||
asset_content_type: binary/octet-stream
|
||||
- name: Upload Windows tar.gz
|
||||
- name: Upload Vela Windows tar.gz
|
||||
uses: actions/upload-release-asset@v1.0.2
|
||||
with:
|
||||
upload_url: ${{ steps.get_release.outputs.upload_url }}
|
||||
asset_path: ./_bin/vela-windows-amd64.tar.gz
|
||||
asset_path: ./_bin/vela/vela-windows-amd64.tar.gz
|
||||
asset_name: vela-${{ steps.get_version.outputs.VERSION }}-windows-amd64.tar.gz
|
||||
asset_content_type: binary/octet-stream
|
||||
- name: Upload Windows zip
|
||||
- name: Upload Vela Windows zip
|
||||
uses: actions/upload-release-asset@v1.0.2
|
||||
with:
|
||||
upload_url: ${{ steps.get_release.outputs.upload_url }}
|
||||
asset_path: ./_bin/vela-windows-amd64.zip
|
||||
asset_path: ./_bin/vela/vela-windows-amd64.zip
|
||||
asset_name: vela-${{ steps.get_version.outputs.VERSION }}-windows-amd64.zip
|
||||
asset_content_type: binary/octet-stream
|
||||
- name: Upload Kubectl-Vela Linux amd64 tar.gz
|
||||
uses: actions/upload-release-asset@v1.0.2
|
||||
with:
|
||||
upload_url: ${{ steps.get_release.outputs.upload_url }}
|
||||
asset_path: ./_bin/kubectl-vela/kubectl-vela-linux-amd64.tar.gz
|
||||
asset_name: kubectl-vela-${{ steps.get_version.outputs.VERSION }}-linux-amd64.tar.gz
|
||||
asset_content_type: binary/octet-stream
|
||||
- name: Upload Kubectl-Vela Linux amd64 zip
|
||||
uses: actions/upload-release-asset@v1.0.2
|
||||
with:
|
||||
upload_url: ${{ steps.get_release.outputs.upload_url }}
|
||||
asset_path: ./_bin/kubectl-vela/kubectl-vela-linux-amd64.zip
|
||||
asset_name: kubectl-vela-${{ steps.get_version.outputs.VERSION }}-linux-amd64.zip
|
||||
asset_content_type: binary/octet-stream
|
||||
- name: Upload Kubectl-Vela MacOS tar.gz
|
||||
uses: actions/upload-release-asset@v1.0.2
|
||||
with:
|
||||
upload_url: ${{ steps.get_release.outputs.upload_url }}
|
||||
asset_path: ./_bin/kubectl-vela/kubectl-vela-darwin-amd64.tar.gz
|
||||
asset_name: kubectl-vela-${{ steps.get_version.outputs.VERSION }}-darwin-amd64.tar.gz
|
||||
asset_content_type: binary/octet-stream
|
||||
- name: Upload Kubectl-Vela MacOS zip
|
||||
uses: actions/upload-release-asset@v1.0.2
|
||||
with:
|
||||
upload_url: ${{ steps.get_release.outputs.upload_url }}
|
||||
asset_path: ./_bin/kubectl-vela/kubectl-vela-darwin-amd64.zip
|
||||
asset_name: kubectl-vela-${{ steps.get_version.outputs.VERSION }}-darwin-amd64.zip
|
||||
asset_content_type: binary/octet-stream
|
||||
- name: Upload Kubectl-Vela Windows tar.gz
|
||||
uses: actions/upload-release-asset@v1.0.2
|
||||
with:
|
||||
upload_url: ${{ steps.get_release.outputs.upload_url }}
|
||||
asset_path: ./_bin/kubectl-vela/kubectl-vela-windows-amd64.tar.gz
|
||||
asset_name: kubectl-vela-${{ steps.get_version.outputs.VERSION }}-windows-amd64.tar.gz
|
||||
asset_content_type: binary/octet-stream
|
||||
- name: Upload Kubectl-Vela Windows zip
|
||||
uses: actions/upload-release-asset@v1.0.2
|
||||
with:
|
||||
upload_url: ${{ steps.get_release.outputs.upload_url }}
|
||||
asset_path: ./_bin/kubectl-vela/kubectl-vela-windows-amd64.zip
|
||||
asset_name: kubectl-vela-${{ steps.get_version.outputs.VERSION }}-windows-amd64.zip
|
||||
asset_content_type: binary/octet-stream
|
||||
- name: Upload Checksums
|
||||
uses: actions/upload-release-asset@v1.0.2
|
||||
with:
|
||||
upload_url: ${{ steps.get_release.outputs.upload_url }}
|
||||
asset_path: ./_bin/sha256sums.txt
|
||||
asset_name: sha256sums.txt
|
||||
asset_content_type: text/plain
|
||||
asset_content_type: text/plain
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: '12.x'
|
||||
- name: Sync release to kubevela.io Repo
|
||||
env:
|
||||
SSH_DEPLOY_KEY: ${{ secrets.GH_PAGES_DEPLOY }}
|
||||
VERSION: ${{ steps.get_version.outputs.VERSION }}
|
||||
COMMIT_ID: ${{ github.sha }}
|
||||
run: |
|
||||
bash ./hack/website/release.sh
|
||||
- name: Update kubectl plugin version in krew-index
|
||||
uses: rajatjindal/krew-release-bot@v0.0.38
|
||||
36
.github/workflows/sync-api.yml
vendored
Normal file
36
.github/workflows/sync-api.yml
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
name: sync-api
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- 'apis/**'
|
||||
- 'pkg/oam/**'
|
||||
tags:
|
||||
- "v*"
|
||||
|
||||
jobs:
|
||||
sync-core-api:
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- name: Set up Go 1.14
|
||||
uses: actions/setup-go@v1
|
||||
env:
|
||||
GO_VERSION: '1.14'
|
||||
GOLANGCI_VERSION: 'v1.38'
|
||||
with:
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
id: go
|
||||
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Get the version
|
||||
id: get_version
|
||||
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/}
|
||||
|
||||
- name: Sync to kubevela-core-api Repo
|
||||
env:
|
||||
SSH_DEPLOY_KEY: ${{ secrets.VELA_API_DEPLOY }}
|
||||
VERSION: ${{ steps.get_version.outputs.VERSION }}
|
||||
COMMIT_ID: ${{ github.sha }}
|
||||
run: |
|
||||
bash ./hack/apis/sync.sh
|
||||
10
.github/workflows/timed-task.yml
vendored
Normal file
10
.github/workflows/timed-task.yml
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
name: Timed Task
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 16 * * *'
|
||||
jobs:
|
||||
clean-image:
|
||||
runs-on: aliyun
|
||||
steps:
|
||||
- name: Cleanup image
|
||||
run: docker image prune -f
|
||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -55,3 +55,6 @@ references/dashboard/src/.umi-production/
|
||||
|
||||
# Swagger: generate Restful API
|
||||
references/apiserver/docs/index.html
|
||||
|
||||
# check docs
|
||||
git-page/
|
||||
47
.krew.yaml
Normal file
47
.krew.yaml
Normal file
@@ -0,0 +1,47 @@
|
||||
apiVersion: krew.googlecontainertools.github.com/v1alpha2
|
||||
kind: Plugin
|
||||
metadata:
|
||||
name: vela
|
||||
spec:
|
||||
version: "{{ .TagName }}"
|
||||
platforms:
|
||||
- selector:
|
||||
matchLabels:
|
||||
os: linux
|
||||
arch: amd64
|
||||
{{addURIAndSha "https://github.com/oam-dev/kubevela/releases/download/{{ .TagName }}/kubectl-vela-{{ .TagName }}-linux-amd64.tar.gz" .TagName }}
|
||||
files:
|
||||
- from: "*/kubectl-vela"
|
||||
to: "."
|
||||
- from: "*/LICENSE"
|
||||
to: "."
|
||||
bin: "kubectl-vela"
|
||||
- selector:
|
||||
matchLabels:
|
||||
os: darwin
|
||||
arch: amd64
|
||||
{{addURIAndSha "https://github.com/oam-dev/kubevela/releases/download/{{ .TagName }}/kubectl-vela-{{ .TagName }}-darwin-amd64.tar.gz" .TagName }}
|
||||
files:
|
||||
- from: "*/kubectl-vela"
|
||||
to: "."
|
||||
- from: "*/LICENSE"
|
||||
to: "."
|
||||
bin: "kubectl-vela"
|
||||
- selector:
|
||||
matchLabels:
|
||||
os: windows
|
||||
arch: amd64
|
||||
{{addURIAndSha "https://github.com/oam-dev/kubevela/releases/download/{{ .TagName }}/kubectl-vela-{{ .TagName }}-windows-amd64.zip" .TagName }}
|
||||
files:
|
||||
- from: "*/kubectl-vela.exe"
|
||||
to: "."
|
||||
- from: "*/LICENSE"
|
||||
to: "."
|
||||
bin: "kubectl-vela.exe"
|
||||
shortDescription: Easily interact with KubeVela
|
||||
homepage: https://kubevela.io
|
||||
description: |
|
||||
kubectl vela is a kubectl plugin from the KubeVela project. KubeVela is
|
||||
a modern application platform that is fully self-service, and adapts to
|
||||
your needs when you grow. This plugin allows you to better view, manage
|
||||
and maintain KubeVela applications.
|
||||
@@ -18,7 +18,7 @@ contributing to `kubevela` or build a PoC (Proof of Concept).
|
||||
3. ginkgo 1.14.0+ (just for [E2E test](./CONTRIBUTING.md#e2e-test))
|
||||
4. golangci-lint 1.31.0+, it will install automatically if you run `make`, you can [install it manually](https://golangci-lint.run/usage/install/#local-installation) if the installation is too slow.
|
||||
|
||||
We also recommend you to learn about KubeVela's [design](https://kubevela.io/#/en/concepts) before dive into its code.
|
||||
We also recommend you to learn about KubeVela's [design](https://kubevela.io/docs/concepts) before dive into its code.
|
||||
|
||||
### Build
|
||||
|
||||
@@ -86,7 +86,7 @@ helm uninstall -n vela-system kubevela
|
||||
|
||||
### Use
|
||||
|
||||
You can try use your local built binaries follow [the documentation](https://kubevela.io/#/en/quick-start).
|
||||
You can try use your local built binaries follow [the documentation](https://kubevela.io/docs/quick-start).
|
||||
|
||||
## Testing
|
||||
|
||||
@@ -109,6 +109,59 @@ Start to test.
|
||||
```
|
||||
make e2e-test
|
||||
```
|
||||
## Logging Conventions
|
||||
|
||||
|
||||
### Structured logging
|
||||
|
||||
We recommend using `klog.InfoS` to structure the log. The `msg` argument need start from a capital letter.
|
||||
and name arguments should always use lowerCamelCase.
|
||||
|
||||
```golang
|
||||
// func InfoS(msg string, keysAndValues ...interface{})
|
||||
klog.InfoS("Reconcile traitDefinition", "traitDefinition", klog.KRef(req.Namespace, req.Name))
|
||||
// output:
|
||||
// I0605 10:10:57.308074 22276 traitdefinition_controller.go:59] "Reconcile traitDefinition" traitDefinition="vela-system/expose"
|
||||
```
|
||||
|
||||
### Use `klog.KObj` and `klog.KRef` for Kubernetes objects
|
||||
|
||||
`klog.KObj` and `klog.KRef` can unify the output of kubernetes object.
|
||||
|
||||
```golang
|
||||
// KObj is used to create ObjectRef when logging information about Kubernetes objects
|
||||
klog.InfoS("Start to reconcile", "appDeployment", klog.KObj(appDeployment))
|
||||
// KRef is used to create ObjectRef when logging information about Kubernetes objects without access to metav1.Object
|
||||
klog.InfoS("Reconcile application", "application", klog.KRef(req.Namespace, req.Name))
|
||||
```
|
||||
|
||||
### Logging Level
|
||||
|
||||
[This file](https://github.com/oam-dev/kubevela/blob/master/pkg/controller/common/logs.go) contains KubeVela's log level,
|
||||
you can set the log level by `klog.V(level)`.
|
||||
|
||||
```golang
|
||||
// you can use klog.V(common.LogDebug) to print debug log
|
||||
klog.V(common.LogDebug).InfoS("Successfully applied components", "workloads", len(workloads))
|
||||
```
|
||||
|
||||
more detail in [Structured Logging Guide](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-instrumentation/migration-to-structured-logging.md#structured-logging-in-kubernetes).
|
||||
|
||||
## Contribute Docs
|
||||
|
||||
Please read [the documentation](https://github.com/oam-dev/kubevela/tree/master/docs/README.md) before contributing to the docs.
|
||||
|
||||
- Build docs
|
||||
|
||||
```shell script
|
||||
make docs-build
|
||||
```
|
||||
|
||||
- Local development and preview
|
||||
|
||||
```shell script
|
||||
make docs-start
|
||||
```
|
||||
|
||||
## Make a pull request
|
||||
|
||||
|
||||
24
Dockerfile
24
Dockerfile
@@ -1,5 +1,5 @@
|
||||
# Build the manager binary
|
||||
FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.14 as builder
|
||||
FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.14-alpine as builder
|
||||
|
||||
WORKDIR /workspace
|
||||
# Copy the Go Modules manifests
|
||||
@@ -19,24 +19,26 @@ COPY version/ version/
|
||||
ARG TARGETARCH
|
||||
ARG VERSION
|
||||
ARG GITVERSION
|
||||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} GO111MODULE=on \
|
||||
go build -a -ldflags "-X github.com/oam-dev/kubevela/version.VelaVersion=${VERSION:-undefined} -X github.com/oam-dev/kubevela/version.GitRevision=${GITVERSION:-undefined}" \
|
||||
RUN GO111MODULE=on CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} \
|
||||
go build -a -ldflags "-s -w -X github.com/oam-dev/kubevela/version.VelaVersion=${VERSION:-undefined} -X github.com/oam-dev/kubevela/version.GitRevision=${GITVERSION:-undefined}" \
|
||||
-o manager-${TARGETARCH} main.go
|
||||
|
||||
# Use ubuntu as base image for convenience.
|
||||
# Use alpine as base image due to the discussion in issue #1448
|
||||
# You can replace distroless as minimal base image to package the manager binary
|
||||
# Refer to https://github.com/GoogleContainerTools/distroless for more details
|
||||
# Could use `--build-arg=BASE_IMAGE=gcr.io/distroless/static:nonroot` to overwrite
|
||||
# Overwrite `BASE_IMAGE` by passing `--build-arg=BASE_IMAGE=gcr.io/distroless/static:nonroot`
|
||||
ARG BASE_IMAGE
|
||||
FROM ${BASE_IMAGE:-ubuntu:latest}
|
||||
FROM ${BASE_IMAGE:-alpine:latest}
|
||||
# This is required by daemon connnecting with cri
|
||||
RUN ln -s /usr/bin/* /usr/sbin/ && apt-get update -y \
|
||||
&& apt-get install --no-install-recommends -y ca-certificates \
|
||||
&& apt-get clean && rm -rf /var/log/*log /var/lib/apt/lists/* /var/log/apt/* /var/lib/dpkg/*-old /var/cache/debconf/*-old
|
||||
RUN apk add --no-cache ca-certificates bash
|
||||
|
||||
WORKDIR /
|
||||
|
||||
ARG TARGETARCH
|
||||
COPY --from=builder /workspace/manager-${TARGETARCH} /manager
|
||||
COPY --from=builder /workspace/manager-${TARGETARCH} /usr/local/bin/manager
|
||||
|
||||
ENTRYPOINT ["/manager"]
|
||||
COPY entrypoint.sh /usr/local/bin/
|
||||
|
||||
ENTRYPOINT ["entrypoint.sh"]
|
||||
|
||||
CMD ["manager"]
|
||||
|
||||
48
Dockerfile.e2e
Normal file
48
Dockerfile.e2e
Normal file
@@ -0,0 +1,48 @@
|
||||
# Build the manager binary
|
||||
FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.14-alpine as builder
|
||||
|
||||
WORKDIR /workspace
|
||||
# Copy the Go Modules manifests
|
||||
COPY go.mod go.mod
|
||||
COPY go.sum go.sum
|
||||
# cache deps before building and copying source so that we don't need to re-download as much
|
||||
# and so that source changes don't invalidate our downloaded layer
|
||||
RUN go mod download
|
||||
|
||||
# Copy the go source
|
||||
COPY cmd/core/main.go main.go
|
||||
COPY cmd/core/main_e2e_test.go main_e2e_test.go
|
||||
COPY cmd/ cmd/
|
||||
COPY apis/ apis/
|
||||
COPY pkg/ pkg/
|
||||
COPY version/ version/
|
||||
|
||||
# Build
|
||||
ARG TARGETARCH
|
||||
ARG VERSION
|
||||
ARG GITVERSION
|
||||
|
||||
RUN apk add gcc musl-dev libc-dev ;\
|
||||
go test -c -o manager-${TARGETARCH} -cover -covermode=atomic -coverpkg ./... .
|
||||
|
||||
# Use alpine as base image due to the discussion in issue #1448
|
||||
# You can replace distroless as minimal base image to package the manager binary
|
||||
# Refer to https://github.com/GoogleContainerTools/distroless for more details
|
||||
# Overwrite `BASE_IMAGE` by passing `--build-arg=BASE_IMAGE=gcr.io/distroless/static:nonroot`
|
||||
ARG BASE_IMAGE
|
||||
FROM ${BASE_IMAGE:-alpine:latest}
|
||||
# This is required by daemon connnecting with cri
|
||||
RUN apk add --no-cache ca-certificates bash
|
||||
|
||||
WORKDIR /
|
||||
|
||||
ARG TARGETARCH
|
||||
COPY --from=builder /workspace/manager-${TARGETARCH} /usr/local/bin/manager
|
||||
|
||||
COPY entrypoint.sh /usr/local/bin/
|
||||
|
||||
VOLUME ["/workspace/data"]
|
||||
|
||||
ENTRYPOINT ["entrypoint.sh"]
|
||||
|
||||
CMD ["manager"]
|
||||
89
Makefile
89
Makefile
@@ -3,10 +3,11 @@ VELA_VERSION ?= master
|
||||
# Repo info
|
||||
GIT_COMMIT ?= git-$(shell git rev-parse --short HEAD)
|
||||
GIT_COMMIT_LONG ?= $(shell git rev-parse HEAD)
|
||||
VELA_VERSION_VAR := github.com/oam-dev/kubevela/version.VelaVersion
|
||||
VELA_GITVERSION_VAR := github.com/oam-dev/kubevela/version.GitRevision
|
||||
LDFLAGS ?= "-X $(VELA_VERSION_VAR)=$(VELA_VERSION) -X $(VELA_GITVERSION_VAR)=$(GIT_COMMIT)"
|
||||
VELA_VERSION_KEY := github.com/oam-dev/kubevela/version.VelaVersion
|
||||
VELA_GITVERSION_KEY := github.com/oam-dev/kubevela/version.GitRevision
|
||||
LDFLAGS ?= "-s -w -X $(VELA_VERSION_KEY)=$(VELA_VERSION) -X $(VELA_GITVERSION_KEY)=$(GIT_COMMIT)"
|
||||
|
||||
GOBUILD_ENV = GO111MODULE=on CGO_ENABLED=0
|
||||
GOX = go run github.com/mitchellh/gox
|
||||
TARGETS := darwin/amd64 linux/amd64 windows/amd64
|
||||
DIST_DIRS := find * -type d -exec
|
||||
@@ -34,6 +35,10 @@ else
|
||||
GOBIN=$(shell go env GOBIN)
|
||||
endif
|
||||
|
||||
# Image URL to use all building/pushing image targets
|
||||
VELA_CORE_IMAGE ?= vela-core:latest
|
||||
VELA_CORE_TEST_IMAGE ?= vela-core-test:$(GIT_COMMIT)
|
||||
|
||||
all: build
|
||||
|
||||
# Run tests
|
||||
@@ -42,25 +47,40 @@ test: vet lint staticcheck
|
||||
go test -race -covermode=atomic ./references/apiserver/... ./references/appfile/... ./references/cli/... ./references/common/... ./references/plugins/...
|
||||
@$(OK) unit-tests pass
|
||||
|
||||
# Build manager binary
|
||||
build: fmt vet lint staticcheck
|
||||
go run hack/chart/generate.go
|
||||
go build -o bin/vela -ldflags ${LDFLAGS} references/cmd/cli/main.go
|
||||
git checkout references/cmd/cli/fake/chart_source.go
|
||||
# Build vela cli binary
|
||||
build: fmt vet lint staticcheck vela-cli kubectl-vela
|
||||
@$(OK) build succeed
|
||||
|
||||
vela-cli:
|
||||
go run hack/chart/generate.go
|
||||
go build -o bin/vela -ldflags ${LDFLAGS} references/cmd/cli/main.go
|
||||
$(GOBUILD_ENV) go build -o bin/vela -a -ldflags $(LDFLAGS) ./references/cmd/cli/main.go
|
||||
git checkout references/cmd/cli/fake/chart_source.go
|
||||
|
||||
kubectl-vela:
|
||||
$(GOBUILD_ENV) go build -o bin/kubectl-vela -a -ldflags $(LDFLAGS) ./cmd/plugin/main.go
|
||||
|
||||
dashboard-build:
|
||||
cd references/dashboard && npm install && cd ..
|
||||
|
||||
doc-gen:
|
||||
rm -r docs/en/cli/*
|
||||
go run hack/docgen/gen.go
|
||||
go run hack/references/generate.go
|
||||
|
||||
docs-build:
|
||||
ifneq ($(wildcard git-page),)
|
||||
rm -rf git-page
|
||||
endif
|
||||
sh ./hack/website/test-build.sh
|
||||
|
||||
docs-start:
|
||||
ifeq ($(wildcard git-page),)
|
||||
git clone --single-branch --depth 1 https://github.com/oam-dev/kubevela.io.git git-page
|
||||
endif
|
||||
rm -r git-page/docs
|
||||
rm git-page/sidebars.js
|
||||
cat docs/sidebars.js > git-page/sidebars.js
|
||||
cp -R docs/en git-page/docs
|
||||
cd git-page && yarn install && yarn start
|
||||
|
||||
api-gen:
|
||||
swag init -g references/apiserver/route.go --output references/apiserver/docs
|
||||
@@ -71,19 +91,28 @@ generate-source:
|
||||
go run hack/frontend/source.go
|
||||
|
||||
cross-build:
|
||||
rm -rf _bin
|
||||
go run hack/chart/generate.go
|
||||
GO111MODULE=on CGO_ENABLED=0 $(GOX) -ldflags $(LDFLAGS) -parallel=2 -output="_bin/{{.OS}}-{{.Arch}}/vela" -osarch='$(TARGETS)' ./references/cmd/cli/
|
||||
$(GOBUILD_ENV) $(GOX) -ldflags $(LDFLAGS) -parallel=2 -output="_bin/vela/{{.OS}}-{{.Arch}}/vela" -osarch='$(TARGETS)' ./references/cmd/cli
|
||||
$(GOBUILD_ENV) $(GOX) -ldflags $(LDFLAGS) -parallel=2 -output="_bin/kubectl-vela/{{.OS}}-{{.Arch}}/kubectl-vela" -osarch='$(TARGETS)' ./cmd/plugin
|
||||
git checkout references/cmd/cli/fake/chart_source.go
|
||||
|
||||
compress:
|
||||
( \
|
||||
echo "\n## Release Info\nVERSION: $(VELA_VERSION)" >> README.md && \
|
||||
echo "GIT_COMMIT: $(GIT_COMMIT_LONG)\n" >> README.md && \
|
||||
cd _bin && \
|
||||
$(DIST_DIRS) cp ../LICENSE {} \; && \
|
||||
$(DIST_DIRS) cp ../README.md {} \; && \
|
||||
cd _bin/vela && \
|
||||
$(DIST_DIRS) cp ../../LICENSE {} \; && \
|
||||
$(DIST_DIRS) cp ../../README.md {} \; && \
|
||||
$(DIST_DIRS) tar -zcf vela-{}.tar.gz {} \; && \
|
||||
$(DIST_DIRS) zip -r vela-{}.zip {} \; && \
|
||||
sha256sum vela-* > sha256sums.txt \
|
||||
cd ../kubectl-vela && \
|
||||
$(DIST_DIRS) cp ../../LICENSE {} \; && \
|
||||
$(DIST_DIRS) cp ../../README.md {} \; && \
|
||||
$(DIST_DIRS) tar -zcf kubectl-vela-{}.tar.gz {} \; && \
|
||||
$(DIST_DIRS) zip -r kubectl-vela-{}.zip {} \; && \
|
||||
cd .. && \
|
||||
sha256sum vela/vela-* kubectl-vela/kubectl-vela-* > sha256sums.txt \
|
||||
)
|
||||
|
||||
# Run against the configured Kubernetes cluster in ~/.kube/config
|
||||
@@ -104,7 +133,7 @@ staticcheck: staticchecktool
|
||||
$(STATICCHECK) ./...
|
||||
|
||||
lint: golangci
|
||||
$(GOLANGCILINT) run ./...
|
||||
$(GOLANGCILINT) run ./...
|
||||
|
||||
reviewable: manifests fmt vet lint staticcheck
|
||||
go mod tidy
|
||||
@@ -117,19 +146,17 @@ check-diff: reviewable
|
||||
|
||||
# Build the docker image
|
||||
docker-build:
|
||||
docker build --build-arg=VERSION=$(VELA_VERSION) --build-arg=GITVERSION=$(GIT_COMMIT) . -t ${IMG}
|
||||
docker build --build-arg=VERSION=$(VELA_VERSION) --build-arg=GITVERSION=$(GIT_COMMIT) -t $(VELA_CORE_IMAGE) .
|
||||
|
||||
# Push the docker image
|
||||
docker-push:
|
||||
docker push ${IMG}
|
||||
docker push $(VELA_CORE_IMAGE)
|
||||
|
||||
e2e-setup:
|
||||
helm install --create-namespace -n flux-system helm-flux http://oam.dev/catalog/helm-flux2-0.1.0.tgz
|
||||
helm install kruise https://github.com/openkruise/kruise/releases/download/v0.7.0/kruise-chart.tgz
|
||||
helm repo add jetstack https://charts.jetstack.io
|
||||
helm repo update
|
||||
helm upgrade --install --create-namespace --namespace cert-manager cert-manager jetstack/cert-manager --version v1.2.0 --set installCRDs=true --wait
|
||||
helm upgrade --install --create-namespace --namespace vela-system --set image.pullPolicy=IfNotPresent --set admissionWebhooks.certManager.enabled=true --set image.repository=vela-core-test --set image.tag=$(GIT_COMMIT) --wait kubevela ./charts/vela-core
|
||||
sh ./hack/e2e/modify_charts.sh
|
||||
helm upgrade --install --create-namespace --namespace vela-system --set image.pullPolicy=IfNotPresent --set image.repository=vela-core-test --set applicationRevisionLimit=5 --set dependCheckWait=10s --set image.tag=$(GIT_COMMIT) --wait kubevela ./charts/vela-core
|
||||
ginkgo version
|
||||
ginkgo -v -r e2e/setup
|
||||
kubectl wait --for=condition=Ready pod -l app.kubernetes.io/name=vela-core,app.kubernetes.io/instance=kubevela -n vela-system --timeout=600s
|
||||
@@ -166,25 +193,25 @@ e2e-cleanup:
|
||||
|
||||
image-cleanup:
|
||||
# Delete Docker image
|
||||
ifneq ($(shell docker images -q vela-core-test:$(GIT_COMMIT)),)
|
||||
docker image rm -f vela-core-test:$(GIT_COMMIT)
|
||||
ifneq ($(shell docker images -q $(VELA_CORE_TEST_IMAGE)),)
|
||||
docker rmi -f $(VELA_CORE_TEST_IMAGE)
|
||||
endif
|
||||
|
||||
end-e2e:
|
||||
sh ./hack/e2e/end_e2e.sh
|
||||
|
||||
# load docker image to the kind cluster
|
||||
kind-load:
|
||||
docker build -t vela-core-test:$(GIT_COMMIT) .
|
||||
kind load docker-image vela-core-test:$(GIT_COMMIT) || { echo >&2 "kind not installed or error loading image: $(IMAGE)"; exit 1; }
|
||||
|
||||
# Image URL to use all building/pushing image targets
|
||||
IMG ?= vela-core:latest
|
||||
docker build -t $(VELA_CORE_TEST_IMAGE) -f Dockerfile.e2e .
|
||||
kind load docker-image $(VELA_CORE_TEST_IMAGE) || { echo >&2 "kind not installed or error loading image: $(VELA_CORE_TEST_IMAGE)"; exit 1; }
|
||||
|
||||
# Run tests
|
||||
core-test: fmt vet manifests
|
||||
go test ./pkg/... -coverprofile cover.out
|
||||
|
||||
# Build manager binary
|
||||
# Build vela core manager binary
|
||||
manager: fmt vet lint manifests
|
||||
go build -o bin/manager ./cmd/core/main.go
|
||||
$(GOBUILD_ENV) go build -o bin/manager -a -ldflags $(LDFLAGS) ./cmd/core/main.go
|
||||
|
||||
# Run against the configured Kubernetes cluster in ~/.kube/config
|
||||
core-run: fmt vet manifests
|
||||
|
||||
52
README.md
52
README.md
@@ -8,52 +8,44 @@
|
||||
[](https://twitter.com/oam_dev)
|
||||
[](https://artifacthub.io/packages/search?repo=kubevela)
|
||||
|
||||

|
||||

|
||||
|
||||
*Make shipping applications more enjoyable.*
|
||||
|
||||
# KubeVela
|
||||
|
||||
KubeVela is the platform engine to create *PaaS-like* experience on Kubernetes, in a scalable approach.
|
||||
|
||||
## Community
|
||||
|
||||
- Slack: [CNCF Slack](https://slack.cncf.io/) #kubevela channel
|
||||
- Gitter: [Discussion](https://gitter.im/oam-dev/community)
|
||||
- Bi-weekly Community Call: [Meeting Notes](https://docs.google.com/document/d/1nqdFEyULekyksFHtFvgvFAYE-0AMHKoS3RMnaKsarjs)
|
||||
|
||||
> NOTE: KubeVela is still iterating quickly. It's currently under pre-beta release.
|
||||
|
||||
## What problems does it solve?
|
||||
|
||||
Building **developer-centric platforms** with Kubernetes requires higher level primitives which is out-of-scope of Kubernetes itself. Hence, we platform teams build abstractions.
|
||||
|
||||
However, great in flexibility and extensibility, the existing solutions such as IaC (Infrastructure-as-Code) and client-side templating tools all lead to ***Configuration Drift*** (i.e. the generated instances are not in line with the expected configuration) which is a nightmare in production.
|
||||
|
||||
KubeVela allows platform teams to create developer-centric abstractions with IaC but maintain them with the battle tested [Kubernetes Control Loop](https://kubernetes.io/docs/concepts/architecture/controller/). Think about a plug-in that turns your Kubernetes cluster into a *"PaaS"* via abstractions designed by yourself.
|
||||
|
||||
## Getting Started
|
||||
|
||||
- [Installation](https://kubevela.io/#/en/install)
|
||||
- [Quick start](https://kubevela.io/#/en/quick-start)
|
||||
- [How it works](https://kubevela.io/#/en/concepts)
|
||||
KubeVela is a modern application platform that makes deploying and managing applications across today's hybrid, multi-cloud environments easier and faster.
|
||||
|
||||
## Features
|
||||
|
||||
- **Robust, repeatable and extensible approach to create and maintain abstractions** - design your abstractions with [CUE](https://cuelang.org/) or [Helm](https://helm.sh), ship them to end users by `kubectl apply -f`, automatically generating GUI forms, upgrade your abstractions at runtime, and let Kubernetes controller guarantee determinism of the abstractions, no configuration drift.
|
||||
- **Generic progressive rollout framework** - built-in rollout framework and strategies to upgrade your microservice regardless of its workload type (e.g. stateless, stateful, or even custom operators etc), seamless integration with observability systems.
|
||||
- **Multi-enviroment app delievry model (WIP)** - built-in model to deliver or rollout your apps across multiple enviroments and/or clusters, seamless integration with Service Mesh for traffic management.
|
||||
- **Simple and Kubernetes native** - KubeVela is just a simple custom controller, all its app delivery abstractions and features are defined as [Kubernetes Custom Resources](https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/) so they naturally work with any CI/CD or GitOps tools.
|
||||
**Application Centric** - Leveraging Open Application Model (OAM), KubeVela introduces consistent yet higher level API to capture a full deployment of microservices on top of hybrid environments. Placement strategy and patch, traffic shifting and rolling update are all declared at application level. No infrastructure level concern, simply deploy.
|
||||
|
||||
**Natively Extensible** - KubeVela uses [CUE](https://github.com/cuelang/cue) to glue capabilities (e.g. workload types, operational behaviors, and cloud services) provided by runtime infrastructure and expose them to users via self-service API. When users' needs grow, these API can naturally expand in programmable approach. No restriction, fully flexible.
|
||||
|
||||
**Runtime Agnostic** - KubeVela is built with Kubernetes as control plane but adaptable to any runtime as data-plane. It can deploy (and manage) diverse workload types such as container, cloud functions, databases, or even EC2 instances across hybrid environments. Also, this means KubeVela seamlessly works with any Kubernetes compatible CI/CD or GitOps tools via declarative API.
|
||||
|
||||
## Getting Started
|
||||
|
||||
- [Introduction](https://kubevela.io/docs)
|
||||
- [Installation](https://kubevela.io/docs/install)
|
||||
- [Deploy an Application](https://kubevela.io/docs/application)
|
||||
|
||||
## Documentation
|
||||
|
||||
Visit the [KubeVela documentation site](https://kubevela.io/) to find *Installation Instruction*, *Platform Builder Guide* and *Developer Experience Guide*.
|
||||
Full documentation is available on the [KubeVela website](https://kubevela.io/).
|
||||
|
||||
## Community
|
||||
|
||||
- Slack: [CNCF Slack](https://slack.cncf.io/) #kubevela channel (*English*)
|
||||
- Gitter: [oam-dev](https://gitter.im/oam-dev/community) (*English*)
|
||||
- [DingTalk Group](https://page.dingtalk.com/wow/dingtalk/act/en-home): `23310022` (*Chinese*)
|
||||
- Bi-weekly Community Call: [Meeting Notes](https://docs.google.com/document/d/1nqdFEyULekyksFHtFvgvFAYE-0AMHKoS3RMnaKsarjs)
|
||||
|
||||
## Talks and Conferences
|
||||
|
||||
| Engagement | Link |
|
||||
|:-----------|:------------|
|
||||
| 🎤 Talks | - [KubeVela - The Modern App Delivery System in Alibaba](https://docs.google.com/presentation/d/1CWCLcsKpDQB3bBDTfdv2BZ8ilGGJv2E8L-iOA5HMrV0/edit?usp=sharing) |
|
||||
| 🎤 Talks | - [KubeVela - The Modern App Delivery System in Alibaba](https://docs.google.com/presentation/d/1CWCLcsKpDQB3bBDTfdv2BZ8ilGGJv2E8L-iOA5HMrV0/edit?usp=sharing) <br> - [Cloud-Native Apps With Open Application Model (OAM) And KubeVela](https://www.youtube.com/watch?v=2CBu6sOTtwk) |
|
||||
| 🌎 KubeCon | - [ [NA 2020] Standardizing Cloud Native Application Delivery Across Different Clouds](https://www.youtube.com/watch?v=0yhVuBIbHcI) <br> - [ [EU 2021] Zero Pain Microservice Development and Deployment with Dapr and KubeVela](https://sched.co/iE4S) |
|
||||
| 📺 Conferences | - [Dapr, Rudr, OAM: Mark Russinovich presents next gen app development & deployment](https://www.youtube.com/watch?v=eJCu6a-x9uo) <br> - [Mark Russinovich presents "The Future of Cloud Native Applications with OAM and Dapr"](https://myignite.techcommunity.microsoft.com/sessions/82059)|
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ limitations under the License.
|
||||
package common
|
||||
|
||||
import (
|
||||
v1alpha12 "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1"
|
||||
runtimev1alpha1 "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
|
||||
"github.com/oam-dev/kubevela/apis/standard.oam.dev/v1alpha1"
|
||||
@@ -84,7 +84,7 @@ type Schematic struct {
|
||||
|
||||
HELM *Helm `json:"helm,omitempty"`
|
||||
|
||||
// TODO(wonderflow): support HCL(terraform)here.
|
||||
Terraform *Terraform `json:"terraform,omitempty"`
|
||||
}
|
||||
|
||||
// A Helm represents resources used by a Helm module
|
||||
@@ -98,6 +98,17 @@ type Helm struct {
|
||||
Repository runtime.RawExtension `json:"repository"`
|
||||
}
|
||||
|
||||
// Terraform is the struct to describe cloud resources managed by Hashicorp Terraform
|
||||
type Terraform struct {
|
||||
// Configuration is Terraform Configuration
|
||||
Configuration string `json:"configuration"`
|
||||
|
||||
// Type specifies which Terraform configuration it is, HCL or JSON syntax
|
||||
// +kubebuilder:default:=hcl
|
||||
// +kubebuilder:validation:Enum:=hcl;json
|
||||
Type string `json:"type,omitempty"`
|
||||
}
|
||||
|
||||
// A WorkloadTypeDescriptor refer to a Workload Type
|
||||
type WorkloadTypeDescriptor struct {
|
||||
// Type ref to a WorkloadDefinition via name
|
||||
@@ -160,10 +171,13 @@ const (
|
||||
|
||||
// ApplicationComponentStatus record the health status of App component
|
||||
type ApplicationComponentStatus struct {
|
||||
Name string `json:"name"`
|
||||
Healthy bool `json:"healthy"`
|
||||
Message string `json:"message,omitempty"`
|
||||
Traits []ApplicationTraitStatus `json:"traits,omitempty"`
|
||||
Name string `json:"name"`
|
||||
// WorkloadDefinition is the definition of a WorkloadDefinition, such as deployments/apps.v1
|
||||
WorkloadDefinition WorkloadGVK `json:"workloadDefinition,omitempty"`
|
||||
Healthy bool `json:"healthy"`
|
||||
Message string `json:"message,omitempty"`
|
||||
Traits []ApplicationTraitStatus `json:"traits,omitempty"`
|
||||
Scopes []runtimev1alpha1.TypedReference `json:"scopes,omitempty"`
|
||||
}
|
||||
|
||||
// ApplicationTraitStatus records the trait health status
|
||||
@@ -193,20 +207,47 @@ type RawComponent struct {
|
||||
type AppStatus struct {
|
||||
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
|
||||
// Important: Run "make" to regenerate code after modifying this file
|
||||
v1alpha1.RolloutStatus `json:",inline"`
|
||||
runtimev1alpha1.ConditionedStatus `json:",inline"`
|
||||
|
||||
Rollout AppRolloutStatus `json:"rollout,omitempty"`
|
||||
|
||||
Phase ApplicationPhase `json:"status,omitempty"`
|
||||
|
||||
// Components record the related Components created by Application Controller
|
||||
Components []v1alpha12.TypedReference `json:"components,omitempty"`
|
||||
Components []runtimev1alpha1.TypedReference `json:"components,omitempty"`
|
||||
|
||||
// Services record the status of the application services
|
||||
Services []ApplicationComponentStatus `json:"services,omitempty"`
|
||||
|
||||
// ResourceTracker record the status of the ResourceTracker
|
||||
ResourceTracker *v1alpha12.TypedReference `json:"resourceTracker,omitempty"`
|
||||
ResourceTracker *runtimev1alpha1.TypedReference `json:"resourceTracker,omitempty"`
|
||||
|
||||
// LatestRevision of the application configuration it generates
|
||||
// +optional
|
||||
LatestRevision *Revision `json:"latestRevision,omitempty"`
|
||||
}
|
||||
|
||||
// DefinitionType describes the type of DefinitionRevision.
|
||||
// +kubebuilder:validation:Enum=Component;Trait
|
||||
type DefinitionType string
|
||||
|
||||
const (
|
||||
// ComponentType represents DefinitionRevision refer to type ComponentDefinition
|
||||
ComponentType DefinitionType = "Component"
|
||||
|
||||
// TraitType represents DefinitionRevision refer to type TraitDefinition
|
||||
TraitType DefinitionType = "Trait"
|
||||
)
|
||||
|
||||
// AppRolloutStatus defines the observed state of AppRollout
|
||||
type AppRolloutStatus struct {
|
||||
v1alpha1.RolloutStatus `json:",inline"`
|
||||
|
||||
// LastUpgradedTargetAppRevision contains the name of the app that we upgraded to
|
||||
// We will restart the rollout if this is not the same as the spec
|
||||
LastUpgradedTargetAppRevision string `json:"lastTargetAppRevision"`
|
||||
|
||||
// LastSourceAppRevision contains the name of the app that we need to upgrade from.
|
||||
// We will restart the rollout if this is not the same as the spec
|
||||
LastSourceAppRevision string `json:"LastSourceAppRevision,omitempty"`
|
||||
}
|
||||
|
||||
@@ -25,9 +25,26 @@ import (
|
||||
)
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *AppStatus) DeepCopyInto(out *AppStatus) {
|
||||
func (in *AppRolloutStatus) DeepCopyInto(out *AppRolloutStatus) {
|
||||
*out = *in
|
||||
in.RolloutStatus.DeepCopyInto(&out.RolloutStatus)
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppRolloutStatus.
|
||||
func (in *AppRolloutStatus) DeepCopy() *AppRolloutStatus {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(AppRolloutStatus)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *AppStatus) DeepCopyInto(out *AppStatus) {
|
||||
*out = *in
|
||||
in.ConditionedStatus.DeepCopyInto(&out.ConditionedStatus)
|
||||
in.Rollout.DeepCopyInto(&out.Rollout)
|
||||
if in.Components != nil {
|
||||
in, out := &in.Components, &out.Components
|
||||
*out = make([]v1alpha1.TypedReference, len(*in))
|
||||
@@ -65,11 +82,17 @@ func (in *AppStatus) DeepCopy() *AppStatus {
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ApplicationComponentStatus) DeepCopyInto(out *ApplicationComponentStatus) {
|
||||
*out = *in
|
||||
out.WorkloadDefinition = in.WorkloadDefinition
|
||||
if in.Traits != nil {
|
||||
in, out := &in.Traits, &out.Traits
|
||||
*out = make([]ApplicationTraitStatus, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
if in.Scopes != nil {
|
||||
in, out := &in.Scopes, &out.Scopes
|
||||
*out = make([]v1alpha1.TypedReference, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApplicationComponentStatus.
|
||||
@@ -268,6 +291,11 @@ func (in *Schematic) DeepCopyInto(out *Schematic) {
|
||||
*out = new(Helm)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.Terraform != nil {
|
||||
in, out := &in.Terraform, &out.Terraform
|
||||
*out = new(Terraform)
|
||||
**out = **in
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Schematic.
|
||||
@@ -295,6 +323,21 @@ func (in *Status) DeepCopy() *Status {
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *Terraform) DeepCopyInto(out *Terraform) {
|
||||
*out = *in
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Terraform.
|
||||
func (in *Terraform) DeepCopy() *Terraform {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(Terraform)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *WorkloadGVK) DeepCopyInto(out *WorkloadGVK) {
|
||||
*out = *in
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright 2020 The KubeVela Authors.
|
||||
Copyright 2021 The KubeVela Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -88,8 +88,14 @@ type ApplicationSpec struct {
|
||||
|
||||
// Application is the Schema for the applications API
|
||||
// +kubebuilder:object:root=true
|
||||
// +kubebuilder:resource:categories={oam}
|
||||
// +kubebuilder:resource:categories={oam},shortName=app
|
||||
// +kubebuilder:subresource:status
|
||||
// +kubebuilder:printcolumn:name="COMPONENT",type=string,JSONPath=`.spec.components[*].name`
|
||||
// +kubebuilder:printcolumn:name="TYPE",type=string,JSONPath=`.spec.components[*].type`
|
||||
// +kubebuilder:printcolumn:name="PHASE",type=string,JSONPath=`.status.status`
|
||||
// +kubebuilder:printcolumn:name="HEALTHY",type=boolean,JSONPath=`.status.services[*].healthy`
|
||||
// +kubebuilder:printcolumn:name="STATUS",type=string,JSONPath=`.status.services[*].message`
|
||||
// +kubebuilder:printcolumn:name="AGE",type=date,JSONPath=".metadata.creationTimestamp"
|
||||
type Application struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
|
||||
@@ -55,7 +55,8 @@ type ApplicationRevisionSpec struct {
|
||||
|
||||
// ApplicationRevision is the Schema for the ApplicationRevision API
|
||||
// +kubebuilder:object:root=true
|
||||
// +kubebuilder:shortName=apprev,resource:categories={oam}
|
||||
// +kubebuilder:resource:categories={oam},shortName=apprev
|
||||
// +kubebuilder:printcolumn:name="AGE",type=date,JSONPath=".metadata.creationTimestamp"
|
||||
type ApplicationRevision struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright 2020 The KubeVela Authors.
|
||||
Copyright 2021 The KubeVela Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
@@ -61,8 +61,14 @@ type AppRolloutStatus struct {
|
||||
|
||||
// AppRollout is the Schema for the AppRollout API
|
||||
// +kubebuilder:object:root=true
|
||||
// +kubebuilder:resource:categories={oam}
|
||||
// +kubebuilder:resource:categories={oam},shortName=approllout
|
||||
// +kubebuilder:subresource:status
|
||||
// +kubebuilder:printcolumn:name="TARGET",type=string,JSONPath=`.status.rolloutStatus.rolloutTargetSize`
|
||||
// +kubebuilder:printcolumn:name="UPGRADED",type=string,JSONPath=`.status.rolloutStatus.upgradedReplicas`
|
||||
// +kubebuilder:printcolumn:name="READY",type=string,JSONPath=`.status.rolloutStatus.upgradedReadyReplicas`
|
||||
// +kubebuilder:printcolumn:name="BATCH-STATE",type=string,JSONPath=`.status.rolloutStatus.batchRollingState`
|
||||
// +kubebuilder:printcolumn:name="ROLLING-STATE",type=string,JSONPath=`.status.rolloutStatus.rollingState`
|
||||
// +kubebuilder:printcolumn:name="AGE",type=date,JSONPath=".metadata.creationTimestamp"
|
||||
type AppRollout struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
|
||||
@@ -62,13 +62,18 @@ type ComponentDefinitionStatus struct {
|
||||
runtimev1alpha1.ConditionedStatus `json:",inline"`
|
||||
// ConfigMapRef refer to a ConfigMap which contains OpenAPI V3 JSON schema of Component parameters.
|
||||
ConfigMapRef string `json:"configMapRef,omitempty"`
|
||||
// LatestRevision of the component definition
|
||||
// +optional
|
||||
LatestRevision *common.Revision `json:"latestRevision,omitempty"`
|
||||
}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
|
||||
// ComponentDefinition is the Schema for the componentdefinitions API
|
||||
// +kubebuilder:resource:scope=Namespaced,categories={oam}
|
||||
// +kubebuilder:resource:scope=Namespaced,categories={oam},shortName=comp
|
||||
// +kubebuilder:subresource:status
|
||||
// +kubebuilder:printcolumn:name="WORKLOAD-KIND",type=string,JSONPath=".spec.workload.definition.kind"
|
||||
// +kubebuilder:printcolumn:name="DESCRIPTION",type=string,JSONPath=".metadata.annotations.definition\\.oam\\.dev/description"
|
||||
type ComponentDefinition struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright 2020 The KubeVela Authors.
|
||||
Copyright 2021 The KubeVela Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright 2020 The KubeVela Authors.
|
||||
Copyright 2021 The KubeVela Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright 2020 The KubeVela Authors.
|
||||
Copyright 2021 The KubeVela Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
@@ -69,8 +69,8 @@ type WorkloadDefinitionStatus struct {
|
||||
// valid OAM workload kind by referencing its CustomResourceDefinition. The CRD
|
||||
// is used to validate the schema of the workload when it is embedded in an OAM
|
||||
// Component.
|
||||
// +kubebuilder:printcolumn:JSONPath=".spec.definitionRef.name",name=DEFINITION-NAME,type=string
|
||||
// +kubebuilder:resource:scope=Namespaced,categories={oam}
|
||||
// +kubebuilder:resource:scope=Namespaced,categories={oam},shortName=workload
|
||||
// +kubebuilder:printcolumn:name="DEFINITION-NAME",type=string,JSONPath=".spec.definitionRef.name"
|
||||
type WorkloadDefinition struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
@@ -111,6 +111,10 @@ type TraitDefinitionSpec struct {
|
||||
// +optional
|
||||
WorkloadRefPath string `json:"workloadRefPath,omitempty"`
|
||||
|
||||
// PodDisruptive specifies whether using the trait will cause the pod to restart or not.
|
||||
// +optional
|
||||
PodDisruptive bool `json:"podDisruptive,omitempty"`
|
||||
|
||||
// AppliesToWorkloads specifies the list of workload kinds this trait
|
||||
// applies to. Workload kinds are specified in kind.group/version format,
|
||||
// e.g. server.core.oam.dev/v1alpha2. Traits that omit this field apply to
|
||||
@@ -150,6 +154,9 @@ type TraitDefinitionStatus struct {
|
||||
runtimev1alpha1.ConditionedStatus `json:",inline"`
|
||||
// ConfigMapRef refer to a ConfigMap which contains OpenAPI V3 JSON schema of Component parameters.
|
||||
ConfigMapRef string `json:"configMapRef,omitempty"`
|
||||
// LatestRevision of the trait definition
|
||||
// +optional
|
||||
LatestRevision *common.Revision `json:"latestRevision,omitempty"`
|
||||
}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
@@ -158,9 +165,10 @@ type TraitDefinitionStatus struct {
|
||||
// OAM trait kind by referencing its CustomResourceDefinition. The CRD is used
|
||||
// to validate the schema of the trait when it is embedded in an OAM
|
||||
// ApplicationConfiguration.
|
||||
// +kubebuilder:printcolumn:JSONPath=".spec.definitionRef.name",name=DEFINITION-NAME,type=string
|
||||
// +kubebuilder:resource:scope=Namespaced,categories={oam}
|
||||
// +kubebuilder:resource:scope=Namespaced,categories={oam},shortName=trait
|
||||
// +kubebuilder:subresource:status
|
||||
// +kubebuilder:printcolumn:name="APPLIES-TO",type=string,JSONPath=".spec.appliesToWorkloads"
|
||||
// +kubebuilder:printcolumn:name="DESCRIPTION",type=string,JSONPath=".metadata.annotations.definition\\.oam\\.dev/description"
|
||||
type TraitDefinition struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
@@ -213,7 +221,7 @@ type ScopeDefinitionSpec struct {
|
||||
// to validate the schema of the scope when it is embedded in an OAM
|
||||
// ApplicationConfiguration.
|
||||
// +kubebuilder:printcolumn:JSONPath=".spec.definitionRef.name",name=DEFINITION-NAME,type=string
|
||||
// +kubebuilder:resource:scope=Namespaced,categories={oam}
|
||||
// +kubebuilder:resource:scope=Namespaced,categories={oam},shortName=scope
|
||||
type ScopeDefinition struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright 2020 The KubeVela Authors.
|
||||
Copyright 2021 The KubeVela Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright 2020 The KubeVela Authors.
|
||||
Copyright 2021 The KubeVela Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright 2020 The KubeVela Authors.
|
||||
Copyright 2021 The KubeVela Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright 2020 The KubeVela Authors.
|
||||
Copyright 2021 The KubeVela Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -782,6 +782,11 @@ func (in *ComponentDefinitionSpec) DeepCopy() *ComponentDefinitionSpec {
|
||||
func (in *ComponentDefinitionStatus) DeepCopyInto(out *ComponentDefinitionStatus) {
|
||||
*out = *in
|
||||
in.ConditionedStatus.DeepCopyInto(&out.ConditionedStatus)
|
||||
if in.LatestRevision != nil {
|
||||
in, out := &in.LatestRevision, &out.LatestRevision
|
||||
*out = new(common.Revision)
|
||||
**out = **in
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ComponentDefinitionStatus.
|
||||
@@ -2067,6 +2072,11 @@ func (in *TraitDefinitionSpec) DeepCopy() *TraitDefinitionSpec {
|
||||
func (in *TraitDefinitionStatus) DeepCopyInto(out *TraitDefinitionStatus) {
|
||||
*out = *in
|
||||
in.ConditionedStatus.DeepCopyInto(&out.ConditionedStatus)
|
||||
if in.LatestRevision != nil {
|
||||
in, out := &in.LatestRevision, &out.LatestRevision
|
||||
*out = new(common.Revision)
|
||||
**out = **in
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TraitDefinitionStatus.
|
||||
|
||||
@@ -178,7 +178,7 @@ type AppDeploymentStatus struct {
|
||||
|
||||
// AppDeployment is the Schema for the AppDeployment API
|
||||
// +kubebuilder:object:root=true
|
||||
// +kubebuilder:resource:categories={oam}
|
||||
// +kubebuilder:resource:categories={oam},shortName=appdeploy
|
||||
// +kubebuilder:subresource:status
|
||||
type AppDeployment struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
|
||||
@@ -67,6 +67,13 @@ type ApplicationSpec struct {
|
||||
// Application is the Schema for the applications API
|
||||
// +kubebuilder:storageversion
|
||||
// +kubebuilder:subresource:status
|
||||
// +kubebuilder:resource:categories={oam},shortName=app
|
||||
// +kubebuilder:printcolumn:name="COMPONENT",type=string,JSONPath=`.spec.components[*].name`
|
||||
// +kubebuilder:printcolumn:name="TYPE",type=string,JSONPath=`.spec.components[*].type`
|
||||
// +kubebuilder:printcolumn:name="PHASE",type=string,JSONPath=`.status.status`
|
||||
// +kubebuilder:printcolumn:name="HEALTHY",type=boolean,JSONPath=`.status.services[*].healthy`
|
||||
// +kubebuilder:printcolumn:name="STATUS",type=string,JSONPath=`.status.services[*].message`
|
||||
// +kubebuilder:printcolumn:name="AGE",type=date,JSONPath=".metadata.creationTimestamp"
|
||||
type Application struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
|
||||
@@ -56,6 +56,8 @@ type ApplicationRevisionSpec struct {
|
||||
|
||||
// ApplicationRevision is the Schema for the ApplicationRevision API
|
||||
// +kubebuilder:storageversion
|
||||
// +kubebuilder:resource:categories={oam},shortName=apprev
|
||||
// +kubebuilder:printcolumn:name="AGE",type=date,JSONPath=".metadata.creationTimestamp"
|
||||
type ApplicationRevision struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
|
||||
@@ -19,6 +19,7 @@ package v1beta1
|
||||
import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
|
||||
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
|
||||
"github.com/oam-dev/kubevela/apis/standard.oam.dev/v1alpha1"
|
||||
)
|
||||
|
||||
@@ -41,36 +42,30 @@ type AppRolloutSpec struct {
|
||||
// RolloutPlan is the details on how to rollout the resources
|
||||
RolloutPlan v1alpha1.RolloutPlan `json:"rolloutPlan"`
|
||||
|
||||
// RevertOnDelete revert the rollout when the rollout CR is deleted
|
||||
// It will remove the target app from the kubernetes if it's set to true
|
||||
// RevertOnDelete revert the failed rollout when the rollout CR is deleted
|
||||
// It will revert the change back to the source version at once (not in batches)
|
||||
// Default is false
|
||||
// +optional
|
||||
RevertOnDelete *bool `json:"revertOnDelete,omitempty"`
|
||||
}
|
||||
|
||||
// AppRolloutStatus defines the observed state of AppRollout
|
||||
type AppRolloutStatus struct {
|
||||
v1alpha1.RolloutStatus `json:",inline"`
|
||||
|
||||
// LastUpgradedTargetAppRevision contains the name of the app that we upgraded to
|
||||
// We will restart the rollout if this is not the same as the spec
|
||||
LastUpgradedTargetAppRevision string `json:"lastTargetAppRevision"`
|
||||
|
||||
// LastSourceAppRevision contains the name of the app that we need to upgrade from.
|
||||
// We will restart the rollout if this is not the same as the spec
|
||||
LastSourceAppRevision string `json:"LastSourceAppRevision,omitempty"`
|
||||
RevertOnDelete bool `json:"revertOnDelete,omitempty"`
|
||||
}
|
||||
|
||||
// AppRollout is the Schema for the AppRollout API
|
||||
// +kubebuilder:object:root=true
|
||||
// +kubebuilder:resource:categories={oam}
|
||||
// +kubebuilder:resource:categories={oam},shortName=approllout
|
||||
// +kubebuilder:subresource:status
|
||||
// +kubebuilder:storageversion
|
||||
// +kubebuilder:printcolumn:name="TARGET",type=string,JSONPath=`.status.rolloutTargetSize`
|
||||
// +kubebuilder:printcolumn:name="UPGRADED",type=string,JSONPath=`.status.upgradedReplicas`
|
||||
// +kubebuilder:printcolumn:name="READY",type=string,JSONPath=`.status.upgradedReadyReplicas`
|
||||
// +kubebuilder:printcolumn:name="BATCH-STATE",type=string,JSONPath=`.status.batchRollingState`
|
||||
// +kubebuilder:printcolumn:name="ROLLING-STATE",type=string,JSONPath=`.status.rollingState`
|
||||
// +kubebuilder:printcolumn:name="AGE",type=date,JSONPath=".metadata.creationTimestamp"
|
||||
type AppRollout struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
|
||||
Spec AppRolloutSpec `json:"spec,omitempty"`
|
||||
Status AppRolloutStatus `json:"status,omitempty"`
|
||||
Spec AppRolloutSpec `json:"spec,omitempty"`
|
||||
Status common.AppRolloutStatus `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
// AppRolloutList contains a list of AppRollout
|
||||
|
||||
@@ -62,14 +62,19 @@ type ComponentDefinitionStatus struct {
|
||||
runtimev1alpha1.ConditionedStatus `json:",inline"`
|
||||
// ConfigMapRef refer to a ConfigMap which contains OpenAPI V3 JSON schema of Component parameters.
|
||||
ConfigMapRef string `json:"configMapRef,omitempty"`
|
||||
// LatestRevision of the component definition
|
||||
// +optional
|
||||
LatestRevision *common.Revision `json:"latestRevision,omitempty"`
|
||||
}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
|
||||
// ComponentDefinition is the Schema for the componentdefinitions API
|
||||
// +kubebuilder:resource:scope=Namespaced,categories={oam}
|
||||
// +kubebuilder:resource:scope=Namespaced,categories={oam},shortName=comp
|
||||
// +kubebuilder:storageversion
|
||||
// +kubebuilder:subresource:status
|
||||
// +kubebuilder:printcolumn:name="WORKLOAD-KIND",type=string,JSONPath=".spec.workload.definition.kind"
|
||||
// +kubebuilder:printcolumn:name="DESCRIPTION",type=string,JSONPath=".metadata.annotations.definition\\.oam\\.dev/description"
|
||||
type ComponentDefinition struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
|
||||
@@ -20,6 +20,7 @@ import (
|
||||
runtimev1alpha1 "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/types"
|
||||
|
||||
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
|
||||
)
|
||||
@@ -67,9 +68,10 @@ type WorkloadDefinitionStatus struct {
|
||||
// valid OAM workload kind by referencing its CustomResourceDefinition. The CRD
|
||||
// is used to validate the schema of the workload when it is embedded in an OAM
|
||||
// Component.
|
||||
// +kubebuilder:printcolumn:JSONPath=".spec.definitionRef.name",name=DEFINITION-NAME,type=string
|
||||
// +kubebuilder:resource:scope=Namespaced,categories={oam}
|
||||
// +kubebuilder:resource:scope=Namespaced,categories={oam},shortName=workload
|
||||
// +kubebuilder:storageversion
|
||||
// +kubebuilder:printcolumn:name="DEFINITION-NAME",type=string,JSONPath=".spec.definitionRef.name"
|
||||
// +kubebuilder:printcolumn:name="DESCRIPTION",type=string,JSONPath=".metadata.annotations.definition\\.oam\\.dev/description"
|
||||
type WorkloadDefinition struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
@@ -110,6 +112,10 @@ type TraitDefinitionSpec struct {
|
||||
// +optional
|
||||
WorkloadRefPath string `json:"workloadRefPath,omitempty"`
|
||||
|
||||
// PodDisruptive specifies whether using the trait will cause the pod to restart or not.
|
||||
// +optional
|
||||
PodDisruptive bool `json:"podDisruptive,omitempty"`
|
||||
|
||||
// AppliesToWorkloads specifies the list of workload kinds this trait
|
||||
// applies to. Workload kinds are specified in kind.group/version format,
|
||||
// e.g. server.core.oam.dev/v1alpha2. Traits that omit this field apply to
|
||||
@@ -149,6 +155,9 @@ type TraitDefinitionStatus struct {
|
||||
runtimev1alpha1.ConditionedStatus `json:",inline"`
|
||||
// ConfigMapRef refer to a ConfigMap which contains OpenAPI V3 JSON schema of Component parameters.
|
||||
ConfigMapRef string `json:"configMapRef,omitempty"`
|
||||
// LatestRevision of the component definition
|
||||
// +optional
|
||||
LatestRevision *common.Revision `json:"latestRevision,omitempty"`
|
||||
}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
@@ -157,10 +166,11 @@ type TraitDefinitionStatus struct {
|
||||
// OAM trait kind by referencing its CustomResourceDefinition. The CRD is used
|
||||
// to validate the schema of the trait when it is embedded in an OAM
|
||||
// ApplicationConfiguration.
|
||||
// +kubebuilder:printcolumn:JSONPath=".spec.definitionRef.name",name=DEFINITION-NAME,type=string
|
||||
// +kubebuilder:resource:scope=Namespaced,categories={oam}
|
||||
// +kubebuilder:resource:scope=Namespaced,categories={oam},shortName=trait
|
||||
// +kubebuilder:subresource:status
|
||||
// +kubebuilder:storageversion
|
||||
// +kubebuilder:printcolumn:name="APPLIES-TO",type=string,JSONPath=".spec.appliesToWorkloads"
|
||||
// +kubebuilder:printcolumn:name="DESCRIPTION",type=string,JSONPath=".metadata.annotations.definition\\.oam\\.dev/description"
|
||||
type TraitDefinition struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
@@ -213,7 +223,7 @@ type ScopeDefinitionSpec struct {
|
||||
// to validate the schema of the scope when it is embedded in an OAM
|
||||
// ApplicationConfiguration.
|
||||
// +kubebuilder:printcolumn:JSONPath=".spec.definitionRef.name",name=DEFINITION-NAME,type=string
|
||||
// +kubebuilder:resource:scope=Namespaced,categories={oam}
|
||||
// +kubebuilder:resource:scope=Namespaced,categories={oam},shortName=scope
|
||||
// +kubebuilder:storageversion
|
||||
type ScopeDefinition struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
@@ -232,12 +242,41 @@ type ScopeDefinitionList struct {
|
||||
}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
// +kubebuilder:subresource:status
|
||||
|
||||
// An ResourceTracker represents a tracker for track cross namespace resources
|
||||
// +kubebuilder:resource:scope=Cluster,categories={oam}
|
||||
// +kubebuilder:resource:scope=Cluster,categories={oam},shortName=tracker
|
||||
type ResourceTracker struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
|
||||
Status ResourceTrackerStatus `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
// ResourceTrackerStatus define the status of resourceTracker
|
||||
type ResourceTrackerStatus struct {
|
||||
TrackedResources []TypedReference `json:"trackedResources,omitempty"`
|
||||
}
|
||||
|
||||
// A TypedReference refers to an object by Name, Kind, and APIVersion. It is
|
||||
// commonly used to reference across-namespace objects
|
||||
type TypedReference struct {
|
||||
// APIVersion of the referenced object.
|
||||
APIVersion string `json:"apiVersion"`
|
||||
|
||||
// Kind of the referenced object.
|
||||
Kind string `json:"kind"`
|
||||
|
||||
// Name of the referenced object.
|
||||
Name string `json:"name"`
|
||||
|
||||
// Namespace of the objects outside the application namespace.
|
||||
// +optional
|
||||
Namespace string `json:"namespace,omitempty"`
|
||||
|
||||
// UID of the referenced object.
|
||||
// +optional
|
||||
UID types.UID `json:"uid,omitempty"`
|
||||
}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
|
||||
64
apis/core.oam.dev/v1beta1/definitionrevision_types.go
Normal file
64
apis/core.oam.dev/v1beta1/definitionrevision_types.go
Normal file
@@ -0,0 +1,64 @@
|
||||
/*
|
||||
Copyright 2021. The KubeVela Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1beta1
|
||||
|
||||
import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
|
||||
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
|
||||
)
|
||||
|
||||
// DefinitionRevisionSpec is the spec of DefinitionRevision
|
||||
type DefinitionRevisionSpec struct {
|
||||
// Revision record revision number of DefinitionRevision
|
||||
Revision int64 `json:"revision"`
|
||||
|
||||
// RevisionHash record the hash value of the spec of DefinitionRevision object.
|
||||
RevisionHash string `json:"revisionHash"`
|
||||
|
||||
// DefinitionType
|
||||
DefinitionType common.DefinitionType `json:"definitionType"`
|
||||
|
||||
// ComponentDefinition records the snapshot of the created/modified ComponentDefinition
|
||||
ComponentDefinition ComponentDefinition `json:"componentDefinition,omitempty"`
|
||||
|
||||
// TraitDefinition records the snapshot of the created/modified TraitDefinition
|
||||
TraitDefinition TraitDefinition `json:"traitDefinition,omitempty"`
|
||||
}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
|
||||
// DefinitionRevision is the Schema for the DefinitionRevision API
|
||||
// +kubebuilder:resource:scope=Namespaced,categories={oam},shortName=comprev
|
||||
// +kubebuilder:printcolumn:name="REVISION",type=integer,JSONPath=".spec.revision"
|
||||
// +kubebuilder:printcolumn:name="HASH",type=string,JSONPath=".spec.revisionHash"
|
||||
// +kubebuilder:printcolumn:name="TYPE",type=string,JSONPath=".spec.definitionType"
|
||||
type DefinitionRevision struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
|
||||
Spec DefinitionRevisionSpec `json:"spec,omitempty"`
|
||||
}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
|
||||
// DefinitionRevisionList contains a list of DefinitionRevision
|
||||
type DefinitionRevisionList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata,omitempty"`
|
||||
Items []DefinitionRevision `json:"items"`
|
||||
}
|
||||
@@ -61,6 +61,14 @@ var (
|
||||
TraitDefinitionGroupVersionKind = SchemeGroupVersion.WithKind(TraitDefinitionKind)
|
||||
)
|
||||
|
||||
// DefinitionRevision type metadata.
|
||||
var (
|
||||
DefinitionRevisionKind = reflect.TypeOf(DefinitionRevision{}).Name()
|
||||
DefinitionRevisionGroupKind = schema.GroupKind{Group: Group, Kind: DefinitionRevisionKind}.String()
|
||||
DefinitionRevisionKindAPIVersion = DefinitionRevisionKind + "." + SchemeGroupVersion.String()
|
||||
DefinitionRevisionGroupVersionKind = SchemeGroupVersion.WithKind(DefinitionRevisionKind)
|
||||
)
|
||||
|
||||
// Application type metadata.
|
||||
var (
|
||||
ApplicationKind = reflect.TypeOf(Application{}).Name()
|
||||
@@ -121,6 +129,7 @@ func init() {
|
||||
SchemeBuilder.Register(&ComponentDefinition{}, &ComponentDefinitionList{})
|
||||
SchemeBuilder.Register(&WorkloadDefinition{}, &WorkloadDefinitionList{})
|
||||
SchemeBuilder.Register(&TraitDefinition{}, &TraitDefinitionList{})
|
||||
SchemeBuilder.Register(&DefinitionRevision{}, &DefinitionRevisionList{})
|
||||
SchemeBuilder.Register(&ScopeDefinition{}, &ScopeDefinitionList{})
|
||||
SchemeBuilder.Register(&Application{}, &ApplicationList{})
|
||||
SchemeBuilder.Register(&AppRollout{}, &AppRolloutList{})
|
||||
|
||||
@@ -225,11 +225,6 @@ func (in *AppRolloutSpec) DeepCopyInto(out *AppRolloutSpec) {
|
||||
copy(*out, *in)
|
||||
}
|
||||
in.RolloutPlan.DeepCopyInto(&out.RolloutPlan)
|
||||
if in.RevertOnDelete != nil {
|
||||
in, out := &in.RevertOnDelete, &out.RevertOnDelete
|
||||
*out = new(bool)
|
||||
**out = **in
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppRolloutSpec.
|
||||
@@ -242,22 +237,6 @@ func (in *AppRolloutSpec) DeepCopy() *AppRolloutSpec {
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *AppRolloutStatus) DeepCopyInto(out *AppRolloutStatus) {
|
||||
*out = *in
|
||||
in.RolloutStatus.DeepCopyInto(&out.RolloutStatus)
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppRolloutStatus.
|
||||
func (in *AppRolloutStatus) DeepCopy() *AppRolloutStatus {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(AppRolloutStatus)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *Application) DeepCopyInto(out *Application) {
|
||||
*out = *in
|
||||
@@ -749,6 +728,11 @@ func (in *ComponentDefinitionSpec) DeepCopy() *ComponentDefinitionSpec {
|
||||
func (in *ComponentDefinitionStatus) DeepCopyInto(out *ComponentDefinitionStatus) {
|
||||
*out = *in
|
||||
in.ConditionedStatus.DeepCopyInto(&out.ConditionedStatus)
|
||||
if in.LatestRevision != nil {
|
||||
in, out := &in.LatestRevision, &out.LatestRevision
|
||||
*out = new(common.Revision)
|
||||
**out = **in
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ComponentDefinitionStatus.
|
||||
@@ -761,6 +745,81 @@ func (in *ComponentDefinitionStatus) DeepCopy() *ComponentDefinitionStatus {
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *DefinitionRevision) DeepCopyInto(out *DefinitionRevision) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
|
||||
in.Spec.DeepCopyInto(&out.Spec)
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DefinitionRevision.
|
||||
func (in *DefinitionRevision) DeepCopy() *DefinitionRevision {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(DefinitionRevision)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *DefinitionRevision) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *DefinitionRevisionList) DeepCopyInto(out *DefinitionRevisionList) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ListMeta.DeepCopyInto(&out.ListMeta)
|
||||
if in.Items != nil {
|
||||
in, out := &in.Items, &out.Items
|
||||
*out = make([]DefinitionRevision, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DefinitionRevisionList.
|
||||
func (in *DefinitionRevisionList) DeepCopy() *DefinitionRevisionList {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(DefinitionRevisionList)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *DefinitionRevisionList) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *DefinitionRevisionSpec) DeepCopyInto(out *DefinitionRevisionSpec) {
|
||||
*out = *in
|
||||
in.ComponentDefinition.DeepCopyInto(&out.ComponentDefinition)
|
||||
in.TraitDefinition.DeepCopyInto(&out.TraitDefinition)
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DefinitionRevisionSpec.
|
||||
func (in *DefinitionRevisionSpec) DeepCopy() *DefinitionRevisionSpec {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(DefinitionRevisionSpec)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *Distribution) DeepCopyInto(out *Distribution) {
|
||||
*out = *in
|
||||
@@ -867,6 +926,7 @@ func (in *ResourceTracker) DeepCopyInto(out *ResourceTracker) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
|
||||
in.Status.DeepCopyInto(&out.Status)
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceTracker.
|
||||
@@ -919,6 +979,26 @@ func (in *ResourceTrackerList) DeepCopyObject() runtime.Object {
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ResourceTrackerStatus) DeepCopyInto(out *ResourceTrackerStatus) {
|
||||
*out = *in
|
||||
if in.TrackedResources != nil {
|
||||
in, out := &in.TrackedResources, &out.TrackedResources
|
||||
*out = make([]TypedReference, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceTrackerStatus.
|
||||
func (in *ResourceTrackerStatus) DeepCopy() *ResourceTrackerStatus {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ResourceTrackerStatus)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ScopeDefinition) DeepCopyInto(out *ScopeDefinition) {
|
||||
*out = *in
|
||||
@@ -1134,6 +1214,11 @@ func (in *TraitDefinitionSpec) DeepCopy() *TraitDefinitionSpec {
|
||||
func (in *TraitDefinitionStatus) DeepCopyInto(out *TraitDefinitionStatus) {
|
||||
*out = *in
|
||||
in.ConditionedStatus.DeepCopyInto(&out.ConditionedStatus)
|
||||
if in.LatestRevision != nil {
|
||||
in, out := &in.LatestRevision, &out.LatestRevision
|
||||
*out = new(common.Revision)
|
||||
**out = **in
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TraitDefinitionStatus.
|
||||
@@ -1146,6 +1231,21 @@ func (in *TraitDefinitionStatus) DeepCopy() *TraitDefinitionStatus {
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *TypedReference) DeepCopyInto(out *TypedReference) {
|
||||
*out = *in
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TypedReference.
|
||||
func (in *TypedReference) DeepCopy() *TypedReference {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(TypedReference)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *URIMatch) DeepCopyInto(out *URIMatch) {
|
||||
*out = *in
|
||||
|
||||
@@ -25,7 +25,7 @@ limitations under the License.
|
||||
//go:generate go run -tags generate sigs.k8s.io/controller-tools/cmd/controller-gen object:headerFile=../hack/boilerplate.go.txt paths=./... crd:crdVersions=v1 output:artifacts:config=../config/crd/base
|
||||
|
||||
// Generate legacy_support for K8s 1.12~1.15 versions CRD manifests
|
||||
//go:generate go run -tags generate sigs.k8s.io/controller-tools/cmd/controller-gen object:headerFile=../hack/boilerplate.go.txt paths=./... crd:trivialVersions=true output:artifacts:config=../legacy/charts/vela-core-legacy/crds
|
||||
//go:generate go run -tags generate sigs.k8s.io/controller-tools/cmd/controller-gen object:headerFile=../hack/boilerplate.go.txt paths=./... crd output:artifacts:config=../legacy/charts/vela-core-legacy/crds
|
||||
//go:generate go run ../legacy/convert/main.go ../legacy/charts/vela-core-legacy/crds
|
||||
|
||||
//go:generate go run ../hack/crd/update.go ../charts/vela-core/crds/standard.oam.dev_podspecworkloads.yaml
|
||||
|
||||
@@ -50,6 +50,9 @@ const (
|
||||
type RollingState string
|
||||
|
||||
const (
|
||||
// LocatingTargetAppState indicates that the rollout is in the stage of locating target app
|
||||
// we use this state to make sure we special handle the target app successfully only once
|
||||
LocatingTargetAppState RollingState = "locatingTargetApp"
|
||||
// VerifyingSpecState indicates that the rollout is in the stage of verifying the rollout settings
|
||||
// and the controller can locate both the target and the source
|
||||
VerifyingSpecState RollingState = "verifyingSpec"
|
||||
@@ -64,8 +67,12 @@ const (
|
||||
RolloutFailingState RollingState = "rolloutFailing"
|
||||
// RolloutSucceedState indicates that rollout successfully completed to match the desired target state
|
||||
RolloutSucceedState RollingState = "rolloutSucceed"
|
||||
// RolloutAbandoningState indicates that the rollout is abandoned, can be restarted. This is a terminal state
|
||||
RolloutAbandoningState RollingState = "rolloutAbandoned"
|
||||
// RolloutAbandoningState indicates that the rollout is being abandoned
|
||||
// we need to finalize it by cleaning up the old resources, adjust traffic and return control back to its owner
|
||||
RolloutAbandoningState RollingState = "rolloutAbandoning"
|
||||
// RolloutDeletingState indicates that the rollout is being deleted
|
||||
// we need to finalize it by cleaning up the old resources, adjust traffic and return control back to its owner
|
||||
RolloutDeletingState RollingState = "RolloutDeletingState"
|
||||
// RolloutFailedState indicates that rollout is failed, the target replica is not reached
|
||||
// we can not move forward anymore, we will let the client to decide when or whether to revert.
|
||||
RolloutFailedState RollingState = "rolloutFailed"
|
||||
@@ -240,9 +247,13 @@ type RolloutStatus struct {
|
||||
// Conditions represents the latest available observations of a CloneSet's current state.
|
||||
runtimev1alpha1.ConditionedStatus `json:",inline"`
|
||||
|
||||
// RolloutTargetTotalSize is the size of the target resources. This is determined once the initial spec verification
|
||||
// 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
|
||||
RolloutTargetTotalSize int32 `json:"rolloutTargetSize,omitempty"`
|
||||
RolloutOriginalSize int32 `json:"rolloutOriginalSize,omitempty"`
|
||||
|
||||
// RolloutTargetSize is the size of the target resources. This is determined once the initial spec verification
|
||||
// and does not change until the rollout is restarted
|
||||
RolloutTargetSize int32 `json:"rolloutTargetSize,omitempty"`
|
||||
|
||||
// NewPodTemplateIdentifier is a string that uniquely represent the new pod template
|
||||
// each workload type could use different ways to identify that so we cannot compare between resources
|
||||
|
||||
@@ -36,9 +36,15 @@ const (
|
||||
// RollingRetriableFailureEvent indicates that we encountered an unexpected but retriable error
|
||||
RollingRetriableFailureEvent RolloutEvent = "RollingRetriableFailureEvent"
|
||||
|
||||
// AppLocatedEvent indicates that apps are located successfully
|
||||
AppLocatedEvent RolloutEvent = "AppLocatedEvent"
|
||||
|
||||
// RollingModifiedEvent indicates that the rolling target or source has changed
|
||||
RollingModifiedEvent RolloutEvent = "RollingModifiedEvent"
|
||||
|
||||
// RollingDeletedEvent indicates that the rolling is being deleted
|
||||
RollingDeletedEvent RolloutEvent = "RollingDeletedEvent"
|
||||
|
||||
// RollingSpecVerifiedEvent indicates that we have successfully verified that the rollout spec
|
||||
RollingSpecVerifiedEvent RolloutEvent = "RollingSpecVerifiedEvent"
|
||||
|
||||
@@ -86,6 +92,8 @@ const (
|
||||
RolloutFailing runtimev1alpha1.ConditionType = "RolloutFailing"
|
||||
// RolloutAbandoning means that the rollout is being abandoned.
|
||||
RolloutAbandoning runtimev1alpha1.ConditionType = "RolloutAbandoning"
|
||||
// RolloutDeleting means that the rollout is being deleted.
|
||||
RolloutDeleting runtimev1alpha1.ConditionType = "RolloutDeleting"
|
||||
// RolloutFailed means that the rollout failed.
|
||||
RolloutFailed runtimev1alpha1.ConditionType = "RolloutFailed"
|
||||
// RolloutSucceed means that the rollout is done.
|
||||
@@ -166,8 +174,8 @@ func (r *RolloutStatus) getRolloutConditionType() runtimev1alpha1.ConditionType
|
||||
case RolloutAbandoningState:
|
||||
return RolloutAbandoning
|
||||
|
||||
case RolloutFailedState:
|
||||
return RolloutFailed
|
||||
case RolloutDeletingState:
|
||||
return RolloutDeleting
|
||||
|
||||
case RolloutSucceedState:
|
||||
return RolloutSucceed
|
||||
@@ -201,9 +209,9 @@ func (r *RolloutStatus) RolloutFailing(reason string) {
|
||||
// ResetStatus resets the status of the rollout to start from beginning
|
||||
func (r *RolloutStatus) ResetStatus() {
|
||||
r.NewPodTemplateIdentifier = ""
|
||||
r.RolloutTargetTotalSize = -1
|
||||
r.RolloutTargetSize = -1
|
||||
r.LastAppliedPodTemplateIdentifier = ""
|
||||
r.RollingState = VerifyingSpecState
|
||||
r.RollingState = LocatingTargetAppState
|
||||
r.BatchRollingState = BatchInitializingState
|
||||
r.CurrentBatch = 0
|
||||
r.UpgradedReplicas = 0
|
||||
@@ -234,7 +242,11 @@ func (r *RolloutStatus) SetRolloutCondition(new runtimev1alpha1.Condition) {
|
||||
if !exists {
|
||||
r.Conditions = append(r.Conditions, new)
|
||||
}
|
||||
}
|
||||
|
||||
// we can't panic since it will crash the other controllers
|
||||
func (r *RolloutStatus) illegalStateTransition(err error) {
|
||||
r.RolloutFailed(err.Error())
|
||||
}
|
||||
|
||||
// StateTransition is the center place to do rollout state transition
|
||||
@@ -253,15 +265,41 @@ func (r *RolloutStatus) StateTransition(event RolloutEvent) {
|
||||
|
||||
// we have special transition for these types of event since they require additional info
|
||||
if event == RollingFailedEvent || event == RollingRetriableFailureEvent {
|
||||
panic(fmt.Errorf(invalidRollingStateTransition, rollingState, event))
|
||||
r.illegalStateTransition(fmt.Errorf(invalidRollingStateTransition, rollingState, event))
|
||||
return
|
||||
}
|
||||
// special handle modified event here
|
||||
if event == RollingModifiedEvent {
|
||||
if r.RollingState == RolloutDeletingState {
|
||||
r.illegalStateTransition(fmt.Errorf(invalidRollingStateTransition, rollingState, event))
|
||||
return
|
||||
}
|
||||
if r.RollingState == RolloutFailedState || r.RollingState == RolloutSucceedState {
|
||||
r.ResetStatus()
|
||||
} else {
|
||||
r.SetRolloutCondition(NewNegativeCondition(r.getRolloutConditionType(), "Rollout Spec is modified"))
|
||||
r.RollingState = RolloutAbandoningState
|
||||
r.BatchRollingState = BatchInitializingState
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// special handle deleted event here, it can happen at many states
|
||||
if event == RollingDeletedEvent {
|
||||
if r.RollingState == RolloutFailedState || r.RollingState == RolloutSucceedState {
|
||||
r.illegalStateTransition(fmt.Errorf(invalidRollingStateTransition, rollingState, event))
|
||||
return
|
||||
}
|
||||
r.SetRolloutCondition(NewNegativeCondition(r.getRolloutConditionType(), "Rollout is being deleted"))
|
||||
r.RollingState = RolloutDeletingState
|
||||
r.BatchRollingState = BatchInitializingState
|
||||
return
|
||||
}
|
||||
|
||||
// special handle appLocatedEvent event here, it only applies to one state but it's legal to happen at other states
|
||||
if event == AppLocatedEvent {
|
||||
if r.RollingState == LocatingTargetAppState {
|
||||
r.RollingState = VerifyingSpecState
|
||||
}
|
||||
return
|
||||
}
|
||||
@@ -273,7 +311,7 @@ func (r *RolloutStatus) StateTransition(event RolloutEvent) {
|
||||
r.RollingState = InitializingState
|
||||
return
|
||||
}
|
||||
panic(fmt.Errorf(invalidRollingStateTransition, rollingState, event))
|
||||
r.illegalStateTransition(fmt.Errorf(invalidRollingStateTransition, rollingState, event))
|
||||
|
||||
case InitializingState:
|
||||
if event == RollingInitializedEvent {
|
||||
@@ -282,7 +320,7 @@ func (r *RolloutStatus) StateTransition(event RolloutEvent) {
|
||||
r.BatchRollingState = BatchInitializingState
|
||||
return
|
||||
}
|
||||
panic(fmt.Errorf(invalidRollingStateTransition, rollingState, event))
|
||||
r.illegalStateTransition(fmt.Errorf(invalidRollingStateTransition, rollingState, event))
|
||||
|
||||
case RollingInBatchesState:
|
||||
r.batchStateTransition(event)
|
||||
@@ -294,7 +332,15 @@ func (r *RolloutStatus) StateTransition(event RolloutEvent) {
|
||||
r.ResetStatus()
|
||||
return
|
||||
}
|
||||
panic(fmt.Errorf(invalidRollingStateTransition, rollingState, event))
|
||||
r.illegalStateTransition(fmt.Errorf(invalidRollingStateTransition, rollingState, event))
|
||||
|
||||
case RolloutDeletingState:
|
||||
if event == RollingFinalizedEvent {
|
||||
r.SetRolloutCondition(NewPositiveCondition(r.getRolloutConditionType()))
|
||||
r.RollingState = RolloutFailedState
|
||||
return
|
||||
}
|
||||
r.illegalStateTransition(fmt.Errorf(invalidRollingStateTransition, rollingState, event))
|
||||
|
||||
case FinalisingState:
|
||||
if event == RollingFinalizedEvent {
|
||||
@@ -302,7 +348,7 @@ func (r *RolloutStatus) StateTransition(event RolloutEvent) {
|
||||
r.RollingState = RolloutSucceedState
|
||||
return
|
||||
}
|
||||
panic(fmt.Errorf(invalidRollingStateTransition, rollingState, event))
|
||||
r.illegalStateTransition(fmt.Errorf(invalidRollingStateTransition, rollingState, event))
|
||||
|
||||
case RolloutFailingState:
|
||||
if event == RollingFinalizedEvent {
|
||||
@@ -310,16 +356,13 @@ func (r *RolloutStatus) StateTransition(event RolloutEvent) {
|
||||
r.RollingState = RolloutFailedState
|
||||
return
|
||||
}
|
||||
panic(fmt.Errorf(invalidRollingStateTransition, rollingState, event))
|
||||
r.illegalStateTransition(fmt.Errorf(invalidRollingStateTransition, rollingState, event))
|
||||
|
||||
case RolloutSucceedState:
|
||||
panic(fmt.Errorf(invalidRollingStateTransition, rollingState, event))
|
||||
|
||||
case RolloutFailedState:
|
||||
panic(fmt.Errorf(invalidRollingStateTransition, rollingState, event))
|
||||
case RolloutSucceedState, RolloutFailedState:
|
||||
r.illegalStateTransition(fmt.Errorf(invalidRollingStateTransition, rollingState, event))
|
||||
|
||||
default:
|
||||
panic(fmt.Errorf("invalid rolling state %s", rollingState))
|
||||
r.illegalStateTransition(fmt.Errorf("invalid rolling state %s before transition", rollingState))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -338,7 +381,7 @@ func (r *RolloutStatus) batchStateTransition(event RolloutEvent) {
|
||||
r.BatchRollingState = BatchInRollingState
|
||||
return
|
||||
}
|
||||
panic(fmt.Errorf(invalidBatchRollingStateTransition, batchRollingState, event))
|
||||
r.illegalStateTransition(fmt.Errorf(invalidBatchRollingStateTransition, batchRollingState, event))
|
||||
|
||||
case BatchInRollingState:
|
||||
if event == RolloutOneBatchEvent {
|
||||
@@ -346,7 +389,7 @@ func (r *RolloutStatus) batchStateTransition(event RolloutEvent) {
|
||||
r.BatchRollingState = BatchVerifyingState
|
||||
return
|
||||
}
|
||||
panic(fmt.Errorf(invalidBatchRollingStateTransition, batchRollingState, event))
|
||||
r.illegalStateTransition(fmt.Errorf(invalidBatchRollingStateTransition, batchRollingState, event))
|
||||
|
||||
case BatchVerifyingState:
|
||||
if event == OneBatchAvailableEvent {
|
||||
@@ -354,7 +397,7 @@ func (r *RolloutStatus) batchStateTransition(event RolloutEvent) {
|
||||
r.BatchRollingState = BatchFinalizingState
|
||||
return
|
||||
}
|
||||
panic(fmt.Errorf(invalidBatchRollingStateTransition, batchRollingState, event))
|
||||
r.illegalStateTransition(fmt.Errorf(invalidBatchRollingStateTransition, batchRollingState, event))
|
||||
|
||||
case BatchFinalizingState:
|
||||
if event == FinishedOneBatchEvent {
|
||||
@@ -369,7 +412,7 @@ func (r *RolloutStatus) batchStateTransition(event RolloutEvent) {
|
||||
r.RollingState = FinalisingState
|
||||
return
|
||||
}
|
||||
panic(fmt.Errorf(invalidBatchRollingStateTransition, batchRollingState, event))
|
||||
r.illegalStateTransition(fmt.Errorf(invalidBatchRollingStateTransition, batchRollingState, event))
|
||||
|
||||
case BatchReadyState:
|
||||
if event == BatchRolloutApprovedEvent {
|
||||
@@ -378,9 +421,9 @@ func (r *RolloutStatus) batchStateTransition(event RolloutEvent) {
|
||||
r.CurrentBatch++
|
||||
return
|
||||
}
|
||||
panic(fmt.Errorf(invalidBatchRollingStateTransition, batchRollingState, event))
|
||||
r.illegalStateTransition(fmt.Errorf(invalidBatchRollingStateTransition, batchRollingState, event))
|
||||
|
||||
default:
|
||||
panic(fmt.Errorf("invalid batch rolling state %s", batchRollingState))
|
||||
r.illegalStateTransition(fmt.Errorf("invalid batch rolling state %s", batchRollingState))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,6 +42,7 @@ type RolloutTraitSpec struct {
|
||||
// RolloutTrait is the Schema for the RolloutTrait API
|
||||
// +kubebuilder:object:root=true
|
||||
// +genclient
|
||||
// +kubebuilder:resource:categories={oam}
|
||||
// +kubebuilder:subresource:status
|
||||
type RolloutTrait struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
|
||||
@@ -38,15 +38,16 @@ type CRDInfo struct {
|
||||
|
||||
// Capability defines the content of a capability
|
||||
type Capability struct {
|
||||
Name string `json:"name"`
|
||||
Type CapType `json:"type"`
|
||||
CueTemplate string `json:"template,omitempty"`
|
||||
CueTemplateURI string `json:"templateURI,omitempty"`
|
||||
Parameters []Parameter `json:"parameters,omitempty"`
|
||||
CrdName string `json:"crdName,omitempty"`
|
||||
Center string `json:"center,omitempty"`
|
||||
Status string `json:"status,omitempty"`
|
||||
Description string `json:"description,omitempty"`
|
||||
Name string `json:"name"`
|
||||
Type CapType `json:"type"`
|
||||
CueTemplate string `json:"template,omitempty"`
|
||||
CueTemplateURI string `json:"templateURI,omitempty"`
|
||||
Parameters []Parameter `json:"parameters,omitempty"`
|
||||
CrdName string `json:"crdName,omitempty"`
|
||||
Center string `json:"center,omitempty"`
|
||||
Status string `json:"status,omitempty"`
|
||||
Description string `json:"description,omitempty"`
|
||||
Category CapabilityCategory `json:"category,omitempty"`
|
||||
|
||||
// trait only
|
||||
AppliesTo []string `json:"appliesTo,omitempty"`
|
||||
@@ -58,6 +59,9 @@ type Capability struct {
|
||||
Source *Source `json:"source,omitempty"`
|
||||
Install *Installation `json:"install,omitempty"`
|
||||
CrdInfo *CRDInfo `json:"crdInfo,omitempty"`
|
||||
|
||||
// Terraform
|
||||
TerraformConfiguration string `json:"terraformConfiguration,omitempty"`
|
||||
}
|
||||
|
||||
// Chart defines all necessary information to install a whole chart
|
||||
@@ -121,6 +125,7 @@ type Parameter struct {
|
||||
Usage string `json:"usage,omitempty"`
|
||||
Type cue.Kind `json:"type,omitempty"`
|
||||
Alias string `json:"alias,omitempty"`
|
||||
JSONType string `json:"jsonType,omitempty"`
|
||||
}
|
||||
|
||||
// SetFlagBy set cli flag from Parameter
|
||||
|
||||
50
apis/types/event.go
Normal file
50
apis/types/event.go
Normal file
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
Copyright 2021 The KubeVela Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package types
|
||||
|
||||
// reason for Application
|
||||
const (
|
||||
ReasonParsed = "Parsed"
|
||||
ReasonRendered = "Rendered"
|
||||
ReasonApplied = "Applied"
|
||||
ReasonHealthCheck = "HealthChecked"
|
||||
ReasonDeployed = "Deployed"
|
||||
ReasonRollout = "Rollout"
|
||||
|
||||
ReasonFailedParse = "FailedParse"
|
||||
ReasonFailedRender = "FailedRender"
|
||||
ReasonFailedApply = "FailedApply"
|
||||
ReasonFailedHealthCheck = "FailedHealthCheck"
|
||||
ReasonFailedGC = "FailedGC"
|
||||
ReasonFailedRollout = "FailedRollout"
|
||||
)
|
||||
|
||||
// event message for Application
|
||||
const (
|
||||
MessageParsed = "Parsed successfully"
|
||||
MessageRendered = "Rendered successfully"
|
||||
MessageApplied = "Applied successfully"
|
||||
MessageHealthCheck = "Health checked healthy"
|
||||
MessageDeployed = "Deployed successfully"
|
||||
MessageRollout = "Rollout successfully"
|
||||
|
||||
MessageFailedParse = "fail to parse application, err: %v"
|
||||
MessageFailedRender = "fail to render application, err: %v"
|
||||
MessageFailedApply = "fail to apply component, err: %v"
|
||||
MessageFailedHealthCheck = "fail to health check, err: %v"
|
||||
MessageFailedGC = "fail to garbage collection, err: %v"
|
||||
)
|
||||
@@ -50,8 +50,6 @@ type EnvMeta struct {
|
||||
Email string `json:"email,omitempty"`
|
||||
Domain string `json:"domain,omitempty"`
|
||||
|
||||
// Below are not arguments, should be auto-generated
|
||||
Issuer string `json:"issuer"`
|
||||
Current string `json:"current,omitempty"`
|
||||
}
|
||||
|
||||
@@ -66,4 +64,6 @@ const (
|
||||
TypeCap = "Managing Capabilities"
|
||||
// TypeSystem defines one category
|
||||
TypeSystem = "System"
|
||||
// TypePlugin defines one category used in Kubectl Plugin
|
||||
TypePlugin = "Debug and Test"
|
||||
)
|
||||
|
||||
@@ -14,6 +14,8 @@ spec:
|
||||
kind: AppDeployment
|
||||
listKind: AppDeploymentList
|
||||
plural: appdeployments
|
||||
shortNames:
|
||||
- appdeploy
|
||||
singular: appdeployment
|
||||
scope: Namespaced
|
||||
versions:
|
||||
|
||||
@@ -9,13 +9,21 @@ metadata:
|
||||
spec:
|
||||
group: core.oam.dev
|
||||
names:
|
||||
categories:
|
||||
- oam
|
||||
kind: ApplicationRevision
|
||||
listKind: ApplicationRevisionList
|
||||
plural: applicationrevisions
|
||||
shortNames:
|
||||
- apprev
|
||||
singular: applicationrevision
|
||||
scope: Namespaced
|
||||
versions:
|
||||
- name: v1alpha2
|
||||
- additionalPrinterColumns:
|
||||
- jsonPath: .metadata.creationTimestamp
|
||||
name: AGE
|
||||
type: date
|
||||
name: v1alpha2
|
||||
schema:
|
||||
openAPIV3Schema:
|
||||
description: ApplicationRevision is the Schema for the ApplicationRevision API
|
||||
@@ -305,9 +313,6 @@ spec:
|
||||
status:
|
||||
description: AppStatus defines the observed state of Application
|
||||
properties:
|
||||
batchRollingState:
|
||||
description: BatchRollingState only meaningful when the Status is rolling
|
||||
type: string
|
||||
components:
|
||||
description: Components record the related Components created by Application Controller
|
||||
items:
|
||||
@@ -359,13 +364,6 @@ spec:
|
||||
- type
|
||||
type: object
|
||||
type: array
|
||||
currentBatch:
|
||||
description: The current batch the rollout is working on/blocked it starts from 0
|
||||
format: int32
|
||||
type: integer
|
||||
lastAppliedPodTemplateIdentifier:
|
||||
description: lastAppliedPodTemplateIdentifier is a string that uniquely represent the last pod template each workload type could use different ways to identify that so we cannot compare between resources We update this field only after a successful rollout
|
||||
type: string
|
||||
latestRevision:
|
||||
description: LatestRevision of the application configuration it generates
|
||||
properties:
|
||||
@@ -401,13 +399,82 @@ spec:
|
||||
- kind
|
||||
- name
|
||||
type: object
|
||||
rollingState:
|
||||
description: RollingState is the Rollout State
|
||||
type: string
|
||||
rolloutTargetSize:
|
||||
description: RolloutTargetTotalSize 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
|
||||
rollout:
|
||||
description: AppRolloutStatus defines the observed state of AppRollout
|
||||
properties:
|
||||
LastSourceAppRevision:
|
||||
description: LastSourceAppRevision contains the name of the app that we need to upgrade from. We will restart the rollout if this is not the same as the spec
|
||||
type: string
|
||||
batchRollingState:
|
||||
description: BatchRollingState only meaningful when the Status is rolling
|
||||
type: string
|
||||
conditions:
|
||||
description: Conditions of the resource.
|
||||
items:
|
||||
description: A Condition that may apply to a resource.
|
||||
properties:
|
||||
lastTransitionTime:
|
||||
description: LastTransitionTime is the last time this condition transitioned from one status to another.
|
||||
format: date-time
|
||||
type: string
|
||||
message:
|
||||
description: A Message containing details about this condition's last transition from one status to another, if any.
|
||||
type: string
|
||||
reason:
|
||||
description: A Reason for this condition's last transition from one status to another.
|
||||
type: string
|
||||
status:
|
||||
description: Status of this condition; is it currently True, False, or Unknown?
|
||||
type: string
|
||||
type:
|
||||
description: Type of this condition. At most one of each condition type may apply to a resource at any point in time.
|
||||
type: string
|
||||
required:
|
||||
- lastTransitionTime
|
||||
- reason
|
||||
- status
|
||||
- type
|
||||
type: object
|
||||
type: array
|
||||
currentBatch:
|
||||
description: The current batch the rollout is working on/blocked it starts from 0
|
||||
format: int32
|
||||
type: integer
|
||||
lastAppliedPodTemplateIdentifier:
|
||||
description: lastAppliedPodTemplateIdentifier is a string that uniquely represent the last pod template each workload type could use different ways to identify that so we cannot compare between resources We update this field only after a successful rollout
|
||||
type: string
|
||||
lastTargetAppRevision:
|
||||
description: LastUpgradedTargetAppRevision contains the name of the app that we upgraded to We will restart the rollout if this is not the same as the spec
|
||||
type: string
|
||||
rollingState:
|
||||
description: RollingState is the Rollout State
|
||||
type: string
|
||||
rolloutOriginalSize:
|
||||
description: RolloutTargetSize is the size of the target resources. This is determined once the initial spec verification and does not change until the rollout is restarted
|
||||
format: int32
|
||||
type: integer
|
||||
rolloutTargetSize:
|
||||
description: RolloutTargetSize is the size of the target resources. This is determined once the initial spec verification and does not change until the rollout is restarted
|
||||
format: int32
|
||||
type: integer
|
||||
targetGeneration:
|
||||
description: NewPodTemplateIdentifier is a string that uniquely represent the new pod template each workload type could use different ways to identify that so we cannot compare between resources
|
||||
type: string
|
||||
upgradedReadyReplicas:
|
||||
description: UpgradedReadyReplicas is the number of Pods upgraded by the rollout controller that have a Ready Condition.
|
||||
format: int32
|
||||
type: integer
|
||||
upgradedReplicas:
|
||||
description: UpgradedReplicas is the number of Pods upgraded by the rollout controller
|
||||
format: int32
|
||||
type: integer
|
||||
required:
|
||||
- currentBatch
|
||||
- lastTargetAppRevision
|
||||
- rollingState
|
||||
- upgradedReadyReplicas
|
||||
- upgradedReplicas
|
||||
type: object
|
||||
services:
|
||||
description: Services record the status of the application services
|
||||
items:
|
||||
@@ -419,6 +486,28 @@ spec:
|
||||
type: string
|
||||
name:
|
||||
type: string
|
||||
scopes:
|
||||
items:
|
||||
description: A TypedReference refers to an object by Name, Kind, and APIVersion. It is commonly used to reference cluster-scoped objects or objects where the namespace is already known.
|
||||
properties:
|
||||
apiVersion:
|
||||
description: APIVersion of the referenced object.
|
||||
type: string
|
||||
kind:
|
||||
description: Kind of the referenced object.
|
||||
type: string
|
||||
name:
|
||||
description: Name of the referenced object.
|
||||
type: string
|
||||
uid:
|
||||
description: UID of the referenced object.
|
||||
type: string
|
||||
required:
|
||||
- apiVersion
|
||||
- kind
|
||||
- name
|
||||
type: object
|
||||
type: array
|
||||
traits:
|
||||
items:
|
||||
description: ApplicationTraitStatus records the trait health status
|
||||
@@ -434,6 +523,17 @@ spec:
|
||||
- type
|
||||
type: object
|
||||
type: array
|
||||
workloadDefinition:
|
||||
description: WorkloadDefinition is the definition of a WorkloadDefinition, such as deployments/apps.v1
|
||||
properties:
|
||||
apiVersion:
|
||||
type: string
|
||||
kind:
|
||||
type: string
|
||||
required:
|
||||
- apiVersion
|
||||
- kind
|
||||
type: object
|
||||
required:
|
||||
- healthy
|
||||
- name
|
||||
@@ -442,22 +542,6 @@ spec:
|
||||
status:
|
||||
description: ApplicationPhase is a label for the condition of a application at the current time
|
||||
type: string
|
||||
targetGeneration:
|
||||
description: NewPodTemplateIdentifier is a string that uniquely represent the new pod template each workload type could use different ways to identify that so we cannot compare between resources
|
||||
type: string
|
||||
upgradedReadyReplicas:
|
||||
description: UpgradedReadyReplicas is the number of Pods upgraded by the rollout controller that have a Ready Condition.
|
||||
format: int32
|
||||
type: integer
|
||||
upgradedReplicas:
|
||||
description: UpgradedReplicas is the number of Pods upgraded by the rollout controller
|
||||
format: int32
|
||||
type: integer
|
||||
required:
|
||||
- currentBatch
|
||||
- rollingState
|
||||
- upgradedReadyReplicas
|
||||
- upgradedReplicas
|
||||
type: object
|
||||
type: object
|
||||
applicationConfiguration:
|
||||
@@ -581,6 +665,22 @@ spec:
|
||||
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
|
||||
type:
|
||||
default: hcl
|
||||
description: Type specifies which Terraform configuration it is, HCL or JSON syntax
|
||||
enum:
|
||||
- hcl
|
||||
- json
|
||||
type: string
|
||||
required:
|
||||
- configuration
|
||||
type: object
|
||||
type: object
|
||||
status:
|
||||
description: Status defines the custom health policy and status message for workload
|
||||
@@ -647,6 +747,21 @@ spec:
|
||||
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
|
||||
description: ComponentDefinitions records the snapshot of the componentDefinitions related with the created/modified Application
|
||||
@@ -748,6 +863,9 @@ spec:
|
||||
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
|
||||
@@ -821,6 +939,22 @@ spec:
|
||||
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
|
||||
type:
|
||||
default: hcl
|
||||
description: Type specifies which Terraform configuration it is, HCL or JSON syntax
|
||||
enum:
|
||||
- hcl
|
||||
- json
|
||||
type: string
|
||||
required:
|
||||
- configuration
|
||||
type: object
|
||||
type: object
|
||||
status:
|
||||
description: Status defines the custom health policy and status message for trait
|
||||
@@ -870,6 +1004,21 @@ spec:
|
||||
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
|
||||
description: TraitDefinitions records the snapshot of the traitDefinitions related with the created/modified Application
|
||||
@@ -1002,6 +1151,22 @@ spec:
|
||||
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
|
||||
type:
|
||||
default: hcl
|
||||
description: Type specifies which Terraform configuration it is, HCL or JSON syntax
|
||||
enum:
|
||||
- hcl
|
||||
- json
|
||||
type: string
|
||||
required:
|
||||
- configuration
|
||||
type: object
|
||||
type: object
|
||||
status:
|
||||
description: Status defines the custom health policy and status message for workload
|
||||
@@ -1058,7 +1223,12 @@ spec:
|
||||
type: object
|
||||
served: true
|
||||
storage: false
|
||||
- name: v1beta1
|
||||
subresources: {}
|
||||
- additionalPrinterColumns:
|
||||
- jsonPath: .metadata.creationTimestamp
|
||||
name: AGE
|
||||
type: date
|
||||
name: v1beta1
|
||||
schema:
|
||||
openAPIV3Schema:
|
||||
description: ApplicationRevision is the Schema for the ApplicationRevision API
|
||||
@@ -1348,9 +1518,6 @@ spec:
|
||||
status:
|
||||
description: AppStatus defines the observed state of Application
|
||||
properties:
|
||||
batchRollingState:
|
||||
description: BatchRollingState only meaningful when the Status is rolling
|
||||
type: string
|
||||
components:
|
||||
description: Components record the related Components created by Application Controller
|
||||
items:
|
||||
@@ -1402,13 +1569,6 @@ spec:
|
||||
- type
|
||||
type: object
|
||||
type: array
|
||||
currentBatch:
|
||||
description: The current batch the rollout is working on/blocked it starts from 0
|
||||
format: int32
|
||||
type: integer
|
||||
lastAppliedPodTemplateIdentifier:
|
||||
description: lastAppliedPodTemplateIdentifier is a string that uniquely represent the last pod template each workload type could use different ways to identify that so we cannot compare between resources We update this field only after a successful rollout
|
||||
type: string
|
||||
latestRevision:
|
||||
description: LatestRevision of the application configuration it generates
|
||||
properties:
|
||||
@@ -1444,13 +1604,82 @@ spec:
|
||||
- kind
|
||||
- name
|
||||
type: object
|
||||
rollingState:
|
||||
description: RollingState is the Rollout State
|
||||
type: string
|
||||
rolloutTargetSize:
|
||||
description: RolloutTargetTotalSize 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
|
||||
rollout:
|
||||
description: AppRolloutStatus defines the observed state of AppRollout
|
||||
properties:
|
||||
LastSourceAppRevision:
|
||||
description: LastSourceAppRevision contains the name of the app that we need to upgrade from. We will restart the rollout if this is not the same as the spec
|
||||
type: string
|
||||
batchRollingState:
|
||||
description: BatchRollingState only meaningful when the Status is rolling
|
||||
type: string
|
||||
conditions:
|
||||
description: Conditions of the resource.
|
||||
items:
|
||||
description: A Condition that may apply to a resource.
|
||||
properties:
|
||||
lastTransitionTime:
|
||||
description: LastTransitionTime is the last time this condition transitioned from one status to another.
|
||||
format: date-time
|
||||
type: string
|
||||
message:
|
||||
description: A Message containing details about this condition's last transition from one status to another, if any.
|
||||
type: string
|
||||
reason:
|
||||
description: A Reason for this condition's last transition from one status to another.
|
||||
type: string
|
||||
status:
|
||||
description: Status of this condition; is it currently True, False, or Unknown?
|
||||
type: string
|
||||
type:
|
||||
description: Type of this condition. At most one of each condition type may apply to a resource at any point in time.
|
||||
type: string
|
||||
required:
|
||||
- lastTransitionTime
|
||||
- reason
|
||||
- status
|
||||
- type
|
||||
type: object
|
||||
type: array
|
||||
currentBatch:
|
||||
description: The current batch the rollout is working on/blocked it starts from 0
|
||||
format: int32
|
||||
type: integer
|
||||
lastAppliedPodTemplateIdentifier:
|
||||
description: lastAppliedPodTemplateIdentifier is a string that uniquely represent the last pod template each workload type could use different ways to identify that so we cannot compare between resources We update this field only after a successful rollout
|
||||
type: string
|
||||
lastTargetAppRevision:
|
||||
description: LastUpgradedTargetAppRevision contains the name of the app that we upgraded to We will restart the rollout if this is not the same as the spec
|
||||
type: string
|
||||
rollingState:
|
||||
description: RollingState is the Rollout State
|
||||
type: string
|
||||
rolloutOriginalSize:
|
||||
description: RolloutTargetSize is the size of the target resources. This is determined once the initial spec verification and does not change until the rollout is restarted
|
||||
format: int32
|
||||
type: integer
|
||||
rolloutTargetSize:
|
||||
description: RolloutTargetSize is the size of the target resources. This is determined once the initial spec verification and does not change until the rollout is restarted
|
||||
format: int32
|
||||
type: integer
|
||||
targetGeneration:
|
||||
description: NewPodTemplateIdentifier is a string that uniquely represent the new pod template each workload type could use different ways to identify that so we cannot compare between resources
|
||||
type: string
|
||||
upgradedReadyReplicas:
|
||||
description: UpgradedReadyReplicas is the number of Pods upgraded by the rollout controller that have a Ready Condition.
|
||||
format: int32
|
||||
type: integer
|
||||
upgradedReplicas:
|
||||
description: UpgradedReplicas is the number of Pods upgraded by the rollout controller
|
||||
format: int32
|
||||
type: integer
|
||||
required:
|
||||
- currentBatch
|
||||
- lastTargetAppRevision
|
||||
- rollingState
|
||||
- upgradedReadyReplicas
|
||||
- upgradedReplicas
|
||||
type: object
|
||||
services:
|
||||
description: Services record the status of the application services
|
||||
items:
|
||||
@@ -1462,6 +1691,28 @@ spec:
|
||||
type: string
|
||||
name:
|
||||
type: string
|
||||
scopes:
|
||||
items:
|
||||
description: A TypedReference refers to an object by Name, Kind, and APIVersion. It is commonly used to reference cluster-scoped objects or objects where the namespace is already known.
|
||||
properties:
|
||||
apiVersion:
|
||||
description: APIVersion of the referenced object.
|
||||
type: string
|
||||
kind:
|
||||
description: Kind of the referenced object.
|
||||
type: string
|
||||
name:
|
||||
description: Name of the referenced object.
|
||||
type: string
|
||||
uid:
|
||||
description: UID of the referenced object.
|
||||
type: string
|
||||
required:
|
||||
- apiVersion
|
||||
- kind
|
||||
- name
|
||||
type: object
|
||||
type: array
|
||||
traits:
|
||||
items:
|
||||
description: ApplicationTraitStatus records the trait health status
|
||||
@@ -1477,6 +1728,17 @@ spec:
|
||||
- type
|
||||
type: object
|
||||
type: array
|
||||
workloadDefinition:
|
||||
description: WorkloadDefinition is the definition of a WorkloadDefinition, such as deployments/apps.v1
|
||||
properties:
|
||||
apiVersion:
|
||||
type: string
|
||||
kind:
|
||||
type: string
|
||||
required:
|
||||
- apiVersion
|
||||
- kind
|
||||
type: object
|
||||
required:
|
||||
- healthy
|
||||
- name
|
||||
@@ -1485,22 +1747,6 @@ spec:
|
||||
status:
|
||||
description: ApplicationPhase is a label for the condition of a application at the current time
|
||||
type: string
|
||||
targetGeneration:
|
||||
description: NewPodTemplateIdentifier is a string that uniquely represent the new pod template each workload type could use different ways to identify that so we cannot compare between resources
|
||||
type: string
|
||||
upgradedReadyReplicas:
|
||||
description: UpgradedReadyReplicas is the number of Pods upgraded by the rollout controller that have a Ready Condition.
|
||||
format: int32
|
||||
type: integer
|
||||
upgradedReplicas:
|
||||
description: UpgradedReplicas is the number of Pods upgraded by the rollout controller
|
||||
format: int32
|
||||
type: integer
|
||||
required:
|
||||
- currentBatch
|
||||
- rollingState
|
||||
- upgradedReadyReplicas
|
||||
- upgradedReplicas
|
||||
type: object
|
||||
type: object
|
||||
applicationConfiguration:
|
||||
@@ -1624,6 +1870,22 @@ spec:
|
||||
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
|
||||
type:
|
||||
default: hcl
|
||||
description: Type specifies which Terraform configuration it is, HCL or JSON syntax
|
||||
enum:
|
||||
- hcl
|
||||
- json
|
||||
type: string
|
||||
required:
|
||||
- configuration
|
||||
type: object
|
||||
type: object
|
||||
status:
|
||||
description: Status defines the custom health policy and status message for workload
|
||||
@@ -1690,6 +1952,21 @@ spec:
|
||||
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
|
||||
description: ComponentDefinitions records the snapshot of the componentDefinitions related with the created/modified Application
|
||||
@@ -1792,6 +2069,9 @@ spec:
|
||||
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
|
||||
@@ -1865,6 +2145,22 @@ spec:
|
||||
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
|
||||
type:
|
||||
default: hcl
|
||||
description: Type specifies which Terraform configuration it is, HCL or JSON syntax
|
||||
enum:
|
||||
- hcl
|
||||
- json
|
||||
type: string
|
||||
required:
|
||||
- configuration
|
||||
type: object
|
||||
type: object
|
||||
status:
|
||||
description: Status defines the custom health policy and status message for trait
|
||||
@@ -1914,6 +2210,21 @@ spec:
|
||||
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
|
||||
description: TraitDefinitions records the snapshot of the traitDefinitions related with the created/modified Application
|
||||
@@ -2046,6 +2357,22 @@ spec:
|
||||
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
|
||||
type:
|
||||
default: hcl
|
||||
description: Type specifies which Terraform configuration it is, HCL or JSON syntax
|
||||
enum:
|
||||
- hcl
|
||||
- json
|
||||
type: string
|
||||
required:
|
||||
- configuration
|
||||
type: object
|
||||
type: object
|
||||
status:
|
||||
description: Status defines the custom health policy and status message for workload
|
||||
@@ -2102,6 +2429,7 @@ spec:
|
||||
type: object
|
||||
served: true
|
||||
storage: true
|
||||
subresources: {}
|
||||
status:
|
||||
acceptedNames:
|
||||
kind: ""
|
||||
|
||||
@@ -25,10 +25,31 @@ spec:
|
||||
kind: Application
|
||||
listKind: ApplicationList
|
||||
plural: applications
|
||||
shortNames:
|
||||
- app
|
||||
singular: application
|
||||
scope: Namespaced
|
||||
versions:
|
||||
- name: v1alpha2
|
||||
- additionalPrinterColumns:
|
||||
- jsonPath: .spec.components[*].name
|
||||
name: COMPONENT
|
||||
type: string
|
||||
- jsonPath: .spec.components[*].type
|
||||
name: TYPE
|
||||
type: string
|
||||
- jsonPath: .status.status
|
||||
name: PHASE
|
||||
type: string
|
||||
- jsonPath: .status.services[*].healthy
|
||||
name: HEALTHY
|
||||
type: boolean
|
||||
- jsonPath: .status.services[*].message
|
||||
name: STATUS
|
||||
type: string
|
||||
- jsonPath: .metadata.creationTimestamp
|
||||
name: AGE
|
||||
type: date
|
||||
name: v1alpha2
|
||||
schema:
|
||||
openAPIV3Schema:
|
||||
description: Application is the Schema for the applications API
|
||||
@@ -304,9 +325,6 @@ spec:
|
||||
status:
|
||||
description: AppStatus defines the observed state of Application
|
||||
properties:
|
||||
batchRollingState:
|
||||
description: BatchRollingState only meaningful when the Status is rolling
|
||||
type: string
|
||||
components:
|
||||
description: Components record the related Components created by Application Controller
|
||||
items:
|
||||
@@ -358,13 +376,6 @@ spec:
|
||||
- type
|
||||
type: object
|
||||
type: array
|
||||
currentBatch:
|
||||
description: The current batch the rollout is working on/blocked it starts from 0
|
||||
format: int32
|
||||
type: integer
|
||||
lastAppliedPodTemplateIdentifier:
|
||||
description: lastAppliedPodTemplateIdentifier is a string that uniquely represent the last pod template each workload type could use different ways to identify that so we cannot compare between resources We update this field only after a successful rollout
|
||||
type: string
|
||||
latestRevision:
|
||||
description: LatestRevision of the application configuration it generates
|
||||
properties:
|
||||
@@ -400,13 +411,82 @@ spec:
|
||||
- kind
|
||||
- name
|
||||
type: object
|
||||
rollingState:
|
||||
description: RollingState is the Rollout State
|
||||
type: string
|
||||
rolloutTargetSize:
|
||||
description: RolloutTargetTotalSize 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
|
||||
rollout:
|
||||
description: AppRolloutStatus defines the observed state of AppRollout
|
||||
properties:
|
||||
LastSourceAppRevision:
|
||||
description: LastSourceAppRevision contains the name of the app that we need to upgrade from. We will restart the rollout if this is not the same as the spec
|
||||
type: string
|
||||
batchRollingState:
|
||||
description: BatchRollingState only meaningful when the Status is rolling
|
||||
type: string
|
||||
conditions:
|
||||
description: Conditions of the resource.
|
||||
items:
|
||||
description: A Condition that may apply to a resource.
|
||||
properties:
|
||||
lastTransitionTime:
|
||||
description: LastTransitionTime is the last time this condition transitioned from one status to another.
|
||||
format: date-time
|
||||
type: string
|
||||
message:
|
||||
description: A Message containing details about this condition's last transition from one status to another, if any.
|
||||
type: string
|
||||
reason:
|
||||
description: A Reason for this condition's last transition from one status to another.
|
||||
type: string
|
||||
status:
|
||||
description: Status of this condition; is it currently True, False, or Unknown?
|
||||
type: string
|
||||
type:
|
||||
description: Type of this condition. At most one of each condition type may apply to a resource at any point in time.
|
||||
type: string
|
||||
required:
|
||||
- lastTransitionTime
|
||||
- reason
|
||||
- status
|
||||
- type
|
||||
type: object
|
||||
type: array
|
||||
currentBatch:
|
||||
description: The current batch the rollout is working on/blocked it starts from 0
|
||||
format: int32
|
||||
type: integer
|
||||
lastAppliedPodTemplateIdentifier:
|
||||
description: lastAppliedPodTemplateIdentifier is a string that uniquely represent the last pod template each workload type could use different ways to identify that so we cannot compare between resources We update this field only after a successful rollout
|
||||
type: string
|
||||
lastTargetAppRevision:
|
||||
description: LastUpgradedTargetAppRevision contains the name of the app that we upgraded to We will restart the rollout if this is not the same as the spec
|
||||
type: string
|
||||
rollingState:
|
||||
description: RollingState is the Rollout State
|
||||
type: string
|
||||
rolloutOriginalSize:
|
||||
description: RolloutTargetSize is the size of the target resources. This is determined once the initial spec verification and does not change until the rollout is restarted
|
||||
format: int32
|
||||
type: integer
|
||||
rolloutTargetSize:
|
||||
description: RolloutTargetSize is the size of the target resources. This is determined once the initial spec verification and does not change until the rollout is restarted
|
||||
format: int32
|
||||
type: integer
|
||||
targetGeneration:
|
||||
description: NewPodTemplateIdentifier is a string that uniquely represent the new pod template each workload type could use different ways to identify that so we cannot compare between resources
|
||||
type: string
|
||||
upgradedReadyReplicas:
|
||||
description: UpgradedReadyReplicas is the number of Pods upgraded by the rollout controller that have a Ready Condition.
|
||||
format: int32
|
||||
type: integer
|
||||
upgradedReplicas:
|
||||
description: UpgradedReplicas is the number of Pods upgraded by the rollout controller
|
||||
format: int32
|
||||
type: integer
|
||||
required:
|
||||
- currentBatch
|
||||
- lastTargetAppRevision
|
||||
- rollingState
|
||||
- upgradedReadyReplicas
|
||||
- upgradedReplicas
|
||||
type: object
|
||||
services:
|
||||
description: Services record the status of the application services
|
||||
items:
|
||||
@@ -418,6 +498,28 @@ spec:
|
||||
type: string
|
||||
name:
|
||||
type: string
|
||||
scopes:
|
||||
items:
|
||||
description: A TypedReference refers to an object by Name, Kind, and APIVersion. It is commonly used to reference cluster-scoped objects or objects where the namespace is already known.
|
||||
properties:
|
||||
apiVersion:
|
||||
description: APIVersion of the referenced object.
|
||||
type: string
|
||||
kind:
|
||||
description: Kind of the referenced object.
|
||||
type: string
|
||||
name:
|
||||
description: Name of the referenced object.
|
||||
type: string
|
||||
uid:
|
||||
description: UID of the referenced object.
|
||||
type: string
|
||||
required:
|
||||
- apiVersion
|
||||
- kind
|
||||
- name
|
||||
type: object
|
||||
type: array
|
||||
traits:
|
||||
items:
|
||||
description: ApplicationTraitStatus records the trait health status
|
||||
@@ -433,6 +535,17 @@ spec:
|
||||
- type
|
||||
type: object
|
||||
type: array
|
||||
workloadDefinition:
|
||||
description: WorkloadDefinition is the definition of a WorkloadDefinition, such as deployments/apps.v1
|
||||
properties:
|
||||
apiVersion:
|
||||
type: string
|
||||
kind:
|
||||
type: string
|
||||
required:
|
||||
- apiVersion
|
||||
- kind
|
||||
type: object
|
||||
required:
|
||||
- healthy
|
||||
- name
|
||||
@@ -441,29 +554,32 @@ spec:
|
||||
status:
|
||||
description: ApplicationPhase is a label for the condition of a application at the current time
|
||||
type: string
|
||||
targetGeneration:
|
||||
description: NewPodTemplateIdentifier is a string that uniquely represent the new pod template each workload type could use different ways to identify that so we cannot compare between resources
|
||||
type: string
|
||||
upgradedReadyReplicas:
|
||||
description: UpgradedReadyReplicas is the number of Pods upgraded by the rollout controller that have a Ready Condition.
|
||||
format: int32
|
||||
type: integer
|
||||
upgradedReplicas:
|
||||
description: UpgradedReplicas is the number of Pods upgraded by the rollout controller
|
||||
format: int32
|
||||
type: integer
|
||||
required:
|
||||
- currentBatch
|
||||
- rollingState
|
||||
- upgradedReadyReplicas
|
||||
- upgradedReplicas
|
||||
type: object
|
||||
type: object
|
||||
served: true
|
||||
storage: false
|
||||
subresources:
|
||||
status: {}
|
||||
- name: v1beta1
|
||||
- additionalPrinterColumns:
|
||||
- jsonPath: .spec.components[*].name
|
||||
name: COMPONENT
|
||||
type: string
|
||||
- jsonPath: .spec.components[*].type
|
||||
name: TYPE
|
||||
type: string
|
||||
- jsonPath: .status.status
|
||||
name: PHASE
|
||||
type: string
|
||||
- jsonPath: .status.services[*].healthy
|
||||
name: HEALTHY
|
||||
type: boolean
|
||||
- jsonPath: .status.services[*].message
|
||||
name: STATUS
|
||||
type: string
|
||||
- jsonPath: .metadata.creationTimestamp
|
||||
name: AGE
|
||||
type: date
|
||||
name: v1beta1
|
||||
schema:
|
||||
openAPIV3Schema:
|
||||
description: Application is the Schema for the applications API
|
||||
@@ -739,9 +855,6 @@ spec:
|
||||
status:
|
||||
description: AppStatus defines the observed state of Application
|
||||
properties:
|
||||
batchRollingState:
|
||||
description: BatchRollingState only meaningful when the Status is rolling
|
||||
type: string
|
||||
components:
|
||||
description: Components record the related Components created by Application Controller
|
||||
items:
|
||||
@@ -793,13 +906,6 @@ spec:
|
||||
- type
|
||||
type: object
|
||||
type: array
|
||||
currentBatch:
|
||||
description: The current batch the rollout is working on/blocked it starts from 0
|
||||
format: int32
|
||||
type: integer
|
||||
lastAppliedPodTemplateIdentifier:
|
||||
description: lastAppliedPodTemplateIdentifier is a string that uniquely represent the last pod template each workload type could use different ways to identify that so we cannot compare between resources We update this field only after a successful rollout
|
||||
type: string
|
||||
latestRevision:
|
||||
description: LatestRevision of the application configuration it generates
|
||||
properties:
|
||||
@@ -835,13 +941,82 @@ spec:
|
||||
- kind
|
||||
- name
|
||||
type: object
|
||||
rollingState:
|
||||
description: RollingState is the Rollout State
|
||||
type: string
|
||||
rolloutTargetSize:
|
||||
description: RolloutTargetTotalSize 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
|
||||
rollout:
|
||||
description: AppRolloutStatus defines the observed state of AppRollout
|
||||
properties:
|
||||
LastSourceAppRevision:
|
||||
description: LastSourceAppRevision contains the name of the app that we need to upgrade from. We will restart the rollout if this is not the same as the spec
|
||||
type: string
|
||||
batchRollingState:
|
||||
description: BatchRollingState only meaningful when the Status is rolling
|
||||
type: string
|
||||
conditions:
|
||||
description: Conditions of the resource.
|
||||
items:
|
||||
description: A Condition that may apply to a resource.
|
||||
properties:
|
||||
lastTransitionTime:
|
||||
description: LastTransitionTime is the last time this condition transitioned from one status to another.
|
||||
format: date-time
|
||||
type: string
|
||||
message:
|
||||
description: A Message containing details about this condition's last transition from one status to another, if any.
|
||||
type: string
|
||||
reason:
|
||||
description: A Reason for this condition's last transition from one status to another.
|
||||
type: string
|
||||
status:
|
||||
description: Status of this condition; is it currently True, False, or Unknown?
|
||||
type: string
|
||||
type:
|
||||
description: Type of this condition. At most one of each condition type may apply to a resource at any point in time.
|
||||
type: string
|
||||
required:
|
||||
- lastTransitionTime
|
||||
- reason
|
||||
- status
|
||||
- type
|
||||
type: object
|
||||
type: array
|
||||
currentBatch:
|
||||
description: The current batch the rollout is working on/blocked it starts from 0
|
||||
format: int32
|
||||
type: integer
|
||||
lastAppliedPodTemplateIdentifier:
|
||||
description: lastAppliedPodTemplateIdentifier is a string that uniquely represent the last pod template each workload type could use different ways to identify that so we cannot compare between resources We update this field only after a successful rollout
|
||||
type: string
|
||||
lastTargetAppRevision:
|
||||
description: LastUpgradedTargetAppRevision contains the name of the app that we upgraded to We will restart the rollout if this is not the same as the spec
|
||||
type: string
|
||||
rollingState:
|
||||
description: RollingState is the Rollout State
|
||||
type: string
|
||||
rolloutOriginalSize:
|
||||
description: RolloutTargetSize is the size of the target resources. This is determined once the initial spec verification and does not change until the rollout is restarted
|
||||
format: int32
|
||||
type: integer
|
||||
rolloutTargetSize:
|
||||
description: RolloutTargetSize is the size of the target resources. This is determined once the initial spec verification and does not change until the rollout is restarted
|
||||
format: int32
|
||||
type: integer
|
||||
targetGeneration:
|
||||
description: NewPodTemplateIdentifier is a string that uniquely represent the new pod template each workload type could use different ways to identify that so we cannot compare between resources
|
||||
type: string
|
||||
upgradedReadyReplicas:
|
||||
description: UpgradedReadyReplicas is the number of Pods upgraded by the rollout controller that have a Ready Condition.
|
||||
format: int32
|
||||
type: integer
|
||||
upgradedReplicas:
|
||||
description: UpgradedReplicas is the number of Pods upgraded by the rollout controller
|
||||
format: int32
|
||||
type: integer
|
||||
required:
|
||||
- currentBatch
|
||||
- lastTargetAppRevision
|
||||
- rollingState
|
||||
- upgradedReadyReplicas
|
||||
- upgradedReplicas
|
||||
type: object
|
||||
services:
|
||||
description: Services record the status of the application services
|
||||
items:
|
||||
@@ -853,6 +1028,28 @@ spec:
|
||||
type: string
|
||||
name:
|
||||
type: string
|
||||
scopes:
|
||||
items:
|
||||
description: A TypedReference refers to an object by Name, Kind, and APIVersion. It is commonly used to reference cluster-scoped objects or objects where the namespace is already known.
|
||||
properties:
|
||||
apiVersion:
|
||||
description: APIVersion of the referenced object.
|
||||
type: string
|
||||
kind:
|
||||
description: Kind of the referenced object.
|
||||
type: string
|
||||
name:
|
||||
description: Name of the referenced object.
|
||||
type: string
|
||||
uid:
|
||||
description: UID of the referenced object.
|
||||
type: string
|
||||
required:
|
||||
- apiVersion
|
||||
- kind
|
||||
- name
|
||||
type: object
|
||||
type: array
|
||||
traits:
|
||||
items:
|
||||
description: ApplicationTraitStatus records the trait health status
|
||||
@@ -868,6 +1065,17 @@ spec:
|
||||
- type
|
||||
type: object
|
||||
type: array
|
||||
workloadDefinition:
|
||||
description: WorkloadDefinition is the definition of a WorkloadDefinition, such as deployments/apps.v1
|
||||
properties:
|
||||
apiVersion:
|
||||
type: string
|
||||
kind:
|
||||
type: string
|
||||
required:
|
||||
- apiVersion
|
||||
- kind
|
||||
type: object
|
||||
required:
|
||||
- healthy
|
||||
- name
|
||||
@@ -876,22 +1084,6 @@ spec:
|
||||
status:
|
||||
description: ApplicationPhase is a label for the condition of a application at the current time
|
||||
type: string
|
||||
targetGeneration:
|
||||
description: NewPodTemplateIdentifier is a string that uniquely represent the new pod template each workload type could use different ways to identify that so we cannot compare between resources
|
||||
type: string
|
||||
upgradedReadyReplicas:
|
||||
description: UpgradedReadyReplicas is the number of Pods upgraded by the rollout controller that have a Ready Condition.
|
||||
format: int32
|
||||
type: integer
|
||||
upgradedReplicas:
|
||||
description: UpgradedReplicas is the number of Pods upgraded by the rollout controller
|
||||
format: int32
|
||||
type: integer
|
||||
required:
|
||||
- currentBatch
|
||||
- rollingState
|
||||
- upgradedReadyReplicas
|
||||
- upgradedReplicas
|
||||
type: object
|
||||
type: object
|
||||
served: true
|
||||
|
||||
@@ -14,10 +14,31 @@ spec:
|
||||
kind: AppRollout
|
||||
listKind: AppRolloutList
|
||||
plural: approllouts
|
||||
shortNames:
|
||||
- approllout
|
||||
singular: approllout
|
||||
scope: Namespaced
|
||||
versions:
|
||||
- name: v1alpha2
|
||||
- additionalPrinterColumns:
|
||||
- jsonPath: .status.rolloutStatus.rolloutTargetSize
|
||||
name: TARGET
|
||||
type: string
|
||||
- jsonPath: .status.rolloutStatus.upgradedReplicas
|
||||
name: UPGRADED
|
||||
type: string
|
||||
- jsonPath: .status.rolloutStatus.upgradedReadyReplicas
|
||||
name: READY
|
||||
type: string
|
||||
- jsonPath: .status.rolloutStatus.batchRollingState
|
||||
name: BATCH-STATE
|
||||
type: string
|
||||
- jsonPath: .status.rolloutStatus.rollingState
|
||||
name: ROLLING-STATE
|
||||
type: string
|
||||
- jsonPath: .metadata.creationTimestamp
|
||||
name: AGE
|
||||
type: date
|
||||
name: v1alpha2
|
||||
schema:
|
||||
openAPIV3Schema:
|
||||
description: AppRollout is the Schema for the AppRollout API
|
||||
@@ -319,8 +340,12 @@ spec:
|
||||
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: RolloutTargetTotalSize is the size of the target resources. This is determined once the initial spec verification and does not change until the rollout is restarted
|
||||
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:
|
||||
@@ -346,7 +371,26 @@ spec:
|
||||
storage: false
|
||||
subresources:
|
||||
status: {}
|
||||
- name: v1beta1
|
||||
- additionalPrinterColumns:
|
||||
- jsonPath: .status.rolloutTargetSize
|
||||
name: TARGET
|
||||
type: string
|
||||
- jsonPath: .status.upgradedReplicas
|
||||
name: UPGRADED
|
||||
type: string
|
||||
- jsonPath: .status.upgradedReadyReplicas
|
||||
name: READY
|
||||
type: string
|
||||
- jsonPath: .status.batchRollingState
|
||||
name: BATCH-STATE
|
||||
type: string
|
||||
- jsonPath: .status.rollingState
|
||||
name: ROLLING-STATE
|
||||
type: string
|
||||
- jsonPath: .metadata.creationTimestamp
|
||||
name: AGE
|
||||
type: date
|
||||
name: v1beta1
|
||||
schema:
|
||||
openAPIV3Schema:
|
||||
description: AppRollout is the Schema for the AppRollout API
|
||||
@@ -368,7 +412,7 @@ spec:
|
||||
type: string
|
||||
type: array
|
||||
revertOnDelete:
|
||||
description: RevertOnDelete revert the rollout when the rollout CR is deleted It will remove the target app from the kubernetes if it's set to true
|
||||
description: RevertOnDelete revert the failed rollout when the rollout CR is deleted It will revert the change back to the source version at once (not in batches) Default is false
|
||||
type: boolean
|
||||
rolloutPlan:
|
||||
description: RolloutPlan is the details on how to rollout the resources
|
||||
@@ -648,8 +692,12 @@ spec:
|
||||
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: RolloutTargetTotalSize is the size of the target resources. This is determined once the initial spec verification and does not change until the rollout is restarted
|
||||
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:
|
||||
|
||||
@@ -14,10 +14,19 @@ spec:
|
||||
kind: ComponentDefinition
|
||||
listKind: ComponentDefinitionList
|
||||
plural: componentdefinitions
|
||||
shortNames:
|
||||
- comp
|
||||
singular: componentdefinition
|
||||
scope: Namespaced
|
||||
versions:
|
||||
- name: v1alpha2
|
||||
- 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
|
||||
@@ -134,6 +143,22 @@ spec:
|
||||
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
|
||||
type:
|
||||
default: hcl
|
||||
description: Type specifies which Terraform configuration it is, HCL or JSON syntax
|
||||
enum:
|
||||
- hcl
|
||||
- json
|
||||
type: string
|
||||
required:
|
||||
- configuration
|
||||
type: object
|
||||
type: object
|
||||
status:
|
||||
description: Status defines the custom health policy and status message for workload
|
||||
@@ -200,13 +225,35 @@ spec:
|
||||
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: {}
|
||||
- name: v1beta1
|
||||
- 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
|
||||
@@ -323,6 +370,22 @@ spec:
|
||||
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
|
||||
type:
|
||||
default: hcl
|
||||
description: Type specifies which Terraform configuration it is, HCL or JSON syntax
|
||||
enum:
|
||||
- hcl
|
||||
- json
|
||||
type: string
|
||||
required:
|
||||
- configuration
|
||||
type: object
|
||||
type: object
|
||||
status:
|
||||
description: Status defines the custom health policy and status message for workload
|
||||
@@ -389,6 +452,21 @@ spec:
|
||||
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
|
||||
|
||||
487
charts/vela-core/crds/core.oam.dev_definitionrevisions.yaml
Normal file
487
charts/vela-core/crds/core.oam.dev_definitionrevisions.yaml
Normal file
@@ -0,0 +1,487 @@
|
||||
|
||||
---
|
||||
apiVersion: apiextensions.k8s.io/v1
|
||||
kind: CustomResourceDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.2.4
|
||||
name: definitionrevisions.core.oam.dev
|
||||
spec:
|
||||
group: core.oam.dev
|
||||
names:
|
||||
categories:
|
||||
- oam
|
||||
kind: DefinitionRevision
|
||||
listKind: DefinitionRevisionList
|
||||
plural: definitionrevisions
|
||||
shortNames:
|
||||
- comprev
|
||||
singular: definitionrevision
|
||||
scope: Namespaced
|
||||
versions:
|
||||
- additionalPrinterColumns:
|
||||
- jsonPath: .spec.revision
|
||||
name: REVISION
|
||||
type: integer
|
||||
- jsonPath: .spec.revisionHash
|
||||
name: HASH
|
||||
type: string
|
||||
- jsonPath: .spec.definitionType
|
||||
name: TYPE
|
||||
type: string
|
||||
name: v1beta1
|
||||
schema:
|
||||
openAPIV3Schema:
|
||||
description: DefinitionRevision is the Schema for the DefinitionRevision 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: DefinitionRevisionSpec is the spec of DefinitionRevision
|
||||
properties:
|
||||
componentDefinition:
|
||||
description: ComponentDefinition records the snapshot of the created/modified ComponentDefinition
|
||||
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
|
||||
type:
|
||||
default: hcl
|
||||
description: Type specifies which Terraform configuration it is, HCL or JSON syntax
|
||||
enum:
|
||||
- hcl
|
||||
- json
|
||||
type: string
|
||||
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
|
||||
definitionType:
|
||||
description: DefinitionType
|
||||
enum:
|
||||
- Component
|
||||
- Trait
|
||||
type: string
|
||||
revision:
|
||||
description: Revision record revision number of DefinitionRevision
|
||||
format: int64
|
||||
type: integer
|
||||
revisionHash:
|
||||
description: RevisionHash record the hash value of the spec of DefinitionRevision object.
|
||||
type: string
|
||||
traitDefinition:
|
||||
description: TraitDefinition records the snapshot of the created/modified TraitDefinition
|
||||
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
|
||||
type:
|
||||
default: hcl
|
||||
description: Type specifies which Terraform configuration it is, HCL or JSON syntax
|
||||
enum:
|
||||
- hcl
|
||||
- json
|
||||
type: string
|
||||
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 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
|
||||
required:
|
||||
- definitionType
|
||||
- revision
|
||||
- revisionHash
|
||||
type: object
|
||||
type: object
|
||||
served: true
|
||||
storage: true
|
||||
subresources: {}
|
||||
status:
|
||||
acceptedNames:
|
||||
kind: ""
|
||||
plural: ""
|
||||
conditions: []
|
||||
storedVersions: []
|
||||
@@ -14,6 +14,8 @@ spec:
|
||||
kind: ResourceTracker
|
||||
listKind: ResourceTrackerList
|
||||
plural: resourcetrackers
|
||||
shortNames:
|
||||
- tracker
|
||||
singular: resourcetracker
|
||||
scope: Cluster
|
||||
versions:
|
||||
@@ -30,9 +32,40 @@ spec:
|
||||
type: string
|
||||
metadata:
|
||||
type: object
|
||||
status:
|
||||
description: ResourceTrackerStatus define the status of resourceTracker
|
||||
properties:
|
||||
trackedResources:
|
||||
items:
|
||||
description: A TypedReference refers to an object by Name, Kind, and APIVersion. It is commonly used to reference across-namespace objects
|
||||
properties:
|
||||
apiVersion:
|
||||
description: APIVersion of the referenced object.
|
||||
type: string
|
||||
kind:
|
||||
description: Kind of the referenced object.
|
||||
type: string
|
||||
name:
|
||||
description: Name of the referenced object.
|
||||
type: string
|
||||
namespace:
|
||||
description: Namespace of the objects outside the application namespace.
|
||||
type: string
|
||||
uid:
|
||||
description: UID of the referenced object.
|
||||
type: string
|
||||
required:
|
||||
- apiVersion
|
||||
- kind
|
||||
- name
|
||||
type: object
|
||||
type: array
|
||||
type: object
|
||||
type: object
|
||||
served: true
|
||||
storage: true
|
||||
subresources:
|
||||
status: {}
|
||||
status:
|
||||
acceptedNames:
|
||||
kind: ""
|
||||
|
||||
@@ -14,6 +14,8 @@ spec:
|
||||
kind: ScopeDefinition
|
||||
listKind: ScopeDefinitionList
|
||||
plural: scopedefinitions
|
||||
shortNames:
|
||||
- scope
|
||||
singular: scopedefinition
|
||||
scope: Namespaced
|
||||
versions:
|
||||
|
||||
@@ -14,12 +14,17 @@ spec:
|
||||
kind: TraitDefinition
|
||||
listKind: TraitDefinitionList
|
||||
plural: traitdefinitions
|
||||
shortNames:
|
||||
- trait
|
||||
singular: traitdefinition
|
||||
scope: Namespaced
|
||||
versions:
|
||||
- additionalPrinterColumns:
|
||||
- jsonPath: .spec.definitionRef.name
|
||||
name: DEFINITION-NAME
|
||||
- jsonPath: .spec.appliesToWorkloads
|
||||
name: APPLIES-TO
|
||||
type: string
|
||||
- jsonPath: .metadata.annotations.definition\.oam\.dev/description
|
||||
name: DESCRIPTION
|
||||
type: string
|
||||
name: v1alpha2
|
||||
schema:
|
||||
@@ -63,6 +68,9 @@ spec:
|
||||
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
|
||||
@@ -136,6 +144,22 @@ spec:
|
||||
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
|
||||
type:
|
||||
default: hcl
|
||||
description: Type specifies which Terraform configuration it is, HCL or JSON syntax
|
||||
enum:
|
||||
- hcl
|
||||
- json
|
||||
type: string
|
||||
required:
|
||||
- configuration
|
||||
type: object
|
||||
type: object
|
||||
status:
|
||||
description: Status defines the custom health policy and status message for trait
|
||||
@@ -185,6 +209,21 @@ spec:
|
||||
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
|
||||
@@ -192,8 +231,11 @@ spec:
|
||||
subresources:
|
||||
status: {}
|
||||
- additionalPrinterColumns:
|
||||
- jsonPath: .spec.definitionRef.name
|
||||
name: DEFINITION-NAME
|
||||
- jsonPath: .spec.appliesToWorkloads
|
||||
name: APPLIES-TO
|
||||
type: string
|
||||
- jsonPath: .metadata.annotations.definition\.oam\.dev/description
|
||||
name: DESCRIPTION
|
||||
type: string
|
||||
name: v1beta1
|
||||
schema:
|
||||
@@ -237,6 +279,9 @@ spec:
|
||||
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
|
||||
@@ -310,6 +355,22 @@ spec:
|
||||
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
|
||||
type:
|
||||
default: hcl
|
||||
description: Type specifies which Terraform configuration it is, HCL or JSON syntax
|
||||
enum:
|
||||
- hcl
|
||||
- json
|
||||
type: string
|
||||
required:
|
||||
- configuration
|
||||
type: object
|
||||
type: object
|
||||
status:
|
||||
description: Status defines the custom health policy and status message for trait
|
||||
@@ -359,6 +420,21 @@ spec:
|
||||
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
|
||||
|
||||
@@ -14,6 +14,8 @@ spec:
|
||||
kind: WorkloadDefinition
|
||||
listKind: WorkloadDefinitionList
|
||||
plural: workloaddefinitions
|
||||
shortNames:
|
||||
- workload
|
||||
singular: workloaddefinition
|
||||
scope: Namespaced
|
||||
versions:
|
||||
@@ -150,6 +152,22 @@ spec:
|
||||
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
|
||||
type:
|
||||
default: hcl
|
||||
description: Type specifies which Terraform configuration it is, HCL or JSON syntax
|
||||
enum:
|
||||
- hcl
|
||||
- json
|
||||
type: string
|
||||
required:
|
||||
- configuration
|
||||
type: object
|
||||
type: object
|
||||
status:
|
||||
description: Status defines the custom health policy and status message for workload
|
||||
@@ -204,6 +222,9 @@ spec:
|
||||
- jsonPath: .spec.definitionRef.name
|
||||
name: DEFINITION-NAME
|
||||
type: string
|
||||
- jsonPath: .metadata.annotations.definition\.oam\.dev/description
|
||||
name: DESCRIPTION
|
||||
type: string
|
||||
name: v1beta1
|
||||
schema:
|
||||
openAPIV3Schema:
|
||||
@@ -333,6 +354,22 @@ spec:
|
||||
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
|
||||
type:
|
||||
default: hcl
|
||||
description: Type specifies which Terraform configuration it is, HCL or JSON syntax
|
||||
enum:
|
||||
- hcl
|
||||
- json
|
||||
type: string
|
||||
required:
|
||||
- configuration
|
||||
type: object
|
||||
type: object
|
||||
status:
|
||||
description: Status defines the custom health policy and status message for workload
|
||||
|
||||
@@ -9,6 +9,8 @@ metadata:
|
||||
spec:
|
||||
group: standard.oam.dev
|
||||
names:
|
||||
categories:
|
||||
- oam
|
||||
kind: RolloutTrait
|
||||
listKind: RolloutTraitList
|
||||
plural: rollouttraits
|
||||
@@ -340,8 +342,12 @@ spec:
|
||||
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: RolloutTargetTotalSize is the size of the target resources. This is determined once the initial spec verification and does not change until the rollout is restarted
|
||||
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:
|
||||
|
||||
@@ -1,21 +1 @@
|
||||
1. Get the application URL by running these commands:
|
||||
{{- if .Values.ingress.enabled }}
|
||||
{{- range $host := .Values.ingress.hosts }}
|
||||
{{- range .paths }}
|
||||
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ . }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- else if contains "NodePort" .Values.service.type }}
|
||||
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "kubevela.fullname" . }})
|
||||
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
|
||||
echo http://$NODE_IP:$NODE_PORT
|
||||
{{- else if contains "LoadBalancer" .Values.service.type }}
|
||||
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
|
||||
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "kubevela.fullname" . }}'
|
||||
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "kubevela.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
|
||||
echo http://$SERVICE_IP:{{ .Values.service.port }}
|
||||
{{- else if contains "ClusterIP" .Values.service.type }}
|
||||
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "kubevela.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
|
||||
echo "Visit http://127.0.0.1:8080 to use your application"
|
||||
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:80
|
||||
{{- end }}
|
||||
Welcome to use the KubeVela! Enjoy your shipping application journey!
|
||||
@@ -18,4 +18,11 @@ rules:
|
||||
verbs:
|
||||
- get
|
||||
- update
|
||||
- apiGroups:
|
||||
- apiextensions.k8s.io
|
||||
resources:
|
||||
- customresourcedefinitions
|
||||
verbs:
|
||||
- get
|
||||
- update
|
||||
{{- end }}
|
||||
|
||||
@@ -32,6 +32,7 @@ spec:
|
||||
- --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 }}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{{- if .Values.admissionWebhooks.enabled -}}
|
||||
apiVersion: admissionregistration.k8s.io/v1beta1
|
||||
apiVersion: admissionregistration.k8s.io/v1
|
||||
kind: MutatingWebhookConfiguration
|
||||
metadata:
|
||||
name: {{ template "kubevela.fullname" . }}-admission
|
||||
@@ -21,6 +21,7 @@ webhooks:
|
||||
failurePolicy: Fail
|
||||
{{- end }}
|
||||
name: mutating.core.oam.dev.v1alpha2.applicationconfigurations
|
||||
sideEffects: None
|
||||
rules:
|
||||
- apiGroups:
|
||||
- core.oam.dev
|
||||
@@ -47,6 +48,7 @@ webhooks:
|
||||
failurePolicy: Fail
|
||||
{{- end }}
|
||||
name: mutating.core.oam.dev.v1beta1.approllouts
|
||||
sideEffects: None
|
||||
rules:
|
||||
- apiGroups:
|
||||
- core.oam.dev
|
||||
@@ -70,9 +72,10 @@ webhooks:
|
||||
{{- if .Values.admissionWebhooks.patch.enabled }}
|
||||
failurePolicy: Ignore
|
||||
{{- else }}
|
||||
failurePolicy: Fails
|
||||
failurePolicy: Fail
|
||||
{{- end }}
|
||||
name: mutating.core.oam-dev.v1alpha2.components
|
||||
sideEffects: None
|
||||
rules:
|
||||
- apiGroups:
|
||||
- core.oam.dev
|
||||
@@ -87,28 +90,6 @@ webhooks:
|
||||
admissionReviewVersions:
|
||||
- v1beta1
|
||||
timeoutSeconds: 5
|
||||
- clientConfig:
|
||||
caBundle: Cg==
|
||||
service:
|
||||
name: {{ template "kubevela.name" . }}-webhook
|
||||
namespace: {{ .Release.Namespace }}
|
||||
path: /mutate-standard-oam-dev-v1alpha1-metricstrait
|
||||
{{- if .Values.admissionWebhooks.patch.enabled }}
|
||||
failurePolicy: Ignore
|
||||
{{- else }}
|
||||
failurePolicy: Fails
|
||||
{{- end }}
|
||||
name: mmetricstrait.kb.io
|
||||
rules:
|
||||
- apiGroups:
|
||||
- standard.oam.dev
|
||||
apiVersions:
|
||||
- v1alpha1
|
||||
operations:
|
||||
- CREATE
|
||||
- UPDATE
|
||||
resources:
|
||||
- metricstraits
|
||||
- clientConfig:
|
||||
caBundle: Cg==
|
||||
service:
|
||||
@@ -118,9 +99,12 @@ webhooks:
|
||||
{{- if .Values.admissionWebhooks.patch.enabled }}
|
||||
failurePolicy: Ignore
|
||||
{{- else }}
|
||||
failurePolicy: Fails
|
||||
failurePolicy: Fail
|
||||
{{- end }}
|
||||
name: mcontainerized.kb.io
|
||||
sideEffects: None
|
||||
admissionReviewVersions:
|
||||
- v1beta1
|
||||
rules:
|
||||
- apiGroups:
|
||||
- standard.oam.dev
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{{- if .Values.admissionWebhooks.enabled -}}
|
||||
apiVersion: admissionregistration.k8s.io/v1beta1
|
||||
apiVersion: admissionregistration.k8s.io/v1
|
||||
kind: ValidatingWebhookConfiguration
|
||||
metadata:
|
||||
name: {{ template "kubevela.fullname" . }}-admission
|
||||
@@ -21,6 +21,7 @@ webhooks:
|
||||
failurePolicy: {{ .Values.admissionWebhooks.failurePolicy }}
|
||||
{{- end }}
|
||||
name: validating.core.oam.dev.v1alpha2.applicationconfigurations
|
||||
sideEffects: None
|
||||
rules:
|
||||
- apiGroups:
|
||||
- core.oam.dev
|
||||
@@ -47,6 +48,7 @@ webhooks:
|
||||
failurePolicy: {{ .Values.admissionWebhooks.failurePolicy }}
|
||||
{{- end }}
|
||||
name: validating.core.oam.dev.v1beta1.approllouts
|
||||
sideEffects: None
|
||||
rules:
|
||||
- apiGroups:
|
||||
- core.oam.dev
|
||||
@@ -73,6 +75,7 @@ webhooks:
|
||||
failurePolicy: {{ .Values.admissionWebhooks.failurePolicy }}
|
||||
{{- end }}
|
||||
name: validating.core.oam.dev.v1alpha2.components
|
||||
sideEffects: None
|
||||
rules:
|
||||
- apiGroups:
|
||||
- core.oam.dev
|
||||
@@ -99,6 +102,9 @@ webhooks:
|
||||
failurePolicy: {{ .Values.admissionWebhooks.failurePolicy }}
|
||||
{{- end }}
|
||||
name: validating.core.oam.dev.v1alpha2.traitdefinitions
|
||||
sideEffects: None
|
||||
admissionReviewVersions:
|
||||
- v1beta1
|
||||
rules:
|
||||
- apiGroups:
|
||||
- core.oam.dev
|
||||
@@ -110,32 +116,7 @@ webhooks:
|
||||
resources:
|
||||
- traitdefinitions
|
||||
scope: Cluster
|
||||
admissionReviewVersions:
|
||||
- v1beta1
|
||||
timeoutSeconds: 5
|
||||
- clientConfig:
|
||||
caBundle: Cg==
|
||||
service:
|
||||
name: {{ template "kubevela.name" . }}-webhook
|
||||
namespace: {{ .Release.Namespace }}
|
||||
path: /validate-standard-oam-dev-v1alpha1-metricstrait
|
||||
{{- if .Values.admissionWebhooks.patch.enabled }}
|
||||
failurePolicy: Ignore
|
||||
{{- else }}
|
||||
failurePolicy: {{ .Values.admissionWebhooks.failurePolicy }}
|
||||
{{- end }}
|
||||
name: vmetricstrait.kb.io
|
||||
rules:
|
||||
- apiGroups:
|
||||
- standard.oam.dev
|
||||
apiVersions:
|
||||
- v1alpha1
|
||||
operations:
|
||||
- CREATE
|
||||
- UPDATE
|
||||
- DELETE
|
||||
resources:
|
||||
- metricstraits
|
||||
- clientConfig:
|
||||
caBundle: Cg==
|
||||
service:
|
||||
@@ -144,6 +125,9 @@ webhooks:
|
||||
path: /validate-standard-oam-dev-v1alpha1-podspecworkload
|
||||
failurePolicy: Fail
|
||||
name: vcontainerized.kb.io
|
||||
admissionReviewVersions:
|
||||
- v1beta1
|
||||
sideEffects: None
|
||||
rules:
|
||||
- apiGroups:
|
||||
- standard.oam.dev
|
||||
@@ -154,5 +138,29 @@ webhooks:
|
||||
- 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
|
||||
sideEffects: None
|
||||
rules:
|
||||
- apiGroups:
|
||||
- core.oam.dev
|
||||
apiVersions:
|
||||
- v1beta1
|
||||
operations:
|
||||
- CREATE
|
||||
- UPDATE
|
||||
resources:
|
||||
- applications
|
||||
{{- end -}}
|
||||
|
||||
24
charts/vela-core/templates/defwithtemplate/annotations.yaml
Normal file
24
charts/vela-core/templates/defwithtemplate/annotations.yaml
Normal file
@@ -0,0 +1,24 @@
|
||||
# Code generated by KubeVela templates. DO NOT EDIT.
|
||||
apiVersion: core.oam.dev/v1beta1
|
||||
kind: TraitDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
definition.oam.dev/description: "Add annotations for your Workload."
|
||||
name: annotations
|
||||
namespace: {{.Values.systemDefinitionNamespace}}
|
||||
spec:
|
||||
appliesToWorkloads:
|
||||
- deployments.apps
|
||||
podDisruptive: true
|
||||
schematic:
|
||||
cue:
|
||||
template: |-
|
||||
patch: {
|
||||
spec: template: metadata: annotations: {
|
||||
for k, v in parameter {
|
||||
"\(k)": v
|
||||
}
|
||||
}
|
||||
}
|
||||
parameter: [string]: string
|
||||
|
||||
51
charts/vela-core/templates/defwithtemplate/cpuscaler.yaml
Normal file
51
charts/vela-core/templates/defwithtemplate/cpuscaler.yaml
Normal file
@@ -0,0 +1,51 @@
|
||||
# Code generated by KubeVela templates. DO NOT EDIT.
|
||||
apiVersion: core.oam.dev/v1beta1
|
||||
kind: TraitDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
definition.oam.dev/description: "Automatically scale the component based on CPU usage."
|
||||
name: cpuscaler
|
||||
namespace: {{.Values.systemDefinitionNamespace}}
|
||||
spec:
|
||||
appliesToWorkloads:
|
||||
- webservice
|
||||
- worker
|
||||
schematic:
|
||||
cue:
|
||||
template: |
|
||||
outputs: cpuscaler: {
|
||||
apiVersion: "autoscaling/v2beta2"
|
||||
kind: "HorizontalPodAutoscaler"
|
||||
metadata: name: context.name
|
||||
spec: {
|
||||
scaleTargetRef: {
|
||||
apiVersion: "apps/v1"
|
||||
kind: "Deployment"
|
||||
name: context.name
|
||||
}
|
||||
minReplicas: parameter.min
|
||||
maxReplicas: parameter.max
|
||||
metrics: [{
|
||||
type: "Resource"
|
||||
resource: {
|
||||
name: "cpu"
|
||||
target: {
|
||||
type: "Utilization"
|
||||
averageUtilization: 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
|
||||
}
|
||||
|
||||
@@ -3,32 +3,33 @@ apiVersion: core.oam.dev/v1beta1
|
||||
kind: TraitDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
definition.oam.dev/description: "Configures K8s ingress and service to enable web traffic for your service.
|
||||
Please use route trait in cap center for advanced usage."
|
||||
definition.oam.dev/description: "Enable public web traffic for the component."
|
||||
name: ingress
|
||||
namespace: {{.Values.systemDefinitionNamespace}}
|
||||
spec:
|
||||
status:
|
||||
customStatus: |-
|
||||
if len(context.outputs.ingress.status.loadBalancer.ingress) > 0 {
|
||||
message: "Visiting URL: " + context.outputs.ingress.spec.rules[0].host + ", IP: " + context.outputs.ingress.status.loadBalancer.ingress[0].ip
|
||||
let igs = context.outputs.ingress.status.loadBalancer.ingress
|
||||
if igs == _|_ {
|
||||
message: "No loadBalancer found, visiting by using 'vela port-forward " + context.appName + " --route'\n"
|
||||
}
|
||||
if len(context.outputs.ingress.status.loadBalancer.ingress) == 0 {
|
||||
message: "No loadBalancer found, visiting by using 'vela port-forward " + context.appName + " --route'\n"
|
||||
if len(igs) > 0 {
|
||||
if igs[0].ip != _|_ {
|
||||
message: "Visiting URL: " + context.outputs.ingress.spec.rules[0].host + ", IP: " + igs[0].ip
|
||||
}
|
||||
if igs[0].ip == _|_ {
|
||||
message: "Visiting URL: " + context.outputs.ingress.spec.rules[0].host
|
||||
}
|
||||
}
|
||||
healthPolicy: |
|
||||
isHealth: len(context.outputs.service.spec.clusterIP) > 0
|
||||
appliesToWorkloads:
|
||||
- webservice
|
||||
- worker
|
||||
podDisruptive: false
|
||||
schematic:
|
||||
cue:
|
||||
template: |
|
||||
parameter: {
|
||||
domain: string
|
||||
http: [string]: int
|
||||
}
|
||||
|
||||
// trait template can have multiple outputs in one trait
|
||||
outputs: service: {
|
||||
apiVersion: "v1"
|
||||
@@ -71,3 +72,11 @@ spec:
|
||||
}
|
||||
}
|
||||
|
||||
parameter: {
|
||||
// +usage=Specify the domain you want to expose
|
||||
domain: string
|
||||
|
||||
// +usage=Specify the mapping relationship between the http path and the workload port
|
||||
http: [string]: int
|
||||
}
|
||||
|
||||
|
||||
24
charts/vela-core/templates/defwithtemplate/labels.yaml
Normal file
24
charts/vela-core/templates/defwithtemplate/labels.yaml
Normal file
@@ -0,0 +1,24 @@
|
||||
# Code generated by KubeVela templates. DO NOT EDIT.
|
||||
apiVersion: core.oam.dev/v1beta1
|
||||
kind: TraitDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
definition.oam.dev/description: "Add labels for your Workload."
|
||||
name: labels
|
||||
namespace: {{.Values.systemDefinitionNamespace}}
|
||||
spec:
|
||||
appliesToWorkloads:
|
||||
- deployments.apps
|
||||
podDisruptive: true
|
||||
schematic:
|
||||
cue:
|
||||
template: |-
|
||||
patch: {
|
||||
spec: template: metadata: labels: {
|
||||
for k, v in parameter {
|
||||
"\(k)": v
|
||||
}
|
||||
}
|
||||
}
|
||||
parameter: [string]: string
|
||||
|
||||
24
charts/vela-core/templates/defwithtemplate/scaler.yaml
Normal file
24
charts/vela-core/templates/defwithtemplate/scaler.yaml
Normal file
@@ -0,0 +1,24 @@
|
||||
# Code generated by KubeVela templates. DO NOT EDIT.
|
||||
apiVersion: core.oam.dev/v1beta1
|
||||
kind: TraitDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
definition.oam.dev/description: "Manually scale the component."
|
||||
name: scaler
|
||||
namespace: {{.Values.systemDefinitionNamespace}}
|
||||
spec:
|
||||
appliesToWorkloads:
|
||||
- webservice
|
||||
- worker
|
||||
podDisruptive: false
|
||||
schematic:
|
||||
cue:
|
||||
template: |
|
||||
patch: {
|
||||
spec: replicas: parameter.replicas
|
||||
}
|
||||
parameter: {
|
||||
// +usage=Specify the number of workload
|
||||
replicas: *1 | int
|
||||
}
|
||||
|
||||
50
charts/vela-core/templates/defwithtemplate/sidecar.yaml
Normal file
50
charts/vela-core/templates/defwithtemplate/sidecar.yaml
Normal file
@@ -0,0 +1,50 @@
|
||||
# Code generated by KubeVela templates. DO NOT EDIT.
|
||||
apiVersion: core.oam.dev/v1beta1
|
||||
kind: TraitDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
definition.oam.dev/description: "Inject a sidecar container to the component."
|
||||
name: sidecar
|
||||
namespace: {{.Values.systemDefinitionNamespace}}
|
||||
spec:
|
||||
appliesToWorkloads:
|
||||
- deployments.apps
|
||||
podDisruptive: true
|
||||
schematic:
|
||||
cue:
|
||||
template: |-
|
||||
patch: {
|
||||
// +patchKey=name
|
||||
spec: template: spec: containers: [{
|
||||
name: parameter.name
|
||||
image: parameter.image
|
||||
if parameter.cmd != _|_ {
|
||||
command: parameter.cmd
|
||||
}
|
||||
if parameter["volumes"] != _|_ {
|
||||
volumeMounts: [ for v in parameter.volumes {
|
||||
{
|
||||
mountPath: v.path
|
||||
name: v.name
|
||||
}
|
||||
}]
|
||||
}
|
||||
}]
|
||||
}
|
||||
parameter: {
|
||||
// +usage=Specify the name of sidecar container
|
||||
name: string
|
||||
|
||||
// +usage=Specify the image of sidecar container
|
||||
image: string
|
||||
|
||||
// +usage=Specify the commands run in the sidecar
|
||||
cmd?: [...string]
|
||||
|
||||
// +usage=Specify the shared volume path
|
||||
volumes?: [...{
|
||||
name: string
|
||||
path: string
|
||||
}]
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ spec:
|
||||
}
|
||||
}
|
||||
parameter: {
|
||||
// +usage=specify number of tasks to run in parallel
|
||||
// +usage=Specify number of tasks to run in parallel
|
||||
// +short=c
|
||||
count: *1 | int
|
||||
|
||||
|
||||
@@ -62,7 +62,50 @@ spec:
|
||||
cpu: parameter.cpu
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
}
|
||||
}}]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -100,5 +143,37 @@ spec:
|
||||
|
||||
// If addRevisionLabel is true, the appRevision label will be added to the underlying pods
|
||||
addRevisionLabel: *false | bool
|
||||
|
||||
// +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"
|
||||
}
|
||||
}]
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +35,50 @@ spec:
|
||||
if parameter["cmd"] != _|_ {
|
||||
command: parameter.cmd
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
}
|
||||
}}]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -47,5 +90,36 @@ spec:
|
||||
image: string
|
||||
// +usage=Commands to run in the container
|
||||
cmd?: [...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"
|
||||
}
|
||||
}]
|
||||
}
|
||||
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
{{- if .Values.ingress.enabled -}}
|
||||
{{- $fullName := include "kubevela.fullname" . -}}
|
||||
{{- $svcPort := .Values.service.port -}}
|
||||
{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
|
||||
apiVersion: networking.k8s.io/v1beta1
|
||||
{{- else -}}
|
||||
apiVersion: extensions/v1beta1
|
||||
{{- end }}
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: {{ $fullName }}
|
||||
labels:
|
||||
{{- include "kubevela.labels" . | nindent 4 }}
|
||||
{{- with .Values.ingress.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- if .Values.ingress.tls }}
|
||||
tls:
|
||||
{{- range .Values.ingress.tls }}
|
||||
- hosts:
|
||||
{{- range .hosts }}
|
||||
- {{ . | quote }}
|
||||
{{- end }}
|
||||
secretName: {{ .secretName }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
rules:
|
||||
{{- range .Values.ingress.hosts }}
|
||||
- host: {{ .host | quote }}
|
||||
http:
|
||||
paths:
|
||||
{{- range .paths }}
|
||||
- path: {{ . }}
|
||||
backend:
|
||||
serviceName: {{ $fullName }}
|
||||
servicePort: {{ $svcPort }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -107,6 +107,13 @@ spec:
|
||||
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 }}"
|
||||
@@ -120,6 +127,9 @@ spec:
|
||||
{{ if ne .Values.disableCaps "" }}
|
||||
- "--disable-caps={{ .Values.disableCaps }}"
|
||||
{{ end }}
|
||||
- "--system-definition-namespace={{ .Values.systemDefinitionNamespace }}"
|
||||
- "--application-revision-limit={{ .Values.applicationRevisionLimit }}"
|
||||
- "--definition-revision-limit={{ .Values.definitionRevisionLimit }}"
|
||||
image: {{ .Values.image.repository }}:{{ .Values.image.tag }}
|
||||
imagePullPolicy: {{ quote .Values.image.pullPolicy }}
|
||||
resources:
|
||||
|
||||
60
charts/vela-core/templates/test/test-application.yaml
Normal file
60
charts/vela-core/templates/test/test-application.yaml
Normal file
@@ -0,0 +1,60 @@
|
||||
apiVersion: core.oam.dev/v1beta1
|
||||
kind: Application
|
||||
metadata:
|
||||
annotations:
|
||||
helm.sh/hook: test-success
|
||||
name: first-vela-app
|
||||
spec:
|
||||
components:
|
||||
- name: express-server
|
||||
type: webservice
|
||||
properties:
|
||||
image: crccheck/hello-world
|
||||
port: 8000
|
||||
traits:
|
||||
- type: ingress
|
||||
properties:
|
||||
domain: testsvc.example.com
|
||||
http:
|
||||
"/": 8000
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
name: "{{ .Release.Name }}-application-test"
|
||||
annotations:
|
||||
"helm.sh/hook": test
|
||||
spec:
|
||||
serviceAccountName: kubevela-vela-core
|
||||
containers:
|
||||
- name: {{ .Release.Name }}-application-test
|
||||
image: alpine/k8s:1.18.2
|
||||
imagePullPolicy: IfNotPresent
|
||||
command:
|
||||
- /bin/bash
|
||||
- -ec
|
||||
- |
|
||||
|
||||
set -e
|
||||
|
||||
echo "Waiting application is ready..."
|
||||
|
||||
echo "waiting for application being Applied"
|
||||
kubectl -n vela-system wait --for=condition=Applied application first-vela-app --timeout=3m
|
||||
echo "application being Applied"
|
||||
|
||||
# wait for deploy being created
|
||||
echo "waiting for deployment being available"
|
||||
kubectl -n vela-system wait --for=condition=available deploy express-server --timeout 3m
|
||||
echo "deployment being available"
|
||||
|
||||
# wait for ingress being created
|
||||
while ! [ `kubectl -n vela-system get ing express-server | grep -v NAME | wc -l` = 1 ]; do
|
||||
echo "waiting for ingress being created"
|
||||
sleep 1
|
||||
done
|
||||
|
||||
|
||||
|
||||
echo "Application and its components are created"
|
||||
restartPolicy: Never
|
||||
@@ -1,15 +0,0 @@
|
||||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
name: "{{ include "kubevela.fullname" . }}-test-connection"
|
||||
labels:
|
||||
{{- include "kubevela.labels" . | nindent 4 }}
|
||||
annotations:
|
||||
"helm.sh/hook": test-success
|
||||
spec:
|
||||
containers:
|
||||
- name: wget
|
||||
image: busybox
|
||||
command: ['wget']
|
||||
args: ['{{ include "kubevela.fullname" . }}:{{ .Values.service.port }}']
|
||||
restartPolicy: Never
|
||||
@@ -38,24 +38,6 @@ securityContext: {}
|
||||
# runAsNonRoot: true
|
||||
# runAsUser: 1000
|
||||
|
||||
service:
|
||||
type: ClusterIP
|
||||
port: 80
|
||||
|
||||
ingress:
|
||||
enabled: false
|
||||
annotations: {}
|
||||
# kubernetes.io/ingress.class: nginx
|
||||
# kubernetes.io/tls-acme: "true"
|
||||
hosts:
|
||||
- host: chart-example.local
|
||||
paths: []
|
||||
tls: []
|
||||
# - secretName: chart-example-tls
|
||||
# hosts:
|
||||
# - chart-example.local
|
||||
|
||||
|
||||
resources:
|
||||
limits:
|
||||
cpu: 500m
|
||||
@@ -88,8 +70,8 @@ admissionWebhooks:
|
||||
patch:
|
||||
enabled: true
|
||||
image:
|
||||
repository: jettech/kube-webhook-certgen
|
||||
tag: v1.5.0
|
||||
repository: wonderflow/kube-webhook-certgen
|
||||
tag: v2.1
|
||||
pullPolicy: IfNotPresent
|
||||
affinity: {}
|
||||
tolerations: []
|
||||
@@ -97,4 +79,21 @@ admissionWebhooks:
|
||||
enabled: false
|
||||
|
||||
|
||||
#If non-empty, write log files in this path
|
||||
logFilePath: ""
|
||||
|
||||
#Defines the maximum size a log file can grow to. Unit is megabytes.
|
||||
#If the value is 0, the maximum file size is unlimited.
|
||||
logFileMaxSize: 1024
|
||||
|
||||
systemDefinitionNamespace: vela-system
|
||||
|
||||
applicationRevisionLimit: 10
|
||||
|
||||
definitionRevisionLimit: 20
|
||||
|
||||
# concurrentReconciles is the concurrent reconcile number of the controller
|
||||
concurrentReconciles: 4
|
||||
|
||||
# dependCheckWait is the time to wait for ApplicationConfiguration's dependent-resource ready
|
||||
dependCheckWait: 30s
|
||||
156
cmd/core/main.go
156
cmd/core/main.go
@@ -22,24 +22,17 @@ import (
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
"os/signal"
|
||||
"path/filepath"
|
||||
"strconv"
|
||||
"strings"
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
"github.com/crossplane/crossplane-runtime/pkg/logging"
|
||||
injectorcontroller "github.com/oam-dev/trait-injector/controllers"
|
||||
"github.com/oam-dev/trait-injector/pkg/injector"
|
||||
"github.com/oam-dev/trait-injector/pkg/plugin"
|
||||
"go.uber.org/zap/zapcore"
|
||||
"gopkg.in/natefinch/lumberjack.v2"
|
||||
"k8s.io/klog/v2"
|
||||
ctrl "sigs.k8s.io/controller-runtime"
|
||||
"sigs.k8s.io/controller-runtime/pkg/healthz"
|
||||
"sigs.k8s.io/controller-runtime/pkg/log/zap"
|
||||
|
||||
standardcontroller "github.com/oam-dev/kubevela/pkg/controller"
|
||||
commonconfig "github.com/oam-dev/kubevela/pkg/controller/common"
|
||||
oamcontroller "github.com/oam-dev/kubevela/pkg/controller/core.oam.dev"
|
||||
oamv1alpha2 "github.com/oam-dev/kubevela/pkg/controller/core.oam.dev/v1alpha2"
|
||||
"github.com/oam-dev/kubevela/pkg/controller/utils"
|
||||
@@ -58,7 +51,6 @@ const (
|
||||
)
|
||||
|
||||
var (
|
||||
setupLog = ctrl.Log.WithName(kubevelaName)
|
||||
scheme = common.Scheme
|
||||
waitSecretTimeout = 90 * time.Second
|
||||
waitSecretInterval = 2 * time.Second
|
||||
@@ -66,11 +58,11 @@ var (
|
||||
|
||||
func main() {
|
||||
var metricsAddr, logFilePath, leaderElectionNamespace string
|
||||
var enableLeaderElection, logCompress, logDebug bool
|
||||
var logRetainDate int
|
||||
var enableLeaderElection, logDebug bool
|
||||
var logFileMaxSize uint64
|
||||
var certDir string
|
||||
var webhookPort int
|
||||
var useWebhook, useTraitInjector bool
|
||||
var useWebhook bool
|
||||
var controllerArgs oamcontroller.Args
|
||||
var healthAddr string
|
||||
var disableCaps string
|
||||
@@ -79,7 +71,6 @@ func main() {
|
||||
var applyOnceOnly string
|
||||
|
||||
flag.BoolVar(&useWebhook, "use-webhook", false, "Enable Admission Webhook")
|
||||
flag.BoolVar(&useTraitInjector, "use-trait-injector", false, "Enable TraitInjector")
|
||||
flag.StringVar(&certDir, "webhook-cert-dir", "/k8s-webhook-server/serving-certs", "Admission webhook cert/key dir.")
|
||||
flag.IntVar(&webhookPort, "webhook-port", 9443, "admission webhook listen address")
|
||||
flag.StringVar(&metricsAddr, "metrics-addr", ":8080", "The address the metric endpoint binds to.")
|
||||
@@ -88,11 +79,14 @@ func main() {
|
||||
flag.StringVar(&leaderElectionNamespace, "leader-election-namespace", "",
|
||||
"Determines the namespace in which the leader election configmap will be created.")
|
||||
flag.StringVar(&logFilePath, "log-file-path", "", "The file to write logs to.")
|
||||
flag.IntVar(&logRetainDate, "log-retain-date", 7, "The number of days of logs history to retain.")
|
||||
flag.BoolVar(&logCompress, "log-compress", true, "Enable compression on the rotated logs.")
|
||||
flag.Uint64Var(&logFileMaxSize, "log-file-max-size", 1024, "Defines the maximum size a log file can grow to, Unit is megabytes.")
|
||||
flag.BoolVar(&logDebug, "log-debug", false, "Enable debug logs for development purpose")
|
||||
flag.IntVar(&controllerArgs.RevisionLimit, "revision-limit", 50,
|
||||
"RevisionLimit is the maximum number of revisions that will be maintained. The default value is 50.")
|
||||
flag.IntVar(&controllerArgs.AppRevisionLimit, "application-revision-limit", 10,
|
||||
"application-revision-limit is the maximum number of application useless revisions that will be maintained, if the useless revisions exceed this number, older ones will be GCed first.The default value is 10.")
|
||||
flag.IntVar(&controllerArgs.DefRevisionLimit, "definition-revision-limit", 20,
|
||||
"definition-revision-limit is the maximum number of component/trait definition useless revisions that will be maintained, if the useless revisions exceed this number, older ones will be GCed first.The default value is 20.")
|
||||
flag.StringVar(&controllerArgs.CustomRevisionHookURL, "custom-revision-hook-url", "",
|
||||
"custom-revision-hook-url is a webhook url which will let KubeVela core to call with applicationConfiguration and component info and return a customized component revision")
|
||||
flag.BoolVar(&controllerArgs.ApplicationConfigurationInstalled, "app-config-installed", true,
|
||||
@@ -105,29 +99,26 @@ func main() {
|
||||
flag.DurationVar(&syncPeriod, "informer-re-sync-interval", 60*time.Minute,
|
||||
"controller shared informer lister full re-sync period")
|
||||
flag.StringVar(&oam.SystemDefinitonNamespace, "system-definition-namespace", "vela-system", "define the namespace of the system-level definition")
|
||||
flag.Parse()
|
||||
flag.IntVar(&controllerArgs.ConcurrentReconciles, "concurrent-reconciles", 4, "concurrent-reconciles is the concurrent reconcile number of the controller. The default value is 4")
|
||||
flag.DurationVar(&controllerArgs.DependCheckWait, "depend-check-wait", 30*time.Second, "depend-check-wait is the time to wait for ApplicationConfiguration's dependent-resource ready."+
|
||||
"The default value is 30s, which means if dependent resources were not prepared, the ApplicationConfiguration would be reconciled after 30s.")
|
||||
|
||||
flag.Parse()
|
||||
// setup logging
|
||||
var w io.Writer
|
||||
if len(logFilePath) > 0 {
|
||||
w = zapcore.AddSync(&lumberjack.Logger{
|
||||
Filename: logFilePath,
|
||||
MaxAge: logRetainDate, // days
|
||||
Compress: logCompress,
|
||||
})
|
||||
} else {
|
||||
w = os.Stdout
|
||||
klog.InitFlags(nil)
|
||||
if logDebug {
|
||||
_ = flag.Set("v", strconv.Itoa(int(commonconfig.LogDebug)))
|
||||
}
|
||||
|
||||
logger := zap.New(func(o *zap.Options) {
|
||||
o.Development = logDebug
|
||||
o.DestWritter = w
|
||||
})
|
||||
ctrl.SetLogger(logger)
|
||||
if logFilePath != "" {
|
||||
_ = flag.Set("logtostderr", "false")
|
||||
_ = flag.Set("log_file", logFilePath)
|
||||
_ = flag.Set("log_file_max_size", strconv.FormatUint(logFileMaxSize, 10))
|
||||
}
|
||||
|
||||
setupLog.Info(fmt.Sprintf("KubeVela Version: %s, GIT Revision: %s.", version.VelaVersion, version.GitRevision))
|
||||
setupLog.Info(fmt.Sprintf("Disable Capabilities: %s.", disableCaps))
|
||||
setupLog.Info(fmt.Sprintf("core init with definition namespace %s", oam.SystemDefinitonNamespace))
|
||||
klog.InfoS("KubeVela information", "version", version.VelaVersion, "revision", version.GitRevision)
|
||||
klog.InfoS("Disable capabilities", "name", disableCaps)
|
||||
klog.InfoS("Vela-Core init", "definition namespace", oam.SystemDefinitonNamespace)
|
||||
|
||||
restConfig := ctrl.GetConfigOrDie()
|
||||
restConfig.UserAgent = kubevelaName + "/" + version.GitRevision
|
||||
@@ -144,109 +135,96 @@ func main() {
|
||||
SyncPeriod: &syncPeriod,
|
||||
})
|
||||
if err != nil {
|
||||
setupLog.Error(err, "unable to create a controller manager")
|
||||
klog.ErrorS(err, "Unable to create a controller manager")
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
if err := registerHealthChecks(mgr); err != nil {
|
||||
setupLog.Error(err, "unable to register ready/health checks")
|
||||
klog.ErrorS(err, "Unable to register ready/health checks")
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
if err := utils.CheckDisabledCapabilities(disableCaps); err != nil {
|
||||
setupLog.Error(err, "unable to get enabled capabilities")
|
||||
klog.ErrorS(err, "Unable to get enabled capabilities")
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
switch strings.ToLower(applyOnceOnly) {
|
||||
case "", "false", string(oamcontroller.ApplyOnceOnlyOff):
|
||||
controllerArgs.ApplyMode = oamcontroller.ApplyOnceOnlyOff
|
||||
setupLog.Info("ApplyOnceOnly is disabled")
|
||||
klog.Info("ApplyOnceOnly is disabled")
|
||||
case "true", string(oamcontroller.ApplyOnceOnlyOn):
|
||||
controllerArgs.ApplyMode = oamcontroller.ApplyOnceOnlyOn
|
||||
setupLog.Info("ApplyOnceOnly is enabled, that means workload or trait only apply once if no spec change even they are changed by others")
|
||||
klog.Info("ApplyOnceOnly is enabled, that means workload or trait only apply once if no spec change even they are changed by others")
|
||||
case string(oamcontroller.ApplyOnceOnlyForce):
|
||||
controllerArgs.ApplyMode = oamcontroller.ApplyOnceOnlyForce
|
||||
setupLog.Info("ApplyOnceOnlyForce is enabled, that means workload or trait only apply once if no spec change even they are changed or deleted by others")
|
||||
klog.Info("ApplyOnceOnlyForce is enabled, that means workload or trait only apply once if no spec change even they are changed or deleted by others")
|
||||
default:
|
||||
setupLog.Error(fmt.Errorf("invalid apply-once-only value: %s", applyOnceOnly),
|
||||
"unable to setup the vela core controller",
|
||||
"valid apply-once-only value:", "on/off/force, by default it's off")
|
||||
klog.ErrorS(fmt.Errorf("invalid apply-once-only value: %s", applyOnceOnly),
|
||||
"Unable to setup the vela core controller",
|
||||
"apply-once-only", "on/off/force, by default it's off")
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
dm, err := discoverymapper.New(mgr.GetConfig())
|
||||
if err != nil {
|
||||
setupLog.Error(err, "failed to create CRD discovery client")
|
||||
klog.ErrorS(err, "Failed to create CRD discovery client")
|
||||
os.Exit(1)
|
||||
}
|
||||
controllerArgs.DiscoveryMapper = dm
|
||||
pd, err := definition.NewPackageDiscover(mgr.GetConfig())
|
||||
if err != nil {
|
||||
setupLog.Error(err, "failed to create CRD discovery for CUE package client")
|
||||
os.Exit(1)
|
||||
klog.Error(err, "Failed to create CRD discovery for CUE package client")
|
||||
if !definition.IsCUEParseErr(err) {
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
controllerArgs.PackageDiscover = pd
|
||||
|
||||
if useWebhook {
|
||||
setupLog.Info("vela webhook enabled, will serving at :" + strconv.Itoa(webhookPort))
|
||||
klog.InfoS("Enable webhook", "server port", strconv.Itoa(webhookPort))
|
||||
oamwebhook.Register(mgr, controllerArgs)
|
||||
velawebhook.Register(mgr, disableCaps)
|
||||
if err := waitWebhookSecretVolume(certDir, waitSecretTimeout, waitSecretInterval); err != nil {
|
||||
setupLog.Error(err, "unable to get webhook secret")
|
||||
klog.ErrorS(err, "Unable to get webhook secret")
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
if err = oamv1alpha2.Setup(mgr, controllerArgs, logging.NewLogrLogger(setupLog)); err != nil {
|
||||
setupLog.Error(err, "unable to setup the oam core controller")
|
||||
if err = oamv1alpha2.Setup(mgr, controllerArgs); err != nil {
|
||||
klog.ErrorS(err, "Unable to setup the oam core controller")
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
if err = standardcontroller.Setup(mgr, disableCaps); err != nil {
|
||||
setupLog.Error(err, "unable to setup the vela core controller")
|
||||
klog.ErrorS(err, "Unable to setup the vela core controller")
|
||||
os.Exit(1)
|
||||
}
|
||||
if driver := os.Getenv(system.StorageDriverEnv); len(driver) == 0 {
|
||||
// first use system environment,
|
||||
err := os.Setenv(system.StorageDriverEnv, storageDriver)
|
||||
if err != nil {
|
||||
setupLog.Error(err, "unable to setup the vela core controller")
|
||||
klog.ErrorS(err, "Unable to setup the vela core controller")
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
setupLog.Info("use storage driver", "storageDriver", os.Getenv(system.StorageDriverEnv))
|
||||
klog.InfoS("Use storage driver", "storageDriver", os.Getenv(system.StorageDriverEnv))
|
||||
|
||||
if useTraitInjector {
|
||||
// register all service injectors
|
||||
plugin.RegisterTargetInjectors(injector.Defaults()...)
|
||||
klog.Info("Start the vela controller manager")
|
||||
|
||||
tiWebhook := &injectorcontroller.ServiceBindingReconciler{
|
||||
Client: mgr.GetClient(),
|
||||
Log: ctrl.Log.WithName("controllers").WithName("ServiceBinding"),
|
||||
Scheme: mgr.GetScheme(),
|
||||
Recorder: mgr.GetEventRecorderFor("servicebinding"),
|
||||
}
|
||||
if err = (tiWebhook).SetupWithManager(mgr); err != nil {
|
||||
setupLog.Error(err, "unable to create controller", "controller", "ServiceBinding")
|
||||
os.Exit(1)
|
||||
}
|
||||
// this has hard coded requirement "./ssl/service-injector.pem", "./ssl/service-injector.key"
|
||||
go tiWebhook.ServeAdmission()
|
||||
}
|
||||
|
||||
setupLog.Info("starting the vela controller manager")
|
||||
|
||||
if err := mgr.Start(makeSignalHandler()); err != nil {
|
||||
setupLog.Error(err, "problem running manager")
|
||||
if err := mgr.Start(ctrl.SetupSignalHandler()); err != nil {
|
||||
klog.ErrorS(err, "Failed to run manager")
|
||||
os.Exit(1)
|
||||
}
|
||||
setupLog.Info("program safely stops...")
|
||||
if logFilePath != "" {
|
||||
klog.Flush()
|
||||
}
|
||||
klog.Info("Safely stops Program...")
|
||||
}
|
||||
|
||||
// registerHealthChecks is used to create readiness&liveness probes
|
||||
func registerHealthChecks(mgr ctrl.Manager) error {
|
||||
setupLog.Info("creating readiness/health check")
|
||||
klog.Info("Create readiness/health check")
|
||||
if err := mgr.AddReadyzCheck("ping", healthz.Ping); err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -265,8 +243,8 @@ func waitWebhookSecretVolume(certDir string, timeout, interval time.Duration) er
|
||||
if time.Since(start) > timeout {
|
||||
return fmt.Errorf("getting webhook secret timeout after %s", timeout.String())
|
||||
}
|
||||
setupLog.Info(fmt.Sprintf("waiting webhook secret, time consumed: %d/%d seconds ...",
|
||||
int64(time.Since(start).Seconds()), int64(timeout.Seconds())))
|
||||
klog.InfoS("Wait webhook secret", "time consumed(second)", int64(time.Since(start).Seconds()),
|
||||
"timeout(second)", int64(timeout.Seconds()))
|
||||
if _, err := os.Stat(certDir); !os.IsNotExist(err) {
|
||||
ready := func() bool {
|
||||
f, err := os.Open(filepath.Clean(certDir))
|
||||
@@ -288,8 +266,8 @@ func waitWebhookSecretVolume(certDir string, timeout, interval time.Duration) er
|
||||
return nil
|
||||
})
|
||||
if err == nil {
|
||||
setupLog.Info(fmt.Sprintf("webhook secret is ready (time consumed: %d seconds)",
|
||||
int64(time.Since(start).Seconds())))
|
||||
klog.InfoS("Webhook secret is ready", "time consumed(second)",
|
||||
int64(time.Since(start).Seconds()))
|
||||
return true
|
||||
}
|
||||
return false
|
||||
@@ -300,21 +278,3 @@ func waitWebhookSecretVolume(certDir string, timeout, interval time.Duration) er
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func makeSignalHandler() (stopCh <-chan struct{}) {
|
||||
stop := make(chan struct{})
|
||||
c := make(chan os.Signal, 2)
|
||||
|
||||
signal.Notify(c, os.Interrupt, syscall.SIGTERM)
|
||||
|
||||
go func() {
|
||||
<-c
|
||||
close(stop)
|
||||
|
||||
// second signal. Exit directly.
|
||||
<-c
|
||||
os.Exit(1)
|
||||
}()
|
||||
|
||||
return stop
|
||||
}
|
||||
|
||||
64
cmd/core/main_e2e_test.go
Normal file
64
cmd/core/main_e2e_test.go
Normal file
@@ -0,0 +1,64 @@
|
||||
/*
|
||||
Copyright 2021 The KubeVela Authors.
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"os/signal"
|
||||
"strings"
|
||||
"syscall"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestE2EMain(t *testing.T) {
|
||||
fmt.Println("this is e2e test")
|
||||
var (
|
||||
args []string
|
||||
run bool
|
||||
)
|
||||
|
||||
for _, arg := range os.Args {
|
||||
switch {
|
||||
case strings.HasPrefix(arg, "__DEVEL__E2E"):
|
||||
run = true
|
||||
case strings.HasPrefix(arg, "-test"):
|
||||
default:
|
||||
args = append(args, arg)
|
||||
}
|
||||
}
|
||||
|
||||
if !run {
|
||||
return
|
||||
}
|
||||
|
||||
waitCh := make(chan int, 1)
|
||||
|
||||
//args=append(args, "leader-election-namespace='someNS'")
|
||||
os.Args = args
|
||||
go func() {
|
||||
main()
|
||||
close(waitCh)
|
||||
}()
|
||||
|
||||
signalCh := make(chan os.Signal, 1)
|
||||
signal.Notify(signalCh, syscall.SIGINT, syscall.SIGQUIT, syscall.SIGTERM, syscall.SIGHUP)
|
||||
select {
|
||||
case <-signalCh:
|
||||
case <-waitCh:
|
||||
}
|
||||
fmt.Println("exit test e2e main")
|
||||
}
|
||||
35
cmd/plugin/main.go
Normal file
35
cmd/plugin/main.go
Normal file
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
Copyright 2021. The KubeVela Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"math/rand"
|
||||
"os"
|
||||
"time"
|
||||
|
||||
"github.com/oam-dev/kubevela/pkg/plugin/cli"
|
||||
)
|
||||
|
||||
func main() {
|
||||
rand.Seed(time.Now().UnixNano())
|
||||
|
||||
command := cli.NewCommand()
|
||||
|
||||
if err := command.Execute(); err != nil {
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
@@ -2,5 +2,7 @@ coverage:
|
||||
status:
|
||||
project:
|
||||
default:
|
||||
threshold: 0.5%
|
||||
patch: off
|
||||
threshold: 0.1%
|
||||
patch:
|
||||
default:
|
||||
target: 70%
|
||||
|
||||
@@ -27,7 +27,7 @@ This design is based on and tries to resolve the following use cases:
|
||||
|
||||
The overall architecture diagram:
|
||||
|
||||

|
||||

|
||||
|
||||
Here's some explanation of the diagram:
|
||||
|
||||
@@ -39,19 +39,19 @@ Here's some explanation of the diagram:
|
||||
|
||||
The above architecture implies that the Vela APIServer could be used to multiple k8s clusters and catalogs. Below is what a deployment of Vela platform would look like:
|
||||
|
||||

|
||||

|
||||
|
||||
### 2. API Design
|
||||
|
||||
Below is the overall architecture of API grouping and storage:
|
||||
|
||||

|
||||

|
||||
|
||||
There are two distinguished layers:
|
||||
- **API layer**: It defines the API discovery and serving endpoints that Vela APIServer implementation must follow. This is the integration point for external system components (e.g. UI) to contact.
|
||||
- **Storage layer**: It describes the storage systems and objects that Vela APIServer syncs data with behind the scene. There are three types of storage:
|
||||
- **K8s cluster**: Vela APIServer manages multiple k8s clusters with regard to the applications and definitions custom resources.
|
||||
- **Catalog server**: Vela APIServer manages mulitple catalogs which contain COTS application pacakges. Currently in our use case the catalogs resides in Git repos. In the future we can extend this to other catalog storage like file server, object storage.
|
||||
- **Catalog server**: Vela APIServer manages multiple catalogs which contain COTS application pacakges. Currently in our use case the catalogs resides in Git repos. In the future we can extend this to other catalog storage like file server, object storage.
|
||||
- **MySQL database**: Vela APIServer stores global, cross-cluster, cross catalog information in a MySQL database. These data do not exist in k8s or catalog and thus need to be managed by APIServer in a separate database. The database is usually hosted on cloud.
|
||||
|
||||
#### Environment API
|
||||
@@ -313,7 +313,7 @@ Under the hood, APIServer will rescan the catalog.
|
||||
|
||||
Vela APIServer aggregates package information from multiple catalog servers. To download a package, the user first requests the APIServer to find the location of the catalog and the package. Then the user visits the catalog repo directly to download the package data. The workflow is shown as below:
|
||||
|
||||

|
||||

|
||||
|
||||
In our future roadmap, we will build a catalog controller for each k8s cluster. Then we will add API endpoint to install the package in APIServer which basically creates a CR to trigger the controller to reconcile package installation into the cluster. We choose this instead of APIServer installing the package because in this way we can bypass the APIServer in the package data transfer path and avoid APIServer becoming a single point of failure.
|
||||
|
||||
|
||||
@@ -105,7 +105,7 @@ In the following example, we are assuming the app has deployed v1 now and is upg
|
||||
|
||||
We will make sure the spec works for the following environments:
|
||||
|
||||
- K8s ingress + service (traffic split percetange determined by replica number)
|
||||
- K8s ingress + service (traffic split percentages determined by replica number)
|
||||
- Istio service mesh
|
||||
|
||||
Here is the workflow with Istio:
|
||||
|
||||
@@ -142,7 +142,7 @@ Besides the condition in `apply-once-only`, `apply-once-only-force` has one more
|
||||
|
||||
Three available options are provided to a vela-core runtime setup flag named `apply-one-only`, referring to three modes:
|
||||
|
||||
- off - `apply-once-only` is disabeld, this is the default option
|
||||
- off - `apply-once-only` is disabled, this is the default option
|
||||
- on - `apply-once-only` is enabled
|
||||
- force - `apply-once-only-force` is enabled
|
||||
|
||||
|
||||
@@ -152,7 +152,7 @@ status:
|
||||
# update with original manifest fails
|
||||
# reconciling also fails for cannot applying trait
|
||||
```
|
||||
Additonally, if a trait has no immutable field, update will eliminate all fields set by others.
|
||||
Additionally, if a trait has no immutable field, update will eliminate all fields set by others.
|
||||
```yaml
|
||||
# original trait manifest
|
||||
kind: Bar
|
||||
|
||||
@@ -136,7 +136,7 @@ const cueTemplate appCreateMode = "appFile"
|
||||
```go
|
||||
type appConfigValue struct {
|
||||
appName string `json:"appName"`
|
||||
defintion runtime.RawExtension `json:"defintion"` // the content
|
||||
definition runtime.RawExtension `json:"definition"` // the content
|
||||
definitionName string `json:"definitionName"` // use to find the definition
|
||||
definitionType string `json:"definitionType"`
|
||||
}
|
||||
@@ -161,7 +161,7 @@ const cueTemplate appUpdateMode = "appFile"
|
||||
```go
|
||||
|
||||
type appConfigValue struct {
|
||||
defintion runtime.RawExtension `json:"defintion"` // the content
|
||||
definition runtime.RawExtension `json:"definition"` // the content
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@@ -179,7 +179,7 @@ just change the application, and the system will pick up the change, then apply
|
||||
depends on the workload type and we will list each in the
|
||||
[rollout with different workload](#Rollout plan work with different type of workloads) section
|
||||
. This special AC logic is also the real magic for the other rollout scenario to work as AC
|
||||
controller is the only entity that is directly responsible for emiting the workload to the k8s.
|
||||
controller is the only entity that is directly responsible for emitting the workload to the k8s.
|
||||
|
||||
|
||||
#### ApplicationDeployment workflow
|
||||
@@ -293,7 +293,7 @@ the following fields:
|
||||
## State Transition
|
||||
Here is the state transition graph
|
||||
|
||||

|
||||

|
||||
|
||||
Here are the various top-level states of the rollout
|
||||
```go
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
# Route Trait Design
|
||||
|
||||
The main idea of route trait is to let users have an entrypoint to visit their App.
|
||||
The main idea of [route trait](https://github.com/oam-dev/catalog/tree/master/traits/routetrait) is to let users have an entrypoint to visit their App.
|
||||
|
||||
In k8s world, if you want to do so, you have to understand K8s [Serivce](https://kubernetes.io/docs/concepts/services-networking/service/)
|
||||
In k8s world, if you want to do so, you have to understand K8s [Service](https://kubernetes.io/docs/concepts/services-networking/service/)
|
||||
, [Ingress](https://kubernetes.io/docs/concepts/services-networking/ingress/), [Ingress Controllers](https://kubernetes.io/docs/concepts/services-networking/ingress-controllers/).
|
||||
It's not easy to get all of these things work well.
|
||||
|
||||
|
||||
72
docs/README.md
Normal file
72
docs/README.md
Normal file
@@ -0,0 +1,72 @@
|
||||
# Contributing to KubeVela Docs
|
||||
|
||||
[Here](https://github.com/oam-dev/kubevela/tree/master/docs) is the source documentation of [Kubevela website](http://kubevela.io/).
|
||||
Any files modifid here will trigger the `check-docs` Github action to run and validate the docs could be build successfully into the website.
|
||||
Any changes on these files(`docs/en/*`, `docs/en/resource/*`, `sidebars.js`) will be submitted to the corresponding locations of the repo
|
||||
[kubevela.io](https://github.com/oam-dev/kubevela.io). The Github-Action there will parse the document and publish it to the Kubevela Website automatically.
|
||||
|
||||
Please follow our guides below to learn how to write the docs in the right way.
|
||||
|
||||
## Add or Update Docs
|
||||
|
||||
When you add or modify the docs, these three files(`docs/en/`, `docs/en/resource/` and `sidebars.js`) should be taken into consideration.
|
||||
|
||||
1. `docs/en/`, the main English documentation files are mainly located in this folder. All markdown files need to follow the format,
|
||||
that the title at the beginning should be in the following format:
|
||||
|
||||
```markdown
|
||||
---
|
||||
title: Title Name
|
||||
---
|
||||
|
||||
```
|
||||
|
||||
When you want to add a link refer to any `.md` files inside the docs(`docs/en`), you need to use relative path and remove the `.md` suffix.
|
||||
For example, the `en/helm/component.md` has a link refer to `en/platform-engineers/definition-and-templates.md`. Then the format should like:
|
||||
|
||||
```markdown
|
||||
[the definition and template concepts](../platform-engineers/definition-and-templates)
|
||||
```
|
||||
|
||||
2. `docs/en/resource/`, image files are located in this folder. When you want to use link any image in documentation,
|
||||
you should put the image resources here and use a relative path like below:
|
||||
|
||||
```markdown
|
||||

|
||||
```
|
||||
|
||||
3. `sidebars.js`, this file contain the navigation information of the KubeVela website.
|
||||
Please read [the official docs of docusaurus](https://docusaurus.io/docs/sidebar) to learn how to write `sidebar.js`.
|
||||
|
||||
```js
|
||||
{
|
||||
type: 'category',
|
||||
label: 'Capability References',
|
||||
items: [
|
||||
// Note!: here must be add the path under "docs/en"
|
||||
'developers/references/README',
|
||||
'developers/references/workload-types/webservice',
|
||||
'developers/references/workload-types/task',
|
||||
...
|
||||
],
|
||||
},
|
||||
```
|
||||
|
||||
[comment]: <> (TODO: ADD how to translate into Chinese or other language here.)
|
||||
|
||||
## Local Development
|
||||
|
||||
You can preview the website locally with the `node` and `yarn` installed.
|
||||
Every time you modify the files under the docs, you need to re-run the following command, it will not sync automatically:
|
||||
|
||||
```shell
|
||||
make docs-start
|
||||
```
|
||||
|
||||
## Build in Local
|
||||
|
||||
You can build Kubevela website in local to test the correctness of docs, only run the following cmd:
|
||||
|
||||
```shell
|
||||
make docs-build
|
||||
```
|
||||
@@ -1,159 +0,0 @@
|
||||
/** @type {import('@docusaurus/types').DocusaurusConfig} */
|
||||
module.exports = {
|
||||
title: 'KubeVela',
|
||||
tagline: 'Make shipping applications more enjoyable.',
|
||||
url: 'https://kubevela.io',
|
||||
baseUrl: '/',
|
||||
onBrokenLinks: 'throw',
|
||||
onBrokenMarkdownLinks: 'warn',
|
||||
favicon: 'img/favicon.ico',
|
||||
organizationName: 'oam-dev', // Usually your GitHub org/user name.
|
||||
projectName: 'kubevela.io', // Usually your repo name.
|
||||
i18n: {
|
||||
defaultLocale: 'en',
|
||||
locales: ['en', 'zh'],
|
||||
localeConfigs: {
|
||||
en: {
|
||||
label: 'English',
|
||||
},
|
||||
zh: {
|
||||
label: '简体中文',
|
||||
},
|
||||
},
|
||||
},
|
||||
themeConfig: {
|
||||
navbar: {
|
||||
title: 'KubeVela',
|
||||
logo: {
|
||||
alt: 'KubeVela',
|
||||
src: 'img/logo.svg',
|
||||
srcDark: 'img/logoDark.svg',
|
||||
},
|
||||
items: [
|
||||
{
|
||||
type: 'docsVersionDropdown',
|
||||
position: 'right',
|
||||
},
|
||||
{
|
||||
to: 'docs/',
|
||||
activeBasePath: 'docs',
|
||||
label: 'Documentation',
|
||||
position: 'left',
|
||||
},
|
||||
{
|
||||
to: 'blog',
|
||||
label: 'Blog',
|
||||
position: 'left'
|
||||
},
|
||||
{
|
||||
type: 'localeDropdown',
|
||||
position: 'right',
|
||||
},
|
||||
{
|
||||
href: 'https://github.com/oam-dev/kubevela',
|
||||
className: 'header-githab-link',
|
||||
position: 'right',
|
||||
},
|
||||
],
|
||||
},
|
||||
footer: {
|
||||
links: [
|
||||
{
|
||||
title: 'Documentation',
|
||||
items: [
|
||||
{
|
||||
label: 'Getting Started',
|
||||
to: '/docs/install',
|
||||
},
|
||||
{
|
||||
label: 'Platform Builder Guide',
|
||||
to: '/docs/platform-engineers/overview',
|
||||
},
|
||||
{
|
||||
label: 'Developer Experience Guide',
|
||||
to: '/docs/quick-start-appfile',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: 'Community',
|
||||
items: [
|
||||
{
|
||||
label: 'Slack ( #kubevela channel )',
|
||||
href: 'https://slack.cncf.io/'
|
||||
},
|
||||
{
|
||||
label: 'Gitter',
|
||||
href: 'https://gitter.im/oam-dev/community',
|
||||
},
|
||||
{
|
||||
label: 'DingTalk (23310022)',
|
||||
href: '.',
|
||||
}
|
||||
],
|
||||
},
|
||||
{
|
||||
title: 'More',
|
||||
items: [
|
||||
{
|
||||
label: 'GitHub',
|
||||
href: 'https://github.com/oam-dev/kubevela',
|
||||
},
|
||||
{
|
||||
label: 'Blog',
|
||||
to: 'blog',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
copyright: `
|
||||
<br />
|
||||
<strong>© KubeVela Authors ${new Date().getFullYear()} | Documentation Distributed under <a herf="https://creativecommons.org/licenses/by/4.0">CC-BY-4.0</a> </strong>
|
||||
<br />
|
||||
`,
|
||||
},
|
||||
prism: {
|
||||
theme: require('prism-react-renderer/themes/dracula'),
|
||||
},
|
||||
},
|
||||
plugins: [
|
||||
[
|
||||
require.resolve("@easyops-cn/docusaurus-search-local"),
|
||||
{
|
||||
hashed: true,
|
||||
language: ["en", "zh"],
|
||||
indexBlog: true,
|
||||
},
|
||||
],
|
||||
],
|
||||
presets: [
|
||||
[
|
||||
'@docusaurus/preset-classic',
|
||||
{
|
||||
docs: {
|
||||
sidebarPath: require.resolve('./sidebars.js'),
|
||||
editUrl:
|
||||
'https://github.com/oam-dev/kubevela.io/edit/main/',
|
||||
showLastUpdateAuthor: true,
|
||||
showLastUpdateTime: true,
|
||||
includeCurrentVersion: true,
|
||||
lastVersion: 'current',
|
||||
// versions: {
|
||||
// current: {
|
||||
// label: 'master',
|
||||
// path: '/',
|
||||
// },
|
||||
// },
|
||||
},
|
||||
blog: {
|
||||
showReadingTime: true,
|
||||
editUrl:
|
||||
'https://github.com/oam-dev/kubevela.io/tree/main/blog',
|
||||
},
|
||||
theme: {
|
||||
customCss: require.resolve('./src/css/custom.css'),
|
||||
},
|
||||
},
|
||||
],
|
||||
],
|
||||
};
|
||||
@@ -1,10 +1,10 @@
|
||||

|
||||

|
||||
|
||||
*Make shipping applications more enjoyable.*
|
||||
|
||||
# KubeVela
|
||||
|
||||
KubeVela is the platform engine to create *PaaS-like* experience on Kubernetes, in a scalable approach.
|
||||
KubeVela is a modern application platform that makes deploying and managing applications across today's hybrid, multi-cloud environments easier and faster.
|
||||
|
||||
## Community
|
||||
|
||||
|
||||
123
docs/en/advanced-install.md
Normal file
123
docs/en/advanced-install.md
Normal file
@@ -0,0 +1,123 @@
|
||||
---
|
||||
title: Other Install Topics
|
||||
---
|
||||
|
||||
## Install KubeVela with cert-manager
|
||||
|
||||
KubeVela can use cert-manager generate certs for your application if it's available. Note that you need to install cert-manager **before** the KubeVela chart.
|
||||
|
||||
```shell script
|
||||
helm repo add jetstack https://charts.jetstack.io
|
||||
helm repo update
|
||||
helm install cert-manager jetstack/cert-manager --namespace cert-manager --version v1.2.0 --create-namespace --set installCRDs=true
|
||||
```
|
||||
|
||||
Install kubevela with enabled certmanager:
|
||||
```shell script
|
||||
helm install --create-namespace -n vela-system --set admissionWebhooks.certManager.enabled=true kubevela kubevela/vela-core
|
||||
```
|
||||
|
||||
## Install Pre-release
|
||||
|
||||
Add flag `--devel` in command `helm search` to choose a pre-release
|
||||
version in format `<next_version>-rc-master`. It means a release candidate version build on `master` branch,
|
||||
such as `0.4.0-rc-master`.
|
||||
|
||||
```shell script
|
||||
helm search repo kubevela/vela-core -l --devel
|
||||
```
|
||||
```console
|
||||
NAME CHART VERSION APP VERSION DESCRIPTION
|
||||
kubevela/vela-core 0.4.0-rc-master 0.4.0-rc-master A Helm chart for KubeVela core
|
||||
kubevela/vela-core 0.3.2 0.3.2 A Helm chart for KubeVela core
|
||||
kubevela/vela-core 0.3.1 0.3.1 A Helm chart for KubeVela core
|
||||
```
|
||||
|
||||
And try the following command to install it.
|
||||
|
||||
```shell script
|
||||
helm install --create-namespace -n vela-system kubevela kubevela/vela-core --version <next_version>-rc-master
|
||||
```
|
||||
```console
|
||||
NAME: kubevela
|
||||
LAST DEPLOYED: Thu Apr 1 19:41:30 2021
|
||||
NAMESPACE: vela-system
|
||||
STATUS: deployed
|
||||
REVISION: 1
|
||||
NOTES:
|
||||
Welcome to use the KubeVela! Enjoy your shipping application journey!
|
||||
```
|
||||
|
||||
## Upgrade
|
||||
|
||||
### Step 1. Update Helm repo
|
||||
|
||||
|
||||
You can explore the newly released chart versions of KubeVela by run:
|
||||
|
||||
```shell
|
||||
helm repo update
|
||||
helm search repo kubevela/vela-core -l
|
||||
```
|
||||
|
||||
### Step 2. Upgrade KubeVela CRDs
|
||||
|
||||
```shell
|
||||
kubectl apply -f https://raw.githubusercontent.com/oam-dev/kubevela/master/charts/vela-core/crds/core.oam.dev_componentdefinitions.yaml
|
||||
kubectl apply -f https://raw.githubusercontent.com/oam-dev/kubevela/master/charts/vela-core/crds/core.oam.dev_workloaddefinitions.yaml
|
||||
kubectl apply -f https://raw.githubusercontent.com/oam-dev/kubevela/master/charts/vela-core/crds/core.oam.dev_traitdefinitions.yaml
|
||||
kubectl apply -f https://raw.githubusercontent.com/oam-dev/kubevela/master/charts/vela-core/crds/core.oam.dev_applications.yaml
|
||||
kubectl apply -f https://raw.githubusercontent.com/oam-dev/kubevela/master/charts/vela-core/crds/core.oam.dev_approllouts.yaml
|
||||
kubectl apply -f https://raw.githubusercontent.com/oam-dev/kubevela/master/charts/vela-core/crds/core.oam.dev_applicationrevisions.yaml
|
||||
kubectl apply -f https://raw.githubusercontent.com/oam-dev/kubevela/master/charts/vela-core/crds/core.oam.dev_scopedefinitions.yaml
|
||||
kubectl apply -f https://raw.githubusercontent.com/oam-dev/kubevela/master/charts/vela-core/crds/core.oam.dev_appdeployments.yaml
|
||||
kubectl apply -f https://raw.githubusercontent.com/oam-dev/kubevela/master/charts/vela-core/crds/core.oam.dev_applicationcontexts.yaml
|
||||
```
|
||||
|
||||
> Tips: If you see errors like `* is invalid: spec.scope: Invalid value: "Namespaced": filed is immutable`. Please delete the CRD which reports error and re-apply the kubevela crds.
|
||||
|
||||
```shell
|
||||
kubectl delete crd \
|
||||
scopedefinitions.core.oam.dev \
|
||||
traitdefinitions.core.oam.dev \
|
||||
workloaddefinitions.core.oam.dev
|
||||
```
|
||||
|
||||
### Step 3. Upgrade KubeVela Helm chart
|
||||
|
||||
```shell
|
||||
helm upgrade --install --create-namespace --namespace vela-system kubevela kubevela/vela-core --version <the_new_version>
|
||||
```
|
||||
|
||||
## Clean Up
|
||||
|
||||
Run:
|
||||
|
||||
```shell script
|
||||
helm uninstall -n vela-system kubevela
|
||||
rm -r ~/.vela
|
||||
```
|
||||
|
||||
This will uninstall KubeVela server component and its dependency components.
|
||||
This also cleans up local CLI cache.
|
||||
|
||||
Then clean up CRDs (CRDs are not removed via helm by default):
|
||||
|
||||
```shell script
|
||||
kubectl delete crd \
|
||||
appdeployments.core.oam.dev \
|
||||
applicationconfigurations.core.oam.dev \
|
||||
applicationcontexts.core.oam.dev \
|
||||
applicationrevisions.core.oam.dev \
|
||||
applications.core.oam.dev \
|
||||
approllouts.core.oam.dev \
|
||||
componentdefinitions.core.oam.dev \
|
||||
components.core.oam.dev \
|
||||
containerizedworkloads.core.oam.dev \
|
||||
healthscopes.core.oam.dev \
|
||||
manualscalertraits.core.oam.dev \
|
||||
podspecworkloads.standard.oam.dev \
|
||||
scopedefinitions.core.oam.dev \
|
||||
traitdefinitions.core.oam.dev \
|
||||
workloaddefinitions.core.oam.dev
|
||||
```
|
||||
@@ -1,234 +0,0 @@
|
||||
---
|
||||
title: Application CRD
|
||||
---
|
||||
|
||||
This documentation will walk through how to use `Application` object to define your apps with corresponding operational behaviors in declarative approach.
|
||||
|
||||
## Example
|
||||
|
||||
The sample application below claimed a `backend` component with *Worker* workload type, and a `frontend` component with *Web Service* workload type.
|
||||
|
||||
Moreover, the `frontend` component claimed `sidecar` and `autoscaler` traits which means the workload will be automatically injected with a `fluentd` sidecar and scale from 1-100 replicas triggered by CPU usage.
|
||||
|
||||
```yaml
|
||||
apiVersion: core.oam.dev/v1beta1
|
||||
kind: Application
|
||||
metadata:
|
||||
name: website
|
||||
spec:
|
||||
components:
|
||||
- name: backend
|
||||
type: worker
|
||||
properties:
|
||||
image: busybox
|
||||
cmd:
|
||||
- sleep
|
||||
- '1000'
|
||||
- name: frontend
|
||||
type: webservice
|
||||
properties:
|
||||
image: nginx
|
||||
traits:
|
||||
- type: autoscaler
|
||||
properties:
|
||||
min: 1
|
||||
max: 10
|
||||
cpuPercent: 60
|
||||
- type: sidecar
|
||||
properties:
|
||||
name: "sidecar-test"
|
||||
image: "fluentd"
|
||||
```
|
||||
|
||||
The `type: worker` means the specification of this component (claimed in following `properties` section) will be enforced by a `ComponentDefinition` object named `worker` as below:
|
||||
|
||||
```yaml
|
||||
apiVersion: core.oam.dev/v1beta1
|
||||
kind: ComponentDefinition
|
||||
metadata:
|
||||
name: worker
|
||||
annotations:
|
||||
definition.oam.dev/description: "Describes long-running, scalable, containerized services that running at backend. They do NOT have network endpoint to receive external network traffic."
|
||||
spec:
|
||||
workload:
|
||||
definition:
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
schematic:
|
||||
cue:
|
||||
template: |
|
||||
output: {
|
||||
apiVersion: "apps/v1"
|
||||
kind: "Deployment"
|
||||
spec: {
|
||||
selector: matchLabels: {
|
||||
"app.oam.dev/component": context.name
|
||||
}
|
||||
template: {
|
||||
metadata: labels: {
|
||||
"app.oam.dev/component": context.name
|
||||
}
|
||||
spec: {
|
||||
containers: [{
|
||||
name: context.name
|
||||
image: parameter.image
|
||||
|
||||
if parameter["cmd"] != _|_ {
|
||||
command: parameter.cmd
|
||||
}
|
||||
}]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
parameter: {
|
||||
image: string
|
||||
cmd?: [...string]
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
Hence, the `properties` section of `backend` only supports two parameters: `image` and `cmd`, this is enforced by the `parameter` list of the `.spec.template` field of the definition.
|
||||
|
||||
The similar extensible abstraction mechanism also applies to traits.
|
||||
For example, `type: autoscaler` in `frontend` means its trait specification (i.e. `properties` section)
|
||||
will be enforced by a `TraitDefinition` object named `autoscaler` as below:
|
||||
|
||||
```yaml
|
||||
apiVersion: core.oam.dev/v1beta1
|
||||
kind: TraitDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
definition.oam.dev/description: "configure k8s HPA for Deployment"
|
||||
name: hpa
|
||||
spec:
|
||||
appliesToWorkloads:
|
||||
- webservice
|
||||
- worker
|
||||
schematic:
|
||||
cue:
|
||||
template: |
|
||||
outputs: hpa: {
|
||||
apiVersion: "autoscaling/v2beta2"
|
||||
kind: "HorizontalPodAutoscaler"
|
||||
metadata: name: context.name
|
||||
spec: {
|
||||
scaleTargetRef: {
|
||||
apiVersion: "apps/v1"
|
||||
kind: "Deployment"
|
||||
name: context.name
|
||||
}
|
||||
minReplicas: parameter.min
|
||||
maxReplicas: parameter.max
|
||||
metrics: [{
|
||||
type: "Resource"
|
||||
resource: {
|
||||
name: "cpu"
|
||||
target: {
|
||||
type: "Utilization"
|
||||
averageUtilization: parameter.cpuUtil
|
||||
}
|
||||
}
|
||||
}]
|
||||
}
|
||||
}
|
||||
parameter: {
|
||||
min: *1 | int
|
||||
max: *10 | int
|
||||
cpuUtil: *50 | int
|
||||
}
|
||||
```
|
||||
|
||||
The application also have a `sidecar` trait.
|
||||
|
||||
```yaml
|
||||
apiVersion: core.oam.dev/v1beta1
|
||||
kind: TraitDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
definition.oam.dev/description: "add sidecar to the app"
|
||||
name: sidecar
|
||||
spec:
|
||||
appliesToWorkloads:
|
||||
- webservice
|
||||
- worker
|
||||
schematic:
|
||||
cue:
|
||||
template: |-
|
||||
patch: {
|
||||
// +patchKey=name
|
||||
spec: template: spec: containers: [parameter]
|
||||
}
|
||||
parameter: {
|
||||
name: string
|
||||
image: string
|
||||
command?: [...string]
|
||||
}
|
||||
```
|
||||
|
||||
All the definition objects are expected to be defined and installed by platform team.
|
||||
The end users will only focus on `Application` resource.
|
||||
|
||||
## Conventions and "Standard Contract"
|
||||
|
||||
After the `Application` resource is applied to Kubernetes cluster,
|
||||
the KubeVela runtime will generate and manage the underlying resources instances following below "standard contract" and conventions.
|
||||
|
||||
|
||||
| Label | Description |
|
||||
| :--: | :---------: |
|
||||
|`workload.oam.dev/type=<component definition name>` | The name of its corresponding `ComponentDefinition` |
|
||||
|`trait.oam.dev/type=<trait definition name>` | The name of its corresponding `TraitDefinition` |
|
||||
|`app.oam.dev/name=<app name>` | The name of the application it belongs to |
|
||||
|`app.oam.dev/component=<component name>` | The name of the component it belongs to |
|
||||
|`trait.oam.dev/resource=<name of trait resource instance>` | The name of trait resource instance |
|
||||
|`app.oam.dev/appRevision=<name of app revision>` | The name of the application revision it belongs to |
|
||||
|
||||
|
||||
## Run Application
|
||||
|
||||
Apply application yaml above, then you'll get the application started
|
||||
|
||||
```shell
|
||||
$ kubectl get application -o yaml
|
||||
apiVersion: core.oam.dev/v1beta1
|
||||
kind: Application
|
||||
metadata:
|
||||
name: website
|
||||
....
|
||||
status:
|
||||
components:
|
||||
- apiVersion: core.oam.dev/v1alpha2
|
||||
kind: Component
|
||||
name: backend
|
||||
- apiVersion: core.oam.dev/v1alpha2
|
||||
kind: Component
|
||||
name: frontend
|
||||
....
|
||||
status: running
|
||||
|
||||
```
|
||||
|
||||
You could see a Deployment named `frontend` with a container `fluentd` injected is running.
|
||||
|
||||
```shell
|
||||
$ kubectl get deploy frontend
|
||||
NAME READY UP-TO-DATE AVAILABLE AGE
|
||||
frontend 1/1 1 1 100m
|
||||
```
|
||||
|
||||
Another Deployment is also running named `backend`.
|
||||
|
||||
```shell
|
||||
$ kubectl get deploy backend
|
||||
NAME READY UP-TO-DATE AVAILABLE AGE
|
||||
backend 1/1 1 1 100m
|
||||
```
|
||||
|
||||
An HPA was also created by the `autoscaler` trait.
|
||||
|
||||
```shell
|
||||
$ kubectl get HorizontalPodAutoscaler frontend
|
||||
NAME REFERENCE TARGETS MINPODS MAXPODS REPLICAS AGE
|
||||
frontend Deployment/frontend <unknown>/50% 1 10 1 101m
|
||||
```
|
||||
35
docs/en/cli/vela_system_cue-packages.md
Normal file
35
docs/en/cli/vela_system_cue-packages.md
Normal file
@@ -0,0 +1,35 @@
|
||||
## vela system cue-packages
|
||||
|
||||
List cue package
|
||||
|
||||
### Synopsis
|
||||
|
||||
List cue package
|
||||
|
||||
```
|
||||
vela system cue-packages
|
||||
```
|
||||
|
||||
### Examples
|
||||
|
||||
```
|
||||
vela system cue-packages
|
||||
```
|
||||
|
||||
### Options
|
||||
|
||||
```
|
||||
-h, --help help for cue-packages
|
||||
```
|
||||
|
||||
### Options inherited from parent commands
|
||||
|
||||
```
|
||||
-e, --env string specify environment name for application
|
||||
```
|
||||
|
||||
### SEE ALSO
|
||||
|
||||
* [vela system](vela_system.md) - System management utilities
|
||||
|
||||
###### Auto generated by spf13/cobra on 2-May-2021
|
||||
39
docs/en/cli/vela_system_live-diff.md
Normal file
39
docs/en/cli/vela_system_live-diff.md
Normal file
@@ -0,0 +1,39 @@
|
||||
## vela system live-diff
|
||||
|
||||
Dry-run an application, and do diff on a specific app revison
|
||||
|
||||
### Synopsis
|
||||
|
||||
Dry-run an application, and do diff on a specific app revison. The provided capability definitions will be used during Dry-run. If any capabilities used in the app are not found in the provided ones, it will try to find from cluster.
|
||||
|
||||
```
|
||||
vela system live-diff
|
||||
```
|
||||
|
||||
### Examples
|
||||
|
||||
```
|
||||
vela live-diff -f app-v2.yaml -r app-v1 --context 10
|
||||
```
|
||||
|
||||
### Options
|
||||
|
||||
```
|
||||
-r, --Revision string specify an application Revision name, by default, it will compare with the latest Revision
|
||||
-c, --context int output number lines of context around changes, by default show all unchanged lines (default -1)
|
||||
-d, --definition string specify a file or directory containing capability definitions, they will only be used in dry-run rather than applied to K8s cluster
|
||||
-f, --file string application file name (default "./app.yaml")
|
||||
-h, --help help for live-diff
|
||||
```
|
||||
|
||||
### Options inherited from parent commands
|
||||
|
||||
```
|
||||
-e, --env string specify environment name for application
|
||||
```
|
||||
|
||||
### SEE ALSO
|
||||
|
||||
* [vela system](vela_system.md) - System management utilities
|
||||
|
||||
###### Auto generated by spf13/cobra on 2-May-2021
|
||||
@@ -2,105 +2,46 @@
|
||||
title: How it Works
|
||||
---
|
||||
|
||||
*"KubeVela is a scalable way to create PaaS-like experience on Kubernetes"*
|
||||
|
||||
In this documentation, we will explain the core idea of KubeVela and clarify some technical terms that are widely used in the project.
|
||||
|
||||
## Overview
|
||||
## API
|
||||
|
||||
First of all, KubeVela introduces a workflow with separate of concerns as below:
|
||||
On control plane, KubeVela introduces [Open Application Model (OAM)](https://oam.dev) as the main API to model a full deployment of modern microservices application. This API could be explained as below:
|
||||
|
||||

|
||||
|
||||
In detail:
|
||||
- Components - deployable/provisionable entities that compose your application.
|
||||
- e.g. a Helm chart, a Kubernetes workload, a Terraform module, or a cloud database instance etc.
|
||||
- Traits - attachable features that will *overlay* given component with operational behaviors.
|
||||
- e.g. autoscaling rules, rollout strategies, ingress rules, sidecars, security policies etc.
|
||||
- Application - full description of your application deployment assembled with components and traits.
|
||||
- Environment - the target environments to deploy this application.
|
||||
|
||||
We also reference components and traits as *"capabilities"* in KubeVela.
|
||||
|
||||
## Workflow
|
||||
|
||||
To ensure simple yet consistent user experience across hybrid environments. KubeVela introduces a workflow with separate of concerns as below:
|
||||
- **Platform Team**
|
||||
- Defining templates for deployment environments and reusable capability modules to compose an application, and registering them into the cluster.
|
||||
- **End Users**
|
||||
- Choose a deployment environment, model and assemble the app with available modules, and deploy the app to target environment.
|
||||
- Model and manage platform capabilities as components or traits, together with target environments specifications.
|
||||
- **Application Team**
|
||||
- Choose a environment, assemble the application with components and traits per needs, and deploy it to target environment.
|
||||
|
||||
> Note that either platform team or application team application will only talk to the control plane cluster. KubeVela is designed to hide the details of runtime infrastructures except for debugging or verifying purpose.
|
||||
|
||||
Below is how this workflow looks like:
|
||||
|
||||

|
||||

|
||||
|
||||
This template based workflow make it possible for platform team enforce best practices and deployment confidence with a set of Kubernetes CRDs, and give end users a *PaaS-like* experience (*i.e. app-centric, higher level abstractions, self-service operations etc*) by natural.
|
||||
|
||||

|
||||
|
||||
Below are the core building blocks in KubeVela that make this happen.
|
||||
|
||||
## `Application`
|
||||
The *Application* is the core API of KubeVela. It allows developers to work with a single artifact to capture the complete application definition with simplified primitives.
|
||||
|
||||
### Why Choose `Application` as the Main Abstraction
|
||||
|
||||
Having an "application" concept is important to any developer-centric platform to simplify administrative tasks and can serve as an anchor to avoid configuration drifts during operation. Also, as an abstraction object, `Application` provides a much simpler path for on-boarding Kubernetes capabilities without relying on low level details. For example, a developer will be able to model a "web service" without defining a detailed Kubernetes Deployment + Service combo each time, or claim the auto-scaling requirements without referring to the underlying KEDA ScaleObject.
|
||||
|
||||
### Example
|
||||
|
||||
An example of `website` application with two components (i.e. `frontend` and `backend`) could be modeled as below:
|
||||
|
||||
```yaml
|
||||
apiVersion: core.oam.dev/v1beta1
|
||||
kind: Application
|
||||
metadata:
|
||||
name: website
|
||||
spec:
|
||||
components:
|
||||
- name: backend
|
||||
type: worker
|
||||
properties:
|
||||
image: busybox
|
||||
cmd:
|
||||
- sleep
|
||||
- '1000'
|
||||
- name: frontend
|
||||
type: webservice
|
||||
properties:
|
||||
image: nginx
|
||||
traits:
|
||||
- type: autoscaler
|
||||
properties:
|
||||
min: 1
|
||||
max: 10
|
||||
- type: sidecar
|
||||
properties:
|
||||
name: "sidecar-test"
|
||||
image: "fluentd"
|
||||
```
|
||||
|
||||
## Building the Abstraction
|
||||
|
||||
Unlike most of the higher level platforms, the `Application` abstraction in KubeVela is fully extensible and does not even have fixed schema. Instead, it is composed by building blocks (app components and traits etc.) that allow you to onboard platform capabilities to this application definition with your own abstractions.
|
||||
|
||||
The building blocks to abstraction and model platform capabilities named `ComponentDefinition` and `TraitDefinition`.
|
||||
|
||||
### ComponentDefinition
|
||||
|
||||
You can think of `ComponentDefinition` as a *template* for workload type. It contains template, parametering and workload characteristic information as a declarative API resource.
|
||||
|
||||
Hence, the `Application` abstraction essentially declares how users want to **instantiate** given component definitions. Specifically, the `.type` field references the name of installed `ComponentDefinition` and `.properties` are the user set values to instantiate it.
|
||||
|
||||
Some typical component definitions are *Long Running Web Service*, *One-time Off Task* or *Redis Database*. All component definitions expected to be pre-installed in the platform, or provided by component providers such as 3rd-party software vendors.
|
||||
|
||||
### TraitDefinition
|
||||
|
||||
Optionally, each component has a `.traits` section that augments the component instance with operational behaviors such as load balancing policy, network ingress routing, auto-scaling policies, or upgrade strategies, etc.
|
||||
|
||||
You can think of traits as operational features provided by the platform. To attach a trait to component instance, the user will use `.type` field to reference the specific `TraitDefinition`, and `.properties` field to set property values of the given trait. Similarly, `TraitDefiniton` also allows you to define *template* for operational features.
|
||||
|
||||
We also reference component definitions and trait definitions as *"capability definitions"* in KubeVela.
|
||||
All the capability building blocks can be updated or extended easily at any time since they are fully programmable via CUE.
|
||||
|
||||
## Environment
|
||||
Before releasing an application to production, it's important to test the code in testing/staging workspaces. In KubeVela, we describe these workspaces as "deployment environments" or "environments" for short. Each environment has its own configuration (e.g., domain, Kubernetes cluster and namespace, configuration data, access control policy, etc.) to allow user to create different deployment environments such as "test" and "production".
|
||||
Before releasing an application to production, it's important to test the code in testing/staging workspaces. In KubeVela, we describe these workspaces as "environments". Each environment has its own configuration (e.g., domain, Kubernetes cluster and namespace, configuration data, access control policy, etc.) to allow user to create different deployment environments such as "test" and "production".
|
||||
|
||||
Currently, a KubeVela `environment` only maps to a Kubernetes namespace, while the cluster level environment is work in progress.
|
||||
## What's Next
|
||||
|
||||
### Summary
|
||||
Here are some recommended next steps:
|
||||
|
||||
The main concepts of KubeVela could be shown as below:
|
||||
|
||||

|
||||
|
||||
## Architecture
|
||||
|
||||
The overall architecture of KubeVela is shown as below:
|
||||
|
||||

|
||||
|
||||
Specifically, the application controller is responsible for application abstraction and encapsulation (i.e. the controller for `Application` and `Definition`). The rollout controller will handle progressive rollout strategy with the whole application as a unit. The multi-env deployment engine (*currently WIP*) is responsible for deploying the application across multiple clusters and environments.
|
||||
- Learn KubeVela's [core concepts](./concepts)
|
||||
- Learn how to [deploy an application](end-user/application) in detail and understand how it works.
|
||||
|
||||
@@ -22,7 +22,7 @@ This command will automatically open the reference documentation for given workl
|
||||
|
||||
Let's take `$ vela show webservice --web` as example. The detailed schema documentation for `Web Service` workload type will show up immediately as below:
|
||||
|
||||

|
||||

|
||||
|
||||
Note that there's in the section named `Specification`, it even provides you with a full sample for the usage of this workload type with a fake name `my-service-name`.
|
||||
|
||||
@@ -30,7 +30,7 @@ Note that there's in the section named `Specification`, it even provides you wit
|
||||
|
||||
Similarly, we can also do `$ vela show autoscale --web`:
|
||||
|
||||

|
||||

|
||||
|
||||
With these auto-generated reference documentations, we could easily complete the application description by simple copy-paste, for example:
|
||||
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
title: Setting Up Deployment Environment
|
||||
---
|
||||
|
||||
A deployment environment is where you could configure the workspace, email for certificate issuer and domain for your applications globally. A typical set of deployment environment is `test`, `staging`, `prod`, etc.
|
||||
A deployment environment is where you could configure the workspace, email for contact and domain for your applications globally.
|
||||
A typical set of deployment environment is `test`, `staging`, `prod`, etc.
|
||||
|
||||
## Create environment
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ Introduce how to automatically scale workloads by cron.
|
||||
timezone: "America/Los_Angeles"
|
||||
```
|
||||
|
||||
> The full specification of `autoscale` could show up by `$ vela show autoscale` or be found on [its reference documentation](../references/traits/autoscale)
|
||||
> The full specification of `autoscale` could show up by `$ vela show autoscale`.
|
||||
|
||||
2. Deploy an application
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user