Compare commits

...

22 Commits
v1.7.3 ... main

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

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

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

* Fix: correct golang version and actions vesions

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

* Fix: Upgrade kubevela and velaux version

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

* Fix: upgrade golangci lint version

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

* Fix: uprgrade golangci lint version

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

* Fix: upgrade staticcheck version

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

* Fix: upgrade staticcheck version

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

---------

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

- fixes #151

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

* Fix: solve dependency conflict

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

* Fix compile conflict

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

* Fix: downgrade go version to support github action builders

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

* Fix: updated the golang and linter versions

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

* Try lint

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

* fix go version

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

* rollback golangci-lint

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

* Add permission, bump staticcheck version

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

* Use staticcheck action

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

* Fix: remove go get command to download dependencies

Update velaux image

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

* Fix: attempting to fix the build failure in staticheck

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

* Fix: removed offending config for the docker setup

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

* Fix: use newer docker version

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

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

* Fix: e2e tests for mac os

- Upgrades docker version

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

* Fix: upgrade the images for supporting k3s images

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

---------

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

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

* bump velaux

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

* fix velaux image version

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

---------

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

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

* use env to provide token

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

* allow detach worker

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

* Add doc

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

* reviewable

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

* add velaux enable guide

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

* reviewable

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

---------

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
2023-03-13 14:53:26 +08:00
fsl fbd81b5e00
Fix: update ci version (#129) 2023-03-01 14:58:41 +08:00
qiaozp 1254051855
Bump vela to v1.7.4 (#127) 2023-02-23 10:59:27 +08:00
qiaozp 57d26ff9d9
Feat: optimize the multi-node cluster usage (#126) 2023-02-22 15:34:48 +08:00
qiaozp ce6ccd29e9
Remove podOnly in velad's vela-core fork (#125) 2023-02-21 11:15:07 +08:00
fsl 257ac1ecf4
Fix: update package dependencies (#124) 2023-02-20 13:13:37 +08:00
171 changed files with 2204 additions and 25362 deletions

2
.github/CODEOWNERS vendored
View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,10 +1,11 @@
include makefiles/dependency.mk
K3S_VERSION ?= v1.24.8+k3s1
K3S_VERSION ?= v1.27.2+k3s1
STATIC_DIR := pkg/resources/static
VELA_VERSION ?= v1.7.3
VELAUX_VERSION ?= v1.7.2
VELAUX_IMAGE_VERSION ?= ${VELAUX_VERSION}
VELA_VERSION ?= v1.10.1
VELAUX_VERSION ?= v1.9.4
VELA_VERSION_NO_V := $(subst v,,$(VELA_VERSION))
VELAUX_IMAGE_VERSION ?= v1.9.4
LDFLAGS= "-X github.com/oam-dev/velad/version.VelaUXVersion=${VELAUX_VERSION} -X github.com/oam-dev/velad/version.VelaVersion=${VELA_VERSION}"
UNAME_S := $(shell uname -s)
@ -26,7 +27,7 @@ build:
OS=${OS} ARCH=${ARCH} make $(OS)-$(ARCH)
linux-amd64 linux-arm64: download_vela_images_addons pack_vela_chart download_k3s_bin_script download_k3s_images
linux-amd64 linux-arm64: download_vela_images_addons download_k3s_bin_script download_k3s_images
$(eval OS := $(word 1, $(subst -, ,$@)))
$(eval ARCH := $(word 2, $(subst -, ,$@)))
echo "Compiling for ${OS}/${ARCH}"
@ -36,7 +37,7 @@ linux-amd64 linux-arm64: download_vela_images_addons pack_vela_chart download_k3
-ldflags=${LDFLAGS} \
github.com/oam-dev/velad/cmd/velad
darwin-amd64 darwin-arm64 windows-amd64: download_vela_images_addons download_k3d pack_vela_chart download_k3s_images
darwin-amd64 darwin-arm64 windows-amd64: download_vela_images_addons download_k3d download_k3s_images
$(eval OS := $(word 1, $(subst -, ,$@)))
$(eval ARCH := $(word 2, $(subst -, ,$@)))
echo "Compiling for ${OS}/${ARCH}"
@ -46,9 +47,17 @@ darwin-amd64 darwin-arm64 windows-amd64: download_vela_images_addons download_k3
-ldflags=${LDFLAGS} \
github.com/oam-dev/velad/cmd/velad
download_vela_images_addons:
CHART_DIR := ${STATIC_DIR}/vela/charts
download_vela_chart:
mkdir -p ${CHART_DIR}
curl -L -o ${CHART_DIR}/vela-core.tgz https://kubevela.github.io/charts/vela-core-${VELA_VERSION_NO_V}.tgz
download_vela_images_addons: download_vela_chart
tar -xzf ${CHART_DIR}/vela-core.tgz -C ${CHART_DIR}
./hack/download_vela_images.sh ${VELA_VERSION} ${VELAUX_IMAGE_VERSION} ${ARCH}
./hack/download_addons.sh ${VELAUX_VERSION}
rm -rf ${CHART_DIR}/vela-core
download_k3d:
./hack/download_k3d_images.sh ${ARCH}
@ -62,11 +71,6 @@ download_k3s_images:
mkdir -p ${STATIC_DIR}/k3s/images
curl -Lo ${STATIC_DIR}/k3s/images/k3s-airgap-images.tar.gz https://github.com/k3s-io/k3s/releases/download/${K3S_VERSION}/k3s-airgap-images-${ARCH}.tar.gz
CHART_DIR := ${STATIC_DIR}/vela/charts
pack_vela_chart:
cp -r ${STATIC_DIR}/vela/charts/vela-core .
tar -czf ${STATIC_DIR}/vela/charts/vela-core.tgz vela-core
rm -r vela-core
.PHONY: clean
clean:

View File

@ -3,33 +3,8 @@
VelaD embed one KubeVela Helm chart and VelaD's build process will cache some images(e.g. vela-core).
When KubeVela has a new release. Do these steps below to upgrade VelaD's embedded KubeVela version.
1. Upgrade vela-core helm chart
2. Upgrade go.mod
3. Upgrade vela version in makefile
### Upgrade vela-core helm chart.
First check the now vela-core version:
```shell
cat pkg/resources/static/vela/charts/vela-core/Chart.yaml | grep version:
```
Output like:
```text
version: v1.4.2
```
Then use upgrade script, for example if you want to upgrade vela to v1.4.3, then use v1.4.3 as the version parameter.
```shell
./hack/upgrade_vela.sh v1.4.3
```
This script will clone the KubeVela repo and make diff between version now and v1.4.3. Then try to patch the diff in VelaD's
embedded vela-core chart in `pkg/resources/static/vela/charts/vela-core`
If there are conflict, you have to resolve them manually.
1. Upgrade go.mod
2. Upgrade vela version in makefile
### Upgrade vela version in makefile

View File

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

View File

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

View File

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

View File

@ -43,7 +43,6 @@ If you want build linux version, run
VELAUX_VERSION=v1.x.y VELA_VERSION=v1.z.w make download_vela_images_addons
make download_k3s_bin_script
make download_k3s_images
make pack_vela_chart
```
If you want to build non-linux version, run
@ -51,7 +50,6 @@ If you want to build non-linux version, run
```shell
VELAUX_VERSION=v1.x.y VELA_VERSION=v1.z.w make download_vela_images_addons
make download_k3d
make pack_vela_chart
make download_k3s_images
```

View File

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

434
go.mod
View File

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

3121
go.sum

File diff suppressed because it is too large Load Diff

View File

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

View File

@ -46,8 +46,7 @@ function download_images() {
vela_images=("oamdev/vela-core:${vela_version}"
"oamdev/cluster-gateway:${cluster_gateway_version}"
"oamdev/kube-webhook-certgen:${certgen_version}"
"oamdev/velaux:${velaux_version}"
"oamdev/vela-apiserver:${vela_version}")
"oamdev/velaux:${velaux_version}")
for IMG in ${vela_images[*]};
do

View File

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

View File

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

47
hack/upgrade_velaux.sh Executable file
View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -50,7 +50,7 @@ type k3dSetupOptions struct {
const (
// K3dImageTag is image tag of k3d
K3dImageTag = "v1.24.8-k3s1"
K3dImageTag = "v1.27.2-k3s1"
)
func init() {
@ -67,6 +67,11 @@ type K3dHandler struct {
cfg config.ClusterConfig
}
// Join -
func (d *K3dHandler) Join(_ apis.JoinArgs) error {
return errors.New("not implemented")
}
// Install will install a k3d cluster
func (d *K3dHandler) Install(args apis.InstallArgs) error {
var err error

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

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

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,50 +0,0 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.9.2
name: policies.core.oam.dev
spec:
group: core.oam.dev
names:
categories:
- oam
kind: Policy
listKind: PolicyList
plural: policies
singular: policy
scope: Namespaced
versions:
- additionalPrinterColumns:
- jsonPath: .type
name: TYPE
type: string
name: v1alpha1
schema:
openAPIV3Schema:
description: Policy is the Schema for the policy API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
properties:
type: object
x-kubernetes-preserve-unknown-fields: true
type:
type: string
required:
- type
type: object
served: true
storage: true
subresources: {}

View File

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

View File

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

View File

@ -1,146 +0,0 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.9.2
name: scopedefinitions.core.oam.dev
spec:
group: core.oam.dev
names:
categories:
- oam
kind: ScopeDefinition
listKind: ScopeDefinitionList
plural: scopedefinitions
shortNames:
- scope
singular: scopedefinition
scope: Namespaced
versions:
- additionalPrinterColumns:
- jsonPath: .spec.definitionRef.name
name: DEFINITION-NAME
type: string
name: v1alpha2
schema:
openAPIV3Schema:
description: A ScopeDefinition registers a kind of Kubernetes custom resource
as a valid OAM scope kind by referencing its CustomResourceDefinition. The
CRD is used to validate the schema of the scope when it is embedded in an
OAM ApplicationConfiguration.
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: A ScopeDefinitionSpec defines the desired state of a ScopeDefinition.
properties:
allowComponentOverlap:
description: AllowComponentOverlap specifies whether an OAM component
may exist in multiple instances of this kind of scope.
type: boolean
definitionRef:
description: Reference to the CustomResourceDefinition that defines
this scope kind.
properties:
name:
description: Name of the referenced CustomResourceDefinition.
type: string
version:
description: Version indicate which version should be used if
CRD has multiple versions by default it will use the first one
if not specified
type: string
required:
- name
type: object
extension:
description: Extension is used for extension needs by OAM platform
builders
type: object
x-kubernetes-preserve-unknown-fields: true
workloadRefsPath:
description: WorkloadRefsPath indicates if/where a scope accepts workloadRef
objects
type: string
required:
- allowComponentOverlap
- definitionRef
type: object
type: object
served: true
storage: false
subresources: {}
- additionalPrinterColumns:
- jsonPath: .spec.definitionRef.name
name: DEFINITION-NAME
type: string
name: v1beta1
schema:
openAPIV3Schema:
description: A ScopeDefinition registers a kind of Kubernetes custom resource
as a valid OAM scope kind by referencing its CustomResourceDefinition. The
CRD is used to validate the schema of the scope when it is embedded in an
OAM ApplicationConfiguration.
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: A ScopeDefinitionSpec defines the desired state of a ScopeDefinition.
properties:
allowComponentOverlap:
description: AllowComponentOverlap specifies whether an OAM component
may exist in multiple instances of this kind of scope.
type: boolean
definitionRef:
description: Reference to the CustomResourceDefinition that defines
this scope kind.
properties:
name:
description: Name of the referenced CustomResourceDefinition.
type: string
version:
description: Version indicate which version should be used if
CRD has multiple versions by default it will use the first one
if not specified
type: string
required:
- name
type: object
extension:
description: Extension is used for extension needs by OAM platform
builders
type: object
x-kubernetes-preserve-unknown-fields: true
workloadRefsPath:
description: WorkloadRefsPath indicates if/where a scope accepts workloadRef
objects
type: string
required:
- allowComponentOverlap
- definitionRef
type: object
type: object
served: true
storage: true
subresources: {}

View File

@ -1,673 +0,0 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.9.2
name: traitdefinitions.core.oam.dev
spec:
group: core.oam.dev
names:
categories:
- oam
kind: TraitDefinition
listKind: TraitDefinitionList
plural: traitdefinitions
shortNames:
- trait
singular: traitdefinition
scope: Namespaced
versions:
- additionalPrinterColumns:
- jsonPath: .spec.appliesToWorkloads
name: APPLIES-TO
type: string
- jsonPath: .metadata.annotations.definition\.oam\.dev/description
name: DESCRIPTION
type: string
name: v1alpha2
schema:
openAPIV3Schema:
description: A TraitDefinition registers a kind of Kubernetes custom resource
as a valid OAM trait kind by referencing its CustomResourceDefinition. The
CRD is used to validate the schema of the trait when it is embedded in an
OAM ApplicationConfiguration.
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: A TraitDefinitionSpec defines the desired state of a TraitDefinition.
properties:
appliesToWorkloads:
description: AppliesToWorkloads specifies the list of workload kinds
this trait applies to. Workload kinds are specified in resource.group/version
format, e.g. server.core.oam.dev/v1alpha2. Traits that omit this
field apply to all workload kinds.
items:
type: string
type: array
conflictsWith:
description: 'ConflictsWith specifies the list of traits(CRD name,
Definition name, CRD group) which could not apply to the same workloads
with this trait. Traits that omit this field can work with any other
traits. Example rules: "service" # Trait definition name "services.k8s.io"
# API resource/crd name "*.networking.k8s.io" # API group "labelSelector:foo=bar"
# label selector labelSelector format: https://pkg.go.dev/k8s.io/apimachinery/pkg/labels#Parse'
items:
type: string
type: array
definitionRef:
description: Reference to the CustomResourceDefinition that defines
this trait kind.
properties:
name:
description: Name of the referenced CustomResourceDefinition.
type: string
version:
description: Version indicate which version should be used if
CRD has multiple versions by default it will use the first one
if not specified
type: string
required:
- name
type: object
extension:
description: Extension is used for extension needs by OAM platform
builders
type: object
x-kubernetes-preserve-unknown-fields: true
podDisruptive:
description: PodDisruptive specifies whether using the trait will
cause the pod to restart or not.
type: boolean
revisionEnabled:
description: Revision indicates whether a trait is aware of component
revision
type: boolean
schematic:
description: Schematic defines the data format and template of the
encapsulation of the trait
properties:
cue:
description: CUE defines the encapsulation in CUE format
properties:
template:
description: Template defines the abstraction template data
of the capability, it will replace the old CUE template
in extension field. Template is a required field if CUE
is defined in Capability Definition.
type: string
required:
- template
type: object
helm:
description: A Helm represents resources used by a Helm module
properties:
release:
description: Release records a Helm release used by a Helm
module workload.
type: object
x-kubernetes-preserve-unknown-fields: true
repository:
description: HelmRelease records a Helm repository used by
a Helm module workload.
type: object
x-kubernetes-preserve-unknown-fields: true
required:
- release
- repository
type: object
kube:
description: Kube defines the encapsulation in raw Kubernetes
resource format
properties:
parameters:
description: Parameters defines configurable parameters
items:
description: A KubeParameter defines a configurable parameter
of a component.
properties:
description:
description: Description of this parameter.
type: string
fieldPaths:
description: "FieldPaths specifies an array of fields
within this workload that will be overwritten by the
value of this parameter. \tAll fields must be of the
same type. Fields are specified as JSON field paths
without a leading dot, for example 'spec.replicas'."
items:
type: string
type: array
name:
description: Name of this parameter
type: string
required:
default: false
description: Required specifies whether or not a value
for this parameter must be supplied when authoring
an Application.
type: boolean
type:
description: 'ValueType indicates the type of the parameter
value, and only supports basic data types: string,
number, boolean.'
enum:
- string
- number
- boolean
type: string
required:
- fieldPaths
- name
- type
type: object
type: array
template:
description: Template defines the raw Kubernetes resource
type: object
x-kubernetes-preserve-unknown-fields: true
required:
- template
type: object
terraform:
description: Terraform is the struct to describe cloud resources
managed by Hashicorp Terraform
properties:
configuration:
description: Configuration is Terraform Configuration
type: string
customRegion:
description: Region is cloud provider's region. It will override
the region in the region field of ProviderReference
type: string
deleteResource:
default: true
description: DeleteResource will determine whether provisioned
cloud resources will be deleted when CR is deleted
type: boolean
gitCredentialsSecretReference:
description: GitCredentialsSecretReference specifies the reference
to the secret containing the git credentials
properties:
name:
description: name is unique within a namespace to reference
a secret resource.
type: string
namespace:
description: namespace defines the space within which
the secret name must be unique.
type: string
type: object
x-kubernetes-map-type: atomic
path:
description: Path is the sub-directory of remote git repository.
It's valid when remote is set
type: string
providerRef:
description: ProviderReference specifies the reference to
Provider
properties:
name:
description: Name of the referenced object.
type: string
namespace:
default: default
description: Namespace of the referenced object.
type: string
required:
- name
type: object
type:
default: hcl
description: Type specifies which Terraform configuration
it is, HCL or JSON syntax
enum:
- hcl
- json
- remote
type: string
writeConnectionSecretToRef:
description: WriteConnectionSecretToReference specifies the
namespace and name of a Secret to which any connection details
for this managed resource should be written. Connection
details frequently include the endpoint, username, and password
required to connect to the managed resource.
properties:
name:
description: Name of the secret.
type: string
namespace:
description: Namespace of the secret.
type: string
required:
- name
type: object
required:
- configuration
type: object
type: object
status:
description: Status defines the custom health policy and status message
for trait
properties:
customStatus:
description: CustomStatus defines the custom status message that
could display to user
type: string
healthPolicy:
description: HealthPolicy defines the health check policy for
the abstraction
type: string
type: object
workloadRefPath:
description: WorkloadRefPath indicates where/if a trait accepts a
workloadRef object
type: string
type: object
status:
description: TraitDefinitionStatus is the status of TraitDefinition
properties:
conditions:
description: Conditions of the resource.
items:
description: A Condition that may apply to a resource.
properties:
lastTransitionTime:
description: LastTransitionTime is the last time this condition
transitioned from one status to another.
format: date-time
type: string
message:
description: A Message containing details about this condition's
last transition from one status to another, if any.
type: string
reason:
description: A Reason for this condition's last transition from
one status to another.
type: string
status:
description: Status of this condition; is it currently True,
False, or Unknown?
type: string
type:
description: Type of this condition. At most one of each condition
type may apply to a resource at any point in time.
type: string
required:
- lastTransitionTime
- reason
- status
- type
type: object
type: array
configMapRef:
description: ConfigMapRef refer to a ConfigMap which contains OpenAPI
V3 JSON schema of Component parameters.
type: string
latestRevision:
description: LatestRevision of the trait definition
properties:
name:
type: string
revision:
format: int64
type: integer
revisionHash:
description: RevisionHash record the hash value of the spec of
ApplicationRevision object.
type: string
required:
- name
- revision
type: object
type: object
type: object
served: true
storage: false
subresources:
status: {}
- additionalPrinterColumns:
- jsonPath: .spec.appliesToWorkloads
name: APPLIES-TO
type: string
- jsonPath: .metadata.annotations.definition\.oam\.dev/description
name: DESCRIPTION
type: string
name: v1beta1
schema:
openAPIV3Schema:
description: A TraitDefinition registers a kind of Kubernetes custom resource
as a valid OAM trait kind by referencing its CustomResourceDefinition. The
CRD is used to validate the schema of the trait when it is embedded in an
OAM ApplicationConfiguration.
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: A TraitDefinitionSpec defines the desired state of a TraitDefinition.
properties:
appliesToWorkloads:
description: AppliesToWorkloads specifies the list of workload kinds
this trait applies to. Workload kinds are specified in resource.group/version
format, e.g. server.core.oam.dev/v1alpha2. Traits that omit this
field apply to all workload kinds.
items:
type: string
type: array
conflictsWith:
description: 'ConflictsWith specifies the list of traits(CRD name,
Definition name, CRD group) which could not apply to the same workloads
with this trait. Traits that omit this field can work with any other
traits. Example rules: "service" # Trait definition name "services.k8s.io"
# API resource/crd name "*.networking.k8s.io" # API group "labelSelector:foo=bar"
# label selector labelSelector format: https://pkg.go.dev/k8s.io/apimachinery/pkg/labels#Parse'
items:
type: string
type: array
controlPlaneOnly:
description: ControlPlaneOnly defines which cluster is dispatched
to
type: boolean
definitionRef:
description: Reference to the CustomResourceDefinition that defines
this trait kind.
properties:
name:
description: Name of the referenced CustomResourceDefinition.
type: string
version:
description: Version indicate which version should be used if
CRD has multiple versions by default it will use the first one
if not specified
type: string
required:
- name
type: object
extension:
description: Extension is used for extension needs by OAM platform
builders
type: object
x-kubernetes-preserve-unknown-fields: true
manageWorkload:
description: ManageWorkload defines the trait would be responsible
for creating the workload
type: boolean
podDisruptive:
description: PodDisruptive specifies whether using the trait will
cause the pod to restart or not.
type: boolean
revisionEnabled:
description: Revision indicates whether a trait is aware of component
revision
type: boolean
schematic:
description: Schematic defines the data format and template of the
encapsulation of the trait. Only CUE and Kube schematic are supported
for now.
properties:
cue:
description: CUE defines the encapsulation in CUE format
properties:
template:
description: Template defines the abstraction template data
of the capability, it will replace the old CUE template
in extension field. Template is a required field if CUE
is defined in Capability Definition.
type: string
required:
- template
type: object
helm:
description: A Helm represents resources used by a Helm module
properties:
release:
description: Release records a Helm release used by a Helm
module workload.
type: object
x-kubernetes-preserve-unknown-fields: true
repository:
description: HelmRelease records a Helm repository used by
a Helm module workload.
type: object
x-kubernetes-preserve-unknown-fields: true
required:
- release
- repository
type: object
kube:
description: Kube defines the encapsulation in raw Kubernetes
resource format
properties:
parameters:
description: Parameters defines configurable parameters
items:
description: A KubeParameter defines a configurable parameter
of a component.
properties:
description:
description: Description of this parameter.
type: string
fieldPaths:
description: "FieldPaths specifies an array of fields
within this workload that will be overwritten by the
value of this parameter. \tAll fields must be of the
same type. Fields are specified as JSON field paths
without a leading dot, for example 'spec.replicas'."
items:
type: string
type: array
name:
description: Name of this parameter
type: string
required:
default: false
description: Required specifies whether or not a value
for this parameter must be supplied when authoring
an Application.
type: boolean
type:
description: 'ValueType indicates the type of the parameter
value, and only supports basic data types: string,
number, boolean.'
enum:
- string
- number
- boolean
type: string
required:
- fieldPaths
- name
- type
type: object
type: array
template:
description: Template defines the raw Kubernetes resource
type: object
x-kubernetes-preserve-unknown-fields: true
required:
- template
type: object
terraform:
description: Terraform is the struct to describe cloud resources
managed by Hashicorp Terraform
properties:
configuration:
description: Configuration is Terraform Configuration
type: string
customRegion:
description: Region is cloud provider's region. It will override
the region in the region field of ProviderReference
type: string
deleteResource:
default: true
description: DeleteResource will determine whether provisioned
cloud resources will be deleted when CR is deleted
type: boolean
gitCredentialsSecretReference:
description: GitCredentialsSecretReference specifies the reference
to the secret containing the git credentials
properties:
name:
description: name is unique within a namespace to reference
a secret resource.
type: string
namespace:
description: namespace defines the space within which
the secret name must be unique.
type: string
type: object
x-kubernetes-map-type: atomic
path:
description: Path is the sub-directory of remote git repository.
It's valid when remote is set
type: string
providerRef:
description: ProviderReference specifies the reference to
Provider
properties:
name:
description: Name of the referenced object.
type: string
namespace:
default: default
description: Namespace of the referenced object.
type: string
required:
- name
type: object
type:
default: hcl
description: Type specifies which Terraform configuration
it is, HCL or JSON syntax
enum:
- hcl
- json
- remote
type: string
writeConnectionSecretToRef:
description: WriteConnectionSecretToReference specifies the
namespace and name of a Secret to which any connection details
for this managed resource should be written. Connection
details frequently include the endpoint, username, and password
required to connect to the managed resource.
properties:
name:
description: Name of the secret.
type: string
namespace:
description: Namespace of the secret.
type: string
required:
- name
type: object
required:
- configuration
type: object
type: object
stage:
description: Stage defines the stage information to which this trait
resource processing belongs. Currently, PreDispatch and PostDispatch
are provided, which are used to control resource pre-process and
post-process respectively.
type: string
status:
description: Status defines the custom health policy and status message
for trait
properties:
customStatus:
description: CustomStatus defines the custom status message that
could display to user
type: string
healthPolicy:
description: HealthPolicy defines the health check policy for
the abstraction
type: string
type: object
workloadRefPath:
description: WorkloadRefPath indicates where/if a trait accepts a
workloadRef object
type: string
type: object
status:
description: TraitDefinitionStatus is the status of TraitDefinition
properties:
conditions:
description: Conditions of the resource.
items:
description: A Condition that may apply to a resource.
properties:
lastTransitionTime:
description: LastTransitionTime is the last time this condition
transitioned from one status to another.
format: date-time
type: string
message:
description: A Message containing details about this condition's
last transition from one status to another, if any.
type: string
reason:
description: A Reason for this condition's last transition from
one status to another.
type: string
status:
description: Status of this condition; is it currently True,
False, or Unknown?
type: string
type:
description: Type of this condition. At most one of each condition
type may apply to a resource at any point in time.
type: string
required:
- lastTransitionTime
- reason
- status
- type
type: object
type: array
configMapRef:
description: ConfigMapRef refer to a ConfigMap which contains OpenAPI
V3 JSON schema of Component parameters.
type: string
latestRevision:
description: LatestRevision of the component definition
properties:
name:
type: string
revision:
format: int64
type: integer
revisionHash:
description: RevisionHash record the hash value of the spec of
ApplicationRevision object.
type: string
required:
- name
- revision
type: object
type: object
type: object
served: true
storage: true
subresources:
status: {}

View File

@ -1,173 +0,0 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.9.0
creationTimestamp: null
name: workflows.core.oam.dev
spec:
group: core.oam.dev
names:
categories:
- oam
kind: Workflow
listKind: WorkflowList
plural: workflows
singular: workflow
scope: Namespaced
versions:
- name: v1alpha1
schema:
openAPIV3Schema:
description: Workflow is the Schema for the workflow 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
mode:
description: WorkflowExecuteMode defines the mode of workflow execution
properties:
steps:
description: Steps is the mode of workflow steps execution
type: string
subSteps:
description: SubSteps is the mode of workflow sub steps execution
type: string
type: object
steps:
items:
description: WorkflowStep defines how to execute a workflow step.
properties:
dependsOn:
description: DependsOn is the dependency of the step
items:
type: string
type: array
if:
description: If is the if condition of the step
type: string
inputs:
description: Inputs is the inputs of the step
items:
properties:
from:
type: string
parameterKey:
type: string
required:
- from
- parameterKey
type: object
type: array
meta:
description: Meta is the meta data of the workflow step.
properties:
alias:
type: string
type: object
name:
description: Name is the unique name of the workflow step.
type: string
outputs:
description: Outputs is the outputs of the step
items:
properties:
name:
type: string
valueFrom:
type: string
required:
- name
- valueFrom
type: object
type: array
properties:
description: Properties is the properties of the step
type: object
x-kubernetes-preserve-unknown-fields: true
subSteps:
items:
description: WorkflowStepBase defines the workflow step base
properties:
dependsOn:
description: DependsOn is the dependency of the step
items:
type: string
type: array
if:
description: If is the if condition of the step
type: string
inputs:
description: Inputs is the inputs of the step
items:
properties:
from:
type: string
parameterKey:
type: string
required:
- from
- parameterKey
type: object
type: array
meta:
description: Meta is the meta data of the workflow step.
properties:
alias:
type: string
type: object
name:
description: Name is the unique name of the workflow step.
type: string
outputs:
description: Outputs is the outputs of the step
items:
properties:
name:
type: string
valueFrom:
type: string
required:
- name
- valueFrom
type: object
type: array
properties:
description: Properties is the properties of the step
type: object
x-kubernetes-preserve-unknown-fields: true
timeout:
description: Timeout is the timeout of the step
type: string
type:
description: Type is the type of the workflow step.
type: string
required:
- name
- type
type: object
type: array
timeout:
description: Timeout is the timeout of the step
type: string
type:
description: Type is the type of the workflow step.
type: string
required:
- name
- type
type: object
type: array
type: object
served: true
storage: true

View File

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

View File

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

View File

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

View File

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

View File

@ -1,319 +0,0 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "kubevela.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "kubevela.fullname" -}}
{{- if .Values.fullnameOverride -}}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- if contains $name .Release.Name -}}
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "kubevela.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
Common labels
*/}}
{{- define "kubevela.labels" -}}
helm.sh/chart: {{ include "kubevela.chart" . }}
{{ include "kubevela.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end -}}
{{/*
Selector labels
*/}}
{{- define "kubevela.selectorLabels" -}}
app.kubernetes.io/name: {{ include "kubevela.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end -}}
{{- define "kubevela-cluster-gateway.selectorLabels" -}}
app.kubernetes.io/name: {{ include "kubevela.name" . }}-cluster-gateway
app.kubernetes.io/instance: {{ .Release.Name }}-cluster-gateway
{{- end -}}
{{/*
Create the name of the service account to use
*/}}
{{- define "kubevela.serviceAccountName" -}}
{{- if .Values.serviceAccount.create -}}
{{ default (include "kubevela.fullname" .) .Values.serviceAccount.name }}
{{- else -}}
{{ default "default" .Values.serviceAccount.name }}
{{- end -}}
{{- end -}}
{{/*
systemDefinitionNamespace value defaulter
*/}}
{{- define "systemDefinitionNamespace" -}}
{{- if .Values.systemDefinitionNamespace -}}
{{ .Values.systemDefinitionNamespace }}
{{- else -}}
{{ .Release.Namespace }}
{{- end -}}
{{- end -}}
{{/*
PodSpec for both Deployment and Pod
*/}}
{{- define "kubevela.podSpec" -}}
{{- with .Values.imagePullSecrets -}}
imagePullSecrets:
{{- toYaml . | nindent 6 -}}
{{- end -}}
serviceAccountName: {{ include "kubevela.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 2 }}
containers:
- name: {{ .Release.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 4 }}
args:
- "--metrics-addr=:8080"
- "--enable-leader-election"
{{- if ne .Values.logFilePath "" }}
- "--log-file-path={{ .Values.logFilePath }}"
- "--log-file-max-size={{ .Values.logFileMaxSize }}"
{{ end -}}
{{ if .Values.logDebug }}
- "--log-debug=true"
{{ end }}
{{ if .Values.admissionWebhooks.enabled }}
- "--use-webhook=true"
- "--webhook-port={{ .Values.webhookService.port }}"
- "--webhook-cert-dir={{ .Values.admissionWebhooks.certificate.mountPath }}"
{{ end }}
- "--health-addr=:{{ .Values.healthCheck.port }}"
{{ if ne .Values.disableCaps "" }}
- "--disable-caps={{ .Values.disableCaps }}"
{{ end }}
- "--system-definition-namespace={{ include "systemDefinitionNamespace" . }}"
- "--application-revision-limit={{ .Values.applicationRevisionLimit }}"
- "--definition-revision-limit={{ .Values.definitionRevisionLimit }}"
- "--oam-spec-ver={{ .Values.OAMSpecVer }}"
{{ if .Values.multicluster.enabled }}
- "--enable-cluster-gateway"
{{ end }}
- "--application-re-sync-period={{ .Values.controllerArgs.reSyncPeriod }}"
- "--concurrent-reconciles={{ .Values.concurrentReconciles }}"
- "--kube-api-qps={{ .Values.kubeClient.qps }}"
- "--kube-api-burst={{ .Values.kubeClient.burst }}"
- "--max-workflow-wait-backoff-time={{ .Values.workflow.backoff.maxTime.waitState }}"
- "--max-workflow-failed-backoff-time={{ .Values.workflow.backoff.maxTime.failedState }}"
- "--max-workflow-step-error-retry-times={{ .Values.workflow.step.errorRetryTimes }}"
image: {{ .Values.imageRegistry }}{{ .Values.image.repository }}:{{ .Values.image.tag }}
imagePullPolicy: {{ quote .Values.image.pullPolicy }}
resources:
{{- toYaml .Values.resources | nindent 4 -}}
{{ if .Values.admissionWebhooks.enabled }}
ports:
- containerPort: {{ .Values.webhookService.port }}
name: webhook-server
protocol: TCP
- containerPort: {{ .Values.healthCheck.port }}
name: healthz
protocol: TCP
readinessProbe:
httpGet:
path: /readyz
port: healthz
initialDelaySeconds: 30
periodSeconds: 5
livenessProbe:
httpGet:
path: /healthz
port: healthz
initialDelaySeconds: 90
periodSeconds: 5
volumeMounts:
- mountPath: {{ .Values.admissionWebhooks.certificate.mountPath }}
name: tls-cert-vol
readOnly: true
{{ end }}
{{ if .Values.admissionWebhooks.enabled }}
volumes:
- name: tls-cert-vol
secret:
defaultMode: 420
secretName: {{ template "kubevela.fullname" . }}-admission
{{ end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 6 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{ end }}
{{/*
Cluster Gateway podSpec for both Deployment and Pod
*/}}
{{- define "kubevela-cluster-gateway.podSpec" -}}
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 2 }}
{{- end }}
serviceAccountName: {{ include "kubevela.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 2 }}
containers:
- name: {{ include "kubevela.fullname" . }}-cluster-gateway
securityContext:
{{- toYaml .Values.securityContext | nindent 6 }}
args:
- "apiserver"
- "--secure-port={{ .Values.multicluster.clusterGateway.port }}"
- "--secret-namespace={{ .Release.Namespace }}"
- "--feature-gates=APIPriorityAndFairness=false,ClientIdentityPenetration={{ .Values.authentication.enabled }}"
- "--cluster-gateway-proxy-config=/etc/proxy-config/config.yaml"
{{ if .Values.multicluster.clusterGateway.secureTLS.enabled }}
- "--tls-cert-file={{ .Values.multicluster.clusterGateway.secureTLS.certPath }}/tls.crt"
- "--tls-private-key-file={{ .Values.multicluster.clusterGateway.secureTLS.certPath }}/tls.key"
{{ end }}
image: {{ .Values.imageRegistry }}{{ .Values.multicluster.clusterGateway.image.repository }}:{{ .Values.multicluster.clusterGateway.image.tag }}
imagePullPolicy: {{ .Values.multicluster.clusterGateway.image.pullPolicy }}
resources:
{{- toYaml .Values.multicluster.clusterGateway.resources | nindent 6 }}
ports:
- containerPort: {{ .Values.multicluster.clusterGateway.port }}
volumeMounts:
- mountPath: /etc/proxy-config
name: proxy-config
{{ if .Values.multicluster.clusterGateway.secureTLS.enabled }}
- mountPath: {{ .Values.multicluster.clusterGateway.secureTLS.certPath }}
name: tls-cert-vol
readOnly: true
{{- end }}
volumes:
- configMap:
defaultMode: 420
name: {{ .Release.Name }}-cluster-gateway-proxy-config
name: proxy-config
{{ if .Values.multicluster.clusterGateway.secureTLS.enabled }}
- name: tls-cert-vol
secret:
defaultMode: 420
secretName: {{ template "kubevela.fullname" . }}-cluster-gateway-tls-v2
{{ end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 2 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 2 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 2 }}
{{- end }}
{{ end }}
{{ define "kubevela-cluster-gateway-tls-secret-patch.name-labels" }}
name: {{ template "kubevela.fullname" . }}-cluster-gateway-tls-secret-patch
labels:
app: {{ template "kubevela.fullname" . }}-cluster-gateway-tls-secret-patch
{{- include "kubevela.labels" . | nindent 2 }}
{{ end }}
{{ define "kubevela-cluster-gateway-tls-secret-patch.annotations" }}
annotations:
"helm.sh/hook": post-install,post-upgrade
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded
{{ end }}
{{/*
Cluster Gateway TLS secret patch podSpec for both Job and Pod
*/}}
{{ define "kubevela-cluster-gateway-tls-secret-patch.podSpec" }}
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 2 }}
{{- end }}
containers:
- name: patch
image: {{ .Values.imageRegistry }}{{ .Values.multicluster.clusterGateway.image.repository }}:{{ .Values.multicluster.clusterGateway.image.tag }}
imagePullPolicy: {{ .Values.multicluster.clusterGateway.image.pullPolicy }}
command:
- /patch
args:
- --secret-namespace={{ .Release.Namespace }}
- --secret-name={{ template "kubevela.fullname" . }}-cluster-gateway-tls-v2
restartPolicy: OnFailure
serviceAccountName: {{ include "kubevela.serviceAccountName" . }}
securityContext:
runAsGroup: 2000
runAsNonRoot: true
runAsUser: 2000
{{ end }}
{{ define "kubevela-cluster-gateway-tls-secret-create.name-labels" }}
name: {{ template "kubevela.fullname" . }}-cluster-gateway-tls-secret-create
labels:
app: {{ template "kubevela.fullname" . }}-cluster-gateway-tls-secret-create
{{- include "kubevela.labels" . | nindent 2 }}
{{ end }}
{{ define "kubevela-cluster-gateway-tls-secret-create.annotations" }}
annotations:
"helm.sh/hook": pre-install,pre-upgrade
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded
{{ end }}
{{/*
Cluster Gateway TLS secret create podSpec for both Job and Pod
*/}}
{{ define "kubevela-cluster-gateway-tls-secret-create.podSpec" }}
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 2 }}
{{- end }}
containers:
- name: create
image: {{ .Values.imageRegistry }}{{ .Values.admissionWebhooks.patch.image.repository }}:{{ .Values.admissionWebhooks.patch.image.tag }}
imagePullPolicy: {{ .Values.admissionWebhooks.patch.image.pullPolicy }}
args:
- create
- --host={{ .Release.Name }}-cluster-gateway-service,{{ .Release.Name }}-cluster-gateway-service.{{ .Release.Namespace }}.svc
- --namespace={{ .Release.Namespace }}
- --secret-name={{ template "kubevela.fullname" . }}-cluster-gateway-tls-v2
- --cert-name=tls.crt
- --key-name=tls.key
restartPolicy: OnFailure
serviceAccountName: {{ template "kubevela.fullname" . }}-cluster-gateway-admission
securityContext:
runAsGroup: 2000
runAsNonRoot: true
runAsUser: 2000
{{ end }}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,19 +0,0 @@
{{- if .Values.admissionWebhooks.enabled -}}
apiVersion: v1
kind: Service
metadata:
name: {{ template "kubevela.name" . }}-webhook
namespace: {{ .Release.Namespace }}
labels:
{{- include "kubevela.labels" . | nindent 4 }}
spec:
type: {{ .Values.webhookService.type }}
ports:
- port: 443
targetPort: {{ .Values.webhookService.port }}
protocol: TCP
name: https
selector:
{{ include "kubevela.selectorLabels" . | nindent 6 }}
{{- end -}}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,22 +0,0 @@
# Code generated by KubeVela templates. DO NOT EDIT. Please edit the original cue file.
# Definition source cue file: vela-templates/definitions/internal/apply-component.cue
apiVersion: core.oam.dev/v1beta1
kind: WorkflowStepDefinition
metadata:
annotations:
definition.oam.dev/description: Apply a specific component and its corresponding traits in application
labels:
custom.definition.oam.dev/scope: Application
name: apply-component
namespace: {{ include "systemDefinitionNamespace" . }}
spec:
schematic:
cue:
template: |
parameter: {
// +usage=Specify the component name to apply
component: string
// +usage=Specify the cluster
cluster: *"" | string
}

View File

@ -1,51 +0,0 @@
# Code generated by KubeVela templates. DO NOT EDIT. Please edit the original cue file.
# Definition source cue file: vela-templates/definitions/internal/apply-deployment.cue
apiVersion: core.oam.dev/v1beta1
kind: WorkflowStepDefinition
metadata:
annotations:
definition.oam.dev/alias: ""
definition.oam.dev/description: Apply deployment with specified image and cmd.
name: apply-deployment
namespace: {{ include "systemDefinitionNamespace" . }}
spec:
schematic:
cue:
template: |
import (
"strconv"
"strings"
"vela/op"
)
output: op.#Apply & {
value: {
apiVersion: "apps/v1"
kind: "Deployment"
metadata: {
name: context.stepName
namespace: context.namespace
}
spec: {
selector: matchLabels: "workflow.oam.dev/step-name": "\(context.name)-\(context.stepName)"
template: {
metadata: labels: "workflow.oam.dev/step-name": "\(context.name)-\(context.stepName)"
spec: containers: [{
name: context.stepName
image: parameter.image
if parameter["cmd"] != _|_ {
command: parameter.cmd
}
}]
}
}
}
}
wait: op.#ConditionalWait & {
continue: output.value.status.readyReplicas == 1
}
parameter: {
image: string
cmd?: [...string]
}

View File

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

View File

@ -1,46 +0,0 @@
# Code generated by KubeVela templates. DO NOT EDIT. Please edit the original cue file.
# Definition source cue file: vela-templates/definitions/internal/apply-once.cue
apiVersion: core.oam.dev/v1beta1
kind: PolicyDefinition
metadata:
annotations:
definition.oam.dev/description: Allow configuration drift for applied resources, delivery the resource without continuously reconciliation.
name: apply-once
namespace: {{ include "systemDefinitionNamespace" . }}
spec:
schematic:
cue:
template: |
#ApplyOnceStrategy: {
// +usage=When the strategy takes effect,e.g. onUpdate、onStateKeep
affect?: string
// +usage=Specify the path of the resource that allow configuration drift
path: [...string]
}
#ApplyOncePolicyRule: {
// +usage=Specify how to select the targets of the rule
selector?: #ResourcePolicyRuleSelector
// +usage=Specify the strategy for configuring the resource level configuration drift behaviour
strategy: #ApplyOnceStrategy
}
#ResourcePolicyRuleSelector: {
// +usage=Select resources by component names
componentNames?: [...string]
// +usage=Select resources by component types
componentTypes?: [...string]
// +usage=Select resources by oamTypes (COMPONENT or TRAIT)
oamTypes?: [...string]
// +usage=Select resources by trait types
traitTypes?: [...string]
// +usage=Select resources by resource types (like Deployment)
resourceTypes?: [...string]
// +usage=Select resources by their names
resourceNames?: [...string]
}
parameter: {
// +usage=Whether to enable apply-once for the whole application
enable: *false | bool
// +usage=Specify the rules for configuring apply-once policy in resource level
rules?: [...#ApplyOncePolicyRule]
}

View File

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

View File

@ -1,91 +0,0 @@
# Code generated by KubeVela templates. DO NOT EDIT. Please edit the original cue file.
# Definition source cue file: vela-templates/definitions/internal/apply-terraform-config.cue
apiVersion: core.oam.dev/v1beta1
kind: WorkflowStepDefinition
metadata:
annotations:
definition.oam.dev/alias: ""
definition.oam.dev/description: Apply terraform configuration in the step
definition.oam.dev/example-url: https://raw.githubusercontent.com/kubevela/workflow/main/examples/workflow-run/apply-terraform-resource.yaml
name: apply-terraform-config
namespace: {{ include "systemDefinitionNamespace" . }}
spec:
schematic:
cue:
template: |
import (
"vela/op"
)
apply: op.#Apply & {
value: {
apiVersion: "terraform.core.oam.dev/v1beta2"
kind: "Configuration"
metadata: {
name: "\(context.name)-\(context.stepName)"
namespace: context.namespace
}
spec: {
deleteResource: parameter.deleteResource
variable: parameter.variable
forceDelete: parameter.forceDelete
if parameter.source.path != _|_ {
path: parameter.source.path
}
if parameter.source.remote != _|_ {
remote: parameter.source.remote
}
if parameter.source.hcl != _|_ {
hcl: parameter.source.hcl
}
if parameter.providerRef != _|_ {
providerRef: parameter.providerRef
}
if parameter.jobEnv != _|_ {
jobEnv: parameter.jobEnv
}
if parameter.writeConnectionSecretToRef != _|_ {
writeConnectionSecretToRef: parameter.writeConnectionSecretToRef
}
if parameter.region != _|_ {
region: parameter.region
}
}
}
}
check: op.#ConditionalWait & {
continue: apply.value.status != _|_ && apply.value.status.apply != _|_ && apply.value.status.apply.state == "Available"
}
parameter: {
// +usage=specify the source of the terraform configuration
source: close({
// +usage=directly specify the hcl of the terraform configuration
hcl: string
}) | close({
// +usage=specify the remote url of the terraform configuration
remote: *"https://github.com/kubevela-contrib/terraform-modules.git" | string
// +usage=specify the path of the terraform configuration
path?: string
})
// +usage=whether to delete resource
deleteResource: *true | bool
// +usage=the variable in the configuration
variable: {...}
// +usage=this specifies the namespace and name of a secret to which any connection details for this managed resource should be written.
writeConnectionSecretToRef?: {
name: string
namespace: *context.namespace | string
}
// +usage=providerRef specifies the reference to Provider
providerRef?: {
name: string
namespace: *context.namespace | string
}
// +usage=region is cloud provider's region. It will override the region in the region field of providerRef
region?: string
// +usage=the envs for job
jobEnv?: {...}
// +usae=forceDelete will force delete Configuration no matter which state it is or whether it has provisioned some resources
forceDelete: *false | bool
}

View File

@ -1,144 +0,0 @@
# Code generated by KubeVela templates. DO NOT EDIT. Please edit the original cue file.
# Definition source cue file: vela-templates/definitions/internal/apply-terraform-provider.cue
apiVersion: core.oam.dev/v1beta1
kind: WorkflowStepDefinition
metadata:
annotations:
definition.oam.dev/alias: ""
definition.oam.dev/description: Apply terraform provider config
definition.oam.dev/example-url: https://raw.githubusercontent.com/kubevela/workflow/main/examples/workflow-run/apply-terraform-resource.yaml
name: apply-terraform-provider
namespace: {{ include "systemDefinitionNamespace" . }}
spec:
schematic:
cue:
template: |
import (
"vela/op"
"strings"
)
config: op.#CreateConfig & {
name: "\(context.name)-\(context.stepName)"
namespace: context.namespace
template: "terraform-\(parameter.type)"
config: {
name: parameter.name
if parameter.type == "alibaba" {
ALICLOUD_ACCESS_KEY: parameter.accessKey
ALICLOUD_SECRET_KEY: parameter.secretKey
ALICLOUD_REGION: parameter.region
}
if parameter.type == "aws" {
AWS_ACCESS_KEY_ID: parameter.accessKey
AWS_SECRET_ACCESS_KEY: parameter.secretKey
AWS_DEFAULT_REGION: parameter.region
AWS_SESSION_TOKEN: parameter.token
}
if parameter.type == "azure" {
ARM_CLIENT_ID: parameter.clientID
ARM_CLIENT_SECRET: parameter.clientSecret
ARM_SUBSCRIPTION_ID: parameter.subscriptionID
ARM_TENANT_ID: parameter.tenantID
}
if parameter.type == "baidu" {
BAIDUCLOUD_ACCESS_KEY: parameter.accessKey
BAIDUCLOUD_SECRET_KEY: parameter.secretKey
BAIDUCLOUD_REGION: parameter.region
}
if parameter.type == "ec" {
EC_API_KEY: parameter.apiKey
}
if parameter.type == "gcp" {
GOOGLE_CREDENTIALS: parameter.credentials
GOOGLE_REGION: parameter.region
GOOGLE_PROJECT: parameter.project
}
if parameter.type == "tencent" {
TENCENTCLOUD_SECRET_ID: parameter.secretID
TENCENTCLOUD_SECRET_KEY: parameter.secretKey
TENCENTCLOUD_REGION: parameter.region
}
if parameter.type == "ucloud" {
UCLOUD_PRIVATE_KEY: parameter.privateKey
UCLOUD_PUBLIC_KEY: parameter.publicKey
UCLOUD_PROJECT_ID: parameter.projectID
UCLOUD_REGION: parameter.region
}
}
}
read: op.#Read & {
value: {
apiVersion: "terraform.core.oam.dev/v1beta1"
kind: "Provider"
metadata: {
name: parameter.name
namespace: context.namespace
}
}
}
check: op.#ConditionalWait & {
if read.value.status != _|_ {
continue: read.value.status.state == "ready"
}
if read.value.status == _|_ {
continue: false
}
}
providerBasic: {
accessKey: string
secretKey: string
region: string
}
#AlibabaProvider: {
providerBasic
type: "alibaba"
name: *"alibaba-provider" | string
}
#AWSProvider: {
providerBasic
token: *"" | string
type: "aws"
name: *"aws-provider" | string
}
#AzureProvider: {
subscriptionID: string
tenantID: string
clientID: string
clientSecret: string
name: *"azure-provider" | string
}
#BaiduProvider: {
providerBasic
type: "baidu"
name: *"baidu-provider" | string
}
#ECProvider: {
type: "ec"
apiKey: *"" | string
name: "ec-provider" | string
}
#GCPProvider: {
credentials: string
region: string
project: string
type: "gcp"
name: *"gcp-provider" | string
}
#TencentProvider: {
secretID: string
secretKey: string
region: string
type: "tencent"
name: *"tencent-provider" | string
}
#UCloudProvider: {
publicKey: string
privateKey: string
projectID: string
region: string
type: "ucloud"
name: *"ucloud-provider" | string
}
parameter: *#AlibabaProvider | #AWSProvider | #AzureProvider | #BaiduProvider | #ECProvider | #GCPProvider | #TencentProvider | #UCloudProvider

View File

@ -1,158 +0,0 @@
# Code generated by KubeVela templates. DO NOT EDIT. Please edit the original cue file.
# Definition source cue file: vela-templates/definitions/internal/build-push-image.cue
apiVersion: core.oam.dev/v1beta1
kind: WorkflowStepDefinition
metadata:
annotations:
definition.oam.dev/alias: ""
definition.oam.dev/description: Build and push image from git url
definition.oam.dev/example-url: https://raw.githubusercontent.com/kubevela/workflow/main/examples/workflow-run/built-push-image.yaml
name: build-push-image
namespace: {{ include "systemDefinitionNamespace" . }}
spec:
schematic:
cue:
template: |
import (
"vela/op"
"encoding/json"
"strings"
)
url: {
if parameter.context.git != _|_ {
address: strings.TrimPrefix(parameter.context.git, "git://")
value: "git://\(address)#refs/heads/\(parameter.context.branch)"
}
if parameter.context.git == _|_ {
value: parameter.context
}
}
kaniko: op.#Apply & {
value: {
apiVersion: "v1"
kind: "Pod"
metadata: {
name: "\(context.name)-\(context.stepSessionID)-kaniko"
namespace: context.namespace
}
spec: {
containers: [
{
args: [
"--dockerfile=\(parameter.dockerfile)",
"--context=\(url.value)",
"--destination=\(parameter.image)",
"--verbosity=\(parameter.verbosity)",
if parameter.platform != _|_ {
"--customPlatform=\(parameter.platform)"
},
if parameter.buildArgs != _|_ for arg in parameter.buildArgs {
"--build-arg=\(arg)"
},
]
image: parameter.kanikoExecutor
name: "kaniko"
if parameter.credentials != _|_ && parameter.credentials.image != _|_ {
volumeMounts: [
{
mountPath: "/kaniko/.docker/"
name: parameter.credentials.image.name
},
]
}
if parameter.credentials != _|_ && parameter.credentials.git != _|_ {
env: [
{
name: "GIT_TOKEN"
valueFrom: secretKeyRef: {
key: parameter.credentials.git.key
name: parameter.credentials.git.name
}
},
]
}
},
]
if parameter.credentials != _|_ && parameter.credentials.image != _|_ {
volumes: [
{
name: parameter.credentials.image.name
secret: {
defaultMode: 420
items: [
{
key: parameter.credentials.image.key
path: "config.json"
},
]
secretName: parameter.credentials.image.name
}
},
]
}
restartPolicy: "Never"
}
}
}
log: op.#Log & {
source: resources: [{
name: "\(context.name)-\(context.stepSessionID)-kaniko"
namespace: context.namespace
}]
}
read: op.#Read & {
value: {
apiVersion: "v1"
kind: "Pod"
metadata: {
name: "\(context.name)-\(context.stepSessionID)-kaniko"
namespace: context.namespace
}
}
}
wait: op.#ConditionalWait & {
continue: read.value.status != _|_ && read.value.status.phase == "Succeeded"
}
#secret: {
name: string
key: string
}
#git: {
git: string
branch: *"master" | string
}
parameter: {
// +usage=Specify the kaniko executor image, default to oamdev/kaniko-executor:v1.9.1
kanikoExecutor: *"oamdev/kaniko-executor:v1.9.1" | string
// +usage=Specify the context to build image, you can use context with git and branch or directly specify the context, please refer to https://github.com/GoogleContainerTools/kaniko#kaniko-build-contexts
context: #git | string
// +usage=Specify the dockerfile
dockerfile: *"./Dockerfile" | string
// +usage=Specify the image
image: string
// +usage=Specify the platform to build
platform?: string
// +usage=Specify the build args
buildArgs?: [...string]
// +usage=Specify the credentials to access git and image registry
credentials?: {
// +usage=Specify the credentials to access git
git?: {
// +usage=Specify the secret name
name: string
// +usage=Specify the secret key
key: string
}
// +usage=Specify the credentials to access image registry
image?: {
// +usage=Specify the secret name
name: string
// +usage=Specify the secret key
key: *".dockerconfigjson" | string
}
}
// +usage=Specify the verbosity level
verbosity: *"info" | "panic" | "fatal" | "error" | "warn" | "debug" | "trace"
}

View File

@ -1,60 +0,0 @@
# Code generated by KubeVela templates. DO NOT EDIT. Please edit the original cue file.
# Definition source cue file: vela-templates/definitions/internal/clean-jobs.cue
apiVersion: core.oam.dev/v1beta1
kind: WorkflowStepDefinition
metadata:
annotations:
definition.oam.dev/description: clean applied jobs in the cluster
name: clean-jobs
namespace: {{ include "systemDefinitionNamespace" . }}
spec:
schematic:
cue:
template: |
import (
"vela/op"
)
parameter: {
labelselector?: {...}
namespace: *context.namespace | string
}
cleanJobs: op.#Delete & {
value: {
apiVersion: "batch/v1"
kind: "Job"
metadata: {
name: context.name
namespace: parameter.namespace
}
}
filter: {
namespace: parameter.namespace
if parameter.labelselector != _|_ {
matchingLabels: parameter.labelselector
}
if parameter.labelselector == _|_ {
matchingLabels: "workflow.oam.dev/name": context.name
}
}
}
cleanPods: op.#Delete & {
value: {
apiVersion: "v1"
kind: "pod"
metadata: {
name: context.name
namespace: parameter.namespace
}
}
filter: {
namespace: parameter.namespace
if parameter.labelselector != _|_ {
matchingLabels: parameter.labelselector
}
if parameter.labelselector == _|_ {
matchingLabels: "workflow.oam.dev/name": context.name
}
}
}

View File

@ -1,97 +0,0 @@
# Code generated by KubeVela templates. DO NOT EDIT. Please edit the original cue file.
# Definition source cue file: vela-templates/definitions/internal/collect-service-endpoints.cue
apiVersion: core.oam.dev/v1beta1
kind: WorkflowStepDefinition
metadata:
annotations:
definition.oam.dev/description: Collect service endpoints for the application.
name: collect-service-endpoints
namespace: {{ include "systemDefinitionNamespace" . }}
spec:
schematic:
cue:
template: |
import (
"vela/op"
"vela/ql"
"strconv"
)
collect: ql.#CollectServiceEndpoints & {
app: {
name: *context.name | string
namespace: *context.namespace | string
if parameter.name != _|_ {
name: parameter.name
}
if parameter.namespace != _|_ {
namespace: parameter.namespace
}
filter: {
if parameter.components != _|_ {
components: parameter.components
}
}
}
} @step(1)
outputs: {
eps_port_name_filtered: *[] | [...]
if parameter.portName == _|_ {
eps_port_name_filtered: collect.list
}
if parameter.portName != _|_ {
eps_port_name_filtered: [ for ep in collect.list if parameter.portName == ep.endpoint.portName {ep}]
}
eps_port_filtered: *[] | [...]
if parameter.port == _|_ {
eps_port_filtered: eps_port_name_filtered
}
if parameter.port != _|_ {
eps_port_filtered: [ for ep in eps_port_name_filtered if parameter.port == ep.endpoint.port {ep}]
}
eps: eps_port_filtered
endpoints: *[] | [...]
if parameter.outer != _|_ {
tmps: [ for ep in eps {
ep
if ep.endpoint.inner == _|_ {
outer: true
}
if ep.endpoint.inner != _|_ {
outer: !ep.endpoint.inner
}
}]
endpoints: [ for ep in tmps if (!parameter.outer || ep.outer) {ep}]
}
if parameter.outer == _|_ {
endpoints: eps_port_filtered
}
}
wait: op.#ConditionalWait & {
continue: len(outputs.endpoints) > 0
} @step(2)
value: {
if len(outputs.endpoints) > 0 {
endpoint: outputs.endpoints[0].endpoint
_portStr: strconv.FormatInt(endpoint.port, 10)
url: "\(parameter.protocal)://\(endpoint.host):\(_portStr)"
}
}
parameter: {
// +usage=Specify the name of the application
name?: string
// +usage=Specify the namespace of the application
namespace?: string
// +usage=Filter the component of the endpoints
components?: [...string]
// +usage=Filter the port of the endpoints
port?: int
// +usage=Filter the port name of the endpoints
portName?: string
// +usage=Filter the endpoint that are only outer
outer?: bool
// +usage=The protocal of endpoint url
protocal: *"http" | "https"
}

View File

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

View File

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

View File

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

View File

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

View File

@ -1,44 +0,0 @@
# Code generated by KubeVela templates. DO NOT EDIT. Please edit the original cue file.
# Definition source cue file: vela-templates/definitions/internal/create-config.cue
apiVersion: core.oam.dev/v1beta1
kind: WorkflowStepDefinition
metadata:
annotations:
definition.oam.dev/description: Create or update a config
name: create-config
namespace: {{ include "systemDefinitionNamespace" . }}
spec:
schematic:
cue:
template: |
import (
"vela/op"
)
deploy: op.#CreateConfig & {
name: parameter.name
if parameter.namespace != _|_ {
namespace: parameter.namespace
}
if parameter.namespace == _|_ {
namespace: context.namespace
}
if parameter.template != _|_ {
template: parameter.template
}
config: parameter.config
}
parameter: {
//+usage=Specify the name of the config.
name: string
//+usage=Specify the namespace of the config.
namespace?: string
//+usage=Specify the template of the config.
template?: string
//+usage=Specify the content of the config.
config: {...}
}

View File

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

View File

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

View File

@ -1,34 +0,0 @@
# Code generated by KubeVela templates. DO NOT EDIT. Please edit the original cue file.
# Definition source cue file: vela-templates/definitions/internal/delete-config.cue
apiVersion: core.oam.dev/v1beta1
kind: WorkflowStepDefinition
metadata:
annotations:
definition.oam.dev/description: Delete a config
name: delete-config
namespace: {{ include "systemDefinitionNamespace" . }}
spec:
schematic:
cue:
template: |
import (
"vela/op"
)
deploy: op.#DeleteConfig & {
name: parameter.name
if parameter.namespace != _|_ {
namespace: parameter.namespace
}
if parameter.namespace == _|_ {
namespace: context.namespace
}
}
parameter: {
//+usage=Specify the name of the config.
name: string
//+usage=Specify the namespace of the config.
namespace?: string
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,106 +0,0 @@
# Code generated by KubeVela templates. DO NOT EDIT. Please edit the original cue file.
# Definition source cue file: vela-templates/definitions/internal/env.cue
apiVersion: core.oam.dev/v1beta1
kind: TraitDefinition
metadata:
annotations:
definition.oam.dev/description: Add env on K8s pod for your workload which follows the pod spec in path 'spec.template'
name: env
namespace: {{ include "systemDefinitionNamespace" . }}
spec:
appliesToWorkloads:
- deployments.apps
- statefulsets.apps
- daemonsets.apps
- jobs.batch
schematic:
cue:
template: |
#PatchParams: {
// +usage=Specify the name of the target container, if not set, use the component name
containerName: *"" | string
// +usage=Specify if replacing the whole environment settings for the container
replace: *false | bool
// +usage=Specify the environment variables to merge, if key already existing, override its value
env: [string]: string
// +usage=Specify which existing environment variables to unset
unset: *[] | [...string]
}
PatchContainer: {
_params: #PatchParams
name: _params.containerName
_delKeys: {for k in _params.unset {(k): ""}}
_baseContainers: context.output.spec.template.spec.containers
_matchContainers_: [ for _container_ in _baseContainers if _container_.name == name {_container_}]
_baseContainer: *_|_ | {...}
if len(_matchContainers_) == 0 {
err: "container \(name) not found"
}
if len(_matchContainers_) > 0 {
_baseContainer: _matchContainers_[0]
_baseEnv: _baseContainer.env
if _baseEnv == _|_ {
// +patchStrategy=replace
env: [ for k, v in _params.env if _delKeys[k] == _|_ {
name: k
value: v
}]
}
if _baseEnv != _|_ {
_baseEnvMap: {for envVar in _baseEnv {(envVar.name): envVar}}
// +patchStrategy=replace
env: [ for envVar in _baseEnv if _delKeys[envVar.name] == _|_ && !_params.replace {
name: envVar.name
if _params.env[envVar.name] != _|_ {
value: _params.env[envVar.name]
}
if _params.env[envVar.name] == _|_ {
if envVar.value != _|_ {
value: envVar.value
}
if envVar.valueFrom != _|_ {
valueFrom: envVar.valueFrom
}
}
}] + [ for k, v in _params.env if _delKeys[k] == _|_ && (_params.replace || _baseEnvMap[k] == _|_) {
name: k
value: v
}]
}
}
}
patch: spec: template: spec: {
if parameter.containers == _|_ {
// +patchKey=name
containers: [{
PatchContainer & {_params: {
if parameter.containerName == "" {
containerName: context.name
}
if parameter.containerName != "" {
containerName: parameter.containerName
}
replace: parameter.replace
env: parameter.env
unset: parameter.unset
}}
}]
}
if parameter.containers != _|_ {
// +patchKey=name
containers: [ for c in parameter.containers {
if c.containerName == "" {
err: "containerName must be set for containers"
}
if c.containerName != "" {
PatchContainer & {_params: c}
}
}]
}
}
parameter: *#PatchParams | close({
// +usage=Specify the environment variables for multiple containers
containers: [...#PatchParams]
})
errs: [ for c in patch.spec.template.spec.containers if c.err != _|_ {c.err}]

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