Compare commits
133 Commits
Author | SHA1 | Date |
---|---|---|
|
7e154fbce7 | |
|
c3beea6a6b | |
|
9849282a31 | |
|
089320fad3 | |
|
aa3d7b9ccf | |
|
46fd911d13 | |
|
53db65bb9e | |
|
a0de84a39a | |
|
e689ab1e45 | |
|
e9e899832c | |
|
6b5f971e34 | |
|
962ce760fa | |
|
ab5e4da9f1 | |
|
b60e6ac0ca | |
|
155e9107f1 | |
|
7a45b956cd | |
|
ff1261bda2 | |
|
fbd81b5e00 | |
|
1254051855 | |
|
57d26ff9d9 | |
|
ce6ccd29e9 | |
|
257ac1ecf4 | |
|
b2de768a26 | |
|
f495ab52e6 | |
|
9629357ce2 | |
|
55cf302777 | |
|
5e354fbd6a | |
|
24cf09d5b0 | |
|
8c51fa8e0b | |
|
b65b0b9915 | |
|
1848e24ebd | |
|
bd22cd8bd2 | |
|
ffb935cb24 | |
|
6d567bab09 | |
|
e14291e764 | |
|
c132369431 | |
|
1fb6a29b72 | |
|
f43032dd60 | |
|
a3449ff608 | |
|
8ba1a4a7a5 | |
|
6d5278a568 | |
|
f34e778d62 | |
|
9cf91dbf26 | |
|
eb410976ea | |
|
e596bdb828 | |
|
fee275a9ab | |
|
e028608819 | |
|
993e7c8ef6 | |
|
c50085c60b | |
|
f7feb07498 | |
|
1cc0b8fe1b | |
|
31d5f454c6 | |
|
374872eb83 | |
|
534e7b91dd | |
|
728481d07f | |
|
f9b3b71f41 | |
|
11757c015b | |
|
46aec6a772 | |
|
c33686cf1a | |
|
feb6ea6e4d | |
|
909a0e421a | |
|
0cdd482432 | |
|
4ab6e5f3e4 | |
|
c4231d5db2 | |
|
7a2fdb7fc4 | |
|
fc6a4319c1 | |
|
6f8e883506 | |
|
db1805c586 | |
|
b0abd0429f | |
|
8f77d086f9 | |
|
1bbf774094 | |
|
f12aead25f | |
|
1b8b97781d | |
|
361bab65cf | |
|
1457fdb3bb | |
|
856245d598 | |
|
b76a0fd1e3 | |
|
335a1e78db | |
|
ed8bbd4dcd | |
|
316452b282 | |
|
f7dc298ef9 | |
|
0f632f3ef9 | |
|
1a56bdaaf3 | |
|
6ec19f33b9 | |
|
10bcd9c941 | |
|
c327218205 | |
|
1474296b25 | |
|
5e18e3d733 | |
|
dbfb194bf8 | |
|
fd27a0b23b | |
|
1fd237d650 | |
|
4af82edbf7 | |
|
fecdd0ee41 | |
|
1d3275d9f9 | |
|
96c995b604 | |
|
6aae35f241 | |
|
6880ee8a77 | |
|
ceba643aaf | |
|
a3c9f2acb3 | |
|
dc1ece863f | |
|
572e542b72 | |
|
7105b48085 | |
|
412d0d1621 | |
|
951f53bef3 | |
|
3424c12d8e | |
|
7b91183896 | |
|
140878c771 | |
|
e678d68afe | |
|
c3c97f7c2f | |
|
b684d1e655 | |
|
fdb2e9c553 | |
|
373c2488a9 | |
|
1193371688 | |
|
17c1a440ec | |
|
d32a577dbf | |
|
f933f22bd7 | |
|
7bcad945a3 | |
|
e3f1f1bc08 | |
|
0395f05b35 | |
|
9ce8e0e13f | |
|
7951e6a4ab | |
|
173a8e93a1 | |
|
0c7d2bc328 | |
|
06a414efe9 | |
|
ba15f07ddb | |
|
a955cafe5e | |
|
2c1fdf41ae | |
|
bb76601056 | |
|
e9bb2e418d | |
|
7fd4d0760b | |
|
0a0d4fa637 | |
|
aa1679d246 | |
|
5a0f3cb82e |
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
"plugins": [
|
||||
"git-tag",
|
||||
"all-contributors",
|
||||
"first-time-contributor",
|
||||
"released"
|
||||
],
|
||||
"owner": "kubevela",
|
||||
"repo": "velad",
|
||||
"name": "chivalryq",
|
||||
"email": "qiaozhongpei.qzp@alibaba-inc.com",
|
||||
"onlyPublishWithReleaseLabel": true
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
# This file is a github code protect rule follow the codeowners https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/creating-a-repository-on-github/about-code-owners#example-of-a-codeowners-file
|
||||
|
||||
* @chivalryq @wangyikewxgm
|
|
@ -0,0 +1,30 @@
|
|||
name: Auto Release
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
auto-release:
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- name: Checkout source
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Download auto
|
||||
run: |
|
||||
wget -O- https://github.com/intuit/auto/releases/download/v10.37.1/auto-linux.gz | gunzip > ~/auto
|
||||
chmod a+x ~/auto
|
||||
- name: Check whether a release is due
|
||||
id: auto-version
|
||||
run: |
|
||||
version="$(~/auto version)"
|
||||
echo "::set-output name=version::$version"
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: auto release
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: ~/auto shipit -v
|
|
@ -1,26 +0,0 @@
|
|||
name: Build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- release-*
|
||||
workflow_dispatch: { }
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Install dependencies
|
||||
uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: 1.17
|
||||
- name: Build linux
|
||||
run: make linux-amd64
|
||||
- name: Build darwin
|
||||
run: |
|
||||
GOOS=darwin GOARCH=amd64 make darwin-amd64
|
||||
- name: Build windows
|
||||
run: |
|
||||
GOOS=windows GOARCH=amd64 make windows-amd64
|
|
@ -7,78 +7,82 @@ on:
|
|||
- release-*
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
- main
|
||||
- release-*
|
||||
workflow_dispatch: { }
|
||||
workflow_dispatch: {}
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
env:
|
||||
# Common versions
|
||||
GO_VERSION: '1.17'
|
||||
GOLANGCI_VERSION: 'v1.38'
|
||||
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: |
|
||||
make download_vela_images_addons
|
||||
make download_k3s
|
||||
make download_k3s_images
|
||||
make download_k3s_bin_script
|
||||
make download_k3d
|
||||
make pack_vela_chart
|
||||
|
||||
- name: Go Dependencies
|
||||
run: |
|
||||
go mod tidy -compat=1.17
|
||||
go get -t -v -d ./...
|
||||
go mod tidy
|
||||
|
||||
- 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: |
|
||||
make download_vela_images_addons
|
||||
make download_k3s
|
||||
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
|
||||
|
@ -88,38 +92,39 @@ 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 -compat=1.17
|
||||
go get -t -v -d ./...
|
||||
go mod tidy
|
||||
|
||||
- name: Setup Docker
|
||||
uses: docker-practice/actions-setup-docker@master
|
||||
with:
|
||||
docker_version: "24.0.2"
|
||||
|
||||
- name: Download resources
|
||||
run: |
|
||||
make download_vela_images_addons
|
||||
make download_k3s
|
||||
make download_k3s_images
|
||||
make download_k3s_bin_script
|
||||
make download_k3d
|
||||
make pack_vela_chart
|
||||
|
||||
- name: Check Diff
|
||||
run: make check-diff
|
||||
|
||||
|
|
|
@ -0,0 +1,121 @@
|
|||
name: E2E Test
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- v*
|
||||
branches:
|
||||
- main
|
||||
- release-*
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
- release-*
|
||||
workflow_dispatch: {}
|
||||
|
||||
jobs:
|
||||
build-artifact:
|
||||
env:
|
||||
VELAUX_VERSION_KEY: github.com/oam-dev/velad/version.VelaUXVersion
|
||||
runs-on: ubuntu-22.04
|
||||
strategy:
|
||||
matrix:
|
||||
TARGETS:
|
||||
[linux/amd64, darwin/amd64, windows/amd64, linux/arm64, darwin/arm64]
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Install dependencies
|
||||
uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: "1.22.0"
|
||||
- name: Get matrix
|
||||
id: get_matrix
|
||||
run: |
|
||||
TARGETS=${{matrix.TARGETS}}
|
||||
echo ::set-output name=OS::${TARGETS%/*}
|
||||
echo ::set-output name=ARCH::${TARGETS#*/}
|
||||
- name: Build
|
||||
run: |
|
||||
make ${{ steps.get_matrix.outputs.OS }}-${{ steps.get_matrix.outputs.ARCH }}
|
||||
- name: Upload artifacts
|
||||
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-22.04
|
||||
needs: [build-artifact]
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Install dependencies
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: "1.22.0"
|
||||
- name: Install ginkgo
|
||||
run: go install github.com/onsi/ginkgo/ginkgo@v1.16.5
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: velad-linux-amd64
|
||||
- run: |
|
||||
chmod u+x velad-linux-amd64 && mv velad-linux-amd64 velad
|
||||
sudo ./velad install --set image.pullPolicy=Never --set admissionWebhooks.patch.image.pullPolicy=Never --set multicluster.clusterGateway.image.pullPolicy=Never
|
||||
sudo chmod a+r $(./velad kubeconfig --host)
|
||||
kubectl wait --for=condition=Ready pod -l app.kubernetes.io/name=vela-core --timeout=180s -n vela-system --kubeconfig=$(./velad kubeconfig --host)
|
||||
sudo vela addon enable /root/.vela/addons/velaux
|
||||
- name: Run e2e test
|
||||
run: ginkgo -v ./test/e2e-test
|
||||
test-darwin:
|
||||
runs-on: macos-12
|
||||
needs: [build-artifact]
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Install dependencies
|
||||
uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: "1.22.0"
|
||||
- name: Install ginkgo
|
||||
run: go install github.com/onsi/ginkgo/ginkgo@v1.16.5
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: velad-darwin-amd64
|
||||
- name: Setup Docker
|
||||
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-22.04
|
||||
# needs: [ build-artifact ]
|
||||
# steps:
|
||||
# - uses: actions/download-artifact@v3
|
||||
# with:
|
||||
# name: velad-darwin-amd64
|
||||
# - run: chmod u+x velad-linux-amd64 && mv velad-linux-amd64 velad
|
||||
# - name: pguyot/arm-runner-action@v2
|
||||
# with:
|
||||
# commands: |
|
||||
# sudo ./velad install --set image.pullPolicy=Never --set admissionWebhooks.patch.image.pullPolicy=Never --set multicluster.clusterGateway.image.pullPolicy=Never
|
||||
# sudo vela def list
|
||||
|
||||
# test-windows:
|
||||
# runs-on: windows-2022
|
||||
# needs: [ build-artifact ]
|
||||
# steps:
|
||||
# - uses: actions/download-artifact@v3
|
||||
# with:
|
||||
# name: velad-windows-amd64
|
||||
# - name: Setup Docker
|
||||
# uses: docker-practice/actions-setup-docker@master
|
||||
# - run: chmod u+x velad-windows-amd64 && mv velad-windows-amd64 velad.exe
|
||||
# - run: .\velad install --set image.pullPolicy=Never --set admissionWebhooks.patch.image.pullPolicy=Never --set multicluster.clusterGateway.image.pullPolicy=Never
|
||||
|
|
@ -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 ]
|
||||
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.17
|
||||
go-version: "1.22"
|
||||
- name: Get release
|
||||
id: get_release
|
||||
uses: bruceadams/get-release@v1.2.2
|
||||
|
@ -61,10 +62,12 @@ jobs:
|
|||
echo "LDFLAGS=${LDFLAGS}" >> $GITHUB_ENV
|
||||
- name: Build
|
||||
run: |
|
||||
export OS=${{ steps.get_matrix.outputs.OS }}
|
||||
export ARCH=${{ steps.get_matrix.outputs.ARCH }}
|
||||
make download_vela_images_addons
|
||||
make download_k3s
|
||||
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 \
|
||||
|
@ -95,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
|
||||
|
@ -111,10 +114,15 @@ jobs:
|
|||
run: ./ossutil --config-file .ossutilconfig config -i ${ACCESS_KEY} -k ${ACCESS_KEY_SECRET} -e ${ENDPOINT}
|
||||
- name: Upload to OSS
|
||||
run: |
|
||||
./ossutil --config-file .ossutilconfig sync \
|
||||
./ossutil --config-file .ossutilconfig --force sync \
|
||||
./_bin/velad oss://kubevela-docs/binary/velad/${{ env.VELAD_VERSION }}
|
||||
- name: sync the velad latest version file
|
||||
if: ${{ !contains(env.VELAD_VERSION,'alpha') && !contains(env.VELAD_VERSION,'beta') }}
|
||||
run: |
|
||||
LATEST_VERSION=$(curl -fsSl https://static.kubevela.net/binary/velad/latest_version)
|
||||
verlte() {
|
||||
[ "$1" = "`echo -e "$1\n$2" | sort -V | head -n1`" ]
|
||||
}
|
||||
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
|
||||
|
||||
|
|
|
@ -33,3 +33,5 @@ pkg/resources/static/k3d/
|
|||
pkg/resources/static/vela/images
|
||||
pkg/resources/static/vela/charts/vela-core.tgz
|
||||
pkg/resources/static/vela/addons
|
||||
|
||||
.env
|
||||
|
|
|
@ -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.
|
||||
|
|
78
Makefile
|
@ -1,46 +1,76 @@
|
|||
include makefiles/dependency.mk
|
||||
|
||||
K3S_VERSION ?= v1.21.10+k3s1
|
||||
K3S_VERSION ?= v1.27.2+k3s1
|
||||
STATIC_DIR := pkg/resources/static
|
||||
VELA_VERSION ?= v1.3.5
|
||||
VELAUX_VERSION ?= v1.3.4
|
||||
GOOS ?= linux
|
||||
GOARCH ?= amd64
|
||||
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}"
|
||||
|
||||
.DEFAULT_GOAL := linux-amd64
|
||||
linux-amd64: download_vela_images_addons download_k3s pack_vela_chart
|
||||
go build -o bin/velad \
|
||||
-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)
|
||||
ifeq ($(UNAME_S), Linux)
|
||||
OS ?= linux
|
||||
else
|
||||
OS ?= darwin
|
||||
endif
|
||||
UNAME_M := $(shell uname -m)
|
||||
ifeq ($(UNAME_M), arm64)
|
||||
ARCH ?= arm64
|
||||
else
|
||||
ARCH ?= amd64
|
||||
endif
|
||||
|
||||
.DEFAULT_GOAL := build
|
||||
build:
|
||||
echo "Building for ${OS}/${ARCH}"
|
||||
OS=${OS} ARCH=${ARCH} make $(OS)-$(ARCH)
|
||||
|
||||
|
||||
linux-amd64 linux-arm64: download_vela_images_addons download_k3s_bin_script download_k3s_images
|
||||
$(eval OS := $(word 1, $(subst -, ,$@)))
|
||||
$(eval ARCH := $(word 2, $(subst -, ,$@)))
|
||||
echo "Compiling for ${OS}/${ARCH}"
|
||||
|
||||
GOOS=${OS} GOARCH=${ARCH} \
|
||||
go build -o bin/velad-${OS}-${ARCH} \
|
||||
-ldflags=${LDFLAGS} \
|
||||
github.com/oam-dev/velad/cmd/velad
|
||||
|
||||
darwin-amd64 darwin-arm64 windows-amd64: download_vela_images_addons download_k3d download_k3s_images
|
||||
$(eval OS := $(word 1, $(subst -, ,$@)))
|
||||
$(eval ARCH := $(word 2, $(subst -, ,$@)))
|
||||
echo "Compiling for ${OS}/${ARCH}"
|
||||
|
||||
darwin-amd64 windows-amd64: download_vela_images_addons download_k3d pack_vela_chart download_k3s_images
|
||||
GOOS=${GOOS} GOARCH=${GOARCH} \
|
||||
go build -o bin/velad-${GOOS}-${GOARCH} \
|
||||
-ldflags="-X github.com/oam-dev/velad/version.VelaUXVersion=$VELAUX_VERSION -X github.com/oam-dev/velad/version.VelaVersion=$VELA_VERSION" \
|
||||
GOOS=${OS} GOARCH=${ARCH} \
|
||||
go build -o bin/velad-${OS}-${ARCH} \
|
||||
-ldflags=${LDFLAGS} \
|
||||
github.com/oam-dev/velad/cmd/velad
|
||||
|
||||
download_vela_images_addons:
|
||||
./hack/download_vela_images.sh ${VELA_VERSION} ${VELAUX_VERSION}
|
||||
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
|
||||
./hack/download_k3d_images.sh ${ARCH}
|
||||
|
||||
download_k3s: download_k3s_images
|
||||
download_k3s_bin_script:
|
||||
mkdir -p ${STATIC_DIR}/k3s/other
|
||||
curl -Lo ${STATIC_DIR}/k3s/other/k3s https://github.com/k3s-io/k3s/releases/download/${K3S_VERSION}/k3s
|
||||
curl -Lo ${STATIC_DIR}/k3s/other/setup.sh https://get.k3s.io
|
||||
|
||||
download_k3s_images:
|
||||
mkdir -p ${STATIC_DIR}/k3s/images
|
||||
curl -Lo ${STATIC_DIR}/k3s/images/k3s-airgap-images-amd64.tar.gz https://github.com/k3s-io/k3s/releases/download/${K3S_VERSION}/k3s-airgap-images-amd64.tar.gz
|
||||
curl -Lo ${STATIC_DIR}/k3s/images/k3s-airgap-images.tar.gz https://github.com/k3s-io/k3s/releases/download/${K3S_VERSION}/k3s-airgap-images-${ARCH}.tar.gz
|
||||
|
||||
CHART_DIR := ${STATIC_DIR}/vela/charts
|
||||
pack_vela_chart:
|
||||
cp -r ${STATIC_DIR}/vela/charts/vela-core .
|
||||
tar -czf ${STATIC_DIR}/vela/charts/vela-core.tgz vela-core
|
||||
rm -r vela-core
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
|
@ -61,7 +91,7 @@ go-check:
|
|||
go vet ./...
|
||||
|
||||
reviewable: lint staticcheck fmt go-check
|
||||
go mod tidy -compat=1.17
|
||||
go mod tidy
|
||||
|
||||
check-diff: reviewable
|
||||
git --no-pager diff
|
||||
|
|
17
README.md
|
@ -1,10 +1,10 @@
|
|||
# VelaD
|
||||
|
||||
Lightweight KubeVela that runs as Daemon in single node with k3s
|
||||
Lightweight Deploy tool, helps setup [KubeVela](https://github.com/kubevela/kubevela) quickly。
|
||||
|
||||
English | [简体中文](docs/readme-zh.md)
|
||||
|
||||

|
||||

|
||||
|
||||
## Introduction
|
||||
|
||||
|
@ -19,8 +19,9 @@ VelaD is the fastest way to get started with KubeVela.
|
|||
|
||||
## Features
|
||||
|
||||
1. Set up KubeVela air-gapped
|
||||
2. Build KubeVela control plane with higher availability (Optional)
|
||||
1. Set up KubeVela air-gapped.
|
||||
2. Build KubeVela control plane with higher availability with more nodes and database(Optional).
|
||||
3. Experience KubeVela multi-cluster features in one computer.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
|
@ -32,7 +33,7 @@ If you are using Windows/macOS, docker is needed for run VelaD
|
|||
|
||||
- **Linux/macOS**
|
||||
```shell
|
||||
curl -fsSl https://static.kubevela.net/script/install-velad.sh | bash -s 1.3.4
|
||||
curl -fsSl https://static.kubevela.net/script/install-velad.sh | bash
|
||||
```
|
||||
|
||||
- **Windows**
|
||||
|
@ -71,4 +72,8 @@ velad uninstall
|
|||
|
||||
### More example
|
||||
|
||||
Please check [docs](./docs/) for more VelaD example
|
||||
Please check [docs](./docs/) for more VelaD example
|
||||
|
||||
## Known issues
|
||||
|
||||
- Installation on darwin-arm64 (Apple chip) machine isn't fully air-gapped. Please track #64 for more info.
|
|
@ -0,0 +1,22 @@
|
|||
# How to upgrade KubeVela version of VelaD
|
||||
|
||||
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 go.mod
|
||||
2. Upgrade vela version in makefile
|
||||
|
||||
### Upgrade vela version in makefile
|
||||
|
||||
In `Makefile`, find this two variables, upgrade them to right version.
|
||||
|
||||
> VelaUX sometimes don't release new version together with KubeVela, make sure VelaUX version is right.
|
||||
|
||||
```makefile
|
||||
VELAUX_VERSION ?= v1.6.0
|
||||
VELAUX_IMAGE_VERSION ?= ${VELAUX_VERSION}
|
||||
```
|
||||
|
||||
### After upgrade
|
||||
|
||||
Commit all changes and make a pull request.
|
|
@ -0,0 +1,196 @@
|
|||
# Setup KubeVela and deliver your first app
|
||||
|
||||
VelaD can help you set up KubeVela on your computer. In this article will focus on several points
|
||||
|
||||
1. Install VelaD
|
||||
2. Use VelaD to setup KubeVela
|
||||
3. Install VelaUX
|
||||
4. Deliver your first app
|
||||
|
||||
## Install VelaD
|
||||
|
||||
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
|
||||
```
|
||||
|
||||
- **Windows**
|
||||
```shell
|
||||
powershell -Command "iwr -useb https://static.kubevela.net/script/install-velad.ps1 | iex"
|
||||
```
|
||||
|
||||
After install, you can run `velad version` to check velad CLI installed
|
||||
|
||||
```shell
|
||||
velad version
|
||||
```
|
||||
```text
|
||||
Core Version: v1.4.0
|
||||
VelaD Version: v1.4.0
|
||||
```
|
||||
|
||||
## Use VelaD to setup KubeVela
|
||||
|
||||
All you need is run `velad install`, that will help you do things below:
|
||||
|
||||
1. start a cluster which needed by KubeVela
|
||||
2. install KubeVela in cluster
|
||||
3. install vela CLI on the machine
|
||||
4. place VelaUX(a web panel addon)resources
|
||||
|
||||
```shell
|
||||
velad install
|
||||
```
|
||||
```text
|
||||
INFO[0000] portmapping '8080:80' targets the loadbalancer: defaulting to [servers:*:proxy agents:*:proxy]
|
||||
Preparing K3s images...
|
||||
...(omit for brevity)
|
||||
|
||||
KubeVela control plane has been successfully set up on your cluster.
|
||||
If you want to enable dashboard, please run "vela addon enable /Users/qiaozp/.vela/addons/velaux"
|
||||
|
||||
Keep the token below if you want to restart the control plane
|
||||
K103585b6be41cc4160c795036d769b1aa2c249a8f046707ab0210c56dcc05e8957::server:kOcAPpOXfVfBbrMBinan..(omit for brevity)
|
||||
|
||||
🚀 Successfully install KubeVela control plane
|
||||
💻 When using gateway trait, you can access with 127.0.0.1:8080
|
||||
🔭 See available commands with `vela help`
|
||||
```
|
||||
|
||||
> Note: later we'll use gateway trait. Remember we can use 127.0.0.1:8080 to access application with gateway trait.
|
||||
|
||||
Now you have KubeVela available in this computer. To verify install result, check if tools and resources ready,
|
||||
run `velad status`
|
||||
|
||||
```shell
|
||||
velad status
|
||||
```
|
||||
```text
|
||||
Checking cluster status...
|
||||
K3d images status:
|
||||
✔ image rancher/k3d-tools:5.2.2 ready
|
||||
✔ image rancher/k3d-proxy:5.2.2 ready
|
||||
✔ image rancher/k3s:v1.21.10-k3s1 ready
|
||||
Cluster(K3d) status:
|
||||
✔ cluster [default] ready
|
||||
✔ kubevela status: deployed
|
||||
Checking KubeVela status...
|
||||
Vela status:
|
||||
✔ Vela CLI installed
|
||||
✔ Vela CLI path: /usr/local/bin/vela
|
||||
✔ VelaUX addon dir ready
|
||||
✔ VelaUX addon dir path: /Users/qiaozp/.vela/addons/velaux
|
||||
```
|
||||
|
||||
You could use vela CLI now. try check all available component types. Later we'll use `webservice` type component when deploying first app
|
||||
```shell
|
||||
# optional because `velad install` create default cluster
|
||||
export KUBECONFIG=$(velad kubeconfig --host)
|
||||
```
|
||||
|
||||
```shell
|
||||
vela comp
|
||||
```
|
||||
|
||||
result:
|
||||
```text
|
||||
NAME DEFINITION
|
||||
config-image-registry autodetects.core.oam.dev
|
||||
k8s-objects autodetects.core.oam.dev
|
||||
cron-task cronjobs.batch
|
||||
ref-objects autodetects.core.oam.dev
|
||||
raw autodetects.core.oam.dev
|
||||
task jobs.batch
|
||||
worker deployments.apps
|
||||
webservice deployments.apps
|
||||
```
|
||||
|
||||
## Install VelaUX
|
||||
|
||||
VelaUX is a dashboard including UI+API services, it enables you to do everything around application delivery and management.
|
||||
VelaUX isn't required for KubeVela, but it is an excellent entry to get started.
|
||||
|
||||
VelaD has prepared all VelaUX resources (images, addon manifests) for you. Just like it hints when `velad install`, you can enable VelaUX by:
|
||||
|
||||
```shell
|
||||
vela addon enable /Users/<user>/.vela/addons/velaux
|
||||
```
|
||||
|
||||
Here, you have to replace <user> with your own username. After about half a minutes, you will see the output:
|
||||
|
||||
```text
|
||||
Initialized admin username and password: admin / VelaUX12345
|
||||
To open the dashboard directly by port-forward:
|
||||
vela port-forward -n vela-system addon-velaux 9082:80
|
||||
Select "Cluster: local | Namespace: vela-system | Kind: Service | Name: velaux" from the prompt.
|
||||
Please refer to https://kubevela.io/docs/reference/addons/velaux for more VelaUX addon installation and visiting method.
|
||||
```
|
||||
|
||||
The default username and password is: `admin` / `VelaUX12345`.
|
||||
|
||||
Do as the output says, port-forward velaux and choose "Cluster: local | Namespace: vela-system | Kind: Service | Name: velaux"
|
||||
|
||||
```shell
|
||||
vela port-forward -n vela-system addon-velaux 9082:80
|
||||
? You have 4 deployed resources in your app. Please choose one: Cluster: local | Namespace: vela-system | Kind: Service | Name: velaux
|
||||
Forwarding from 127.0.0.1:9082 -> 80
|
||||
Forwarding from [::1]:9082 -> 80
|
||||
```
|
||||
|
||||
You will see dashboard opened automatically. Use `admin` and password just got to log in and you'll see:
|
||||
|
||||

|
||||
|
||||
🎉 Congrats! You have successfully installed VelaUX.
|
||||
|
||||
## Deliver your first app
|
||||
|
||||
Now we'll use VelaUX to deliver your first app, just a Nginx for example.
|
||||
Notice that this example may be simple. However, you can use the same pattern to deliver more complicated app depends on your stack.
|
||||
|
||||
1. Click the `New Application` in top-right of window.
|
||||
2. Input `first-app` for `Name` and choose `Default(default)` for `Bind Environments`. Click `Next Step`.
|
||||
|
||||

|
||||
|
||||
3. Input `nginx` for `Container Image`. Click `Create`
|
||||
|
||||

|
||||
|
||||
4. Click `first-app` in components panel
|
||||
|
||||

|
||||
|
||||
5. Click the plus button in Traits panel. we'll add a gateway trait, so we can access it from localhost
|
||||
|
||||

|
||||
|
||||
6. In the detail form, first choose `gateway` in `Type`. Arguments will show below. Then fill two arguments
|
||||
- Change `Class` to `traefik` to use Traefik packed with VelaD.
|
||||
- Add a route rule from `/` to `80`, which we'll use localhost:port without sub-path to access port 80 inside.
|
||||
|
||||
Click the `Create` to add gateway trait to this app.
|
||||
|
||||

|
||||
|
||||
7. Finally, we can click the `Deploy` button in the right-top of window. This will launch app to K8s Cluster where
|
||||
KubeVela runs.
|
||||
|
||||
After seven steps. You can check the application healthiness in `Default` tab. When it is running, we can access it with
|
||||
`127.0.0.1:8080`. That was mentioned when velad install.
|
||||
|
||||

|
||||
|
||||
# Summary
|
||||
|
||||
After follow this blog, you have known how to use VelaD to deploy KubeVela, VelaUX, and deploy application using VelaUX.
|
||||
|
||||
VelaD have more capabilities when getting hands on KubeVela.
|
||||
|
||||
- Want to try KubeVela multicluster features? See [multicluster docs](02.multicluster.md)
|
||||
- Want to expose your cluster to other computer? See [Expose cluster](05.expose-cluster.md)
|
||||
- Want to apply origin K8s YAML and distribute them to multi-clusters? See [Apply & Distribute docs](03.apply-and-distribute.md)
|
||||
- Want to deploy KubeVela control plane with higher availability? See [Deploy by Multi-node and Database](04.ha.md)
|
||||
- Want to use VelaD help develop KubeVela locally? See [Develop KubeVela with VelaD](06.develop_kubevela.md)
|
|
@ -0,0 +1,186 @@
|
|||
# Multicluster with VelaD
|
||||
|
||||
There are many [scenarios](https://kubevela.net/docs/case-studies/multi-cluster#introduction) that developers may want
|
||||
to deploy their application across multi-clusters.
|
||||
This article will introduce you to how make use of VelaD to try multi-cluster features of KubeVela.
|
||||
If you don't know the basic use of VelaD, you can follow this [document](01.simple.md)
|
||||
|
||||
## Prerequisite
|
||||
|
||||
Windows/macOS System.
|
||||
|
||||
## Targets
|
||||
|
||||
In this article, there are several targets:
|
||||
|
||||
1. Create a cluster with KubeVela with VelaD as control plane of clusters.
|
||||
2. Create one cluster as managed cluster.
|
||||
3. Join managed cluster into KubeVela
|
||||
4. Deliver one multi-cluster application.
|
||||
|
||||
## Architecture
|
||||
|
||||
The three targets above will actually build two clusters within the same Docker network(so they can access each other).
|
||||
|
||||
The image below shows how multi-cluster scenario works:
|
||||
|
||||

|
||||
|
||||
When using VelaD, clusters are K3d which running in Docker container. Note that these clusters are in the same Docker
|
||||
network, which enables the access between them.
|
||||
|
||||
## Steps
|
||||
|
||||
### Create control plane
|
||||
|
||||
This step has nothing special, `velad install` is all you need which has benn shown in [01.simple](01.simple.md). Here
|
||||
we just skip the output of install.
|
||||
|
||||
```shell
|
||||
velad install
|
||||
```
|
||||
|
||||
### Create managed cluster
|
||||
|
||||
Create the second cluster, namely managed cluster.
|
||||
|
||||
```shell
|
||||
velad install --name sub-cluster --cluster-only
|
||||
```
|
||||
|
||||
In this command, use `--name` flag to distinguish it from first cluster which name is `default`.
|
||||
use `--cluster-only` to tell VelaD not to install KubeVela in this cluster.
|
||||
|
||||
**expcted output**
|
||||
|
||||
```text
|
||||
...(omit for brevity)
|
||||
vela CLI is already installed, skip
|
||||
|
||||
Keep the token below if you want to restart the control plane
|
||||
K10967ee649ab9910497b04c91ad9406e439736df46d1fee85e3451afb8d8cc1da3::server:fgwgYIwkmAQKnmyOIVXc
|
||||
|
||||
🚀 Successfully install a pure cluster!
|
||||
🔗 If you have a cluster with KubeVela, Join this as sub-cluster:
|
||||
vela cluster join $(velad kubeconfig --name sub-cluster --internal)
|
||||
💻 When using gateway trait, you can access with 127.0.0.1:8082
|
||||
🔑 To access the cluster, set KUBECONFIG:
|
||||
export KUBECONFIG=$(velad kubeconfig --name sub-cluster --host)
|
||||
```
|
||||
|
||||
In the output, wee have seen lots of them. The second one is a new hint which tells how
|
||||
to join this cluster as managed cluster.
|
||||
|
||||
### Join cluster into KubeVela
|
||||
|
||||
As hint above, we can use this command to join the cluster
|
||||
|
||||
```shell
|
||||
vela cluster join $(velad kubeconfig --name sub-cluster --internal)
|
||||
```
|
||||
|
||||
Here `velad kubeconfig --name sub-cluster --internal` print a kubeconfig file path which
|
||||
`vela cluster join` need. The `--internal` flag means this is for docker network.
|
||||
|
||||
> Note: all cluster created by VelaD are in docker network "k3d-velad"
|
||||
|
||||
**expected output**
|
||||
|
||||
```text
|
||||
Successfully add cluster , endpoint: https://172.31.0.5:6443.
|
||||
```
|
||||
|
||||
Use `vela cluster list` to show clusters joined. The second one is the managed cluster.
|
||||
|
||||
```shell
|
||||
CLUSTER ALIAS TYPE ENDPOINT ACCEPTED LABELS
|
||||
local Internal - true
|
||||
k3d-velad-cluster-sub-cluster X509Certificate https://172.31.0.5:6443 true
|
||||
```
|
||||
|
||||
### Deliver multi-cluster application.
|
||||
|
||||
After join cluster into KubeVela, we can deliver applications to different clusters.
|
||||
|
||||
Here is one multi-cluster app example, run:
|
||||
|
||||
```shell
|
||||
cat <<EOF | vela up -f -
|
||||
apiVersion: core.oam.dev/v1beta1
|
||||
kind: Application
|
||||
metadata:
|
||||
name: basic-topology
|
||||
spec:
|
||||
components:
|
||||
- name: nginx-basic
|
||||
type: webservice
|
||||
properties:
|
||||
image: nginx
|
||||
traits:
|
||||
- type: expose
|
||||
properties:
|
||||
port: [80]
|
||||
policies:
|
||||
- name: topology-sub-cluster
|
||||
type: topology
|
||||
properties:
|
||||
clusters: ["k3d-velad-cluster-sub-cluster"]
|
||||
EOF
|
||||
```
|
||||
|
||||
This is the first example of KubeVela website for deploy application to multi-cluster.
|
||||
|
||||
You can check the status with `vela status`
|
||||
|
||||
```shell
|
||||
vela status basic-topology
|
||||
```
|
||||
|
||||
**output**
|
||||
|
||||
```text
|
||||
About:
|
||||
|
||||
Name: basic-topology
|
||||
Namespace: default
|
||||
Created at: 2022-05-28 18:44:30 +0800 CST
|
||||
Status: running
|
||||
|
||||
Workflow:
|
||||
|
||||
mode: DAG
|
||||
finished: true
|
||||
Suspend: false
|
||||
Terminated: false
|
||||
Steps
|
||||
- id:92cn9mrqwm
|
||||
name:deploy-topology-sub-cluster
|
||||
type:deploy
|
||||
phase:succeeded
|
||||
message:
|
||||
|
||||
Services:
|
||||
|
||||
- Name: nginx-basic
|
||||
Cluster: k3d-velad-cluster-sub-cluster Namespace: default
|
||||
Type: webservice
|
||||
Healthy Ready:1/1
|
||||
Traits:
|
||||
✅ expose
|
||||
```
|
||||
|
||||
There you go, you have deployed an application in multiple clusters with whole process is modeled as a declarative deployment
|
||||
plan. For more usage, check the KubeVela [document](https://kubevela.io/docs/case-studies/multi-cluster)
|
||||
|
||||
### Tear down the environment
|
||||
|
||||
To tear down the environment, just run `velad uninstall` to uninstall two cluster.
|
||||
```shell
|
||||
velad uninstall --name=default
|
||||
velad uninstall --name=sub-cluster
|
||||
```
|
||||
|
||||
## Summary
|
||||
|
||||
With VelaD, testing and developing application across the clusters become easy. No need for caring fee if you are using
|
||||
true clusters or network/kubeconfig trivia if you are using kind/k3d/minikube.
|
|
@ -0,0 +1,3 @@
|
|||
# Apply and Distribute
|
||||
|
||||
TBD
|
|
@ -0,0 +1,103 @@
|
|||
# Deploy by Multi-node and Database
|
||||
|
||||
You can use VelaD to build KubeVela control plane with higher availability. It consists of:
|
||||
|
||||
1. More than two nodes as server nodes.
|
||||
2. One database (Could be MySQL/MariaDB, PostgreSQL, etcd)
|
||||
3. One linux node as load balancer. (Or you can use a cloud load balancer)
|
||||
|
||||

|
||||
|
||||
We only need run several commands on different nodes.
|
||||
|
||||
## Setup server nodes
|
||||
|
||||
### First node
|
||||
|
||||
On the first server node, run
|
||||
|
||||
```shell
|
||||
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
|
||||
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**: `--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> \
|
||||
--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 any master node, run
|
||||
|
||||
```shell
|
||||
velad load-balancer wizard
|
||||
```
|
||||
|
||||
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
|
||||
|
||||
Run command below on any server nodes. Copy the file to any computer which can access
|
||||
the load balancer.
|
||||
|
||||
```shell
|
||||
velad kubeconfig --external
|
||||
```
|
||||
|
||||
Boom! You can access the KubeVela control plane with this kubeconfig. Failure of any single server won't
|
||||
affect the availability of the control plane.
|
|
@ -0,0 +1,38 @@
|
|||
# Expose Cluster
|
||||
|
||||
Sometimes you want to use a remote server instead of a laptop to host VelaD cluster. You need to expose your cluster to
|
||||
the cluster so that you can access it from your computer. This document show you how to access a remote VelaD cluster.
|
||||
|
||||
## How-to
|
||||
|
||||
### Single-node Cluster
|
||||
|
||||
> Note: If you are using a VM provided by cloud vendor (such as ECS in AliYun, EC2 in aws) , remember to expose 6443
|
||||
> port from your security group.
|
||||
|
||||
The simplest way to expose your cluster when you set-up a single-node cluster.
|
||||
Just add `--bind-ip` argument when `velad install` like:
|
||||
|
||||
```shell
|
||||
velad install --bind-ip=<IP_OF_SERVER>
|
||||
```
|
||||
|
||||
VelaD will generate kubeconfig which can access this cluster for you.
|
||||
Then print the generated kubeconfig for remote access.
|
||||
|
||||
```shell
|
||||
velad kubeconfig --external
|
||||
```
|
||||
|
||||
This will print a kubeconfig path. Copy that file to your local computer (or other server). Set it to `KUBECONFIG` var as
|
||||
other kubeconfig. Then you can access this VelaD cluster from remote.
|
||||
|
||||
To summary:
|
||||
1. `velad install --bind-ip`
|
||||
2. `velad kubeconfig --external`
|
||||
3. Copy external kubeconfig file to other computer.
|
||||
4. export `KUBECONFIG` variable.
|
||||
|
||||
### Multi-node Cluster
|
||||
|
||||
Please follow this [high availability document](04.ha.md) to expose multi-node cluster.
|
|
@ -0,0 +1,37 @@
|
|||
# Develop KubeVela with VelaD
|
||||
|
||||
It's easy to use VelaD to get a local KubeVela development environment. This document will show you how to create a
|
||||
KubeVela controller (vela-core) development environment.
|
||||
|
||||
|
||||
## Prerequisites
|
||||
|
||||
1. No need for preparing a cluster. VelaD will take care of the cluster.
|
||||
2. Other tools you need is listed in [contribution guide](https://kubevela.io/docs/contributor/code-contribute#prerequisites).
|
||||
|
||||
> Note the second item "Kubernetes ..." is NOT needed.
|
||||
> If you want to use cluster already exist as develop environment, please check [this doc](https://kubevela.io/docs/contributor/code-contribute#prerequisites) directly
|
||||
|
||||
3. Docker (If you are using macOS or Windows)
|
||||
|
||||
|
||||
## Steps
|
||||
|
||||
1. Setup Cluster and Helm Chart
|
||||
```shell
|
||||
velad install --set admissionWebhooks.enabled=false --set replicaCount=0
|
||||
```
|
||||
This command setup k3d/k3s cluster and install vela-core with no running controller.
|
||||
|
||||
2. Run Vela Core
|
||||
```shell
|
||||
export KUBECONFIG=$(velad kubeconfig --host)
|
||||
make core-run
|
||||
```
|
||||
This command will run KubeVela controller locally. There you go! you already have a KubeVela
|
||||
development environment.
|
||||
|
||||
## Summary
|
||||
|
||||
This guide shows how to create a KubeVela development environment and run KubeVela locally.
|
||||
For further guide (Testing, Create a PR, Formatting guide...), please return to [contribution guide](https://kubevela.io/docs/contributor/code-contribute#prerequisites)
|
|
@ -0,0 +1,131 @@
|
|||
# Access Service in VelaD
|
||||
|
||||
This document will show you how to access the service running in VelaD.
|
||||
|
||||
## Background
|
||||
|
||||
Typically, you can expose service in cluster in several ways.
|
||||
|
||||
1. LoadBalancer type Service
|
||||
2. NodePort type Service
|
||||
3. Ingress API
|
||||
|
||||
First two types both have some limitations. In VelaD cluster, exposing service through Ingress API is out of box.
|
||||
In KubeVela, we can use the `gateway` trait to expose service through Ingress API.
|
||||
|
||||
## Using gateway trait
|
||||
|
||||
In VelaD, we have installed a default Ingress Controller, which is needed to use Ingress API.
|
||||
The default Ingress controller is [**Traefik**](https://github.com/traefik/traefik). If you want to switch to other like
|
||||
Nginx Ingress Controller, see [Switch to Nginx Ingress Controller](#switch-to-nginx-ingress-controller).
|
||||
|
||||
After running `velad install` command, there is one hint printed to the screen.
|
||||
|
||||
```shell
|
||||
💻 When using gateway trait, you can access with 127.0.0.1:8090
|
||||
```
|
||||
|
||||
It means you can access the Application with `gateway` trait through http://127.0.0.1:8090.
|
||||
|
||||
For example, Run command below to apply app in VelaD cluster:
|
||||
```shell
|
||||
cat << EOF | vela up -f -
|
||||
apiVersion: core.oam.dev/v1beta1
|
||||
kind: Application
|
||||
metadata:
|
||||
name: example
|
||||
spec:
|
||||
components:
|
||||
- name: hello-world
|
||||
type: webservice
|
||||
properties:
|
||||
image: crccheck/hello-world
|
||||
traits:
|
||||
- type: gateway
|
||||
properties:
|
||||
domain: testsvc.example.com
|
||||
class: traefik
|
||||
http:
|
||||
"/": 8000
|
||||
EOF
|
||||
```
|
||||
|
||||
Then access this app by:
|
||||
```shell
|
||||
curl -H "Host: testsvc.example.com" http://localhost:8090/
|
||||
```
|
||||
|
||||
The output like:
|
||||
|
||||
```text
|
||||
<pre>
|
||||
Hello World
|
||||
|
||||
|
||||
## .
|
||||
## ## ## ==
|
||||
## ## ## ## ## ===
|
||||
/""""""""""""""""\___/ ===
|
||||
~~~ {~~ ~~~~ ~~~ ~~~~ ~~ ~ / ===- ~~~
|
||||
\______ o _,/
|
||||
\ \ _,'
|
||||
`'--.._\..--''
|
||||
</pre>
|
||||
```
|
||||
|
||||
## Switch To Nginx Ingress Controller
|
||||
|
||||
There are three steps to switch to nginx ingress controller and using `gateway` trait.
|
||||
|
||||
1. Uninstall Traefik
|
||||
|
||||
> [Helm CLI](https://helm.sh/docs/intro/install/) is needed
|
||||
```shell
|
||||
helm uninstall traefik --namespace kube-system
|
||||
```
|
||||
|
||||
2. Enable Ingress-nginx Addon and dependent FluxCD addon
|
||||
|
||||
```shell
|
||||
vela addon enable fluxcd
|
||||
vela addon enable ingress-nginx
|
||||
```
|
||||
|
||||
3. Port-forward Nginx Ingress Controller To Localhost
|
||||
|
||||
```shell
|
||||
vela port-forward addon-ingress-nginx -n vela-system
|
||||
```
|
||||
|
||||
> We don't need to do port-forwarding for Traefik in the last section because we when `velad install`, a container is created for that.
|
||||
|
||||
Using the app above, only change `class: traefik` to `class: nginx` in the `gateway` trait section, run the command below:
|
||||
|
||||
```shell
|
||||
cat << EOF | vela up -f -
|
||||
apiVersion: core.oam.dev/v1beta1
|
||||
kind: Application
|
||||
metadata:
|
||||
name: example
|
||||
spec:
|
||||
components:
|
||||
- name: hello-world
|
||||
type: webservice
|
||||
properties:
|
||||
image: crccheck/hello-world
|
||||
traits:
|
||||
- type: gateway
|
||||
properties:
|
||||
domain: testsvc.example.com
|
||||
class: nginx
|
||||
http:
|
||||
"/": 8000
|
||||
EOF
|
||||
```
|
||||
|
||||
|
||||
Now you can access the services through Ingress like:
|
||||
|
||||
```shell
|
||||
curl -H "Host: testsvc.example.com" http://localhost:8080/
|
||||
```
|
|
@ -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.
|
|
@ -1,25 +0,0 @@
|
|||
# Build VelaD
|
||||
|
||||
You can build VelaD yourself, there are two main components: k3s and KubeVela. You can specify the version
|
||||
you like of these.
|
||||
|
||||
### k3s
|
||||
|
||||
To use certain k3s version, add `K3S_VERSION` environment and run `make`:
|
||||
|
||||
```shell
|
||||
git clone https://github.com/oam-dev/velad.git
|
||||
cd velad
|
||||
K3S_VERSION=v1.21.10+k3s1 make
|
||||
```
|
||||
|
||||
### KubeVela
|
||||
|
||||
If you want to change the version of KubeVela, use corresponding version of VelaD is recommended.
|
||||
|
||||
```shell
|
||||
git clone https://github.com/oam-dev/velad.git
|
||||
cd velad
|
||||
git checkout vx.y.z
|
||||
make
|
||||
```
|
|
@ -0,0 +1,82 @@
|
|||
# Contribution Guide
|
||||
|
||||
This guild helps you get started developing VelaD
|
||||
|
||||
### Prerequisites
|
||||
|
||||
1. Golang version 1.19+
|
||||
2. Docker (for non-linux user)
|
||||
3. golangci-lint 1.38.0+, it will install automatically if you run make, you can install
|
||||
it [manually](https://golangci-lint.run/usage/install/#local-installation) if the installation is too slow.
|
||||
|
||||
### Build
|
||||
|
||||
1. Clone this project
|
||||
|
||||
```shell
|
||||
git clone https://github.com/kubevela/velad.git
|
||||
cd velad
|
||||
```
|
||||
|
||||
2. Build VelaD
|
||||
|
||||
```shell
|
||||
make
|
||||
```
|
||||
|
||||
This will build the VelaD version corresponding to your machines architecture and OS by default. To cross build other
|
||||
version, you can the target. For example, you can build a darwin-amd64 version by:
|
||||
|
||||
```shell
|
||||
make darwin-amd64
|
||||
```
|
||||
|
||||
### Debug
|
||||
|
||||
When use IDE to debug VelaD, you need to do several things
|
||||
|
||||
1. Download resources needed
|
||||
|
||||
If you want build linux version, run
|
||||
|
||||
```shell
|
||||
VELAUX_VERSION=v1.x.y VELA_VERSION=v1.z.w make download_vela_images_addons
|
||||
make download_k3s_bin_script
|
||||
make download_k3s_images
|
||||
```
|
||||
|
||||
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 download_k3s_images
|
||||
```
|
||||
|
||||
`VELAUX_VERSION=v1.x.y VELA_VERSION=v1.z.w` is optional environment variables if you want to change the default version
|
||||
in makefile.
|
||||
|
||||
2. Build VelaD
|
||||
|
||||
If you are using macOS with intel chip, the complete build command is like:
|
||||
|
||||
```shell
|
||||
OS=darwin ARCH=amd64 \
|
||||
go build -ldflags="-X github.com/oam-dev/velad/version.VelaVersion=v1.x.y -X github.com/oam-dev/velad/version.VelaUXVersion=v1.x.y" \
|
||||
-o bin/velad \
|
||||
cmd/velad/main.go
|
||||
```
|
||||
|
||||
> Ldflags can help to inject vela-core and VelaUX version. (Can be different)
|
||||
> If you are using IDE to debug, remember to add `-ldflags="-X github.com...` part to build option.
|
||||
|
||||
### Create a pull request
|
||||
|
||||
Before you submit a PR, run this command to ensure it is ready:
|
||||
|
||||
```shell
|
||||
make reviewable
|
||||
```
|
||||
|
||||
For other PR things you can check the
|
||||
document [here](https://kubevela.net/docs/contributor/code-contribute#create-a-pull-request).
|
|
@ -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 上面启动
|
||||
|
|
|
@ -8,8 +8,9 @@ VelaD 是上手 KubeVela 的最快方式。
|
|||
|
||||
## 特性
|
||||
|
||||
1. 离线安装
|
||||
2. 通过外部数据库维持高可用性. (可选)
|
||||
1. 离线搭建 KubeVela 环境。
|
||||
2. 可以连接数据库,搭建更高可用性多接点的 KubeVela 控制平面。
|
||||
3. 在一台机器上轻松体验 KubeVela 多集群特性。
|
||||
|
||||
## 安装条件
|
||||
|
||||
|
@ -17,12 +18,12 @@ VelaD 是上手 KubeVela 的最快方式。
|
|||
|
||||
## 快速开始
|
||||
|
||||
### 安装 velad
|
||||
### 安装 VelaD
|
||||
|
||||
- Linux/macOS
|
||||
```shell
|
||||
```shell
|
||||
curl -fsSl https://static.kubevela.net/script/install-velad.sh | bash -s 1.3.4
|
||||
curl -fsSl https://static.kubevela.net/script/install-velad.sh | bash
|
||||
```
|
||||
|
||||
- Windows
|
||||
|
@ -30,7 +31,7 @@ curl -fsSl https://static.kubevela.net/script/install-velad.sh | bash -s 1.3.4
|
|||
powershell -Command "iwr -useb https://static.kubevela.net/script/install.ps1 | iex"
|
||||
```
|
||||
|
||||
### 启动 KubeVela
|
||||
### 使用 VelaD 部署 KubeVela
|
||||
|
||||
Only one command to setup KubeVela
|
||||
|
||||
|
@ -38,34 +39,18 @@ Only one command to setup KubeVela
|
|||
velad install
|
||||
```
|
||||
```shell
|
||||
Preparing cluster setup script...
|
||||
Preparing k3s binary...
|
||||
Successfully place k3s binary to /usr/local/bin/k3s
|
||||
Preparing k3s images
|
||||
Successfully prepare k3s image
|
||||
Setting up cluster...
|
||||
...
|
||||
INFO[0000] portmapping '8080:80' targets the loadbalancer: defaulting to [servers:*:proxy agents:*:proxy]
|
||||
Preparing K3s images...
|
||||
...(omit for brevity)
|
||||
|
||||
Successfully install KubeVela control plane! Try: vela components
|
||||
🚀 Successfully install KubeVela control plane
|
||||
💻 When using gateway trait, you can access with 127.0.0.1:8080
|
||||
🔭 See available commands with `vela help`
|
||||
```
|
||||
恭喜!你已经设置好 KubeVela 了。用以下命令查看可用的组件。
|
||||
恭喜!你已经搭建好一个 KubeVela 的环境了。在这条命令背后,VelaD启动了一个 K3s 容器(如果在 Linux 上,则是 K3s 进程),在其中安装了 vela-core,
|
||||
并在你的机器上设置了vela CLI。
|
||||
|
||||
```shell
|
||||
vela comp
|
||||
```
|
||||
```shell
|
||||
NAME DEFINITION
|
||||
config-dex-connector autodetects.core.oam.dev
|
||||
config-image-registry autodetects.core.oam.dev
|
||||
k8s-objects autodetects.core.oam.dev
|
||||
my-stateful statefulsets.apps
|
||||
raw autodetects.core.oam.dev
|
||||
ref-objects autodetects.core.oam.dev
|
||||
snstateful statefulsets.apps
|
||||
task jobs.batch
|
||||
webservice deployments.apps
|
||||
worker deployments.apps
|
||||
```
|
||||
你可以查看这个[例子](01.simple.md),使用 KubeVela 来部署你的第一个应用
|
||||
|
||||
### 卸载 KubeVela
|
||||
|
||||
|
@ -73,36 +58,6 @@ worker deployments.apps
|
|||
velad uninstall
|
||||
```
|
||||
|
||||
## 更多选项
|
||||
### 更多案例
|
||||
|
||||
### 启动高可用的 KubeVela
|
||||
|
||||
如果你使用 `velad install` 启动控制平面,那么当你运行 `velad uninstall` 的时候,所有的数据都将丢失。这部分介绍如何用外部数据库
|
||||
启动高可用的 KubeVela。
|
||||
|
||||
1. 准备一个数据库,MySQL/MariaDB, PostgreSQL, ETCD 都可以。按照你的喜好和熟悉程度选择其一。
|
||||
2. 运行velad并传入数据库链接字符串。
|
||||
|
||||
> **保存好 token. 这是连接到这个数据库并重启 KubeVela 所必须的**
|
||||
```shell
|
||||
velad install --database-endpoint="mysql://USER:PASSWORD@tcp(HOST:3306)/velad" --token="TOKEN"
|
||||
```
|
||||
|
||||
可以在[这里](db-connect-format.md)找到更多数据库端点的格式
|
||||
|
||||
3. 现在你已经启动了 KubeVela,所有数据存在数据库中。
|
||||
|
||||
如果这台机器因为某些原因关机了,或者你运行了 `velad uninstall`。你可以用同样的命令加上 `--start` 标志重启 KubeVela。
|
||||
|
||||
```shell
|
||||
velad install --database-endpoint="mysql://USER:PASSWORD@tcp(HOST:3306)/velad" --token="TOKEN" --start
|
||||
```
|
||||
|
||||
### 从远端访问
|
||||
|
||||
velad 默认只提供了 kubeconfig 供你从本地访问。例如你运行 `export KUBECONFIG=$(velad kubeconfig --internal)` 使 vela CLI 能访问 KubeVela
|
||||
|
||||
你可以通过如下操作,使得可以从其他机器访问 KubeVela(例如在服务器使用 velad 部署 KubeVela,在本地访问)
|
||||
1. 当运行`velad install`的时候,添加 `--bind-ip=NODE_IP` 参数,velad会帮助生成在其他机器使用的 kubeconfig。其中的 NODE_IP 是运行 velad 所在机器的 IP。
|
||||
2. 运行 `velad kubeconfig` (注意到没有 `--internal`) 将会打印可以外部使用 kubeconfig 的位置。
|
||||
3. 将该文件复制到其他文件。设置好 `KUBECONFIG`,你就可以从远端访问 KubeVela 了!
|
||||
查看[文档](../docs)获取更多 VelaD 的使用方法和案例。
|
||||
|
|
After Width: | Height: | Size: 385 KiB |
After Width: | Height: | Size: 286 KiB |
After Width: | Height: | Size: 299 KiB |
After Width: | Height: | Size: 133 KiB |
After Width: | Height: | Size: 190 KiB |
After Width: | Height: | Size: 163 KiB |
After Width: | Height: | Size: 284 KiB |
After Width: | Height: | Size: 36 KiB |
After Width: | Height: | Size: 428 KiB |
445
go.mod
|
@ -1,255 +1,334 @@
|
|||
module github.com/oam-dev/velad
|
||||
|
||||
go 1.17
|
||||
go 1.22.0
|
||||
|
||||
toolchain go1.22.4
|
||||
|
||||
require (
|
||||
github.com/docker/docker v20.10.10+incompatible
|
||||
github.com/docker/go-connections v0.4.0
|
||||
github.com/fatih/color v1.13.0
|
||||
github.com/kyokomi/emoji/v2 v2.2.9
|
||||
github.com/oam-dev/kubevela v1.3.5
|
||||
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.34.1
|
||||
github.com/pkg/errors v0.9.1
|
||||
github.com/rancher/k3d/v5 v5.2.2
|
||||
github.com/spf13/cobra v1.3.0
|
||||
github.com/stretchr/testify v1.7.0
|
||||
helm.sh/helm/v3 v3.6.1
|
||||
k8s.io/client-go v0.22.3
|
||||
k8s.io/klog/v2 v2.9.0
|
||||
k8s.io/utils v0.0.0-20210930125809-cb0fa318a74b
|
||||
sigs.k8s.io/controller-runtime v0.9.5
|
||||
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 (
|
||||
cloud.google.com/go v0.99.0 // indirect
|
||||
cuelang.org/go v0.2.2 // 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 (
|
||||
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.18 // indirect
|
||||
github.com/Azure/go-autorest/autorest/adal v0.9.13 // indirect
|
||||
github.com/Azure/go-autorest/autorest/date v0.3.0 // indirect
|
||||
github.com/Azure/go-autorest/logger v0.2.1 // indirect
|
||||
github.com/Azure/go-autorest/tracing v0.6.0 // indirect
|
||||
github.com/BurntSushi/toml v0.4.1 // indirect
|
||||
github.com/MakeNowJust/heredoc v0.0.0-20170808103936-bb23615498cd // 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.0 // indirect
|
||||
github.com/Microsoft/go-winio v0.5.1 // indirect
|
||||
github.com/Microsoft/hcsshim v0.9.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.2 // indirect
|
||||
github.com/alessio/shellescape v1.2.2 // 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/agext/levenshtein v1.2.3 // indirect
|
||||
github.com/alessio/shellescape v1.4.1 // indirect
|
||||
github.com/aliyun/alibaba-cloud-sdk-go v1.61.1704 // 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-20200428143746-21a406dcc535 // indirect
|
||||
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
|
||||
github.com/beorn7/perks v1.0.1 // indirect
|
||||
github.com/blang/semver v3.5.1+incompatible // indirect
|
||||
github.com/briandowns/spinner v1.11.1 // indirect
|
||||
github.com/cespare/xxhash/v2 v2.1.2 // indirect
|
||||
github.com/chai2010/gettext-go v0.0.0-20160711120539-c6fed771bfd5 // indirect
|
||||
github.com/cockroachdb/apd/v2 v2.0.1 // indirect
|
||||
github.com/containerd/cgroups v1.0.2 // indirect
|
||||
github.com/containerd/containerd v1.5.7 // indirect
|
||||
github.com/coreos/prometheus-operator v0.41.1 // indirect
|
||||
github.com/crossplane/crossplane-runtime v0.14.1-0.20210722005935-0b469fcc77cd // indirect
|
||||
github.com/cyphar/filepath-securejoin v0.2.2 // indirect
|
||||
github.com/blang/semver/v4 v4.0.0 // indirect
|
||||
github.com/bluele/gcache v0.0.2 // indirect
|
||||
github.com/briandowns/spinner v1.23.0 // indirect
|
||||
github.com/buger/jsonparser v1.1.1 // 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.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.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/deislabs/oras v0.11.1 // indirect
|
||||
github.com/docker/cli v20.10.10+incompatible // indirect
|
||||
github.com/docker/distribution v2.8.0-beta.1+incompatible // indirect
|
||||
github.com/docker/docker-credential-helpers v0.6.4 // indirect
|
||||
github.com/dimchansky/utfbom v1.1.1 // 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 v2.9.5+incompatible // indirect
|
||||
github.com/emicklei/go-restful/v3 v3.0.0-rc2 // indirect
|
||||
github.com/emirpasic/gods v1.12.0 // indirect
|
||||
github.com/evanphx/json-patch v4.12.0+incompatible // indirect
|
||||
github.com/evanphx/json-patch/v5 v5.1.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/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/form3tech-oss/jwt-go v3.2.3+incompatible // indirect
|
||||
github.com/fsnotify/fsnotify v1.5.1 // indirect
|
||||
github.com/fvbommel/sortorder v1.0.2 // indirect
|
||||
github.com/gertd/go-pluralize v0.1.7 // indirect
|
||||
github.com/getkin/kin-openapi v0.76.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 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.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.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-logr/logr v0.4.0 // indirect
|
||||
github.com/go-openapi/jsonpointer v0.19.5 // indirect
|
||||
github.com/go-openapi/jsonreference v0.19.5 // indirect
|
||||
github.com/go-openapi/spec v0.19.8 // indirect
|
||||
github.com/go-openapi/swag v0.19.14 // indirect
|
||||
github.com/go-resty/resty/v2 v2.7.0 // indirect
|
||||
github.com/go-test/deep v1.0.8 // 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.1.0 // indirect
|
||||
github.com/gobwas/glob v0.2.3 // indirect
|
||||
github.com/gogo/protobuf v1.3.2 // indirect
|
||||
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
|
||||
github.com/golang/protobuf v1.5.2 // indirect
|
||||
github.com/google/btree v1.0.1 // indirect
|
||||
github.com/google/go-cmp v0.5.6 // indirect
|
||||
github.com/golang/mock v1.6.0 // indirect
|
||||
github.com/golang/protobuf v1.5.4 // indirect
|
||||
github.com/goodhosts/hostsfile v0.1.1 // indirect
|
||||
github.com/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.0.0 // indirect
|
||||
github.com/google/gofuzz v1.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.2.0 // indirect
|
||||
github.com/googleapis/gnostic v0.5.5 // indirect
|
||||
github.com/gorilla/mux v1.8.0 // indirect
|
||||
github.com/gosuri/uilive v0.0.4 // 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/hashicorp/go-version v1.3.0 // indirect
|
||||
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect
|
||||
github.com/hashicorp/errwrap v1.1.0 // indirect
|
||||
github.com/hashicorp/go-cleanhttp v0.5.2 // 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.9.1 // indirect
|
||||
github.com/huandu/xstrings v1.3.2 // indirect
|
||||
github.com/imdario/mergo v0.3.12 // indirect
|
||||
github.com/inconshreveable/mousetrap v1.0.0 // 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/jmoiron/sqlx v1.3.1 // indirect
|
||||
github.com/jmespath/go-jmespath v0.4.0 // indirect
|
||||
github.com/jmoiron/sqlx v1.3.5 // indirect
|
||||
github.com/josharian/intern v1.0.0 // indirect
|
||||
github.com/json-iterator/go v1.1.12 // indirect
|
||||
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
|
||||
github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351 // indirect
|
||||
github.com/kevinburke/ssh_config v1.2.0 // indirect
|
||||
github.com/klauspost/compress v1.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/lib/pq v1.10.0 // indirect
|
||||
github.com/lib/pq v1.10.9 // indirect
|
||||
github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect
|
||||
github.com/magiconair/properties v1.8.5 // indirect
|
||||
github.com/mailru/easyjson v0.7.6 // indirect
|
||||
github.com/mattn/go-colorable v0.1.12 // indirect
|
||||
github.com/mattn/go-isatty v0.0.14 // indirect
|
||||
github.com/mattn/go-runewidth v0.0.9 // indirect
|
||||
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
|
||||
github.com/lucasb-eyer/go-colorful v1.2.0 // 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.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.0.3 // 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.0 // indirect
|
||||
github.com/mitchellh/hashstructure/v2 v2.0.1 // indirect
|
||||
github.com/mitchellh/mapstructure v1.4.3 // indirect
|
||||
github.com/mitchellh/go-wordwrap v1.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/sys/mount v0.3.0 // indirect
|
||||
github.com/moby/sys/mountinfo v0.5.0 // indirect
|
||||
github.com/moby/term v0.0.0-20210619224110-3f7ff695adc6 // 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/oam-dev/cluster-gateway v1.1.6 // indirect
|
||||
github.com/oam-dev/cluster-register v1.0.4-0.20220325092210-cee4a3d3fb7d // 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.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.4.2 // indirect
|
||||
github.com/oam-dev/terraform-controller v0.8.0 // indirect
|
||||
github.com/olekukonko/tablewriter v0.0.5 // indirect
|
||||
github.com/onsi/gomega v1.17.0 // indirect
|
||||
github.com/opencontainers/go-digest v1.0.0 // indirect
|
||||
github.com/opencontainers/image-spec v1.0.2 // indirect
|
||||
github.com/opencontainers/runc v1.0.3 // indirect
|
||||
github.com/openkruise/kruise-api v0.9.0 // indirect
|
||||
github.com/pelletier/go-toml v1.9.4 // 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.2.2 // indirect
|
||||
github.com/peterbourgon/diskv v2.0.1+incompatible // indirect
|
||||
github.com/pmezard/go-difflib v1.0.0 // indirect
|
||||
github.com/prometheus/client_golang v1.11.0 // indirect
|
||||
github.com/prometheus/client_model v0.2.0 // indirect
|
||||
github.com/prometheus/common v0.26.0 // indirect
|
||||
github.com/prometheus/procfs v0.6.0 // indirect
|
||||
github.com/rubenv/sql-migrate v0.0.0-20200616145509-8d140a17f351 // indirect
|
||||
github.com/russross/blackfriday v1.5.2 // indirect
|
||||
github.com/sergi/go-diff v1.1.0 // indirect
|
||||
github.com/shopspring/decimal v1.2.0 // indirect
|
||||
github.com/sirupsen/logrus v1.8.1 // indirect
|
||||
github.com/spf13/afero v1.6.0 // indirect
|
||||
github.com/spf13/cast v1.4.1 // 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.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.10.0 // indirect
|
||||
github.com/src-d/gcfg v1.4.0 // indirect
|
||||
github.com/subosito/gotenv v1.2.0 // 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.14.4 // indirect
|
||||
github.com/tidwall/match v1.1.1 // indirect
|
||||
github.com/tidwall/pretty v1.2.0 // indirect
|
||||
github.com/wercker/stern v0.0.0-20190705090245-4fa46dd6987f // indirect
|
||||
github.com/wonderflow/cert-manager-api v1.0.3 // indirect
|
||||
github.com/xanzy/ssh-agent v0.3.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 v0.0.0-20181112141820-a009c3971eca // indirect
|
||||
github.com/zclconf/go-cty v1.8.0 // indirect
|
||||
go.opencensus.io v0.23.0 // indirect
|
||||
go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5 // indirect
|
||||
go.uber.org/atomic v1.7.0 // indirect
|
||||
go.uber.org/multierr v1.6.0 // indirect
|
||||
go.uber.org/zap v1.18.1 // indirect
|
||||
go4.org/intern v0.0.0-20210108033219-3eb7198706b2 // indirect
|
||||
go4.org/unsafe/assume-no-moving-gc v0.0.0-20201222180813-1025295fd063 // indirect
|
||||
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 // indirect
|
||||
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd // indirect
|
||||
golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a // indirect
|
||||
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect
|
||||
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e // indirect
|
||||
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
|
||||
golang.org/x/text v0.3.7 // indirect
|
||||
golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect
|
||||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
|
||||
gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
|
||||
google.golang.org/appengine v1.6.7 // indirect
|
||||
google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa // indirect
|
||||
google.golang.org/grpc v1.42.0 // indirect
|
||||
google.golang.org/protobuf v1.27.1 // 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/gorp.v1 v1.7.2 // indirect
|
||||
gopkg.in/inf.v0 v0.9.1 // indirect
|
||||
gopkg.in/ini.v1 v1.66.2 // indirect
|
||||
gopkg.in/src-d/go-billy.v4 v4.3.2 // indirect
|
||||
gopkg.in/src-d/go-git.v4 v4.13.1 // indirect
|
||||
gopkg.in/ini.v1 v1.67.0 // 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.0-20210107192922-496545a6307b // indirect
|
||||
inet.af/netaddr v0.0.0-20210903134321-85fa6c94624e // indirect
|
||||
istio.io/api v0.0.0-20210128181506-0c4b8e54850f // indirect
|
||||
istio.io/client-go v0.0.0-20210128182905-ee2edd059e02 // indirect
|
||||
istio.io/gogo-genproto v0.0.0-20190930162913-45029607206a // indirect
|
||||
k8s.io/api v0.22.3 // indirect
|
||||
k8s.io/apiextensions-apiserver v0.22.1 // indirect
|
||||
k8s.io/apimachinery v0.22.3 // indirect
|
||||
k8s.io/apiserver v0.22.1 // indirect
|
||||
k8s.io/cli-runtime v0.21.0 // indirect
|
||||
k8s.io/component-base v0.22.1 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
inet.af/netaddr v0.0.0-20220811202034-502d2d690317 // 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.22.1 // indirect
|
||||
k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65 // indirect
|
||||
k8s.io/kubectl v0.21.0 // indirect
|
||||
k8s.io/metrics v0.21.0 // indirect
|
||||
open-cluster-management.io/api v0.0.0-20210804091127-340467ff6239 // indirect
|
||||
sigs.k8s.io/apiserver-network-proxy v0.0.24 // indirect
|
||||
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.24 // indirect
|
||||
sigs.k8s.io/apiserver-runtime v1.0.3-0.20210913073608-0663f60bfee2 // indirect
|
||||
sigs.k8s.io/kind v0.9.0 // indirect
|
||||
sigs.k8s.io/kustomize/api v0.8.5 // indirect
|
||||
sigs.k8s.io/kustomize/kyaml v0.10.15 // indirect
|
||||
sigs.k8s.io/structured-merge-diff/v4 v4.2.1 // indirect
|
||||
sigs.k8s.io/yaml v1.3.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.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 (
|
||||
github.com/containerd/containerd => github.com/containerd/containerd v1.4.4
|
||||
cuelang.org/go => cuelang.org/go v0.9.2
|
||||
github.com/docker/cli => github.com/docker/cli v20.10.9+incompatible
|
||||
github.com/getkin/kin-openapi => github.com/getkin/kin-openapi v0.34.0
|
||||
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
|
||||
google.golang.org/grpc => google.golang.org/grpc v1.29.0
|
||||
k8s.io/api => k8s.io/api v0.22.3
|
||||
k8s.io/apimachinery => k8s.io/apimachinery v0.22.3
|
||||
k8s.io/client-go => k8s.io/client-go v0.22.3
|
||||
k8s.io/klog/v2 => k8s.io/klog/v2 v2.9.0
|
||||
sigs.k8s.io/apiserver-network-proxy/konnectivity-client => sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.24
|
||||
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc => go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.42.0
|
||||
google.golang.org/grpc => google.golang.org/grpc v1.53.0
|
||||
oras.land/oras-go => oras.land/oras-go v1.2.2
|
||||
sigs.k8s.io/apiserver-runtime => github.com/kmodules/apiserver-runtime v1.1.2-0.20240303184316-6365e03bf9ac
|
||||
)
|
||||
|
||||
replace github.com/containerd/containerd => github.com/containerd/containerd v1.6.18
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,16 +1,34 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
set -x
|
||||
|
||||
K3D_IMAGE_DIR=pkg/resources/static/k3d/images
|
||||
mkdir -p "$K3D_IMAGE_DIR"
|
||||
|
||||
vela_images=("rancher/k3d-tools:5.2.2"
|
||||
"rancher/k3d-proxy:5.2.2"
|
||||
"rancher/k3s:v1.21.10-k3s1")
|
||||
ARCH=$1
|
||||
|
||||
for IMG in ${vela_images[*]}; do
|
||||
IMAGE_NAME=$(echo "$IMG" | cut -f1 -d: | cut -f2 -d/)
|
||||
echo saving "$IMG" to "$K3D_IMAGE_DIR"/"$IMAGE_NAME".tar
|
||||
docker pull "$IMG"
|
||||
docker save -o "$K3D_IMAGE_DIR"/"$IMAGE_NAME".tar "$IMG"
|
||||
gzip -f "$K3D_IMAGE_DIR"/"$IMAGE_NAME".tar
|
||||
done
|
||||
function download_k3d_images() {
|
||||
k3d_images=(
|
||||
"$(cat pkg/apis/types.go| grep "K3dImageK3s" |tail -n1 | cut -f2 -d'"')"
|
||||
"$(cat pkg/apis/types.go| grep "K3dImageTools" |tail -n1 | cut -f2 -d'"')"
|
||||
"$(cat pkg/apis/types.go| grep "K3dImageProxy" |tail -n1 | cut -f2 -d'"')"
|
||||
)
|
||||
|
||||
for IMG in ${k3d_images[*]}; do
|
||||
IMAGE_NAME=$(echo "$IMG" | cut -f1 -d: | awk -F '/' '{print $NF}')
|
||||
echo saving "$IMG" to "$K3D_IMAGE_DIR"/"$IMAGE_NAME".tar
|
||||
$DOCKER_PULL "$IMG"
|
||||
docker save -o "$K3D_IMAGE_DIR"/"$IMAGE_NAME".tar "$IMG"
|
||||
gzip -f "$K3D_IMAGE_DIR"/"$IMAGE_NAME".tar
|
||||
done
|
||||
}
|
||||
|
||||
function determine_pull_command() {
|
||||
DOCKER_PULL="docker pull --platform=linux/amd64"
|
||||
if [ "$1" == "arm64" ]; then
|
||||
DOCKER_PULL="docker pull --platform=linux/arm64"
|
||||
fi
|
||||
}
|
||||
determine_pull_command "$ARCH"
|
||||
download_k3d_images
|
|
@ -1,6 +1,7 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
set -x
|
||||
|
||||
VELA_IMAGE_DIR=pkg/resources/static/vela/images
|
||||
rm -rf "$VELA_IMAGE_DIR"
|
||||
|
@ -24,16 +25,48 @@ else
|
|||
velaux_version=v$2
|
||||
fi
|
||||
|
||||
vela_images=("oamdev/vela-core:${vela_version}"
|
||||
"oamdev/cluster-gateway:v1.3.2"
|
||||
"oamdev/kube-webhook-certgen:v2.3"
|
||||
"oamdev/velaux:${velaux_version}"
|
||||
"oamdev/vela-apiserver:${vela_version}")
|
||||
# optional, amd64 if not set
|
||||
ARCH=$3
|
||||
|
||||
for IMG in ${vela_images[*]}; do
|
||||
IMAGE_NAME=$(echo "$IMG" | cut -f1 -d: | cut -f2 -d/)
|
||||
echo saving "$IMG" to "$VELA_IMAGE_DIR"/"$IMAGE_NAME".tar.gz
|
||||
docker pull "$IMG"
|
||||
docker save -o "$VELA_IMAGE_DIR"/"$IMAGE_NAME".tar "$IMG"
|
||||
gzip -f "$VELA_IMAGE_DIR"/"$IMAGE_NAME".tar
|
||||
done
|
||||
function set_cluster_gateway_version() {
|
||||
cluster_gateway_version=UNKNOWN
|
||||
image_tag=$(cat pkg/resources/static/vela/charts/vela-core/values.yaml | grep -A 1 oamdev/cluster-gateway | grep tag)
|
||||
cluster_gateway_version=$(echo $image_tag| cut -f2 -d:|xargs)
|
||||
echo "cluster-gateway image version detected:" $cluster_gateway_version
|
||||
}
|
||||
|
||||
function set_certgen_version() {
|
||||
certgen_version=UNKNOWN
|
||||
image_tag=$(cat pkg/resources/static/vela/charts/vela-core/values.yaml | grep -A 1 oamdev/kube-webhook-certgen | grep tag)
|
||||
certgen_version=$(echo $image_tag| cut -f2 -d:|xargs)
|
||||
echo "kube-webhook-certgen image version detected:" $certgen_version
|
||||
}
|
||||
|
||||
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}")
|
||||
|
||||
for IMG in ${vela_images[*]};
|
||||
do
|
||||
IMAGE_NAME=$(echo "$IMG" | cut -f1 -d: | cut -f2 -d/)
|
||||
echo saving "$IMG" to "$VELA_IMAGE_DIR"/"$IMAGE_NAME".tar.gz
|
||||
$DOCKER_PULL "$IMG"
|
||||
docker save -o "$VELA_IMAGE_DIR"/"$IMAGE_NAME".tar "$IMG"
|
||||
gzip -f "$VELA_IMAGE_DIR"/"$IMAGE_NAME".tar
|
||||
done
|
||||
}
|
||||
|
||||
function determine_pull_command() {
|
||||
DOCKER_PULL="docker pull --platform=linux/amd64"
|
||||
if [ "$1" == "arm64" ]; then
|
||||
DOCKER_PULL="docker pull --platform=linux/arm64"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
determine_pull_command "$ARCH"
|
||||
set_cluster_gateway_version
|
||||
set_certgen_version
|
||||
download_images
|
||||
|
|
|
@ -30,7 +30,7 @@ if ((Get-ExecutionPolicy) -gt 'RemoteSigned' -or (Get-ExecutionPolicy) -eq 'ByPa
|
|||
# Check if VelaD is installed.
|
||||
if (Test-Path $VelaDFilePath -PathType Leaf) {
|
||||
Write-Warning "velad is detected - $VelaDFilePath"
|
||||
Invoke-Expression "$VelaDFilePath --version"
|
||||
Invoke-Expression "$VelaDFilePath version"
|
||||
Write-Output "Reinstalling VelaD..."
|
||||
}
|
||||
else {
|
||||
|
@ -76,7 +76,7 @@ if (!(Test-Path $VelaDFilePath -PathType Leaf)) {
|
|||
}
|
||||
|
||||
# Check the VelaD version
|
||||
Invoke-Expression "$VelaDFilePath --version"
|
||||
Invoke-Expression "$VelaDFilePath version"
|
||||
|
||||
# Clean up zipfile
|
||||
Write-Output "Clean up $zipFilePath..."
|
||||
|
|
|
@ -37,7 +37,7 @@ getSystemInfo() {
|
|||
}
|
||||
|
||||
verifySupported() {
|
||||
local supported=(darwin-amd64 darwin-arm64 linux-amd64 linux-arm linux-arm64)
|
||||
local supported=(darwin-amd64 linux-amd64 linux-arm64 darwin-arm64)
|
||||
local current_osarch="${OS}-${ARCH}"
|
||||
|
||||
for osarch in "${supported[@]}"; do
|
||||
|
@ -108,9 +108,9 @@ downloadFile() {
|
|||
|
||||
echo "Downloading $DOWNLOAD_URL ..."
|
||||
if [ "$VELAD_HTTP_REQUEST_CLI" == "curl" ]; then
|
||||
curl -SsL "$DOWNLOAD_URL" -o "$ARTIFACT_TMP_FILE"
|
||||
curl -SL "$DOWNLOAD_URL" -o "$ARTIFACT_TMP_FILE"
|
||||
else
|
||||
wget -q -O "$ARTIFACT_TMP_FILE" "$DOWNLOAD_URL"
|
||||
wget -O "$ARTIFACT_TMP_FILE" "$DOWNLOAD_URL"
|
||||
fi
|
||||
|
||||
if [ ! -f "$ARTIFACT_TMP_FILE" ]; then
|
||||
|
|
|
@ -3,29 +3,39 @@
|
|||
# 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
|
||||
|
||||
[ $# = 2 ] || { echo "Usage: "$0" version_now version_to" >&2; exit 1; }
|
||||
[ $# = 1 ] || { echo "Usage: "$0" version_to" >&2; exit 1; }
|
||||
|
||||
VERSION_NOW=$1
|
||||
VERSION_TO=$2
|
||||
VERSION_NOW=$(cat Makefile |grep "VELA_VERSION ?=" |grep -o "v.*")
|
||||
VERSION_TO=$1
|
||||
PATCH_FILE_NAME=$VERSION_NOW-$VERSION_TO.patch
|
||||
WORKDIR=pkg/resources/static/vela
|
||||
|
||||
git clone git@github.com:kubevela/kubevela.git
|
||||
echo "Upgrading KubeVela version From: "$VERSION_NOW" --> TO: "$VERSION_TO
|
||||
|
||||
pushd kubevela
|
||||
git diff refs/tags/"$VERSION_NOW"...refs/tags/"$VERSION_TO" charts/vela-core > "$PATCH_FILE_NAME"
|
||||
popd
|
||||
echo "Upgrading go.mod version..."
|
||||
|
||||
mv kubevela/"$PATCH_FILE_NAME" .
|
||||
|
||||
echo "Patching charts..."
|
||||
git apply -v --check --reject --apply --directory $WORKDIR "$PATCH_FILE_NAME"
|
||||
echo "Patching done"
|
||||
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
|
||||
|
||||
rm "$PATCH_FILE_NAME"
|
||||
rm -rf kubevela
|
||||
go mod tidy
|
||||
|
||||
echo "Upgrading version variable in Makefile"
|
||||
|
||||
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
|
||||
|
|
|
@ -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
|
|
@ -6,7 +6,7 @@ GOBIN=$(shell go env GOBIN)
|
|||
endif
|
||||
|
||||
|
||||
GOLANGCILINT_VERSION ?= v1.38.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
|
||||
|
|
|
@ -1,17 +1,25 @@
|
|||
package apis
|
||||
|
||||
import "github.com/oam-dev/kubevela/references/cli"
|
||||
import (
|
||||
"github.com/oam-dev/kubevela/pkg/utils/common"
|
||||
cmdutil "github.com/oam-dev/kubevela/pkg/utils/util"
|
||||
"github.com/oam-dev/kubevela/references/cli"
|
||||
)
|
||||
|
||||
// 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
|
||||
|
@ -32,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
|
||||
|
@ -91,6 +109,14 @@ type VelaStatus struct {
|
|||
Reason string
|
||||
}
|
||||
|
||||
// Context keep some context for install progress
|
||||
type Context struct {
|
||||
DryRun bool
|
||||
IOStreams cmdutil.IOStreams
|
||||
CommonArgs common.Args
|
||||
VelaChartPath string
|
||||
}
|
||||
|
||||
var (
|
||||
// K3sTokenPath is the path to k3s token
|
||||
K3sTokenPath = "/var/lib/rancher/k3s/server/token"
|
||||
|
@ -105,11 +131,11 @@ var (
|
|||
VelaDDockerNetwork = "k3d-velad"
|
||||
|
||||
// K3dImageK3s is k3s image tag
|
||||
K3dImageK3s = "rancher/k3s:v1.21.10-k3s1"
|
||||
K3dImageK3s = "rancher/k3s:v1.29.13-k3s1"
|
||||
// K3dImageTools is k3d tools image tag
|
||||
K3dImageTools = "rancher/k3d-tools:5.2.2"
|
||||
K3dImageTools = "ghcr.io/k3d-io/k3d-tools:latest"
|
||||
// K3dImageProxy is k3d proxy image tag
|
||||
K3dImageProxy = "rancher/k3d-proxy:5.2.2"
|
||||
K3dImageProxy = "ghcr.io/k3d-io/k3d-proxy:5.5.1"
|
||||
|
||||
// KubeVelaHelmRelease is helm release name for vela
|
||||
KubeVelaHelmRelease = "kubevela"
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
@ -14,16 +13,17 @@ func GetK3sServerArgs(args apis.InstallArgs) []string {
|
|||
if 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
|
||||
}
|
||||
|
|
|
@ -6,8 +6,9 @@ import "github.com/oam-dev/velad/pkg/apis"
|
|||
type Handler interface {
|
||||
Install(args apis.InstallArgs) error
|
||||
Uninstall(name string) error
|
||||
GenKubeconfig(bindIP string) error
|
||||
GenKubeconfig(ctx apis.Context, bindIP string) error
|
||||
SetKubeconfig() error
|
||||
LoadImage(image string) error
|
||||
GetStatus() apis.ClusterStatus
|
||||
Join(args apis.JoinArgs) error
|
||||
}
|
||||
|
|
|
@ -6,7 +6,6 @@ import (
|
|||
"context"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"net"
|
||||
"os"
|
||||
"os/exec"
|
||||
|
@ -22,15 +21,15 @@ import (
|
|||
|
||||
"github.com/docker/docker/client"
|
||||
"github.com/docker/go-connections/nat"
|
||||
k3dClient "github.com/k3d-io/k3d/v5/pkg/client"
|
||||
config "github.com/k3d-io/k3d/v5/pkg/config/v1alpha4"
|
||||
"github.com/k3d-io/k3d/v5/pkg/runtimes"
|
||||
k3d "github.com/k3d-io/k3d/v5/pkg/types"
|
||||
"github.com/oam-dev/kubevela/pkg/utils/system"
|
||||
"github.com/oam-dev/velad/pkg/apis"
|
||||
"github.com/oam-dev/velad/pkg/resources"
|
||||
"github.com/oam-dev/velad/pkg/utils"
|
||||
"github.com/pkg/errors"
|
||||
k3dClient "github.com/rancher/k3d/v5/pkg/client"
|
||||
config "github.com/rancher/k3d/v5/pkg/config/v1alpha3"
|
||||
"github.com/rancher/k3d/v5/pkg/runtimes"
|
||||
k3d "github.com/rancher/k3d/v5/pkg/types"
|
||||
"k8s.io/client-go/tools/clientcmd"
|
||||
)
|
||||
|
||||
|
@ -41,12 +40,17 @@ var (
|
|||
}
|
||||
dockerCli client.APIClient
|
||||
info = utils.Info
|
||||
infof = utils.Infof
|
||||
errf = utils.Errf
|
||||
)
|
||||
|
||||
type k3dSetupOptions struct {
|
||||
dryRun bool
|
||||
}
|
||||
|
||||
const (
|
||||
// K3dImageTag is image tag of k3d
|
||||
K3dImageTag = "v1.21.10-k3s1"
|
||||
K3dImageTag = "v1.27.2-k3s1"
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
@ -63,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
|
||||
|
@ -70,7 +79,10 @@ func (d *K3dHandler) Install(args apis.InstallArgs) error {
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = setupK3d(d.ctx, d.cfg)
|
||||
o := k3dSetupOptions{
|
||||
dryRun: args.DryRun,
|
||||
}
|
||||
err = o.setupK3d(d.ctx, d.cfg)
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "failed to setup k3d")
|
||||
}
|
||||
|
@ -111,57 +123,88 @@ func (d *K3dHandler) Uninstall(name string) error {
|
|||
// 1. kubeconfig for access from host
|
||||
// 2. kubeconfig for access from other VelaD cluster
|
||||
// 3. kubeconfig for access from other machine (if bindIP provided)
|
||||
func (d *K3dHandler) GenKubeconfig(bindIP string) error {
|
||||
func (d *K3dHandler) GenKubeconfig(ctx apis.Context, bindIP string) error {
|
||||
var err error
|
||||
var cluster = d.cfg.Cluster.Name
|
||||
// 1. kubeconfig for access from host
|
||||
cfg := configPath(cluster)
|
||||
if _, err := k3dClient.KubeconfigGetWrite(context.Background(), runtimes.SelectedRuntime, &d.cfg.Cluster, cfg,
|
||||
&k3dClient.WriteKubeConfigOptions{UpdateExisting: true, OverwriteExisting: false, UpdateCurrentContext: true}); err != nil {
|
||||
return errors.Wrap(err, "failed to gen kubeconfig")
|
||||
cfgHost := configPath(cluster)
|
||||
info("Generating host kubeconfig into", cfgHost)
|
||||
if !ctx.DryRun {
|
||||
if _, err := k3dClient.KubeconfigGetWrite(context.Background(), runtimes.SelectedRuntime, &d.cfg.Cluster, cfgHost,
|
||||
&k3dClient.WriteKubeConfigOptions{UpdateExisting: true, OverwriteExisting: false, UpdateCurrentContext: true}); err != nil {
|
||||
return errors.Wrap(err, "failed to gen kubeconfig")
|
||||
}
|
||||
}
|
||||
// #nosec
|
||||
_cfgContent, err := os.ReadFile(cfgHost)
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "read kubeconfig")
|
||||
}
|
||||
|
||||
var (
|
||||
hostToReplace string
|
||||
kubeConfig = string(_cfgContent)
|
||||
)
|
||||
|
||||
if !ctx.DryRun {
|
||||
switch {
|
||||
case strings.Contains(kubeConfig, "0.0.0.0"):
|
||||
hostToReplace = "0.0.0.0"
|
||||
case strings.Contains(kubeConfig, "host.docker.internal"):
|
||||
hostToReplace = "host.docker.internal"
|
||||
default:
|
||||
return errors.Wrap(err, "unrecognized kubeconfig format")
|
||||
}
|
||||
}
|
||||
|
||||
// Replace host config with loop back address
|
||||
if !ctx.DryRun {
|
||||
cfgHostContent := strings.ReplaceAll(kubeConfig, hostToReplace, "127.0.0.1")
|
||||
err = os.WriteFile(cfgHost, []byte(cfgHostContent), 0600)
|
||||
if err != nil {
|
||||
errf("Fail to re-write host kubeconfig")
|
||||
}
|
||||
}
|
||||
|
||||
// 2. kubeconfig for access from other VelaD cluster
|
||||
// Basically we replace the IP with IP inside the docker network
|
||||
cfgContent, err := os.ReadFile(cfg)
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "read kubeconfig")
|
||||
}
|
||||
cfgIn := configPathInternal(cluster)
|
||||
networks, err := dockerCli.NetworkInspect(d.ctx, apis.VelaDDockerNetwork, types.NetworkInspectOptions{})
|
||||
if err != nil {
|
||||
klog.ErrorS(err, "inspect docker network")
|
||||
return err
|
||||
}
|
||||
var containerIP string
|
||||
cs := networks.Containers
|
||||
for _, c := range cs {
|
||||
if c.Name == fmt.Sprintf("k3d-%s-server-0", d.cfg.Cluster.Name) {
|
||||
containerIP = strings.TrimSuffix(c.IPv4Address, "/16")
|
||||
info("Generating internal kubeconfig into", cfgIn)
|
||||
if !ctx.DryRun {
|
||||
var containerIP string
|
||||
networks, err := dockerCli.NetworkInspect(d.ctx, apis.VelaDDockerNetwork, types.NetworkInspectOptions{})
|
||||
if err != nil {
|
||||
klog.ErrorS(err, "inspect docker network")
|
||||
return err
|
||||
}
|
||||
cs := networks.Containers
|
||||
for _, c := range cs {
|
||||
if c.Name == fmt.Sprintf("k3d-%s-server-0", d.cfg.Cluster.Name) {
|
||||
containerIP = strings.TrimSuffix(c.IPv4Address, "/16")
|
||||
}
|
||||
}
|
||||
re := regexp.MustCompile(hostToReplace + `:\d{4}`)
|
||||
cfgInContent := re.ReplaceAllString(kubeConfig, fmt.Sprintf("%s:6443", containerIP))
|
||||
err = os.WriteFile(cfgIn, []byte(cfgInContent), 0600)
|
||||
if err != nil {
|
||||
errf("Fail to write internal kubeconfig")
|
||||
} else {
|
||||
info("Successfully generate internal kubeconfig at", cfgIn)
|
||||
}
|
||||
}
|
||||
kubeConfig := string(cfgContent)
|
||||
re := regexp.MustCompile(`0.0.0.0:\d{4}`)
|
||||
cfgInContent := re.ReplaceAllString(kubeConfig, fmt.Sprintf("%s:6443", containerIP))
|
||||
err = ioutil.WriteFile(cfgIn, []byte(cfgInContent), 0600)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// 3. kubeconfig for access from other machine
|
||||
if bindIP != "" {
|
||||
cfgOut := configPathExternal(cluster)
|
||||
info("Generating kubeconfig for remote access into ", cfgOut)
|
||||
originConf, err := os.ReadFile(cfg)
|
||||
if err != nil {
|
||||
return err
|
||||
info("Generating external kubeconfig for remote access into ", cfgOut)
|
||||
if !ctx.DryRun {
|
||||
cfgOutContent := strings.Replace(kubeConfig, hostToReplace, bindIP, 1)
|
||||
err = os.WriteFile(cfgOut, []byte(cfgOutContent), 0600)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
newConf := strings.Replace(string(originConf), "0.0.0.0", bindIP, 1)
|
||||
err = os.WriteFile(cfgOut, []byte(newConf), 0600)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
info("Successfully generate kubeconfig at ", cfgOut)
|
||||
info("Successfully generate external kubeconfig at", cfgOut)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
@ -174,7 +217,7 @@ func (d *K3dHandler) SetKubeconfig() error {
|
|||
|
||||
// LoadImage loads image from local path
|
||||
func (d *K3dHandler) LoadImage(image string) error {
|
||||
err := k3dClient.ImageImportIntoClusterMulti(d.ctx, runtimes.SelectedRuntime, []string{image}, &d.cfg.Cluster, k3d.ImageImportOpts{})
|
||||
err := k3dClient.ImageImportIntoClusterMulti(d.ctx, runtimes.SelectedRuntime, []string{image}, &d.cfg.Cluster, k3d.ImageImportOpts{Mode: k3d.ImportModeAutoDetect})
|
||||
return errors.Wrap(err, "failed to import image")
|
||||
}
|
||||
|
||||
|
@ -258,23 +301,23 @@ func fillK3dCluster(ctx context.Context, cluster *k3d.Cluster, status *apis.Clus
|
|||
}
|
||||
}
|
||||
|
||||
func setupK3d(ctx context.Context, clusterConfig config.ClusterConfig) error {
|
||||
func (o k3dSetupOptions) setupK3d(ctx context.Context, clusterConfig config.ClusterConfig) error {
|
||||
info("Preparing K3s images...")
|
||||
err := PrepareK3sImages()
|
||||
err := o.prepareK3sImages()
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "failed to prepare k3d images")
|
||||
}
|
||||
info("Successfully prepare k3d images")
|
||||
|
||||
info("Loading k3d images...")
|
||||
err = LoadK3dImages()
|
||||
err = o.loadK3dImages()
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "failed to extract k3d images")
|
||||
}
|
||||
info("Successfully load k3d images")
|
||||
|
||||
info("Creating k3d cluster...")
|
||||
if err = runClusterIfNotExist(ctx, clusterConfig); err != nil {
|
||||
if err = o.runClusterIfNotExist(ctx, clusterConfig); err != nil {
|
||||
return err
|
||||
}
|
||||
info("Successfully create k3d cluster")
|
||||
|
@ -389,37 +432,44 @@ func getKubeconfigOptions() config.SimpleConfigOptionsKubeconfig {
|
|||
return opts
|
||||
}
|
||||
|
||||
func runClusterIfNotExist(ctx context.Context, cluster config.ClusterConfig) error {
|
||||
if _, err := k3dClient.ClusterGet(ctx, runtimes.SelectedRuntime, &cluster.Cluster); err == nil {
|
||||
info("Detect an existing cluster: ", cluster.Cluster.Name)
|
||||
return nil
|
||||
func (o k3dSetupOptions) runClusterIfNotExist(ctx context.Context, cluster config.ClusterConfig) error {
|
||||
var err error
|
||||
info("Launching k3d cluster:", cluster.Cluster.Name)
|
||||
if !o.dryRun {
|
||||
if _, err = k3dClient.ClusterGet(ctx, runtimes.SelectedRuntime, &cluster.Cluster); err == nil {
|
||||
info("Detect an existing cluster: ", cluster.Cluster.Name)
|
||||
return nil
|
||||
}
|
||||
err = k3dClient.ClusterRun(ctx, runtimes.SelectedRuntime, &cluster)
|
||||
}
|
||||
err := k3dClient.ClusterRun(ctx, runtimes.SelectedRuntime, &cluster)
|
||||
return errors.Wrapf(err, "fail to create cluster: %s", cluster.Cluster.Name)
|
||||
}
|
||||
|
||||
// PrepareK3sImages extracts k3s images to ~/.vela/velad/k3s/images.tg
|
||||
func PrepareK3sImages() error {
|
||||
embedK3sImage, err := resources.K3sImage.Open("static/k3s/images/k3s-airgap-images-amd64.tar.gz")
|
||||
// prepareK3sImages extracts k3s images to ~/.vela/velad/k3s/images.tg
|
||||
func (o k3dSetupOptions) prepareK3sImages() error {
|
||||
embedK3sImage, err := resources.K3sImage.Open("static/k3s/images/k3s-airgap-images.tar.gz")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer utils.CloseQuietly(embedK3sImage)
|
||||
|
||||
// save k3s image.tgz to ~/.vela/velad/k3s/images.tgz
|
||||
k3sImagesDir, err := getK3sImageDir()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
k3sImagesPath := filepath.Join(k3sImagesDir, "k3s-airgap-images-amd64.tgz")
|
||||
// #nosec
|
||||
k3sImagesFile, err := os.OpenFile(k3sImagesPath, os.O_CREATE|os.O_WRONLY|os.O_TRUNC, 0600)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer utils.CloseQuietly(k3sImagesFile)
|
||||
if _, err := io.Copy(k3sImagesFile, embedK3sImage); err != nil {
|
||||
return err
|
||||
k3sImagesPath := filepath.Join(k3sImagesDir, "k3s-airgap-images.tgz")
|
||||
info("Saving k3s image airgap install tarball to", k3sImagesPath)
|
||||
|
||||
if !o.dryRun {
|
||||
// #nosec
|
||||
k3sImagesFile, err := os.OpenFile(k3sImagesPath, os.O_CREATE|os.O_WRONLY|os.O_TRUNC, 0600)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer utils.CloseQuietly(k3sImagesFile)
|
||||
if _, err := io.Copy(k3sImagesFile, embedK3sImage); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
/* #nosec */
|
||||
|
@ -439,8 +489,8 @@ func getK3sImageDir() (string, error) {
|
|||
return k3sImagesDir, nil
|
||||
}
|
||||
|
||||
// LoadK3dImages loads local k3d images to docker
|
||||
func LoadK3dImages() error {
|
||||
// loadK3dImages loads local k3d images to docker
|
||||
func (o k3dSetupOptions) loadK3dImages() error {
|
||||
dir, err := resources.K3dImage.ReadDir("static/k3d/images")
|
||||
if err != nil {
|
||||
return err
|
||||
|
@ -451,24 +501,29 @@ func LoadK3dImages() error {
|
|||
return err
|
||||
}
|
||||
name := strings.Split(entry.Name(), ".")[0]
|
||||
imageTgz, err := utils.SaveToTemp(file, "k3d-image-"+name+"-*.tar.gz")
|
||||
if err != nil {
|
||||
return err
|
||||
var (
|
||||
format = "k3d-image-" + name + "-*.tar.gz"
|
||||
imageTgz string
|
||||
)
|
||||
if o.dryRun {
|
||||
info("Saving and temporary image file:", format)
|
||||
} else {
|
||||
imageTgz, err = utils.SaveToTemp(file, format)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
// #nosec
|
||||
unzipCmd := exec.Command("gzip", "-d", imageTgz)
|
||||
output, err := unzipCmd.CombinedOutput()
|
||||
utils.InfoBytes(output)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
imageTar := strings.TrimSuffix(imageTgz, ".gz")
|
||||
// #nosec
|
||||
importCmd := exec.Command("docker", "image", "load", "-i", imageTar)
|
||||
output, err = importCmd.CombinedOutput()
|
||||
utils.InfoBytes(output)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
if o.dryRun {
|
||||
infof("Importing image to docker using temporary file: %s\n", format)
|
||||
} else {
|
||||
// #nosec
|
||||
importCmd := exec.Command("docker", "image", "load", "-i", imageTgz)
|
||||
output, err := importCmd.CombinedOutput()
|
||||
utils.InfoBytes(output)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -512,7 +567,7 @@ func prepareLoadbalancer(cluster k3d.Cluster, opts k3d.ClusterCreateOpts) *k3d.L
|
|||
|
||||
func getPortWithFilters() (config.PortWithNodeFilters, error) {
|
||||
var port config.PortWithNodeFilters
|
||||
hostPort, err := findAvailablePort(8080)
|
||||
hostPort, err := findAvailablePort(8090)
|
||||
if err != nil {
|
||||
return port, err
|
||||
}
|
||||
|
|
|
@ -27,8 +27,34 @@ 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
|
||||
Worker bool
|
||||
MasterIP string
|
||||
Token string
|
||||
}
|
||||
|
||||
// Install install k3s cluster
|
||||
func (l K3sHandler) Install(args apis.InstallArgs) error {
|
||||
err := SetupK3s(args)
|
||||
|
@ -42,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")
|
||||
}
|
||||
|
@ -54,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
|
||||
|
@ -68,7 +98,7 @@ func (l K3sHandler) SetKubeconfig() error {
|
|||
// LoadImage load imageTar to k3s cluster
|
||||
func (l K3sHandler) LoadImage(imageTar string) error {
|
||||
// #nosec
|
||||
importCmd := exec.Command("k3s", "ctr", "images", "import", imageTar)
|
||||
importCmd := exec.Command("k3s", "ctr", "images", "import", "--all-platforms", imageTar)
|
||||
output, err := importCmd.CombinedOutput()
|
||||
utils.InfoBytes(output)
|
||||
if err != nil {
|
||||
|
@ -105,7 +135,7 @@ func fillServiceStatus(status *apis.ClusterStatus) {
|
|||
out, err := cmd.CombinedOutput()
|
||||
status.K3s.K3sServiceStatus = string(out)
|
||||
if err != nil {
|
||||
var extErr exec.ExitError
|
||||
extErr := new(exec.ExitError)
|
||||
if ok := errors.As(err, &extErr); !ok {
|
||||
status.K3s.Reason = fmt.Sprintf("fail to run systemctl: %v", extErr.Error())
|
||||
}
|
||||
|
@ -148,67 +178,100 @@ func fillVelaStatus(status *apis.ClusterStatus) {
|
|||
}
|
||||
}
|
||||
|
||||
// PrepareK3sImages Write embed images
|
||||
func PrepareK3sImages() error {
|
||||
embedK3sImage, err := resources.K3sImage.Open("static/k3s/images/k3s-airgap-images-amd64.tar.gz")
|
||||
// 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
|
||||
}
|
||||
defer utils.CloseQuietly(embedK3sImage)
|
||||
err = os.MkdirAll(resources.K3sImageDir, 0600)
|
||||
if err != nil {
|
||||
return err
|
||||
infof("Making directory %s\n", resources.K3sImageDir)
|
||||
if !o.DryRun {
|
||||
err = os.MkdirAll(resources.K3sImageDir, 0600)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
/* #nosec */
|
||||
bin, err := os.OpenFile(resources.K3sImageLocation, os.O_CREATE|os.O_WRONLY, 0700)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer utils.CloseQuietly(bin)
|
||||
_, err = io.Copy(bin, embedK3sImage)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
// #nosec
|
||||
unGzipCmd := exec.Command("gzip", "-f", "-d", resources.K3sImageLocation)
|
||||
output, err := unGzipCmd.CombinedOutput()
|
||||
fmt.Print(string(output))
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
infof("Saving K3s air-gap install images to %s\n", resources.K3sImageLocation)
|
||||
if !o.DryRun {
|
||||
/* #nosec */
|
||||
bin, err := os.OpenFile(resources.K3sImageLocation, os.O_CREATE|os.O_WRONLY, 0700)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer utils.CloseQuietly(bin)
|
||||
_, err = io.Copy(bin, embedK3sImage)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
// #nosec
|
||||
unGzipCmd := exec.Command("gzip", "-f", "-d", resources.K3sImageLocation)
|
||||
output, err := unGzipCmd.CombinedOutput()
|
||||
fmt.Print(string(output))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
info("Successfully prepare k3s image")
|
||||
return nil
|
||||
}
|
||||
|
||||
// PrepareK3sScript Write k3s install script to local
|
||||
func PrepareK3sScript() (string, error) {
|
||||
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 (
|
||||
scriptName string
|
||||
err error
|
||||
)
|
||||
embedScript, err := resources.K3sDirectory.Open("static/k3s/other/setup.sh")
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
scriptName, err := utils.SaveToTemp(embedScript, "k3s-setup-*.sh")
|
||||
if err != nil {
|
||||
return "", err
|
||||
format := "k3s-setup-*.sh"
|
||||
infof("Saving temporary file: %s\n", format)
|
||||
if !o.DryRun {
|
||||
scriptName, err = utils.SaveToTemp(embedScript, format)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
}
|
||||
return scriptName, nil
|
||||
}
|
||||
|
||||
// PrepareK3sBin prepare k3s bin
|
||||
func PrepareK3sBin() error {
|
||||
// prepareK3sBin prepare k3s bin
|
||||
func (o k3sSetupOptions) prepareK3sBin() error {
|
||||
embedK3sBinary, err := resources.K3sDirectory.Open("static/k3s/other/k3s")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer utils.CloseQuietly(embedK3sBinary)
|
||||
/* #nosec */
|
||||
bin, err := os.OpenFile(resources.K3sBinaryLocation, os.O_CREATE|os.O_WRONLY, 0700)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer utils.CloseQuietly(bin)
|
||||
_, err = io.Copy(bin, embedK3sBinary)
|
||||
if err != nil {
|
||||
return err
|
||||
infof("Saving k3s binary to %s\n", resources.K3sBinaryLocation)
|
||||
if !o.DryRun {
|
||||
/* #nosec */
|
||||
bin, err := os.OpenFile(resources.K3sBinaryLocation, os.O_CREATE|os.O_WRONLY, 0700)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer utils.CloseQuietly(bin)
|
||||
_, err = io.Copy(bin, embedK3sBinary)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
info("Successfully place k3s binary to " + resources.K3sBinaryLocation)
|
||||
return nil
|
||||
|
@ -216,50 +279,76 @@ func PrepareK3sBin() error {
|
|||
|
||||
// SetupK3s will set up K3s as control plane.
|
||||
func SetupK3s(cArgs apis.InstallArgs) error {
|
||||
o := k3sSetupOptions{
|
||||
DryRun: cArgs.DryRun,
|
||||
Worker: cArgs.Worker,
|
||||
MasterIP: cArgs.MasterIP,
|
||||
Token: cArgs.Token,
|
||||
}
|
||||
info("Preparing cluster setup script...")
|
||||
script, err := PrepareK3sScript()
|
||||
script, err := o.prepareK3sScript()
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "fail to prepare k3s setup script")
|
||||
}
|
||||
|
||||
info("Preparing k3s binary...")
|
||||
err = PrepareK3sBin()
|
||||
err = o.prepareK3sBin()
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "Fail to prepare k3s binary")
|
||||
}
|
||||
|
||||
info("Preparing k3s images")
|
||||
err = PrepareK3sImages()
|
||||
err = o.prepareK3sImages()
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "Fail to prepare k3s images")
|
||||
}
|
||||
|
||||
info("Setting up cluster...")
|
||||
info("Setting up cluster")
|
||||
args := []string{script}
|
||||
other := GetK3sServerArgs(cArgs)
|
||||
args = append(args, other...)
|
||||
/* #nosec */
|
||||
cmd := exec.Command("/bin/bash", args...)
|
||||
|
||||
cmd.Env = os.Environ()
|
||||
cmd.Env = append(cmd.Env, "INSTALL_K3S_SKIP_DOWNLOAD=true")
|
||||
output, err := cmd.CombinedOutput()
|
||||
fmt.Print(string(output))
|
||||
var output []byte
|
||||
if !o.DryRun {
|
||||
/* #nosec */
|
||||
cmd := exec.Command("/bin/bash", args...)
|
||||
o.prepareEnv(cmd)
|
||||
info(cmd.String())
|
||||
output, err = cmd.CombinedOutput()
|
||||
infof(string(output))
|
||||
}
|
||||
return errors.Wrap(err, "K3s install script failed")
|
||||
}
|
||||
|
||||
// GenKubeconfig generate kubeconfig for accessing from other machine
|
||||
func (l K3sHandler) GenKubeconfig(bindIP string) error {
|
||||
func (l K3sHandler) GenKubeconfig(ctx apis.Context, bindIP string) error {
|
||||
if bindIP == "" {
|
||||
return nil
|
||||
}
|
||||
var (
|
||||
err error
|
||||
originConf []byte
|
||||
)
|
||||
info("Generating kubeconfig for remote access into ", apis.K3sExternalKubeConfigLocation)
|
||||
originConf, err := os.ReadFile(apis.K3sKubeConfigLocation)
|
||||
if err != nil {
|
||||
return err
|
||||
if !ctx.DryRun {
|
||||
originConf, err = os.ReadFile(apis.K3sKubeConfigLocation)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
newConf := strings.Replace(string(originConf), "127.0.0.1", bindIP, 1)
|
||||
err = os.WriteFile(apis.K3sExternalKubeConfigLocation, []byte(newConf), 0600)
|
||||
}
|
||||
newConf := strings.Replace(string(originConf), "127.0.0.1", bindIP, 1)
|
||||
err = os.WriteFile(apis.K3sExternalKubeConfigLocation, []byte(newConf), 0600)
|
||||
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")
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
@ -39,6 +39,7 @@ func (a App) Run() {
|
|||
cmd = NewVeladCommand()
|
||||
}
|
||||
|
||||
utils.RemoveNetworkProxyEnv()
|
||||
if err := cmd.Execute(); err != nil {
|
||||
fmt.Println(err)
|
||||
os.Exit(1)
|
||||
|
|
|
@ -33,6 +33,7 @@ func NewVeladCommand() *cobra.Command {
|
|||
}
|
||||
cmd.AddCommand(
|
||||
NewInstallCmd(c, ioStreams),
|
||||
NewJoinCmd(),
|
||||
NewStatusCmd(),
|
||||
NewLoadBalancerCmd(),
|
||||
NewKubeConfigCmd(),
|
||||
|
@ -64,27 +65,67 @@ 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`
|
||||
cmd.Flags().StringArrayVarP(&iArgs.InstallArgs.Values, "set", "", []string{}, "set values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)")
|
||||
cmd.Flags().StringVarP(&iArgs.InstallArgs.Namespace, "namespace", "n", "vela-system", "namespace scope for installing KubeVela Core")
|
||||
cmd.Flags().BoolVarP(&iArgs.InstallArgs.Detail, "detail", "d", true, "show detail log of installation")
|
||||
cmd.Flags().BoolVarP(&iArgs.InstallArgs.ReuseValues, "reuse", "r", true, "will re-use the user's last supplied values.")
|
||||
cmd.Flags().StringArrayVarP(&iArgs.InstallArgs.Values, "set", "", []string{}, "Set values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)")
|
||||
cmd.Flags().StringVarP(&iArgs.InstallArgs.Namespace, "namespace", "n", "vela-system", "Namespace scope for installing KubeVela Core")
|
||||
cmd.Flags().BoolVarP(&iArgs.InstallArgs.Detail, "detail", "d", true, "Show detail log of installation")
|
||||
cmd.Flags().BoolVarP(&iArgs.InstallArgs.ReuseValues, "reuse", "r", true, "Will re-use the user's last supplied values.")
|
||||
|
||||
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{
|
||||
|
@ -120,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)
|
||||
},
|
||||
|
|
|
@ -8,14 +8,12 @@ import (
|
|||
|
||||
"github.com/oam-dev/kubevela/pkg/utils/common"
|
||||
cmdutil "github.com/oam-dev/kubevela/pkg/utils/util"
|
||||
"github.com/oam-dev/kubevela/references/cli"
|
||||
"github.com/pkg/errors"
|
||||
|
||||
"github.com/oam-dev/velad/pkg/apis"
|
||||
"github.com/oam-dev/velad/pkg/cluster"
|
||||
"github.com/oam-dev/velad/pkg/utils"
|
||||
"github.com/oam-dev/velad/pkg/vela"
|
||||
"github.com/oam-dev/velad/version"
|
||||
)
|
||||
|
||||
func tokenCmd(ctx context.Context, args apis.TokenArgs) error {
|
||||
|
@ -26,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 {
|
||||
|
@ -45,13 +49,22 @@ func tokenCmd(ctx context.Context, args apis.TokenArgs) error {
|
|||
}
|
||||
|
||||
func installCmd(c common.Args, ioStreams cmdutil.IOStreams, args apis.InstallArgs) error {
|
||||
ctx := &apis.Context{
|
||||
DryRun: args.DryRun,
|
||||
CommonArgs: c,
|
||||
IOStreams: ioStreams,
|
||||
}
|
||||
var err error
|
||||
|
||||
err = args.Validate()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
defer func() {
|
||||
if args.DryRun {
|
||||
return
|
||||
}
|
||||
err := utils.Cleanup()
|
||||
if err != nil {
|
||||
errf("Fail to clean up: %v\n", err)
|
||||
|
@ -65,7 +78,7 @@ func installCmd(c common.Args, ioStreams cmdutil.IOStreams, args apis.InstallArg
|
|||
}
|
||||
|
||||
// Step.2 Deal with KUBECONFIG
|
||||
err = h.GenKubeconfig(args.BindIP)
|
||||
err = h.GenKubeconfig(*ctx, args.BindIP)
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "fail to generate kubeconfig")
|
||||
}
|
||||
|
@ -75,7 +88,7 @@ func installCmd(c common.Args, ioStreams cmdutil.IOStreams, args apis.InstallArg
|
|||
}
|
||||
|
||||
// Step.3 Install Vela CLI
|
||||
err = vela.InstallVelaCLI()
|
||||
err = vela.InstallVelaCLI(ctx)
|
||||
if err != nil {
|
||||
// not return because this is acceptable
|
||||
errf("fail to install vela CLI: %v\n", err)
|
||||
|
@ -83,38 +96,28 @@ func installCmd(c common.Args, ioStreams cmdutil.IOStreams, args apis.InstallArg
|
|||
|
||||
if !args.ClusterOnly {
|
||||
// Step.4 load vela-core images
|
||||
err = vela.LoadVelaImages()
|
||||
err = vela.LoadVelaImages(ctx)
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "fail to load vela images")
|
||||
}
|
||||
|
||||
// Step.5 save vela-core chart and velaUX addon
|
||||
chart, err := vela.PrepareVelaChart()
|
||||
err := vela.PrepareVelaChart(ctx)
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "fail to prepare vela chart")
|
||||
}
|
||||
err = vela.PrepareVelaUX()
|
||||
err = vela.PrepareVelaUX(ctx)
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "fail to prepare vela UX")
|
||||
}
|
||||
// Step.6 install vela-core
|
||||
info("Installing vela-core Helm chart...")
|
||||
ioStreams.Out = utils.VeladWriter{W: os.Stdout}
|
||||
installCmd := cli.NewInstallCommand(c, "1", ioStreams)
|
||||
installArgs := []string{"--file", chart, "--detail=false", "--version", version.VelaVersion}
|
||||
if utils.IfDeployByPod(args.Controllers) {
|
||||
installArgs = append(installArgs, "--set", "deployByPod=true")
|
||||
}
|
||||
userDefinedArgs := utils.TransArgsToString(args.InstallArgs)
|
||||
installArgs = append(installArgs, userDefinedArgs...)
|
||||
installCmd.SetArgs(installArgs)
|
||||
err = installCmd.Execute()
|
||||
err = vela.InstallVelaChart(ctx, args)
|
||||
if err != nil {
|
||||
errf("Didn't install vela-core in control plane: %v. You can try \"vela install\" later\n", err)
|
||||
return errors.Wrap(err, "fail to install vela-core chart")
|
||||
}
|
||||
}
|
||||
|
||||
utils.PrintGuide(args)
|
||||
utils.PrintGuide(ctx, args)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@ -134,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
|
||||
}
|
||||
|
||||
|
@ -151,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)
|
||||
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
package loadbalancer
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"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 := ioutil.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()
|
||||
|
|
|
@ -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
|
||||
}
|
|
@ -10,7 +10,7 @@ var (
|
|||
// K3sImageDir is the directory to save the k3s air-gap image
|
||||
K3sImageDir = "/var/lib/rancher/k3s/agent/images/"
|
||||
// K3sImageLocation is where to save k3s air-gap images
|
||||
K3sImageLocation = "/var/lib/rancher/k3s/agent/images/k3s-airgap-images-amd64.tar.gz"
|
||||
K3sImageLocation = "/var/lib/rancher/k3s/agent/images/k3s-airgap-images.tar.gz"
|
||||
)
|
||||
|
||||
var (
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
|
@ -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/
|
|
@ -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: 0.1.0
|
||||
|
||||
# This is the version number of the application being deployed. This version number should be
|
||||
# incremented each time you make changes to the application.
|
||||
appVersion: 0.1.0
|
||||
|
||||
home: https://kubevela.io
|
||||
icon: https://kubevela.io/img/logo.svg
|
|
@ -1,173 +0,0 @@
|
|||
<div style="text-align: center">
|
||||
<p align="center">
|
||||
<img src="https://raw.githubusercontent.com/oam-dev/kubevela.io/main/docs/resources/KubeVela-03.png">
|
||||
<br><br>
|
||||
<i>Make shipping applications more enjoyable.</i>
|
||||
</p>
|
||||
</div>
|
||||
|
||||

|
||||
[](https://goreportcard.com/report/github.com/oam-dev/kubevela)
|
||||

|
||||
[](https://codecov.io/gh/oam-dev/kubevela)
|
||||
[](/LICENSE)
|
||||
[](https://github.com/oam-dev/kubevela/releases)
|
||||
[](https://www.tickgit.com/browse?repo=github.com/oam-dev/kubevela)
|
||||
[](https://twitter.com/oam_dev)
|
||||
[](https://artifacthub.io/packages/search?repo=kubevela)
|
||||
[](https://bestpractices.coreinfrastructure.org/projects/4602)
|
||||
|
||||
# KubeVela helm chart
|
||||
|
||||
KubeVela is a modern application platform that makes it easier and faster to deliver and manage applications across hybrid,
|
||||
multi-cloud environments. At the mean time, it is highly extensible and programmable, which can adapt to your needs as they grow.
|
||||
|
||||
## TL;DR
|
||||
|
||||
```bash
|
||||
helm repo add kubevela https://charts.kubevela.net/core
|
||||
helm repo update
|
||||
helm install --create-namespace -n vela-system kubevela kubevela/vela-core --wait
|
||||
```
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- Kubernetes >= v1.19 && < v1.22
|
||||
|
||||
## Parameters
|
||||
|
||||
### KubeVela core parameters
|
||||
|
||||
| Name | Description | Value |
|
||||
| ----------------------------- | --------------------------------------------------------------------------------------------- | --------- |
|
||||
| `systemDefinitionNamespace` | System definition namespace, if unspecified, will use built-in variable `.Release.Namespace`. | `nil` |
|
||||
| `applicationRevisionLimit` | Application revision limit | `10` |
|
||||
| `definitionRevisionLimit` | Definition revision limit | `20` |
|
||||
| `concurrentReconciles` | concurrentReconciles is the concurrent reconcile number of the controller | `4` |
|
||||
| `controllerArgs.reSyncPeriod` | The period for resync the applications | `5m` |
|
||||
| `OAMSpecVer` | OAMSpecVer is the oam spec version controller want to setup | `v0.3` |
|
||||
| `disableCaps` | Disable capability | `rollout` |
|
||||
| `enableFluxcdAddon` | Whether to enable fluxcd addon | `false` |
|
||||
| `dependCheckWait` | dependCheckWait is the time to wait for ApplicationConfiguration's dependent-resource ready | `30s` |
|
||||
|
||||
|
||||
### KubeVela workflow parameters
|
||||
|
||||
| Name | Description | Value |
|
||||
| -------------------------------------- | ------------------------------------------------------ | ----- |
|
||||
| `workflow.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` |
|
||||
|
||||
|
||||
### MultiCluster parameters
|
||||
|
||||
| Name | Description | Value |
|
||||
| ----------------------------------------------------- | -------------------------------- | -------------------------------- |
|
||||
| `multicluster.enabled` | Whether to enable multi-cluster | `true` |
|
||||
| `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.3.2` |
|
||||
| `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` |
|
||||
|
||||
|
||||
### Test parameters
|
||||
|
||||
| Name | Description | Value |
|
||||
| --------------------- | ------------------- | -------------------- |
|
||||
| `test.app.repository` | Test app repository | `oamdev/hello-world` |
|
||||
| `test.app.tag` | Test app tag | `v1` |
|
||||
| `test.k8s.repository` | Test k8s repository | `oamdev/alpine-k8s` |
|
||||
| `test.k8s.tag` | Test k8s tag | `1.18.2` |
|
||||
|
||||
|
||||
### Common parameters
|
||||
|
||||
| Name | Description | Value |
|
||||
| ---------------------------- | -------------------------------------------------------------------------------------------------------------------------- | ------- |
|
||||
| `imagePullSecrets` | Image pull secrets | `[]` |
|
||||
| `nameOverride` | Override name | `""` |
|
||||
| `fullnameOverride` | Fullname override | `""` |
|
||||
| `serviceAccount.create` | Specifies whether a service account should be created | `true` |
|
||||
| `serviceAccount.annotations` | Annotations to add to the service account | `{}` |
|
||||
| `serviceAccount.name` | The name of the service account to use. If not set and create is true, a name is generated using the fullname template | `nil` |
|
||||
| `nodeSelector` | Node selector | `{}` |
|
||||
| `tolerations` | Tolerations | `[]` |
|
||||
| `affinity` | Affinity | `{}` |
|
||||
| `rbac.create` | Specifies whether a RBAC role should be created | `true` |
|
||||
| `logDebug` | Enable debug logs for development purpose | `false` |
|
||||
| `logFilePath` | If non-empty, write log files in this path | `""` |
|
||||
| `logFileMaxSize` | Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. | `1024` |
|
||||
| `kubeClient.qps` | The qps for reconcile clients, default is 50 | `50` |
|
||||
| `kubeClient.burst` | The burst for reconcile clients, default is 100 | `100` |
|
||||
|
||||
|
||||
## 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.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,653 +0,0 @@
|
|||
|
||||
---
|
||||
apiVersion: apiextensions.k8s.io/v1
|
||||
kind: CustomResourceDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.6.2
|
||||
name: componentdefinitions.core.oam.dev
|
||||
spec:
|
||||
group: core.oam.dev
|
||||
names:
|
||||
categories:
|
||||
- oam
|
||||
kind: ComponentDefinition
|
||||
listKind: ComponentDefinitionList
|
||||
plural: componentdefinitions
|
||||
shortNames:
|
||||
- comp
|
||||
singular: componentdefinition
|
||||
scope: Namespaced
|
||||
versions:
|
||||
- additionalPrinterColumns:
|
||||
- jsonPath: .spec.workload.definition.kind
|
||||
name: WORKLOAD-KIND
|
||||
type: string
|
||||
- jsonPath: .metadata.annotations.definition\.oam\.dev/description
|
||||
name: DESCRIPTION
|
||||
type: string
|
||||
name: v1alpha2
|
||||
schema:
|
||||
openAPIV3Schema:
|
||||
description: ComponentDefinition is the Schema for the componentdefinitions
|
||||
API
|
||||
properties:
|
||||
apiVersion:
|
||||
description: 'APIVersion defines the versioned schema of this representation
|
||||
of an object. Servers should convert recognized schemas to the latest
|
||||
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
|
||||
type: string
|
||||
kind:
|
||||
description: 'Kind is a string value representing the REST resource this
|
||||
object represents. Servers may infer this from the endpoint the client
|
||||
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
|
||||
type: string
|
||||
metadata:
|
||||
type: object
|
||||
spec:
|
||||
description: ComponentDefinitionSpec defines the desired state of ComponentDefinition
|
||||
properties:
|
||||
childResourceKinds:
|
||||
description: ChildResourceKinds are the list of GVK of the child resources
|
||||
this workload generates
|
||||
items:
|
||||
description: A ChildResourceKind defines a child Kubernetes resource
|
||||
kind with a selector
|
||||
properties:
|
||||
apiVersion:
|
||||
description: APIVersion of the child resource
|
||||
type: string
|
||||
kind:
|
||||
description: Kind of the child resource
|
||||
type: string
|
||||
selector:
|
||||
additionalProperties:
|
||||
type: string
|
||||
description: Selector to select the child resources that the
|
||||
workload wants to expose to traits
|
||||
type: object
|
||||
required:
|
||||
- apiVersion
|
||||
- kind
|
||||
type: object
|
||||
type: array
|
||||
extension:
|
||||
description: Extension is used for extension needs by OAM platform
|
||||
builders
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
podSpecPath:
|
||||
description: PodSpecPath indicates where/if this workload has K8s
|
||||
podSpec field if one workload has podSpec, trait can do lot's of
|
||||
assumption such as port, env, volume fields.
|
||||
type: string
|
||||
revisionLabel:
|
||||
description: RevisionLabel indicates which label for underlying resources(e.g.
|
||||
pods) of this workload can be used by trait to create resource selectors(e.g.
|
||||
label selector for pods).
|
||||
type: string
|
||||
schematic:
|
||||
description: Schematic defines the data format and template of the
|
||||
encapsulation of the workload
|
||||
properties:
|
||||
cue:
|
||||
description: CUE defines the encapsulation in CUE format
|
||||
properties:
|
||||
template:
|
||||
description: Template defines the abstraction template data
|
||||
of the capability, it will replace the old CUE template
|
||||
in extension field. Template is a required field if CUE
|
||||
is defined in Capability Definition.
|
||||
type: string
|
||||
required:
|
||||
- template
|
||||
type: object
|
||||
helm:
|
||||
description: A Helm represents resources used by a Helm module
|
||||
properties:
|
||||
release:
|
||||
description: Release records a Helm release used by a Helm
|
||||
module workload.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
repository:
|
||||
description: HelmRelease records a Helm repository used by
|
||||
a Helm module workload.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
required:
|
||||
- release
|
||||
- repository
|
||||
type: object
|
||||
kube:
|
||||
description: Kube defines the encapsulation in raw Kubernetes
|
||||
resource format
|
||||
properties:
|
||||
parameters:
|
||||
description: Parameters defines configurable parameters
|
||||
items:
|
||||
description: A KubeParameter defines a configurable parameter
|
||||
of a component.
|
||||
properties:
|
||||
description:
|
||||
description: Description of this parameter.
|
||||
type: string
|
||||
fieldPaths:
|
||||
description: "FieldPaths specifies an array of fields
|
||||
within this workload that will be overwritten by the
|
||||
value of this parameter. \tAll fields must be of the
|
||||
same type. Fields are specified as JSON field paths
|
||||
without a leading dot, for example 'spec.replicas'."
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
name:
|
||||
description: Name of this parameter
|
||||
type: string
|
||||
required:
|
||||
default: false
|
||||
description: Required specifies whether or not a value
|
||||
for this parameter must be supplied when authoring
|
||||
an Application.
|
||||
type: boolean
|
||||
type:
|
||||
description: 'ValueType indicates the type of the parameter
|
||||
value, and only supports basic data types: string,
|
||||
number, boolean.'
|
||||
enum:
|
||||
- string
|
||||
- number
|
||||
- boolean
|
||||
type: string
|
||||
required:
|
||||
- fieldPaths
|
||||
- name
|
||||
- type
|
||||
type: object
|
||||
type: array
|
||||
template:
|
||||
description: Template defines the raw Kubernetes resource
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
required:
|
||||
- template
|
||||
type: object
|
||||
terraform:
|
||||
description: Terraform is the struct to describe cloud resources
|
||||
managed by Hashicorp Terraform
|
||||
properties:
|
||||
configuration:
|
||||
description: Configuration is Terraform Configuration
|
||||
type: string
|
||||
customRegion:
|
||||
description: Region is cloud provider's region. It will override
|
||||
the region in the region field of ProviderReference
|
||||
type: string
|
||||
deleteResource:
|
||||
default: true
|
||||
description: DeleteResource will determine whether provisioned
|
||||
cloud resources will be deleted when CR is deleted
|
||||
type: boolean
|
||||
path:
|
||||
description: Path is the sub-directory of remote git repository.
|
||||
It's valid when remote is set
|
||||
type: string
|
||||
providerRef:
|
||||
description: ProviderReference specifies the reference to
|
||||
Provider
|
||||
properties:
|
||||
name:
|
||||
description: Name of the referenced object.
|
||||
type: string
|
||||
namespace:
|
||||
default: default
|
||||
description: Namespace of the referenced object.
|
||||
type: string
|
||||
required:
|
||||
- name
|
||||
type: object
|
||||
type:
|
||||
default: hcl
|
||||
description: Type specifies which Terraform configuration
|
||||
it is, HCL or JSON syntax
|
||||
enum:
|
||||
- hcl
|
||||
- json
|
||||
- remote
|
||||
type: string
|
||||
writeConnectionSecretToRef:
|
||||
description: WriteConnectionSecretToReference specifies the
|
||||
namespace and name of a Secret to which any connection details
|
||||
for this managed resource should be written. Connection
|
||||
details frequently include the endpoint, username, and password
|
||||
required to connect to the managed resource.
|
||||
properties:
|
||||
name:
|
||||
description: Name of the secret.
|
||||
type: string
|
||||
namespace:
|
||||
description: Namespace of the secret.
|
||||
type: string
|
||||
required:
|
||||
- name
|
||||
type: object
|
||||
required:
|
||||
- configuration
|
||||
type: object
|
||||
type: object
|
||||
status:
|
||||
description: Status defines the custom health policy and status message
|
||||
for workload
|
||||
properties:
|
||||
customStatus:
|
||||
description: CustomStatus defines the custom status message that
|
||||
could display to user
|
||||
type: string
|
||||
healthPolicy:
|
||||
description: HealthPolicy defines the health check policy for
|
||||
the abstraction
|
||||
type: string
|
||||
type: object
|
||||
workload:
|
||||
description: Workload is a workload type descriptor
|
||||
properties:
|
||||
definition:
|
||||
description: Definition mutually exclusive to workload.type, a
|
||||
embedded WorkloadDefinition
|
||||
properties:
|
||||
apiVersion:
|
||||
type: string
|
||||
kind:
|
||||
type: string
|
||||
required:
|
||||
- apiVersion
|
||||
- kind
|
||||
type: object
|
||||
type:
|
||||
description: Type ref to a WorkloadDefinition via name
|
||||
type: string
|
||||
type: object
|
||||
required:
|
||||
- workload
|
||||
type: object
|
||||
status:
|
||||
description: ComponentDefinitionStatus is the status of ComponentDefinition
|
||||
properties:
|
||||
conditions:
|
||||
description: Conditions of the resource.
|
||||
items:
|
||||
description: A Condition that may apply to a resource.
|
||||
properties:
|
||||
lastTransitionTime:
|
||||
description: LastTransitionTime is the last time this condition
|
||||
transitioned from one status to another.
|
||||
format: date-time
|
||||
type: string
|
||||
message:
|
||||
description: A Message containing details about this condition's
|
||||
last transition from one status to another, if any.
|
||||
type: string
|
||||
reason:
|
||||
description: A Reason for this condition's last transition from
|
||||
one status to another.
|
||||
type: string
|
||||
status:
|
||||
description: Status of this condition; is it currently True,
|
||||
False, or Unknown?
|
||||
type: string
|
||||
type:
|
||||
description: Type of this condition. At most one of each condition
|
||||
type may apply to a resource at any point in time.
|
||||
type: string
|
||||
required:
|
||||
- lastTransitionTime
|
||||
- reason
|
||||
- status
|
||||
- type
|
||||
type: object
|
||||
type: array
|
||||
configMapRef:
|
||||
description: ConfigMapRef refer to a ConfigMap which contains OpenAPI
|
||||
V3 JSON schema of Component parameters.
|
||||
type: string
|
||||
latestRevision:
|
||||
description: LatestRevision of the component definition
|
||||
properties:
|
||||
name:
|
||||
type: string
|
||||
revision:
|
||||
format: int64
|
||||
type: integer
|
||||
revisionHash:
|
||||
description: RevisionHash record the hash value of the spec of
|
||||
ApplicationRevision object.
|
||||
type: string
|
||||
required:
|
||||
- name
|
||||
- revision
|
||||
type: object
|
||||
type: object
|
||||
type: object
|
||||
served: true
|
||||
storage: false
|
||||
subresources:
|
||||
status: {}
|
||||
- additionalPrinterColumns:
|
||||
- jsonPath: .spec.workload.definition.kind
|
||||
name: WORKLOAD-KIND
|
||||
type: string
|
||||
- jsonPath: .metadata.annotations.definition\.oam\.dev/description
|
||||
name: DESCRIPTION
|
||||
type: string
|
||||
name: v1beta1
|
||||
schema:
|
||||
openAPIV3Schema:
|
||||
description: ComponentDefinition is the Schema for the componentdefinitions
|
||||
API
|
||||
properties:
|
||||
apiVersion:
|
||||
description: 'APIVersion defines the versioned schema of this representation
|
||||
of an object. Servers should convert recognized schemas to the latest
|
||||
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
|
||||
type: string
|
||||
kind:
|
||||
description: 'Kind is a string value representing the REST resource this
|
||||
object represents. Servers may infer this from the endpoint the client
|
||||
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
|
||||
type: string
|
||||
metadata:
|
||||
type: object
|
||||
spec:
|
||||
description: ComponentDefinitionSpec defines the desired state of ComponentDefinition
|
||||
properties:
|
||||
childResourceKinds:
|
||||
description: ChildResourceKinds are the list of GVK of the child resources
|
||||
this workload generates
|
||||
items:
|
||||
description: A ChildResourceKind defines a child Kubernetes resource
|
||||
kind with a selector
|
||||
properties:
|
||||
apiVersion:
|
||||
description: APIVersion of the child resource
|
||||
type: string
|
||||
kind:
|
||||
description: Kind of the child resource
|
||||
type: string
|
||||
selector:
|
||||
additionalProperties:
|
||||
type: string
|
||||
description: Selector to select the child resources that the
|
||||
workload wants to expose to traits
|
||||
type: object
|
||||
required:
|
||||
- apiVersion
|
||||
- kind
|
||||
type: object
|
||||
type: array
|
||||
extension:
|
||||
description: Extension is used for extension needs by OAM platform
|
||||
builders
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
podSpecPath:
|
||||
description: PodSpecPath indicates where/if this workload has K8s
|
||||
podSpec field if one workload has podSpec, trait can do lot's of
|
||||
assumption such as port, env, volume fields.
|
||||
type: string
|
||||
revisionLabel:
|
||||
description: RevisionLabel indicates which label for underlying resources(e.g.
|
||||
pods) of this workload can be used by trait to create resource selectors(e.g.
|
||||
label selector for pods).
|
||||
type: string
|
||||
schematic:
|
||||
description: Schematic defines the data format and template of the
|
||||
encapsulation of the workload
|
||||
properties:
|
||||
cue:
|
||||
description: CUE defines the encapsulation in CUE format
|
||||
properties:
|
||||
template:
|
||||
description: Template defines the abstraction template data
|
||||
of the capability, it will replace the old CUE template
|
||||
in extension field. Template is a required field if CUE
|
||||
is defined in Capability Definition.
|
||||
type: string
|
||||
required:
|
||||
- template
|
||||
type: object
|
||||
helm:
|
||||
description: A Helm represents resources used by a Helm module
|
||||
properties:
|
||||
release:
|
||||
description: Release records a Helm release used by a Helm
|
||||
module workload.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
repository:
|
||||
description: HelmRelease records a Helm repository used by
|
||||
a Helm module workload.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
required:
|
||||
- release
|
||||
- repository
|
||||
type: object
|
||||
kube:
|
||||
description: Kube defines the encapsulation in raw Kubernetes
|
||||
resource format
|
||||
properties:
|
||||
parameters:
|
||||
description: Parameters defines configurable parameters
|
||||
items:
|
||||
description: A KubeParameter defines a configurable parameter
|
||||
of a component.
|
||||
properties:
|
||||
description:
|
||||
description: Description of this parameter.
|
||||
type: string
|
||||
fieldPaths:
|
||||
description: "FieldPaths specifies an array of fields
|
||||
within this workload that will be overwritten by the
|
||||
value of this parameter. \tAll fields must be of the
|
||||
same type. Fields are specified as JSON field paths
|
||||
without a leading dot, for example 'spec.replicas'."
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
name:
|
||||
description: Name of this parameter
|
||||
type: string
|
||||
required:
|
||||
default: false
|
||||
description: Required specifies whether or not a value
|
||||
for this parameter must be supplied when authoring
|
||||
an Application.
|
||||
type: boolean
|
||||
type:
|
||||
description: 'ValueType indicates the type of the parameter
|
||||
value, and only supports basic data types: string,
|
||||
number, boolean.'
|
||||
enum:
|
||||
- string
|
||||
- number
|
||||
- boolean
|
||||
type: string
|
||||
required:
|
||||
- fieldPaths
|
||||
- name
|
||||
- type
|
||||
type: object
|
||||
type: array
|
||||
template:
|
||||
description: Template defines the raw Kubernetes resource
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
required:
|
||||
- template
|
||||
type: object
|
||||
terraform:
|
||||
description: Terraform is the struct to describe cloud resources
|
||||
managed by Hashicorp Terraform
|
||||
properties:
|
||||
configuration:
|
||||
description: Configuration is Terraform Configuration
|
||||
type: string
|
||||
customRegion:
|
||||
description: Region is cloud provider's region. It will override
|
||||
the region in the region field of ProviderReference
|
||||
type: string
|
||||
deleteResource:
|
||||
default: true
|
||||
description: DeleteResource will determine whether provisioned
|
||||
cloud resources will be deleted when CR is deleted
|
||||
type: boolean
|
||||
path:
|
||||
description: Path is the sub-directory of remote git repository.
|
||||
It's valid when remote is set
|
||||
type: string
|
||||
providerRef:
|
||||
description: ProviderReference specifies the reference to
|
||||
Provider
|
||||
properties:
|
||||
name:
|
||||
description: Name of the referenced object.
|
||||
type: string
|
||||
namespace:
|
||||
default: default
|
||||
description: Namespace of the referenced object.
|
||||
type: string
|
||||
required:
|
||||
- name
|
||||
type: object
|
||||
type:
|
||||
default: hcl
|
||||
description: Type specifies which Terraform configuration
|
||||
it is, HCL or JSON syntax
|
||||
enum:
|
||||
- hcl
|
||||
- json
|
||||
- remote
|
||||
type: string
|
||||
writeConnectionSecretToRef:
|
||||
description: WriteConnectionSecretToReference specifies the
|
||||
namespace and name of a Secret to which any connection details
|
||||
for this managed resource should be written. Connection
|
||||
details frequently include the endpoint, username, and password
|
||||
required to connect to the managed resource.
|
||||
properties:
|
||||
name:
|
||||
description: Name of the secret.
|
||||
type: string
|
||||
namespace:
|
||||
description: Namespace of the secret.
|
||||
type: string
|
||||
required:
|
||||
- name
|
||||
type: object
|
||||
required:
|
||||
- configuration
|
||||
type: object
|
||||
type: object
|
||||
status:
|
||||
description: Status defines the custom health policy and status message
|
||||
for workload
|
||||
properties:
|
||||
customStatus:
|
||||
description: CustomStatus defines the custom status message that
|
||||
could display to user
|
||||
type: string
|
||||
healthPolicy:
|
||||
description: HealthPolicy defines the health check policy for
|
||||
the abstraction
|
||||
type: string
|
||||
type: object
|
||||
workload:
|
||||
description: Workload is a workload type descriptor
|
||||
properties:
|
||||
definition:
|
||||
description: Definition mutually exclusive to workload.type, a
|
||||
embedded WorkloadDefinition
|
||||
properties:
|
||||
apiVersion:
|
||||
type: string
|
||||
kind:
|
||||
type: string
|
||||
required:
|
||||
- apiVersion
|
||||
- kind
|
||||
type: object
|
||||
type:
|
||||
description: Type ref to a WorkloadDefinition via name
|
||||
type: string
|
||||
type: object
|
||||
required:
|
||||
- workload
|
||||
type: object
|
||||
status:
|
||||
description: ComponentDefinitionStatus is the status of ComponentDefinition
|
||||
properties:
|
||||
conditions:
|
||||
description: Conditions of the resource.
|
||||
items:
|
||||
description: A Condition that may apply to a resource.
|
||||
properties:
|
||||
lastTransitionTime:
|
||||
description: LastTransitionTime is the last time this condition
|
||||
transitioned from one status to another.
|
||||
format: date-time
|
||||
type: string
|
||||
message:
|
||||
description: A Message containing details about this condition's
|
||||
last transition from one status to another, if any.
|
||||
type: string
|
||||
reason:
|
||||
description: A Reason for this condition's last transition from
|
||||
one status to another.
|
||||
type: string
|
||||
status:
|
||||
description: Status of this condition; is it currently True,
|
||||
False, or Unknown?
|
||||
type: string
|
||||
type:
|
||||
description: Type of this condition. At most one of each condition
|
||||
type may apply to a resource at any point in time.
|
||||
type: string
|
||||
required:
|
||||
- lastTransitionTime
|
||||
- reason
|
||||
- status
|
||||
- type
|
||||
type: object
|
||||
type: array
|
||||
configMapRef:
|
||||
description: ConfigMapRef refer to a ConfigMap which contains OpenAPI
|
||||
V3 JSON schema of Component parameters.
|
||||
type: string
|
||||
latestRevision:
|
||||
description: LatestRevision of the component definition
|
||||
properties:
|
||||
name:
|
||||
type: string
|
||||
revision:
|
||||
format: int64
|
||||
type: integer
|
||||
revisionHash:
|
||||
description: RevisionHash record the hash value of the spec of
|
||||
ApplicationRevision object.
|
||||
type: string
|
||||
required:
|
||||
- name
|
||||
- revision
|
||||
type: object
|
||||
type: object
|
||||
type: object
|
||||
served: true
|
||||
storage: true
|
||||
subresources:
|
||||
status: {}
|
||||
status:
|
||||
acceptedNames:
|
||||
kind: ""
|
||||
plural: ""
|
||||
conditions: []
|
||||
storedVersions: []
|
|
@ -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: []
|
|
@ -1,590 +0,0 @@
|
|||
|
||||
---
|
||||
apiVersion: apiextensions.k8s.io/v1
|
||||
kind: CustomResourceDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.6.2
|
||||
name: healthscopes.core.oam.dev
|
||||
spec:
|
||||
group: core.oam.dev
|
||||
names:
|
||||
categories:
|
||||
- oam
|
||||
kind: HealthScope
|
||||
listKind: HealthScopeList
|
||||
plural: healthscopes
|
||||
singular: healthscope
|
||||
scope: Namespaced
|
||||
versions:
|
||||
- additionalPrinterColumns:
|
||||
- jsonPath: .status.health
|
||||
name: HEALTH
|
||||
type: string
|
||||
name: v1alpha2
|
||||
schema:
|
||||
openAPIV3Schema:
|
||||
description: A HealthScope determines an aggregate health status based of
|
||||
the health of components.
|
||||
properties:
|
||||
apiVersion:
|
||||
description: 'APIVersion defines the versioned schema of this representation
|
||||
of an object. Servers should convert recognized schemas to the latest
|
||||
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
|
||||
type: string
|
||||
kind:
|
||||
description: 'Kind is a string value representing the REST resource this
|
||||
object represents. Servers may infer this from the endpoint the client
|
||||
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
|
||||
type: string
|
||||
metadata:
|
||||
type: object
|
||||
spec:
|
||||
description: A HealthScopeSpec defines the desired state of a HealthScope.
|
||||
properties:
|
||||
appReferences:
|
||||
description: AppRefs records references of applications' components
|
||||
items:
|
||||
description: AppReference records references of an application's
|
||||
components
|
||||
properties:
|
||||
appName:
|
||||
type: string
|
||||
compReferences:
|
||||
items:
|
||||
description: CompReference records references of a component's
|
||||
resources
|
||||
properties:
|
||||
compName:
|
||||
type: string
|
||||
traits:
|
||||
items:
|
||||
description: 'ObjectReference contains enough information
|
||||
to let you inspect or modify the referred object.
|
||||
--- New uses of this type are discouraged because
|
||||
of difficulty describing its usage when embedded in
|
||||
APIs. 1. Ignored fields. It includes many fields
|
||||
which are not generally honored. For instance, ResourceVersion
|
||||
and FieldPath are both very rarely valid in actual
|
||||
usage. 2. Invalid usage help. It is impossible to
|
||||
add specific help for individual usage. In most embedded
|
||||
usages, there are particular restrictions like,
|
||||
"must refer only to types A and B" or "UID not honored"
|
||||
or "name must be restricted". Those cannot be
|
||||
well described when embedded. 3. Inconsistent validation. Because
|
||||
the usages are different, the validation rules are
|
||||
different by usage, which makes it hard for users
|
||||
to predict what will happen. 4. The fields are both
|
||||
imprecise and overly precise. Kind is not a precise
|
||||
mapping to a URL. This can produce ambiguity during
|
||||
interpretation and require a REST mapping. In most
|
||||
cases, the dependency is on the group,resource tuple and
|
||||
the version of the actual struct is irrelevant. 5.
|
||||
We cannot easily change it. Because this type is
|
||||
embedded in many locations, updates to this type will
|
||||
affect numerous schemas. Don''t make new APIs embed
|
||||
an underspecified API type they do not control. Instead
|
||||
of using this type, create a locally provided and
|
||||
used type that is well-focused on your reference.
|
||||
For example, ServiceReferences for admission registration:
|
||||
https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533
|
||||
.'
|
||||
properties:
|
||||
apiVersion:
|
||||
description: API version of the referent.
|
||||
type: string
|
||||
fieldPath:
|
||||
description: 'If referring to a piece of an object
|
||||
instead of an entire object, this string should
|
||||
contain a valid JSON/Go field access statement,
|
||||
such as desiredState.manifest.containers[2]. For
|
||||
example, if the object reference is to a container
|
||||
within a pod, this would take on a value like:
|
||||
"spec.containers{name}" (where "name" refers to
|
||||
the name of the container that triggered the event)
|
||||
or if no container name is specified "spec.containers[2]"
|
||||
(container with index 2 in this pod). This syntax
|
||||
is chosen only to have some well-defined way of
|
||||
referencing a part of an object. TODO: this design
|
||||
is not final and this field is subject to change
|
||||
in the future.'
|
||||
type: string
|
||||
kind:
|
||||
description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
|
||||
type: string
|
||||
name:
|
||||
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
|
||||
type: string
|
||||
namespace:
|
||||
description: 'Namespace of the referent. More info:
|
||||
https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/'
|
||||
type: string
|
||||
resourceVersion:
|
||||
description: 'Specific resourceVersion to which
|
||||
this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency'
|
||||
type: string
|
||||
uid:
|
||||
description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
|
||||
type: string
|
||||
type: object
|
||||
type: array
|
||||
workload:
|
||||
description: 'ObjectReference contains enough information
|
||||
to let you inspect or modify the referred object. ---
|
||||
New uses of this type are discouraged because of difficulty
|
||||
describing its usage when embedded in APIs. 1. Ignored
|
||||
fields. It includes many fields which are not generally
|
||||
honored. For instance, ResourceVersion and FieldPath
|
||||
are both very rarely valid in actual usage. 2. Invalid
|
||||
usage help. It is impossible to add specific help for
|
||||
individual usage. In most embedded usages, there are
|
||||
particular restrictions like, "must refer only to
|
||||
types A and B" or "UID not honored" or "name must be
|
||||
restricted". Those cannot be well described when
|
||||
embedded. 3. Inconsistent validation. Because the
|
||||
usages are different, the validation rules are different
|
||||
by usage, which makes it hard for users to predict what
|
||||
will happen. 4. The fields are both imprecise and overly
|
||||
precise. Kind is not a precise mapping to a URL. This
|
||||
can produce ambiguity during interpretation and
|
||||
require a REST mapping. In most cases, the dependency
|
||||
is on the group,resource tuple and the version of
|
||||
the actual struct is irrelevant. 5. We cannot easily
|
||||
change it. Because this type is embedded in many locations,
|
||||
updates to this type will affect numerous schemas. Don''t
|
||||
make new APIs embed an underspecified API type they
|
||||
do not control. Instead of using this type, create a
|
||||
locally provided and used type that is well-focused
|
||||
on your reference. For example, ServiceReferences for
|
||||
admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533
|
||||
.'
|
||||
properties:
|
||||
apiVersion:
|
||||
description: API version of the referent.
|
||||
type: string
|
||||
fieldPath:
|
||||
description: 'If referring to a piece of an object
|
||||
instead of an entire object, this string should
|
||||
contain a valid JSON/Go field access statement,
|
||||
such as desiredState.manifest.containers[2]. For
|
||||
example, if the object reference is to a container
|
||||
within a pod, this would take on a value like: "spec.containers{name}"
|
||||
(where "name" refers to the name of the container
|
||||
that triggered the event) or if no container name
|
||||
is specified "spec.containers[2]" (container with
|
||||
index 2 in this pod). This syntax is chosen only
|
||||
to have some well-defined way of referencing a part
|
||||
of an object. TODO: this design is not final and
|
||||
this field is subject to change in the future.'
|
||||
type: string
|
||||
kind:
|
||||
description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
|
||||
type: string
|
||||
name:
|
||||
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
|
||||
type: string
|
||||
namespace:
|
||||
description: 'Namespace of the referent. More info:
|
||||
https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/'
|
||||
type: string
|
||||
resourceVersion:
|
||||
description: 'Specific resourceVersion to which this
|
||||
reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency'
|
||||
type: string
|
||||
uid:
|
||||
description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
|
||||
type: string
|
||||
type: object
|
||||
type: object
|
||||
type: array
|
||||
type: object
|
||||
type: array
|
||||
probe-interval:
|
||||
description: ProbeInterval is the amount of time in seconds between
|
||||
probing tries.
|
||||
format: int32
|
||||
type: integer
|
||||
probe-timeout:
|
||||
description: ProbeTimeout is the amount of time in seconds to wait
|
||||
when receiving a response before marked failure.
|
||||
format: int32
|
||||
type: integer
|
||||
workloadRefs:
|
||||
description: WorkloadReferences to the workloads that are in this
|
||||
scope.
|
||||
items:
|
||||
description: 'ObjectReference contains enough information to let
|
||||
you inspect or modify the referred object. --- New uses of this
|
||||
type are discouraged because of difficulty describing its usage
|
||||
when embedded in APIs. 1. Ignored fields. It includes many fields
|
||||
which are not generally honored. For instance, ResourceVersion
|
||||
and FieldPath are both very rarely valid in actual usage. 2.
|
||||
Invalid usage help. It is impossible to add specific help for
|
||||
individual usage. In most embedded usages, there are particular restrictions
|
||||
like, "must refer only to types A and B" or "UID not honored"
|
||||
or "name must be restricted". Those cannot be well described
|
||||
when embedded. 3. Inconsistent validation. Because the usages
|
||||
are different, the validation rules are different by usage, which
|
||||
makes it hard for users to predict what will happen. 4. The fields
|
||||
are both imprecise and overly precise. Kind is not a precise
|
||||
mapping to a URL. This can produce ambiguity during interpretation
|
||||
and require a REST mapping. In most cases, the dependency is
|
||||
on the group,resource tuple and the version of the actual
|
||||
struct is irrelevant. 5. We cannot easily change it. Because
|
||||
this type is embedded in many locations, updates to this type will
|
||||
affect numerous schemas. Don''t make new APIs embed an underspecified
|
||||
API type they do not control. Instead of using this type, create
|
||||
a locally provided and used type that is well-focused on your
|
||||
reference. For example, ServiceReferences for admission registration:
|
||||
https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533
|
||||
.'
|
||||
properties:
|
||||
apiVersion:
|
||||
description: API version of the referent.
|
||||
type: string
|
||||
fieldPath:
|
||||
description: 'If referring to a piece of an object instead of
|
||||
an entire object, this string should contain a valid JSON/Go
|
||||
field access statement, such as desiredState.manifest.containers[2].
|
||||
For example, if the object reference is to a container within
|
||||
a pod, this would take on a value like: "spec.containers{name}"
|
||||
(where "name" refers to the name of the container that triggered
|
||||
the event) or if no container name is specified "spec.containers[2]"
|
||||
(container with index 2 in this pod). This syntax is chosen
|
||||
only to have some well-defined way of referencing a part of
|
||||
an object. TODO: this design is not final and this field is
|
||||
subject to change in the future.'
|
||||
type: string
|
||||
kind:
|
||||
description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
|
||||
type: string
|
||||
name:
|
||||
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
|
||||
type: string
|
||||
namespace:
|
||||
description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/'
|
||||
type: string
|
||||
resourceVersion:
|
||||
description: 'Specific resourceVersion to which this reference
|
||||
is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency'
|
||||
type: string
|
||||
uid:
|
||||
description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
|
||||
type: string
|
||||
type: object
|
||||
type: array
|
||||
required:
|
||||
- workloadRefs
|
||||
type: object
|
||||
status:
|
||||
description: A HealthScopeStatus represents the observed state of a HealthScope.
|
||||
properties:
|
||||
appHealthConditions:
|
||||
description: AppHealthConditions represents health condition of applications
|
||||
in the scope
|
||||
items:
|
||||
description: AppHealthCondition represents health condition of an
|
||||
application
|
||||
properties:
|
||||
appName:
|
||||
type: string
|
||||
components:
|
||||
items:
|
||||
description: WorkloadHealthCondition represents informative
|
||||
health condition of a workload.
|
||||
properties:
|
||||
componentName:
|
||||
description: ComponentName represents the component name
|
||||
if target is a workload
|
||||
type: string
|
||||
customStatusMsg:
|
||||
type: string
|
||||
diagnosis:
|
||||
type: string
|
||||
healthStatus:
|
||||
description: HealthStatus represents health status strings.
|
||||
type: string
|
||||
targetWorkload:
|
||||
description: 'ObjectReference contains enough information
|
||||
to let you inspect or modify the referred object. ---
|
||||
New uses of this type are discouraged because of difficulty
|
||||
describing its usage when embedded in APIs. 1. Ignored
|
||||
fields. It includes many fields which are not generally
|
||||
honored. For instance, ResourceVersion and FieldPath
|
||||
are both very rarely valid in actual usage. 2. Invalid
|
||||
usage help. It is impossible to add specific help for
|
||||
individual usage. In most embedded usages, there are
|
||||
particular restrictions like, "must refer only to
|
||||
types A and B" or "UID not honored" or "name must be
|
||||
restricted". Those cannot be well described when
|
||||
embedded. 3. Inconsistent validation. Because the
|
||||
usages are different, the validation rules are different
|
||||
by usage, which makes it hard for users to predict what
|
||||
will happen. 4. The fields are both imprecise and overly
|
||||
precise. Kind is not a precise mapping to a URL. This
|
||||
can produce ambiguity during interpretation and
|
||||
require a REST mapping. In most cases, the dependency
|
||||
is on the group,resource tuple and the version of
|
||||
the actual struct is irrelevant. 5. We cannot easily
|
||||
change it. Because this type is embedded in many locations,
|
||||
updates to this type will affect numerous schemas. Don''t
|
||||
make new APIs embed an underspecified API type they
|
||||
do not control. Instead of using this type, create a
|
||||
locally provided and used type that is well-focused
|
||||
on your reference. For example, ServiceReferences for
|
||||
admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533
|
||||
.'
|
||||
properties:
|
||||
apiVersion:
|
||||
description: API version of the referent.
|
||||
type: string
|
||||
fieldPath:
|
||||
description: 'If referring to a piece of an object
|
||||
instead of an entire object, this string should
|
||||
contain a valid JSON/Go field access statement,
|
||||
such as desiredState.manifest.containers[2]. For
|
||||
example, if the object reference is to a container
|
||||
within a pod, this would take on a value like: "spec.containers{name}"
|
||||
(where "name" refers to the name of the container
|
||||
that triggered the event) or if no container name
|
||||
is specified "spec.containers[2]" (container with
|
||||
index 2 in this pod). This syntax is chosen only
|
||||
to have some well-defined way of referencing a part
|
||||
of an object. TODO: this design is not final and
|
||||
this field is subject to change in the future.'
|
||||
type: string
|
||||
kind:
|
||||
description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
|
||||
type: string
|
||||
name:
|
||||
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
|
||||
type: string
|
||||
namespace:
|
||||
description: 'Namespace of the referent. More info:
|
||||
https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/'
|
||||
type: string
|
||||
resourceVersion:
|
||||
description: 'Specific resourceVersion to which this
|
||||
reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency'
|
||||
type: string
|
||||
uid:
|
||||
description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
|
||||
type: string
|
||||
type: object
|
||||
traits:
|
||||
items:
|
||||
description: TraitHealthCondition represents informative
|
||||
health condition of a trait.
|
||||
properties:
|
||||
customStatusMsg:
|
||||
type: string
|
||||
diagnosis:
|
||||
type: string
|
||||
healthStatus:
|
||||
description: HealthStatus represents health status
|
||||
strings.
|
||||
type: string
|
||||
resource:
|
||||
type: string
|
||||
type:
|
||||
type: string
|
||||
required:
|
||||
- healthStatus
|
||||
- resource
|
||||
- type
|
||||
type: object
|
||||
type: array
|
||||
workloadStatus:
|
||||
description: WorkloadStatus represents status of workloads
|
||||
whose HealthStatus is UNKNOWN.
|
||||
type: string
|
||||
required:
|
||||
- healthStatus
|
||||
type: object
|
||||
type: array
|
||||
envName:
|
||||
type: string
|
||||
required:
|
||||
- appName
|
||||
type: object
|
||||
type: array
|
||||
conditions:
|
||||
description: Conditions of the resource.
|
||||
items:
|
||||
description: A Condition that may apply to a resource.
|
||||
properties:
|
||||
lastTransitionTime:
|
||||
description: LastTransitionTime is the last time this condition
|
||||
transitioned from one status to another.
|
||||
format: date-time
|
||||
type: string
|
||||
message:
|
||||
description: A Message containing details about this condition's
|
||||
last transition from one status to another, if any.
|
||||
type: string
|
||||
reason:
|
||||
description: A Reason for this condition's last transition from
|
||||
one status to another.
|
||||
type: string
|
||||
status:
|
||||
description: Status of this condition; is it currently True,
|
||||
False, or Unknown?
|
||||
type: string
|
||||
type:
|
||||
description: Type of this condition. At most one of each condition
|
||||
type may apply to a resource at any point in time.
|
||||
type: string
|
||||
required:
|
||||
- lastTransitionTime
|
||||
- reason
|
||||
- status
|
||||
- type
|
||||
type: object
|
||||
type: array
|
||||
healthConditions:
|
||||
description: WorkloadHealthConditions represents health condition
|
||||
of workloads in the scope Use AppHealthConditions to provide app
|
||||
level status
|
||||
items:
|
||||
description: WorkloadHealthCondition represents informative health
|
||||
condition of a workload.
|
||||
properties:
|
||||
componentName:
|
||||
description: ComponentName represents the component name if
|
||||
target is a workload
|
||||
type: string
|
||||
customStatusMsg:
|
||||
type: string
|
||||
diagnosis:
|
||||
type: string
|
||||
healthStatus:
|
||||
description: HealthStatus represents health status strings.
|
||||
type: string
|
||||
targetWorkload:
|
||||
description: 'ObjectReference contains enough information to
|
||||
let you inspect or modify the referred object. --- New uses
|
||||
of this type are discouraged because of difficulty describing
|
||||
its usage when embedded in APIs. 1. Ignored fields. It includes
|
||||
many fields which are not generally honored. For instance,
|
||||
ResourceVersion and FieldPath are both very rarely valid in
|
||||
actual usage. 2. Invalid usage help. It is impossible to
|
||||
add specific help for individual usage. In most embedded
|
||||
usages, there are particular restrictions like, "must
|
||||
refer only to types A and B" or "UID not honored" or "name
|
||||
must be restricted". Those cannot be well described when
|
||||
embedded. 3. Inconsistent validation. Because the usages
|
||||
are different, the validation rules are different by usage,
|
||||
which makes it hard for users to predict what will happen. 4.
|
||||
The fields are both imprecise and overly precise. Kind is
|
||||
not a precise mapping to a URL. This can produce ambiguity during
|
||||
interpretation and require a REST mapping. In most cases,
|
||||
the dependency is on the group,resource tuple and the
|
||||
version of the actual struct is irrelevant. 5. We cannot
|
||||
easily change it. Because this type is embedded in many locations,
|
||||
updates to this type will affect numerous schemas. Don''t
|
||||
make new APIs embed an underspecified API type they do not
|
||||
control. Instead of using this type, create a locally provided
|
||||
and used type that is well-focused on your reference. For
|
||||
example, ServiceReferences for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533
|
||||
.'
|
||||
properties:
|
||||
apiVersion:
|
||||
description: API version of the referent.
|
||||
type: string
|
||||
fieldPath:
|
||||
description: 'If referring to a piece of an object instead
|
||||
of an entire object, this string should contain a valid
|
||||
JSON/Go field access statement, such as desiredState.manifest.containers[2].
|
||||
For example, if the object reference is to a container
|
||||
within a pod, this would take on a value like: "spec.containers{name}"
|
||||
(where "name" refers to the name of the container that
|
||||
triggered the event) or if no container name is specified
|
||||
"spec.containers[2]" (container with index 2 in this pod).
|
||||
This syntax is chosen only to have some well-defined way
|
||||
of referencing a part of an object. TODO: this design
|
||||
is not final and this field is subject to change in the
|
||||
future.'
|
||||
type: string
|
||||
kind:
|
||||
description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
|
||||
type: string
|
||||
name:
|
||||
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
|
||||
type: string
|
||||
namespace:
|
||||
description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/'
|
||||
type: string
|
||||
resourceVersion:
|
||||
description: 'Specific resourceVersion to which this reference
|
||||
is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency'
|
||||
type: string
|
||||
uid:
|
||||
description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
|
||||
type: string
|
||||
type: object
|
||||
traits:
|
||||
items:
|
||||
description: TraitHealthCondition represents informative health
|
||||
condition of a trait.
|
||||
properties:
|
||||
customStatusMsg:
|
||||
type: string
|
||||
diagnosis:
|
||||
type: string
|
||||
healthStatus:
|
||||
description: HealthStatus represents health status strings.
|
||||
type: string
|
||||
resource:
|
||||
type: string
|
||||
type:
|
||||
type: string
|
||||
required:
|
||||
- healthStatus
|
||||
- resource
|
||||
- type
|
||||
type: object
|
||||
type: array
|
||||
workloadStatus:
|
||||
description: WorkloadStatus represents status of workloads whose
|
||||
HealthStatus is UNKNOWN.
|
||||
type: string
|
||||
required:
|
||||
- healthStatus
|
||||
type: object
|
||||
type: array
|
||||
scopeHealthCondition:
|
||||
description: ScopeHealthCondition represents health condition summary
|
||||
of the scope
|
||||
properties:
|
||||
healthStatus:
|
||||
description: HealthStatus represents health status strings.
|
||||
type: string
|
||||
healthyWorkloads:
|
||||
format: int64
|
||||
type: integer
|
||||
total:
|
||||
format: int64
|
||||
type: integer
|
||||
unhealthyWorkloads:
|
||||
format: int64
|
||||
type: integer
|
||||
unknownWorkloads:
|
||||
format: int64
|
||||
type: integer
|
||||
required:
|
||||
- healthStatus
|
||||
type: object
|
||||
required:
|
||||
- scopeHealthCondition
|
||||
type: object
|
||||
type: object
|
||||
served: true
|
||||
storage: true
|
||||
subresources:
|
||||
status: {}
|
||||
status:
|
||||
acceptedNames:
|
||||
kind: ""
|
||||
plural: ""
|
||||
conditions: []
|
||||
storedVersions: []
|
|
@ -1,134 +0,0 @@
|
|||
|
||||
---
|
||||
apiVersion: apiextensions.k8s.io/v1
|
||||
kind: CustomResourceDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.6.2
|
||||
name: manualscalertraits.core.oam.dev
|
||||
spec:
|
||||
group: core.oam.dev
|
||||
names:
|
||||
categories:
|
||||
- oam
|
||||
kind: ManualScalerTrait
|
||||
listKind: ManualScalerTraitList
|
||||
plural: manualscalertraits
|
||||
singular: manualscalertrait
|
||||
scope: Namespaced
|
||||
versions:
|
||||
- name: v1alpha2
|
||||
schema:
|
||||
openAPIV3Schema:
|
||||
description: A ManualScalerTrait determines how many replicas a workload should
|
||||
have.
|
||||
properties:
|
||||
apiVersion:
|
||||
description: 'APIVersion defines the versioned schema of this representation
|
||||
of an object. Servers should convert recognized schemas to the latest
|
||||
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
|
||||
type: string
|
||||
kind:
|
||||
description: 'Kind is a string value representing the REST resource this
|
||||
object represents. Servers may infer this from the endpoint the client
|
||||
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
|
||||
type: string
|
||||
metadata:
|
||||
type: object
|
||||
spec:
|
||||
description: A ManualScalerTraitSpec defines the desired state of a ManualScalerTrait.
|
||||
properties:
|
||||
replicaCount:
|
||||
description: ReplicaCount of the workload this trait applies to.
|
||||
format: int32
|
||||
type: integer
|
||||
workloadRef:
|
||||
description: WorkloadReference to the workload this trait applies
|
||||
to.
|
||||
properties:
|
||||
apiVersion:
|
||||
description: API version of the referent.
|
||||
type: string
|
||||
fieldPath:
|
||||
description: 'If referring to a piece of an object instead of
|
||||
an entire object, this string should contain a valid JSON/Go
|
||||
field access statement, such as desiredState.manifest.containers[2].
|
||||
For example, if the object reference is to a container within
|
||||
a pod, this would take on a value like: "spec.containers{name}"
|
||||
(where "name" refers to the name of the container that triggered
|
||||
the event) or if no container name is specified "spec.containers[2]"
|
||||
(container with index 2 in this pod). This syntax is chosen
|
||||
only to have some well-defined way of referencing a part of
|
||||
an object. TODO: this design is not final and this field is
|
||||
subject to change in the future.'
|
||||
type: string
|
||||
kind:
|
||||
description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
|
||||
type: string
|
||||
name:
|
||||
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
|
||||
type: string
|
||||
namespace:
|
||||
description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/'
|
||||
type: string
|
||||
resourceVersion:
|
||||
description: 'Specific resourceVersion to which this reference
|
||||
is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency'
|
||||
type: string
|
||||
uid:
|
||||
description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
|
||||
type: string
|
||||
type: object
|
||||
required:
|
||||
- replicaCount
|
||||
- workloadRef
|
||||
type: object
|
||||
status:
|
||||
description: A ManualScalerTraitStatus represents the observed state of
|
||||
a ManualScalerTrait.
|
||||
properties:
|
||||
conditions:
|
||||
description: Conditions of the resource.
|
||||
items:
|
||||
description: A Condition that may apply to a resource.
|
||||
properties:
|
||||
lastTransitionTime:
|
||||
description: LastTransitionTime is the last time this condition
|
||||
transitioned from one status to another.
|
||||
format: date-time
|
||||
type: string
|
||||
message:
|
||||
description: A Message containing details about this condition's
|
||||
last transition from one status to another, if any.
|
||||
type: string
|
||||
reason:
|
||||
description: A Reason for this condition's last transition from
|
||||
one status to another.
|
||||
type: string
|
||||
status:
|
||||
description: Status of this condition; is it currently True,
|
||||
False, or Unknown?
|
||||
type: string
|
||||
type:
|
||||
description: Type of this condition. At most one of each condition
|
||||
type may apply to a resource at any point in time.
|
||||
type: string
|
||||
required:
|
||||
- lastTransitionTime
|
||||
- reason
|
||||
- status
|
||||
- type
|
||||
type: object
|
||||
type: array
|
||||
type: object
|
||||
type: object
|
||||
served: true
|
||||
storage: true
|
||||
subresources:
|
||||
status: {}
|
||||
status:
|
||||
acceptedNames:
|
||||
kind: ""
|
||||
plural: ""
|
||||
conditions: []
|
||||
storedVersions: []
|
|
@ -1,57 +0,0 @@
|
|||
|
||||
---
|
||||
apiVersion: apiextensions.k8s.io/v1
|
||||
kind: CustomResourceDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.6.2
|
||||
name: policies.core.oam.dev
|
||||
spec:
|
||||
group: core.oam.dev
|
||||
names:
|
||||
categories:
|
||||
- oam
|
||||
kind: Policy
|
||||
listKind: PolicyList
|
||||
plural: policies
|
||||
singular: policy
|
||||
scope: Namespaced
|
||||
versions:
|
||||
- additionalPrinterColumns:
|
||||
- jsonPath: .type
|
||||
name: TYPE
|
||||
type: string
|
||||
name: v1alpha1
|
||||
schema:
|
||||
openAPIV3Schema:
|
||||
description: Policy is the Schema for the policy API
|
||||
properties:
|
||||
apiVersion:
|
||||
description: 'APIVersion defines the versioned schema of this representation
|
||||
of an object. Servers should convert recognized schemas to the latest
|
||||
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
|
||||
type: string
|
||||
kind:
|
||||
description: 'Kind is a string value representing the REST resource this
|
||||
object represents. Servers may infer this from the endpoint the client
|
||||
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
|
||||
type: string
|
||||
metadata:
|
||||
type: object
|
||||
properties:
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
type:
|
||||
type: string
|
||||
required:
|
||||
- type
|
||||
type: object
|
||||
served: true
|
||||
storage: true
|
||||
subresources: {}
|
||||
status:
|
||||
acceptedNames:
|
||||
kind: ""
|
||||
plural: ""
|
||||
conditions: []
|
||||
storedVersions: []
|
|
@ -1,274 +0,0 @@
|
|||
|
||||
---
|
||||
apiVersion: apiextensions.k8s.io/v1
|
||||
kind: CustomResourceDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.6.2
|
||||
name: policydefinitions.core.oam.dev
|
||||
spec:
|
||||
group: core.oam.dev
|
||||
names:
|
||||
categories:
|
||||
- oam
|
||||
kind: PolicyDefinition
|
||||
listKind: PolicyDefinitionList
|
||||
plural: policydefinitions
|
||||
shortNames:
|
||||
- def-policy
|
||||
singular: policydefinition
|
||||
scope: Namespaced
|
||||
versions:
|
||||
- name: v1beta1
|
||||
schema:
|
||||
openAPIV3Schema:
|
||||
description: PolicyDefinition is the Schema for the policydefinitions API
|
||||
properties:
|
||||
apiVersion:
|
||||
description: 'APIVersion defines the versioned schema of this representation
|
||||
of an object. Servers should convert recognized schemas to the latest
|
||||
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
|
||||
type: string
|
||||
kind:
|
||||
description: 'Kind is a string value representing the REST resource this
|
||||
object represents. Servers may infer this from the endpoint the client
|
||||
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
|
||||
type: string
|
||||
metadata:
|
||||
type: object
|
||||
spec:
|
||||
description: PolicyDefinitionSpec defines the desired state of PolicyDefinition
|
||||
properties:
|
||||
definitionRef:
|
||||
description: Reference to the CustomResourceDefinition that defines
|
||||
this trait kind.
|
||||
properties:
|
||||
name:
|
||||
description: Name of the referenced CustomResourceDefinition.
|
||||
type: string
|
||||
version:
|
||||
description: Version indicate which version should be used if
|
||||
CRD has multiple versions by default it will use the first one
|
||||
if not specified
|
||||
type: string
|
||||
required:
|
||||
- name
|
||||
type: object
|
||||
manageHealthCheck:
|
||||
description: ManageHealthCheck means the policy will handle health
|
||||
checking and skip application controller built-in health checking.
|
||||
type: boolean
|
||||
schematic:
|
||||
description: Schematic defines the data format and template of the
|
||||
encapsulation of the policy definition
|
||||
properties:
|
||||
cue:
|
||||
description: CUE defines the encapsulation in CUE format
|
||||
properties:
|
||||
template:
|
||||
description: Template defines the abstraction template data
|
||||
of the capability, it will replace the old CUE template
|
||||
in extension field. Template is a required field if CUE
|
||||
is defined in Capability Definition.
|
||||
type: string
|
||||
required:
|
||||
- template
|
||||
type: object
|
||||
helm:
|
||||
description: A Helm represents resources used by a Helm module
|
||||
properties:
|
||||
release:
|
||||
description: Release records a Helm release used by a Helm
|
||||
module workload.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
repository:
|
||||
description: HelmRelease records a Helm repository used by
|
||||
a Helm module workload.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
required:
|
||||
- release
|
||||
- repository
|
||||
type: object
|
||||
kube:
|
||||
description: Kube defines the encapsulation in raw Kubernetes
|
||||
resource format
|
||||
properties:
|
||||
parameters:
|
||||
description: Parameters defines configurable parameters
|
||||
items:
|
||||
description: A KubeParameter defines a configurable parameter
|
||||
of a component.
|
||||
properties:
|
||||
description:
|
||||
description: Description of this parameter.
|
||||
type: string
|
||||
fieldPaths:
|
||||
description: "FieldPaths specifies an array of fields
|
||||
within this workload that will be overwritten by the
|
||||
value of this parameter. \tAll fields must be of the
|
||||
same type. Fields are specified as JSON field paths
|
||||
without a leading dot, for example 'spec.replicas'."
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
name:
|
||||
description: Name of this parameter
|
||||
type: string
|
||||
required:
|
||||
default: false
|
||||
description: Required specifies whether or not a value
|
||||
for this parameter must be supplied when authoring
|
||||
an Application.
|
||||
type: boolean
|
||||
type:
|
||||
description: 'ValueType indicates the type of the parameter
|
||||
value, and only supports basic data types: string,
|
||||
number, boolean.'
|
||||
enum:
|
||||
- string
|
||||
- number
|
||||
- boolean
|
||||
type: string
|
||||
required:
|
||||
- fieldPaths
|
||||
- name
|
||||
- type
|
||||
type: object
|
||||
type: array
|
||||
template:
|
||||
description: Template defines the raw Kubernetes resource
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
required:
|
||||
- template
|
||||
type: object
|
||||
terraform:
|
||||
description: Terraform is the struct to describe cloud resources
|
||||
managed by Hashicorp Terraform
|
||||
properties:
|
||||
configuration:
|
||||
description: Configuration is Terraform Configuration
|
||||
type: string
|
||||
customRegion:
|
||||
description: Region is cloud provider's region. It will override
|
||||
the region in the region field of ProviderReference
|
||||
type: string
|
||||
deleteResource:
|
||||
default: true
|
||||
description: DeleteResource will determine whether provisioned
|
||||
cloud resources will be deleted when CR is deleted
|
||||
type: boolean
|
||||
path:
|
||||
description: Path is the sub-directory of remote git repository.
|
||||
It's valid when remote is set
|
||||
type: string
|
||||
providerRef:
|
||||
description: ProviderReference specifies the reference to
|
||||
Provider
|
||||
properties:
|
||||
name:
|
||||
description: Name of the referenced object.
|
||||
type: string
|
||||
namespace:
|
||||
default: default
|
||||
description: Namespace of the referenced object.
|
||||
type: string
|
||||
required:
|
||||
- name
|
||||
type: object
|
||||
type:
|
||||
default: hcl
|
||||
description: Type specifies which Terraform configuration
|
||||
it is, HCL or JSON syntax
|
||||
enum:
|
||||
- hcl
|
||||
- json
|
||||
- remote
|
||||
type: string
|
||||
writeConnectionSecretToRef:
|
||||
description: WriteConnectionSecretToReference specifies the
|
||||
namespace and name of a Secret to which any connection details
|
||||
for this managed resource should be written. Connection
|
||||
details frequently include the endpoint, username, and password
|
||||
required to connect to the managed resource.
|
||||
properties:
|
||||
name:
|
||||
description: Name of the secret.
|
||||
type: string
|
||||
namespace:
|
||||
description: Namespace of the secret.
|
||||
type: string
|
||||
required:
|
||||
- name
|
||||
type: object
|
||||
required:
|
||||
- configuration
|
||||
type: object
|
||||
type: object
|
||||
type: object
|
||||
status:
|
||||
description: PolicyDefinitionStatus is the status of PolicyDefinition
|
||||
properties:
|
||||
conditions:
|
||||
description: Conditions of the resource.
|
||||
items:
|
||||
description: A Condition that may apply to a resource.
|
||||
properties:
|
||||
lastTransitionTime:
|
||||
description: LastTransitionTime is the last time this condition
|
||||
transitioned from one status to another.
|
||||
format: date-time
|
||||
type: string
|
||||
message:
|
||||
description: A Message containing details about this condition's
|
||||
last transition from one status to another, if any.
|
||||
type: string
|
||||
reason:
|
||||
description: A Reason for this condition's last transition from
|
||||
one status to another.
|
||||
type: string
|
||||
status:
|
||||
description: Status of this condition; is it currently True,
|
||||
False, or Unknown?
|
||||
type: string
|
||||
type:
|
||||
description: Type of this condition. At most one of each condition
|
||||
type may apply to a resource at any point in time.
|
||||
type: string
|
||||
required:
|
||||
- lastTransitionTime
|
||||
- reason
|
||||
- status
|
||||
- type
|
||||
type: object
|
||||
type: array
|
||||
latestRevision:
|
||||
description: LatestRevision of the component definition
|
||||
properties:
|
||||
name:
|
||||
type: string
|
||||
revision:
|
||||
format: int64
|
||||
type: integer
|
||||
revisionHash:
|
||||
description: RevisionHash record the hash value of the spec of
|
||||
ApplicationRevision object.
|
||||
type: string
|
||||
required:
|
||||
- name
|
||||
- revision
|
||||
type: object
|
||||
type: object
|
||||
type: object
|
||||
served: true
|
||||
storage: true
|
||||
subresources:
|
||||
status: {}
|
||||
status:
|
||||
acceptedNames:
|
||||
kind: ""
|
||||
plural: ""
|
||||
conditions: []
|
||||
storedVersions: []
|
|
@ -1,181 +0,0 @@
|
|||
|
||||
---
|
||||
apiVersion: apiextensions.k8s.io/v1
|
||||
kind: CustomResourceDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.6.2
|
||||
name: resourcetrackers.core.oam.dev
|
||||
spec:
|
||||
group: core.oam.dev
|
||||
names:
|
||||
categories:
|
||||
- oam
|
||||
kind: ResourceTracker
|
||||
listKind: ResourceTrackerList
|
||||
plural: resourcetrackers
|
||||
shortNames:
|
||||
- rt
|
||||
singular: resourcetracker
|
||||
scope: Cluster
|
||||
versions:
|
||||
- additionalPrinterColumns:
|
||||
- jsonPath: .spec.type
|
||||
name: TYPE
|
||||
type: string
|
||||
- jsonPath: .metadata.labels['app\.oam\.dev\/name']
|
||||
name: APP
|
||||
type: string
|
||||
- jsonPath: .metadata.labels['app\.oam\.dev\/namespace']
|
||||
name: APP-NS
|
||||
type: string
|
||||
- jsonPath: .spec.applicationGeneration
|
||||
name: APP-GEN
|
||||
type: number
|
||||
name: v1beta1
|
||||
schema:
|
||||
openAPIV3Schema:
|
||||
description: An ResourceTracker represents a tracker for track cross namespace
|
||||
resources
|
||||
properties:
|
||||
apiVersion:
|
||||
description: 'APIVersion defines the versioned schema of this representation
|
||||
of an object. Servers should convert recognized schemas to the latest
|
||||
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
|
||||
type: string
|
||||
kind:
|
||||
description: 'Kind is a string value representing the REST resource this
|
||||
object represents. Servers may infer this from the endpoint the client
|
||||
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
|
||||
type: string
|
||||
metadata:
|
||||
type: object
|
||||
spec:
|
||||
description: ResourceTrackerSpec define the spec of resourceTracker
|
||||
properties:
|
||||
applicationGeneration:
|
||||
format: int64
|
||||
type: integer
|
||||
managedResources:
|
||||
items:
|
||||
description: ManagedResource define the resource to be managed by
|
||||
ResourceTracker
|
||||
properties:
|
||||
apiVersion:
|
||||
description: API version of the referent.
|
||||
type: string
|
||||
cluster:
|
||||
type: string
|
||||
component:
|
||||
type: string
|
||||
creator:
|
||||
description: ResourceCreatorRole defines the resource creator.
|
||||
type: string
|
||||
deleted:
|
||||
description: Deleted marks the resource to be deleted
|
||||
type: boolean
|
||||
env:
|
||||
type: string
|
||||
fieldPath:
|
||||
description: 'If referring to a piece of an object instead of
|
||||
an entire object, this string should contain a valid JSON/Go
|
||||
field access statement, such as desiredState.manifest.containers[2].
|
||||
For example, if the object reference is to a container within
|
||||
a pod, this would take on a value like: "spec.containers{name}"
|
||||
(where "name" refers to the name of the container that triggered
|
||||
the event) or if no container name is specified "spec.containers[2]"
|
||||
(container with index 2 in this pod). This syntax is chosen
|
||||
only to have some well-defined way of referencing a part of
|
||||
an object. TODO: this design is not final and this field is
|
||||
subject to change in the future.'
|
||||
type: string
|
||||
kind:
|
||||
description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
|
||||
type: string
|
||||
name:
|
||||
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
|
||||
type: string
|
||||
namespace:
|
||||
description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/'
|
||||
type: string
|
||||
raw:
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
resourceVersion:
|
||||
description: 'Specific resourceVersion to which this reference
|
||||
is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency'
|
||||
type: string
|
||||
trait:
|
||||
type: string
|
||||
uid:
|
||||
description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
|
||||
type: string
|
||||
type: object
|
||||
type: array
|
||||
type:
|
||||
description: ResourceTrackerType defines the type of resourceTracker
|
||||
type: string
|
||||
required:
|
||||
- applicationGeneration
|
||||
type: object
|
||||
status:
|
||||
description: ResourceTrackerStatus define the status of resourceTracker
|
||||
For backward-compatibility
|
||||
properties:
|
||||
trackedResources:
|
||||
description: Deprecated
|
||||
items:
|
||||
description: ClusterObjectReference defines the object reference
|
||||
with cluster.
|
||||
properties:
|
||||
apiVersion:
|
||||
description: API version of the referent.
|
||||
type: string
|
||||
cluster:
|
||||
type: string
|
||||
creator:
|
||||
description: ResourceCreatorRole defines the resource creator.
|
||||
type: string
|
||||
fieldPath:
|
||||
description: 'If referring to a piece of an object instead of
|
||||
an entire object, this string should contain a valid JSON/Go
|
||||
field access statement, such as desiredState.manifest.containers[2].
|
||||
For example, if the object reference is to a container within
|
||||
a pod, this would take on a value like: "spec.containers{name}"
|
||||
(where "name" refers to the name of the container that triggered
|
||||
the event) or if no container name is specified "spec.containers[2]"
|
||||
(container with index 2 in this pod). This syntax is chosen
|
||||
only to have some well-defined way of referencing a part of
|
||||
an object. TODO: this design is not final and this field is
|
||||
subject to change in the future.'
|
||||
type: string
|
||||
kind:
|
||||
description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
|
||||
type: string
|
||||
name:
|
||||
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
|
||||
type: string
|
||||
namespace:
|
||||
description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/'
|
||||
type: string
|
||||
resourceVersion:
|
||||
description: 'Specific resourceVersion to which this reference
|
||||
is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency'
|
||||
type: string
|
||||
uid:
|
||||
description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
|
||||
type: string
|
||||
type: object
|
||||
type: array
|
||||
type: object
|
||||
type: object
|
||||
served: true
|
||||
storage: true
|
||||
subresources:
|
||||
status: {}
|
||||
status:
|
||||
acceptedNames:
|
||||
kind: ""
|
||||
plural: ""
|
||||
conditions: []
|
||||
storedVersions: []
|
|
@ -1,153 +0,0 @@
|
|||
|
||||
---
|
||||
apiVersion: apiextensions.k8s.io/v1
|
||||
kind: CustomResourceDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.6.2
|
||||
name: scopedefinitions.core.oam.dev
|
||||
spec:
|
||||
group: core.oam.dev
|
||||
names:
|
||||
categories:
|
||||
- oam
|
||||
kind: ScopeDefinition
|
||||
listKind: ScopeDefinitionList
|
||||
plural: scopedefinitions
|
||||
shortNames:
|
||||
- scope
|
||||
singular: scopedefinition
|
||||
scope: Namespaced
|
||||
versions:
|
||||
- additionalPrinterColumns:
|
||||
- jsonPath: .spec.definitionRef.name
|
||||
name: DEFINITION-NAME
|
||||
type: string
|
||||
name: v1alpha2
|
||||
schema:
|
||||
openAPIV3Schema:
|
||||
description: A ScopeDefinition registers a kind of Kubernetes custom resource
|
||||
as a valid OAM scope kind by referencing its CustomResourceDefinition. The
|
||||
CRD is used to validate the schema of the scope when it is embedded in an
|
||||
OAM ApplicationConfiguration.
|
||||
properties:
|
||||
apiVersion:
|
||||
description: 'APIVersion defines the versioned schema of this representation
|
||||
of an object. Servers should convert recognized schemas to the latest
|
||||
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
|
||||
type: string
|
||||
kind:
|
||||
description: 'Kind is a string value representing the REST resource this
|
||||
object represents. Servers may infer this from the endpoint the client
|
||||
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
|
||||
type: string
|
||||
metadata:
|
||||
type: object
|
||||
spec:
|
||||
description: A ScopeDefinitionSpec defines the desired state of a ScopeDefinition.
|
||||
properties:
|
||||
allowComponentOverlap:
|
||||
description: AllowComponentOverlap specifies whether an OAM component
|
||||
may exist in multiple instances of this kind of scope.
|
||||
type: boolean
|
||||
definitionRef:
|
||||
description: Reference to the CustomResourceDefinition that defines
|
||||
this scope kind.
|
||||
properties:
|
||||
name:
|
||||
description: Name of the referenced CustomResourceDefinition.
|
||||
type: string
|
||||
version:
|
||||
description: Version indicate which version should be used if
|
||||
CRD has multiple versions by default it will use the first one
|
||||
if not specified
|
||||
type: string
|
||||
required:
|
||||
- name
|
||||
type: object
|
||||
extension:
|
||||
description: Extension is used for extension needs by OAM platform
|
||||
builders
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
workloadRefsPath:
|
||||
description: WorkloadRefsPath indicates if/where a scope accepts workloadRef
|
||||
objects
|
||||
type: string
|
||||
required:
|
||||
- allowComponentOverlap
|
||||
- definitionRef
|
||||
type: object
|
||||
type: object
|
||||
served: true
|
||||
storage: false
|
||||
subresources: {}
|
||||
- additionalPrinterColumns:
|
||||
- jsonPath: .spec.definitionRef.name
|
||||
name: DEFINITION-NAME
|
||||
type: string
|
||||
name: v1beta1
|
||||
schema:
|
||||
openAPIV3Schema:
|
||||
description: A ScopeDefinition registers a kind of Kubernetes custom resource
|
||||
as a valid OAM scope kind by referencing its CustomResourceDefinition. The
|
||||
CRD is used to validate the schema of the scope when it is embedded in an
|
||||
OAM ApplicationConfiguration.
|
||||
properties:
|
||||
apiVersion:
|
||||
description: 'APIVersion defines the versioned schema of this representation
|
||||
of an object. Servers should convert recognized schemas to the latest
|
||||
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
|
||||
type: string
|
||||
kind:
|
||||
description: 'Kind is a string value representing the REST resource this
|
||||
object represents. Servers may infer this from the endpoint the client
|
||||
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
|
||||
type: string
|
||||
metadata:
|
||||
type: object
|
||||
spec:
|
||||
description: A ScopeDefinitionSpec defines the desired state of a ScopeDefinition.
|
||||
properties:
|
||||
allowComponentOverlap:
|
||||
description: AllowComponentOverlap specifies whether an OAM component
|
||||
may exist in multiple instances of this kind of scope.
|
||||
type: boolean
|
||||
definitionRef:
|
||||
description: Reference to the CustomResourceDefinition that defines
|
||||
this scope kind.
|
||||
properties:
|
||||
name:
|
||||
description: Name of the referenced CustomResourceDefinition.
|
||||
type: string
|
||||
version:
|
||||
description: Version indicate which version should be used if
|
||||
CRD has multiple versions by default it will use the first one
|
||||
if not specified
|
||||
type: string
|
||||
required:
|
||||
- name
|
||||
type: object
|
||||
extension:
|
||||
description: Extension is used for extension needs by OAM platform
|
||||
builders
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
workloadRefsPath:
|
||||
description: WorkloadRefsPath indicates if/where a scope accepts workloadRef
|
||||
objects
|
||||
type: string
|
||||
required:
|
||||
- allowComponentOverlap
|
||||
- definitionRef
|
||||
type: object
|
||||
type: object
|
||||
served: true
|
||||
storage: true
|
||||
subresources: {}
|
||||
status:
|
||||
acceptedNames:
|
||||
kind: ""
|
||||
plural: ""
|
||||
conditions: []
|
||||
storedVersions: []
|
|
@ -1,645 +0,0 @@
|
|||
|
||||
---
|
||||
apiVersion: apiextensions.k8s.io/v1
|
||||
kind: CustomResourceDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.6.2
|
||||
name: traitdefinitions.core.oam.dev
|
||||
spec:
|
||||
group: core.oam.dev
|
||||
names:
|
||||
categories:
|
||||
- oam
|
||||
kind: TraitDefinition
|
||||
listKind: TraitDefinitionList
|
||||
plural: traitdefinitions
|
||||
shortNames:
|
||||
- trait
|
||||
singular: traitdefinition
|
||||
scope: Namespaced
|
||||
versions:
|
||||
- additionalPrinterColumns:
|
||||
- jsonPath: .spec.appliesToWorkloads
|
||||
name: APPLIES-TO
|
||||
type: string
|
||||
- jsonPath: .metadata.annotations.definition\.oam\.dev/description
|
||||
name: DESCRIPTION
|
||||
type: string
|
||||
name: v1alpha2
|
||||
schema:
|
||||
openAPIV3Schema:
|
||||
description: A TraitDefinition registers a kind of Kubernetes custom resource
|
||||
as a valid OAM trait kind by referencing its CustomResourceDefinition. The
|
||||
CRD is used to validate the schema of the trait when it is embedded in an
|
||||
OAM ApplicationConfiguration.
|
||||
properties:
|
||||
apiVersion:
|
||||
description: 'APIVersion defines the versioned schema of this representation
|
||||
of an object. Servers should convert recognized schemas to the latest
|
||||
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
|
||||
type: string
|
||||
kind:
|
||||
description: 'Kind is a string value representing the REST resource this
|
||||
object represents. Servers may infer this from the endpoint the client
|
||||
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
|
||||
type: string
|
||||
metadata:
|
||||
type: object
|
||||
spec:
|
||||
description: A TraitDefinitionSpec defines the desired state of a TraitDefinition.
|
||||
properties:
|
||||
appliesToWorkloads:
|
||||
description: AppliesToWorkloads specifies the list of workload kinds
|
||||
this trait applies to. Workload kinds are specified in kind.group/version
|
||||
format, e.g. server.core.oam.dev/v1alpha2. Traits that omit this
|
||||
field apply to all workload kinds.
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
conflictsWith:
|
||||
description: 'ConflictsWith specifies the list of traits(CRD name,
|
||||
Definition name, CRD group) which could not apply to the same workloads
|
||||
with this trait. Traits that omit this field can work with any other
|
||||
traits. Example rules: "service" # Trait definition name "services.k8s.io"
|
||||
# API resource/crd name "*.networking.k8s.io" # API group "labelSelector:foo=bar"
|
||||
# label selector labelSelector format: https://pkg.go.dev/k8s.io/apimachinery/pkg/labels#Parse'
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
definitionRef:
|
||||
description: Reference to the CustomResourceDefinition that defines
|
||||
this trait kind.
|
||||
properties:
|
||||
name:
|
||||
description: Name of the referenced CustomResourceDefinition.
|
||||
type: string
|
||||
version:
|
||||
description: Version indicate which version should be used if
|
||||
CRD has multiple versions by default it will use the first one
|
||||
if not specified
|
||||
type: string
|
||||
required:
|
||||
- name
|
||||
type: object
|
||||
extension:
|
||||
description: Extension is used for extension needs by OAM platform
|
||||
builders
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
podDisruptive:
|
||||
description: PodDisruptive specifies whether using the trait will
|
||||
cause the pod to restart or not.
|
||||
type: boolean
|
||||
revisionEnabled:
|
||||
description: Revision indicates whether a trait is aware of component
|
||||
revision
|
||||
type: boolean
|
||||
schematic:
|
||||
description: Schematic defines the data format and template of the
|
||||
encapsulation of the trait
|
||||
properties:
|
||||
cue:
|
||||
description: CUE defines the encapsulation in CUE format
|
||||
properties:
|
||||
template:
|
||||
description: Template defines the abstraction template data
|
||||
of the capability, it will replace the old CUE template
|
||||
in extension field. Template is a required field if CUE
|
||||
is defined in Capability Definition.
|
||||
type: string
|
||||
required:
|
||||
- template
|
||||
type: object
|
||||
helm:
|
||||
description: A Helm represents resources used by a Helm module
|
||||
properties:
|
||||
release:
|
||||
description: Release records a Helm release used by a Helm
|
||||
module workload.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
repository:
|
||||
description: HelmRelease records a Helm repository used by
|
||||
a Helm module workload.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
required:
|
||||
- release
|
||||
- repository
|
||||
type: object
|
||||
kube:
|
||||
description: Kube defines the encapsulation in raw Kubernetes
|
||||
resource format
|
||||
properties:
|
||||
parameters:
|
||||
description: Parameters defines configurable parameters
|
||||
items:
|
||||
description: A KubeParameter defines a configurable parameter
|
||||
of a component.
|
||||
properties:
|
||||
description:
|
||||
description: Description of this parameter.
|
||||
type: string
|
||||
fieldPaths:
|
||||
description: "FieldPaths specifies an array of fields
|
||||
within this workload that will be overwritten by the
|
||||
value of this parameter. \tAll fields must be of the
|
||||
same type. Fields are specified as JSON field paths
|
||||
without a leading dot, for example 'spec.replicas'."
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
name:
|
||||
description: Name of this parameter
|
||||
type: string
|
||||
required:
|
||||
default: false
|
||||
description: Required specifies whether or not a value
|
||||
for this parameter must be supplied when authoring
|
||||
an Application.
|
||||
type: boolean
|
||||
type:
|
||||
description: 'ValueType indicates the type of the parameter
|
||||
value, and only supports basic data types: string,
|
||||
number, boolean.'
|
||||
enum:
|
||||
- string
|
||||
- number
|
||||
- boolean
|
||||
type: string
|
||||
required:
|
||||
- fieldPaths
|
||||
- name
|
||||
- type
|
||||
type: object
|
||||
type: array
|
||||
template:
|
||||
description: Template defines the raw Kubernetes resource
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
required:
|
||||
- template
|
||||
type: object
|
||||
terraform:
|
||||
description: Terraform is the struct to describe cloud resources
|
||||
managed by Hashicorp Terraform
|
||||
properties:
|
||||
configuration:
|
||||
description: Configuration is Terraform Configuration
|
||||
type: string
|
||||
customRegion:
|
||||
description: Region is cloud provider's region. It will override
|
||||
the region in the region field of ProviderReference
|
||||
type: string
|
||||
deleteResource:
|
||||
default: true
|
||||
description: DeleteResource will determine whether provisioned
|
||||
cloud resources will be deleted when CR is deleted
|
||||
type: boolean
|
||||
path:
|
||||
description: Path is the sub-directory of remote git repository.
|
||||
It's valid when remote is set
|
||||
type: string
|
||||
providerRef:
|
||||
description: ProviderReference specifies the reference to
|
||||
Provider
|
||||
properties:
|
||||
name:
|
||||
description: Name of the referenced object.
|
||||
type: string
|
||||
namespace:
|
||||
default: default
|
||||
description: Namespace of the referenced object.
|
||||
type: string
|
||||
required:
|
||||
- name
|
||||
type: object
|
||||
type:
|
||||
default: hcl
|
||||
description: Type specifies which Terraform configuration
|
||||
it is, HCL or JSON syntax
|
||||
enum:
|
||||
- hcl
|
||||
- json
|
||||
- remote
|
||||
type: string
|
||||
writeConnectionSecretToRef:
|
||||
description: WriteConnectionSecretToReference specifies the
|
||||
namespace and name of a Secret to which any connection details
|
||||
for this managed resource should be written. Connection
|
||||
details frequently include the endpoint, username, and password
|
||||
required to connect to the managed resource.
|
||||
properties:
|
||||
name:
|
||||
description: Name of the secret.
|
||||
type: string
|
||||
namespace:
|
||||
description: Namespace of the secret.
|
||||
type: string
|
||||
required:
|
||||
- name
|
||||
type: object
|
||||
required:
|
||||
- configuration
|
||||
type: object
|
||||
type: object
|
||||
status:
|
||||
description: Status defines the custom health policy and status message
|
||||
for trait
|
||||
properties:
|
||||
customStatus:
|
||||
description: CustomStatus defines the custom status message that
|
||||
could display to user
|
||||
type: string
|
||||
healthPolicy:
|
||||
description: HealthPolicy defines the health check policy for
|
||||
the abstraction
|
||||
type: string
|
||||
type: object
|
||||
workloadRefPath:
|
||||
description: WorkloadRefPath indicates where/if a trait accepts a
|
||||
workloadRef object
|
||||
type: string
|
||||
type: object
|
||||
status:
|
||||
description: TraitDefinitionStatus is the status of TraitDefinition
|
||||
properties:
|
||||
conditions:
|
||||
description: Conditions of the resource.
|
||||
items:
|
||||
description: A Condition that may apply to a resource.
|
||||
properties:
|
||||
lastTransitionTime:
|
||||
description: LastTransitionTime is the last time this condition
|
||||
transitioned from one status to another.
|
||||
format: date-time
|
||||
type: string
|
||||
message:
|
||||
description: A Message containing details about this condition's
|
||||
last transition from one status to another, if any.
|
||||
type: string
|
||||
reason:
|
||||
description: A Reason for this condition's last transition from
|
||||
one status to another.
|
||||
type: string
|
||||
status:
|
||||
description: Status of this condition; is it currently True,
|
||||
False, or Unknown?
|
||||
type: string
|
||||
type:
|
||||
description: Type of this condition. At most one of each condition
|
||||
type may apply to a resource at any point in time.
|
||||
type: string
|
||||
required:
|
||||
- lastTransitionTime
|
||||
- reason
|
||||
- status
|
||||
- type
|
||||
type: object
|
||||
type: array
|
||||
configMapRef:
|
||||
description: ConfigMapRef refer to a ConfigMap which contains OpenAPI
|
||||
V3 JSON schema of Component parameters.
|
||||
type: string
|
||||
latestRevision:
|
||||
description: LatestRevision of the trait definition
|
||||
properties:
|
||||
name:
|
||||
type: string
|
||||
revision:
|
||||
format: int64
|
||||
type: integer
|
||||
revisionHash:
|
||||
description: RevisionHash record the hash value of the spec of
|
||||
ApplicationRevision object.
|
||||
type: string
|
||||
required:
|
||||
- name
|
||||
- revision
|
||||
type: object
|
||||
type: object
|
||||
type: object
|
||||
served: true
|
||||
storage: false
|
||||
subresources:
|
||||
status: {}
|
||||
- additionalPrinterColumns:
|
||||
- jsonPath: .spec.appliesToWorkloads
|
||||
name: APPLIES-TO
|
||||
type: string
|
||||
- jsonPath: .metadata.annotations.definition\.oam\.dev/description
|
||||
name: DESCRIPTION
|
||||
type: string
|
||||
name: v1beta1
|
||||
schema:
|
||||
openAPIV3Schema:
|
||||
description: A TraitDefinition registers a kind of Kubernetes custom resource
|
||||
as a valid OAM trait kind by referencing its CustomResourceDefinition. The
|
||||
CRD is used to validate the schema of the trait when it is embedded in an
|
||||
OAM ApplicationConfiguration.
|
||||
properties:
|
||||
apiVersion:
|
||||
description: 'APIVersion defines the versioned schema of this representation
|
||||
of an object. Servers should convert recognized schemas to the latest
|
||||
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
|
||||
type: string
|
||||
kind:
|
||||
description: 'Kind is a string value representing the REST resource this
|
||||
object represents. Servers may infer this from the endpoint the client
|
||||
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
|
||||
type: string
|
||||
metadata:
|
||||
type: object
|
||||
spec:
|
||||
description: A TraitDefinitionSpec defines the desired state of a TraitDefinition.
|
||||
properties:
|
||||
appliesToWorkloads:
|
||||
description: AppliesToWorkloads specifies the list of workload kinds
|
||||
this trait applies to. Workload kinds are specified in kind.group/version
|
||||
format, e.g. server.core.oam.dev/v1alpha2. Traits that omit this
|
||||
field apply to all workload kinds.
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
conflictsWith:
|
||||
description: 'ConflictsWith specifies the list of traits(CRD name,
|
||||
Definition name, CRD group) which could not apply to the same workloads
|
||||
with this trait. Traits that omit this field can work with any other
|
||||
traits. Example rules: "service" # Trait definition name "services.k8s.io"
|
||||
# API resource/crd name "*.networking.k8s.io" # API group "labelSelector:foo=bar"
|
||||
# label selector labelSelector format: https://pkg.go.dev/k8s.io/apimachinery/pkg/labels#Parse'
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
definitionRef:
|
||||
description: Reference to the CustomResourceDefinition that defines
|
||||
this trait kind.
|
||||
properties:
|
||||
name:
|
||||
description: Name of the referenced CustomResourceDefinition.
|
||||
type: string
|
||||
version:
|
||||
description: Version indicate which version should be used if
|
||||
CRD has multiple versions by default it will use the first one
|
||||
if not specified
|
||||
type: string
|
||||
required:
|
||||
- name
|
||||
type: object
|
||||
extension:
|
||||
description: Extension is used for extension needs by OAM platform
|
||||
builders
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
manageWorkload:
|
||||
description: ManageWorkload defines the trait would be responsible
|
||||
for creating the workload
|
||||
type: boolean
|
||||
podDisruptive:
|
||||
description: PodDisruptive specifies whether using the trait will
|
||||
cause the pod to restart or not.
|
||||
type: boolean
|
||||
revisionEnabled:
|
||||
description: Revision indicates whether a trait is aware of component
|
||||
revision
|
||||
type: boolean
|
||||
schematic:
|
||||
description: Schematic defines the data format and template of the
|
||||
encapsulation of the trait
|
||||
properties:
|
||||
cue:
|
||||
description: CUE defines the encapsulation in CUE format
|
||||
properties:
|
||||
template:
|
||||
description: Template defines the abstraction template data
|
||||
of the capability, it will replace the old CUE template
|
||||
in extension field. Template is a required field if CUE
|
||||
is defined in Capability Definition.
|
||||
type: string
|
||||
required:
|
||||
- template
|
||||
type: object
|
||||
helm:
|
||||
description: A Helm represents resources used by a Helm module
|
||||
properties:
|
||||
release:
|
||||
description: Release records a Helm release used by a Helm
|
||||
module workload.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
repository:
|
||||
description: HelmRelease records a Helm repository used by
|
||||
a Helm module workload.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
required:
|
||||
- release
|
||||
- repository
|
||||
type: object
|
||||
kube:
|
||||
description: Kube defines the encapsulation in raw Kubernetes
|
||||
resource format
|
||||
properties:
|
||||
parameters:
|
||||
description: Parameters defines configurable parameters
|
||||
items:
|
||||
description: A KubeParameter defines a configurable parameter
|
||||
of a component.
|
||||
properties:
|
||||
description:
|
||||
description: Description of this parameter.
|
||||
type: string
|
||||
fieldPaths:
|
||||
description: "FieldPaths specifies an array of fields
|
||||
within this workload that will be overwritten by the
|
||||
value of this parameter. \tAll fields must be of the
|
||||
same type. Fields are specified as JSON field paths
|
||||
without a leading dot, for example 'spec.replicas'."
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
name:
|
||||
description: Name of this parameter
|
||||
type: string
|
||||
required:
|
||||
default: false
|
||||
description: Required specifies whether or not a value
|
||||
for this parameter must be supplied when authoring
|
||||
an Application.
|
||||
type: boolean
|
||||
type:
|
||||
description: 'ValueType indicates the type of the parameter
|
||||
value, and only supports basic data types: string,
|
||||
number, boolean.'
|
||||
enum:
|
||||
- string
|
||||
- number
|
||||
- boolean
|
||||
type: string
|
||||
required:
|
||||
- fieldPaths
|
||||
- name
|
||||
- type
|
||||
type: object
|
||||
type: array
|
||||
template:
|
||||
description: Template defines the raw Kubernetes resource
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
required:
|
||||
- template
|
||||
type: object
|
||||
terraform:
|
||||
description: Terraform is the struct to describe cloud resources
|
||||
managed by Hashicorp Terraform
|
||||
properties:
|
||||
configuration:
|
||||
description: Configuration is Terraform Configuration
|
||||
type: string
|
||||
customRegion:
|
||||
description: Region is cloud provider's region. It will override
|
||||
the region in the region field of ProviderReference
|
||||
type: string
|
||||
deleteResource:
|
||||
default: true
|
||||
description: DeleteResource will determine whether provisioned
|
||||
cloud resources will be deleted when CR is deleted
|
||||
type: boolean
|
||||
path:
|
||||
description: Path is the sub-directory of remote git repository.
|
||||
It's valid when remote is set
|
||||
type: string
|
||||
providerRef:
|
||||
description: ProviderReference specifies the reference to
|
||||
Provider
|
||||
properties:
|
||||
name:
|
||||
description: Name of the referenced object.
|
||||
type: string
|
||||
namespace:
|
||||
default: default
|
||||
description: Namespace of the referenced object.
|
||||
type: string
|
||||
required:
|
||||
- name
|
||||
type: object
|
||||
type:
|
||||
default: hcl
|
||||
description: Type specifies which Terraform configuration
|
||||
it is, HCL or JSON syntax
|
||||
enum:
|
||||
- hcl
|
||||
- json
|
||||
- remote
|
||||
type: string
|
||||
writeConnectionSecretToRef:
|
||||
description: WriteConnectionSecretToReference specifies the
|
||||
namespace and name of a Secret to which any connection details
|
||||
for this managed resource should be written. Connection
|
||||
details frequently include the endpoint, username, and password
|
||||
required to connect to the managed resource.
|
||||
properties:
|
||||
name:
|
||||
description: Name of the secret.
|
||||
type: string
|
||||
namespace:
|
||||
description: Namespace of the secret.
|
||||
type: string
|
||||
required:
|
||||
- name
|
||||
type: object
|
||||
required:
|
||||
- configuration
|
||||
type: object
|
||||
type: object
|
||||
skipRevisionAffect:
|
||||
description: SkipRevisionAffect defines the update this trait will
|
||||
not generate a new application Revision
|
||||
type: boolean
|
||||
status:
|
||||
description: Status defines the custom health policy and status message
|
||||
for trait
|
||||
properties:
|
||||
customStatus:
|
||||
description: CustomStatus defines the custom status message that
|
||||
could display to user
|
||||
type: string
|
||||
healthPolicy:
|
||||
description: HealthPolicy defines the health check policy for
|
||||
the abstraction
|
||||
type: string
|
||||
type: object
|
||||
workloadRefPath:
|
||||
description: WorkloadRefPath indicates where/if a trait accepts a
|
||||
workloadRef object
|
||||
type: string
|
||||
type: object
|
||||
status:
|
||||
description: TraitDefinitionStatus is the status of TraitDefinition
|
||||
properties:
|
||||
conditions:
|
||||
description: Conditions of the resource.
|
||||
items:
|
||||
description: A Condition that may apply to a resource.
|
||||
properties:
|
||||
lastTransitionTime:
|
||||
description: LastTransitionTime is the last time this condition
|
||||
transitioned from one status to another.
|
||||
format: date-time
|
||||
type: string
|
||||
message:
|
||||
description: A Message containing details about this condition's
|
||||
last transition from one status to another, if any.
|
||||
type: string
|
||||
reason:
|
||||
description: A Reason for this condition's last transition from
|
||||
one status to another.
|
||||
type: string
|
||||
status:
|
||||
description: Status of this condition; is it currently True,
|
||||
False, or Unknown?
|
||||
type: string
|
||||
type:
|
||||
description: Type of this condition. At most one of each condition
|
||||
type may apply to a resource at any point in time.
|
||||
type: string
|
||||
required:
|
||||
- lastTransitionTime
|
||||
- reason
|
||||
- status
|
||||
- type
|
||||
type: object
|
||||
type: array
|
||||
configMapRef:
|
||||
description: ConfigMapRef refer to a ConfigMap which contains OpenAPI
|
||||
V3 JSON schema of Component parameters.
|
||||
type: string
|
||||
latestRevision:
|
||||
description: LatestRevision of the component definition
|
||||
properties:
|
||||
name:
|
||||
type: string
|
||||
revision:
|
||||
format: int64
|
||||
type: integer
|
||||
revisionHash:
|
||||
description: RevisionHash record the hash value of the spec of
|
||||
ApplicationRevision object.
|
||||
type: string
|
||||
required:
|
||||
- name
|
||||
- revision
|
||||
type: object
|
||||
type: object
|
||||
type: object
|
||||
served: true
|
||||
storage: true
|
||||
subresources:
|
||||
status: {}
|
||||
status:
|
||||
acceptedNames:
|
||||
kind: ""
|
||||
plural: ""
|
||||
conditions: []
|
||||
storedVersions: []
|
|
@ -1,149 +0,0 @@
|
|||
|
||||
---
|
||||
apiVersion: apiextensions.k8s.io/v1
|
||||
kind: CustomResourceDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.6.2
|
||||
name: workflows.core.oam.dev
|
||||
spec:
|
||||
group: core.oam.dev
|
||||
names:
|
||||
categories:
|
||||
- oam
|
||||
kind: Workflow
|
||||
listKind: WorkflowList
|
||||
plural: workflows
|
||||
singular: workflow
|
||||
scope: Namespaced
|
||||
versions:
|
||||
- name: v1alpha1
|
||||
schema:
|
||||
openAPIV3Schema:
|
||||
description: Workflow is the Schema for the policy API
|
||||
properties:
|
||||
apiVersion:
|
||||
description: 'APIVersion defines the versioned schema of this representation
|
||||
of an object. Servers should convert recognized schemas to the latest
|
||||
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
|
||||
type: string
|
||||
kind:
|
||||
description: 'Kind is a string value representing the REST resource this
|
||||
object represents. Servers may infer this from the endpoint the client
|
||||
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
|
||||
type: string
|
||||
metadata:
|
||||
type: object
|
||||
steps:
|
||||
items:
|
||||
description: WorkflowStep defines how to execute a workflow step.
|
||||
properties:
|
||||
dependsOn:
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
inputs:
|
||||
description: StepInputs defines variable input of WorkflowStep
|
||||
items:
|
||||
properties:
|
||||
from:
|
||||
type: string
|
||||
parameterKey:
|
||||
type: string
|
||||
required:
|
||||
- from
|
||||
- parameterKey
|
||||
type: object
|
||||
type: array
|
||||
name:
|
||||
description: Name is the unique name of the workflow step.
|
||||
type: string
|
||||
outputs:
|
||||
description: StepOutputs defines output variable of WorkflowStep
|
||||
items:
|
||||
properties:
|
||||
name:
|
||||
type: string
|
||||
valueFrom:
|
||||
type: string
|
||||
required:
|
||||
- name
|
||||
- valueFrom
|
||||
type: object
|
||||
type: array
|
||||
properties:
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
type:
|
||||
type: string
|
||||
required:
|
||||
- name
|
||||
- type
|
||||
type: object
|
||||
type: array
|
||||
type: object
|
||||
served: true
|
||||
storage: true
|
||||
- name: v1beta1
|
||||
schema:
|
||||
openAPIV3Schema:
|
||||
description: Workflow defines workflow steps and other attributes
|
||||
properties:
|
||||
ref:
|
||||
type: string
|
||||
steps:
|
||||
items:
|
||||
description: WorkflowStep defines how to execute a workflow step.
|
||||
properties:
|
||||
dependsOn:
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
inputs:
|
||||
description: StepInputs defines variable input of WorkflowStep
|
||||
items:
|
||||
properties:
|
||||
from:
|
||||
type: string
|
||||
parameterKey:
|
||||
type: string
|
||||
required:
|
||||
- from
|
||||
- parameterKey
|
||||
type: object
|
||||
type: array
|
||||
name:
|
||||
description: Name is the unique name of the workflow step.
|
||||
type: string
|
||||
outputs:
|
||||
description: StepOutputs defines output variable of WorkflowStep
|
||||
items:
|
||||
properties:
|
||||
name:
|
||||
type: string
|
||||
valueFrom:
|
||||
type: string
|
||||
required:
|
||||
- name
|
||||
- valueFrom
|
||||
type: object
|
||||
type: array
|
||||
properties:
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
type:
|
||||
type: string
|
||||
required:
|
||||
- name
|
||||
- type
|
||||
type: object
|
||||
type: array
|
||||
type: object
|
||||
served: true
|
||||
storage: false
|
||||
status:
|
||||
acceptedNames:
|
||||
kind: ""
|
||||
plural: ""
|
||||
conditions: []
|
||||
storedVersions: []
|
|
@ -1,275 +0,0 @@
|
|||
|
||||
---
|
||||
apiVersion: apiextensions.k8s.io/v1
|
||||
kind: CustomResourceDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.6.2
|
||||
name: workflowstepdefinitions.core.oam.dev
|
||||
spec:
|
||||
group: core.oam.dev
|
||||
names:
|
||||
categories:
|
||||
- oam
|
||||
kind: WorkflowStepDefinition
|
||||
listKind: WorkflowStepDefinitionList
|
||||
plural: workflowstepdefinitions
|
||||
shortNames:
|
||||
- workflowstep
|
||||
singular: workflowstepdefinition
|
||||
scope: Namespaced
|
||||
versions:
|
||||
- name: v1beta1
|
||||
schema:
|
||||
openAPIV3Schema:
|
||||
description: WorkflowStepDefinition is the Schema for the workflowstepdefinitions
|
||||
API
|
||||
properties:
|
||||
apiVersion:
|
||||
description: 'APIVersion defines the versioned schema of this representation
|
||||
of an object. Servers should convert recognized schemas to the latest
|
||||
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
|
||||
type: string
|
||||
kind:
|
||||
description: 'Kind is a string value representing the REST resource this
|
||||
object represents. Servers may infer this from the endpoint the client
|
||||
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
|
||||
type: string
|
||||
metadata:
|
||||
type: object
|
||||
spec:
|
||||
description: WorkflowStepDefinitionSpec defines the desired state of WorkflowStepDefinition
|
||||
properties:
|
||||
definitionRef:
|
||||
description: Reference to the CustomResourceDefinition that defines
|
||||
this trait kind.
|
||||
properties:
|
||||
name:
|
||||
description: Name of the referenced CustomResourceDefinition.
|
||||
type: string
|
||||
version:
|
||||
description: Version indicate which version should be used if
|
||||
CRD has multiple versions by default it will use the first one
|
||||
if not specified
|
||||
type: string
|
||||
required:
|
||||
- name
|
||||
type: object
|
||||
schematic:
|
||||
description: Schematic defines the data format and template of the
|
||||
encapsulation of the workflow step definition
|
||||
properties:
|
||||
cue:
|
||||
description: CUE defines the encapsulation in CUE format
|
||||
properties:
|
||||
template:
|
||||
description: Template defines the abstraction template data
|
||||
of the capability, it will replace the old CUE template
|
||||
in extension field. Template is a required field if CUE
|
||||
is defined in Capability Definition.
|
||||
type: string
|
||||
required:
|
||||
- template
|
||||
type: object
|
||||
helm:
|
||||
description: A Helm represents resources used by a Helm module
|
||||
properties:
|
||||
release:
|
||||
description: Release records a Helm release used by a Helm
|
||||
module workload.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
repository:
|
||||
description: HelmRelease records a Helm repository used by
|
||||
a Helm module workload.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
required:
|
||||
- release
|
||||
- repository
|
||||
type: object
|
||||
kube:
|
||||
description: Kube defines the encapsulation in raw Kubernetes
|
||||
resource format
|
||||
properties:
|
||||
parameters:
|
||||
description: Parameters defines configurable parameters
|
||||
items:
|
||||
description: A KubeParameter defines a configurable parameter
|
||||
of a component.
|
||||
properties:
|
||||
description:
|
||||
description: Description of this parameter.
|
||||
type: string
|
||||
fieldPaths:
|
||||
description: "FieldPaths specifies an array of fields
|
||||
within this workload that will be overwritten by the
|
||||
value of this parameter. \tAll fields must be of the
|
||||
same type. Fields are specified as JSON field paths
|
||||
without a leading dot, for example 'spec.replicas'."
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
name:
|
||||
description: Name of this parameter
|
||||
type: string
|
||||
required:
|
||||
default: false
|
||||
description: Required specifies whether or not a value
|
||||
for this parameter must be supplied when authoring
|
||||
an Application.
|
||||
type: boolean
|
||||
type:
|
||||
description: 'ValueType indicates the type of the parameter
|
||||
value, and only supports basic data types: string,
|
||||
number, boolean.'
|
||||
enum:
|
||||
- string
|
||||
- number
|
||||
- boolean
|
||||
type: string
|
||||
required:
|
||||
- fieldPaths
|
||||
- name
|
||||
- type
|
||||
type: object
|
||||
type: array
|
||||
template:
|
||||
description: Template defines the raw Kubernetes resource
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
required:
|
||||
- template
|
||||
type: object
|
||||
terraform:
|
||||
description: Terraform is the struct to describe cloud resources
|
||||
managed by Hashicorp Terraform
|
||||
properties:
|
||||
configuration:
|
||||
description: Configuration is Terraform Configuration
|
||||
type: string
|
||||
customRegion:
|
||||
description: Region is cloud provider's region. It will override
|
||||
the region in the region field of ProviderReference
|
||||
type: string
|
||||
deleteResource:
|
||||
default: true
|
||||
description: DeleteResource will determine whether provisioned
|
||||
cloud resources will be deleted when CR is deleted
|
||||
type: boolean
|
||||
path:
|
||||
description: Path is the sub-directory of remote git repository.
|
||||
It's valid when remote is set
|
||||
type: string
|
||||
providerRef:
|
||||
description: ProviderReference specifies the reference to
|
||||
Provider
|
||||
properties:
|
||||
name:
|
||||
description: Name of the referenced object.
|
||||
type: string
|
||||
namespace:
|
||||
default: default
|
||||
description: Namespace of the referenced object.
|
||||
type: string
|
||||
required:
|
||||
- name
|
||||
type: object
|
||||
type:
|
||||
default: hcl
|
||||
description: Type specifies which Terraform configuration
|
||||
it is, HCL or JSON syntax
|
||||
enum:
|
||||
- hcl
|
||||
- json
|
||||
- remote
|
||||
type: string
|
||||
writeConnectionSecretToRef:
|
||||
description: WriteConnectionSecretToReference specifies the
|
||||
namespace and name of a Secret to which any connection details
|
||||
for this managed resource should be written. Connection
|
||||
details frequently include the endpoint, username, and password
|
||||
required to connect to the managed resource.
|
||||
properties:
|
||||
name:
|
||||
description: Name of the secret.
|
||||
type: string
|
||||
namespace:
|
||||
description: Namespace of the secret.
|
||||
type: string
|
||||
required:
|
||||
- name
|
||||
type: object
|
||||
required:
|
||||
- configuration
|
||||
type: object
|
||||
type: object
|
||||
type: object
|
||||
status:
|
||||
description: WorkflowStepDefinitionStatus is the status of WorkflowStepDefinition
|
||||
properties:
|
||||
conditions:
|
||||
description: Conditions of the resource.
|
||||
items:
|
||||
description: A Condition that may apply to a resource.
|
||||
properties:
|
||||
lastTransitionTime:
|
||||
description: LastTransitionTime is the last time this condition
|
||||
transitioned from one status to another.
|
||||
format: date-time
|
||||
type: string
|
||||
message:
|
||||
description: A Message containing details about this condition's
|
||||
last transition from one status to another, if any.
|
||||
type: string
|
||||
reason:
|
||||
description: A Reason for this condition's last transition from
|
||||
one status to another.
|
||||
type: string
|
||||
status:
|
||||
description: Status of this condition; is it currently True,
|
||||
False, or Unknown?
|
||||
type: string
|
||||
type:
|
||||
description: Type of this condition. At most one of each condition
|
||||
type may apply to a resource at any point in time.
|
||||
type: string
|
||||
required:
|
||||
- lastTransitionTime
|
||||
- reason
|
||||
- status
|
||||
- type
|
||||
type: object
|
||||
type: array
|
||||
configMapRef:
|
||||
description: ConfigMapRef refer to a ConfigMap which contains OpenAPI
|
||||
V3 JSON schema of Component parameters.
|
||||
type: string
|
||||
latestRevision:
|
||||
description: LatestRevision of the component definition
|
||||
properties:
|
||||
name:
|
||||
type: string
|
||||
revision:
|
||||
format: int64
|
||||
type: integer
|
||||
revisionHash:
|
||||
description: RevisionHash record the hash value of the spec of
|
||||
ApplicationRevision object.
|
||||
type: string
|
||||
required:
|
||||
- name
|
||||
- revision
|
||||
type: object
|
||||
type: object
|
||||
type: object
|
||||
served: true
|
||||
storage: true
|
||||
subresources:
|
||||
status: {}
|
||||
status:
|
||||
acceptedNames:
|
||||
kind: ""
|
||||
plural: ""
|
||||
conditions: []
|
||||
storedVersions: []
|
|
@ -1,604 +0,0 @@
|
|||
|
||||
---
|
||||
apiVersion: apiextensions.k8s.io/v1
|
||||
kind: CustomResourceDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.6.2
|
||||
name: workloaddefinitions.core.oam.dev
|
||||
spec:
|
||||
group: core.oam.dev
|
||||
names:
|
||||
categories:
|
||||
- oam
|
||||
kind: WorkloadDefinition
|
||||
listKind: WorkloadDefinitionList
|
||||
plural: workloaddefinitions
|
||||
shortNames:
|
||||
- workload
|
||||
singular: workloaddefinition
|
||||
scope: Namespaced
|
||||
versions:
|
||||
- additionalPrinterColumns:
|
||||
- jsonPath: .spec.definitionRef.name
|
||||
name: DEFINITION-NAME
|
||||
type: string
|
||||
name: v1alpha2
|
||||
schema:
|
||||
openAPIV3Schema:
|
||||
description: A WorkloadDefinition registers a kind of Kubernetes custom resource
|
||||
as a valid OAM workload kind by referencing its CustomResourceDefinition.
|
||||
The CRD is used to validate the schema of the workload when it is embedded
|
||||
in an OAM Component.
|
||||
properties:
|
||||
apiVersion:
|
||||
description: 'APIVersion defines the versioned schema of this representation
|
||||
of an object. Servers should convert recognized schemas to the latest
|
||||
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
|
||||
type: string
|
||||
kind:
|
||||
description: 'Kind is a string value representing the REST resource this
|
||||
object represents. Servers may infer this from the endpoint the client
|
||||
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
|
||||
type: string
|
||||
metadata:
|
||||
type: object
|
||||
spec:
|
||||
description: A WorkloadDefinitionSpec defines the desired state of a WorkloadDefinition.
|
||||
properties:
|
||||
childResourceKinds:
|
||||
description: ChildResourceKinds are the list of GVK of the child resources
|
||||
this workload generates
|
||||
items:
|
||||
description: A ChildResourceKind defines a child Kubernetes resource
|
||||
kind with a selector
|
||||
properties:
|
||||
apiVersion:
|
||||
description: APIVersion of the child resource
|
||||
type: string
|
||||
kind:
|
||||
description: Kind of the child resource
|
||||
type: string
|
||||
selector:
|
||||
additionalProperties:
|
||||
type: string
|
||||
description: Selector to select the child resources that the
|
||||
workload wants to expose to traits
|
||||
type: object
|
||||
required:
|
||||
- apiVersion
|
||||
- kind
|
||||
type: object
|
||||
type: array
|
||||
definitionRef:
|
||||
description: Reference to the CustomResourceDefinition that defines
|
||||
this workload kind.
|
||||
properties:
|
||||
name:
|
||||
description: Name of the referenced CustomResourceDefinition.
|
||||
type: string
|
||||
version:
|
||||
description: Version indicate which version should be used if
|
||||
CRD has multiple versions by default it will use the first one
|
||||
if not specified
|
||||
type: string
|
||||
required:
|
||||
- name
|
||||
type: object
|
||||
extension:
|
||||
description: Extension is used for extension needs by OAM platform
|
||||
builders
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
podSpecPath:
|
||||
description: PodSpecPath indicates where/if this workload has K8s
|
||||
podSpec field if one workload has podSpec, trait can do lot's of
|
||||
assumption such as port, env, volume fields.
|
||||
type: string
|
||||
revisionLabel:
|
||||
description: RevisionLabel indicates which label for underlying resources(e.g.
|
||||
pods) of this workload can be used by trait to create resource selectors(e.g.
|
||||
label selector for pods).
|
||||
type: string
|
||||
schematic:
|
||||
description: Schematic defines the data format and template of the
|
||||
encapsulation of the workload
|
||||
properties:
|
||||
cue:
|
||||
description: CUE defines the encapsulation in CUE format
|
||||
properties:
|
||||
template:
|
||||
description: Template defines the abstraction template data
|
||||
of the capability, it will replace the old CUE template
|
||||
in extension field. Template is a required field if CUE
|
||||
is defined in Capability Definition.
|
||||
type: string
|
||||
required:
|
||||
- template
|
||||
type: object
|
||||
helm:
|
||||
description: A Helm represents resources used by a Helm module
|
||||
properties:
|
||||
release:
|
||||
description: Release records a Helm release used by a Helm
|
||||
module workload.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
repository:
|
||||
description: HelmRelease records a Helm repository used by
|
||||
a Helm module workload.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
required:
|
||||
- release
|
||||
- repository
|
||||
type: object
|
||||
kube:
|
||||
description: Kube defines the encapsulation in raw Kubernetes
|
||||
resource format
|
||||
properties:
|
||||
parameters:
|
||||
description: Parameters defines configurable parameters
|
||||
items:
|
||||
description: A KubeParameter defines a configurable parameter
|
||||
of a component.
|
||||
properties:
|
||||
description:
|
||||
description: Description of this parameter.
|
||||
type: string
|
||||
fieldPaths:
|
||||
description: "FieldPaths specifies an array of fields
|
||||
within this workload that will be overwritten by the
|
||||
value of this parameter. \tAll fields must be of the
|
||||
same type. Fields are specified as JSON field paths
|
||||
without a leading dot, for example 'spec.replicas'."
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
name:
|
||||
description: Name of this parameter
|
||||
type: string
|
||||
required:
|
||||
default: false
|
||||
description: Required specifies whether or not a value
|
||||
for this parameter must be supplied when authoring
|
||||
an Application.
|
||||
type: boolean
|
||||
type:
|
||||
description: 'ValueType indicates the type of the parameter
|
||||
value, and only supports basic data types: string,
|
||||
number, boolean.'
|
||||
enum:
|
||||
- string
|
||||
- number
|
||||
- boolean
|
||||
type: string
|
||||
required:
|
||||
- fieldPaths
|
||||
- name
|
||||
- type
|
||||
type: object
|
||||
type: array
|
||||
template:
|
||||
description: Template defines the raw Kubernetes resource
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
required:
|
||||
- template
|
||||
type: object
|
||||
terraform:
|
||||
description: Terraform is the struct to describe cloud resources
|
||||
managed by Hashicorp Terraform
|
||||
properties:
|
||||
configuration:
|
||||
description: Configuration is Terraform Configuration
|
||||
type: string
|
||||
customRegion:
|
||||
description: Region is cloud provider's region. It will override
|
||||
the region in the region field of ProviderReference
|
||||
type: string
|
||||
deleteResource:
|
||||
default: true
|
||||
description: DeleteResource will determine whether provisioned
|
||||
cloud resources will be deleted when CR is deleted
|
||||
type: boolean
|
||||
path:
|
||||
description: Path is the sub-directory of remote git repository.
|
||||
It's valid when remote is set
|
||||
type: string
|
||||
providerRef:
|
||||
description: ProviderReference specifies the reference to
|
||||
Provider
|
||||
properties:
|
||||
name:
|
||||
description: Name of the referenced object.
|
||||
type: string
|
||||
namespace:
|
||||
default: default
|
||||
description: Namespace of the referenced object.
|
||||
type: string
|
||||
required:
|
||||
- name
|
||||
type: object
|
||||
type:
|
||||
default: hcl
|
||||
description: Type specifies which Terraform configuration
|
||||
it is, HCL or JSON syntax
|
||||
enum:
|
||||
- hcl
|
||||
- json
|
||||
- remote
|
||||
type: string
|
||||
writeConnectionSecretToRef:
|
||||
description: WriteConnectionSecretToReference specifies the
|
||||
namespace and name of a Secret to which any connection details
|
||||
for this managed resource should be written. Connection
|
||||
details frequently include the endpoint, username, and password
|
||||
required to connect to the managed resource.
|
||||
properties:
|
||||
name:
|
||||
description: Name of the secret.
|
||||
type: string
|
||||
namespace:
|
||||
description: Namespace of the secret.
|
||||
type: string
|
||||
required:
|
||||
- name
|
||||
type: object
|
||||
required:
|
||||
- configuration
|
||||
type: object
|
||||
type: object
|
||||
status:
|
||||
description: Status defines the custom health policy and status message
|
||||
for workload
|
||||
properties:
|
||||
customStatus:
|
||||
description: CustomStatus defines the custom status message that
|
||||
could display to user
|
||||
type: string
|
||||
healthPolicy:
|
||||
description: HealthPolicy defines the health check policy for
|
||||
the abstraction
|
||||
type: string
|
||||
type: object
|
||||
required:
|
||||
- definitionRef
|
||||
type: object
|
||||
status:
|
||||
description: WorkloadDefinitionStatus is the status of WorkloadDefinition
|
||||
properties:
|
||||
conditions:
|
||||
description: Conditions of the resource.
|
||||
items:
|
||||
description: A Condition that may apply to a resource.
|
||||
properties:
|
||||
lastTransitionTime:
|
||||
description: LastTransitionTime is the last time this condition
|
||||
transitioned from one status to another.
|
||||
format: date-time
|
||||
type: string
|
||||
message:
|
||||
description: A Message containing details about this condition's
|
||||
last transition from one status to another, if any.
|
||||
type: string
|
||||
reason:
|
||||
description: A Reason for this condition's last transition from
|
||||
one status to another.
|
||||
type: string
|
||||
status:
|
||||
description: Status of this condition; is it currently True,
|
||||
False, or Unknown?
|
||||
type: string
|
||||
type:
|
||||
description: Type of this condition. At most one of each condition
|
||||
type may apply to a resource at any point in time.
|
||||
type: string
|
||||
required:
|
||||
- lastTransitionTime
|
||||
- reason
|
||||
- status
|
||||
- type
|
||||
type: object
|
||||
type: array
|
||||
type: object
|
||||
type: object
|
||||
served: true
|
||||
storage: false
|
||||
subresources: {}
|
||||
- additionalPrinterColumns:
|
||||
- jsonPath: .spec.definitionRef.name
|
||||
name: DEFINITION-NAME
|
||||
type: string
|
||||
- jsonPath: .metadata.annotations.definition\.oam\.dev/description
|
||||
name: DESCRIPTION
|
||||
type: string
|
||||
name: v1beta1
|
||||
schema:
|
||||
openAPIV3Schema:
|
||||
description: A WorkloadDefinition registers a kind of Kubernetes custom resource
|
||||
as a valid OAM workload kind by referencing its CustomResourceDefinition.
|
||||
The CRD is used to validate the schema of the workload when it is embedded
|
||||
in an OAM Component.
|
||||
properties:
|
||||
apiVersion:
|
||||
description: 'APIVersion defines the versioned schema of this representation
|
||||
of an object. Servers should convert recognized schemas to the latest
|
||||
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
|
||||
type: string
|
||||
kind:
|
||||
description: 'Kind is a string value representing the REST resource this
|
||||
object represents. Servers may infer this from the endpoint the client
|
||||
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
|
||||
type: string
|
||||
metadata:
|
||||
type: object
|
||||
spec:
|
||||
description: A WorkloadDefinitionSpec defines the desired state of a WorkloadDefinition.
|
||||
properties:
|
||||
childResourceKinds:
|
||||
description: ChildResourceKinds are the list of GVK of the child resources
|
||||
this workload generates
|
||||
items:
|
||||
description: A ChildResourceKind defines a child Kubernetes resource
|
||||
kind with a selector
|
||||
properties:
|
||||
apiVersion:
|
||||
description: APIVersion of the child resource
|
||||
type: string
|
||||
kind:
|
||||
description: Kind of the child resource
|
||||
type: string
|
||||
selector:
|
||||
additionalProperties:
|
||||
type: string
|
||||
description: Selector to select the child resources that the
|
||||
workload wants to expose to traits
|
||||
type: object
|
||||
required:
|
||||
- apiVersion
|
||||
- kind
|
||||
type: object
|
||||
type: array
|
||||
definitionRef:
|
||||
description: Reference to the CustomResourceDefinition that defines
|
||||
this workload kind.
|
||||
properties:
|
||||
name:
|
||||
description: Name of the referenced CustomResourceDefinition.
|
||||
type: string
|
||||
version:
|
||||
description: Version indicate which version should be used if
|
||||
CRD has multiple versions by default it will use the first one
|
||||
if not specified
|
||||
type: string
|
||||
required:
|
||||
- name
|
||||
type: object
|
||||
extension:
|
||||
description: Extension is used for extension needs by OAM platform
|
||||
builders
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
podSpecPath:
|
||||
description: PodSpecPath indicates where/if this workload has K8s
|
||||
podSpec field if one workload has podSpec, trait can do lot's of
|
||||
assumption such as port, env, volume fields.
|
||||
type: string
|
||||
revisionLabel:
|
||||
description: RevisionLabel indicates which label for underlying resources(e.g.
|
||||
pods) of this workload can be used by trait to create resource selectors(e.g.
|
||||
label selector for pods).
|
||||
type: string
|
||||
schematic:
|
||||
description: Schematic defines the data format and template of the
|
||||
encapsulation of the workload
|
||||
properties:
|
||||
cue:
|
||||
description: CUE defines the encapsulation in CUE format
|
||||
properties:
|
||||
template:
|
||||
description: Template defines the abstraction template data
|
||||
of the capability, it will replace the old CUE template
|
||||
in extension field. Template is a required field if CUE
|
||||
is defined in Capability Definition.
|
||||
type: string
|
||||
required:
|
||||
- template
|
||||
type: object
|
||||
helm:
|
||||
description: A Helm represents resources used by a Helm module
|
||||
properties:
|
||||
release:
|
||||
description: Release records a Helm release used by a Helm
|
||||
module workload.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
repository:
|
||||
description: HelmRelease records a Helm repository used by
|
||||
a Helm module workload.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
required:
|
||||
- release
|
||||
- repository
|
||||
type: object
|
||||
kube:
|
||||
description: Kube defines the encapsulation in raw Kubernetes
|
||||
resource format
|
||||
properties:
|
||||
parameters:
|
||||
description: Parameters defines configurable parameters
|
||||
items:
|
||||
description: A KubeParameter defines a configurable parameter
|
||||
of a component.
|
||||
properties:
|
||||
description:
|
||||
description: Description of this parameter.
|
||||
type: string
|
||||
fieldPaths:
|
||||
description: "FieldPaths specifies an array of fields
|
||||
within this workload that will be overwritten by the
|
||||
value of this parameter. \tAll fields must be of the
|
||||
same type. Fields are specified as JSON field paths
|
||||
without a leading dot, for example 'spec.replicas'."
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
name:
|
||||
description: Name of this parameter
|
||||
type: string
|
||||
required:
|
||||
default: false
|
||||
description: Required specifies whether or not a value
|
||||
for this parameter must be supplied when authoring
|
||||
an Application.
|
||||
type: boolean
|
||||
type:
|
||||
description: 'ValueType indicates the type of the parameter
|
||||
value, and only supports basic data types: string,
|
||||
number, boolean.'
|
||||
enum:
|
||||
- string
|
||||
- number
|
||||
- boolean
|
||||
type: string
|
||||
required:
|
||||
- fieldPaths
|
||||
- name
|
||||
- type
|
||||
type: object
|
||||
type: array
|
||||
template:
|
||||
description: Template defines the raw Kubernetes resource
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
required:
|
||||
- template
|
||||
type: object
|
||||
terraform:
|
||||
description: Terraform is the struct to describe cloud resources
|
||||
managed by Hashicorp Terraform
|
||||
properties:
|
||||
configuration:
|
||||
description: Configuration is Terraform Configuration
|
||||
type: string
|
||||
customRegion:
|
||||
description: Region is cloud provider's region. It will override
|
||||
the region in the region field of ProviderReference
|
||||
type: string
|
||||
deleteResource:
|
||||
default: true
|
||||
description: DeleteResource will determine whether provisioned
|
||||
cloud resources will be deleted when CR is deleted
|
||||
type: boolean
|
||||
path:
|
||||
description: Path is the sub-directory of remote git repository.
|
||||
It's valid when remote is set
|
||||
type: string
|
||||
providerRef:
|
||||
description: ProviderReference specifies the reference to
|
||||
Provider
|
||||
properties:
|
||||
name:
|
||||
description: Name of the referenced object.
|
||||
type: string
|
||||
namespace:
|
||||
default: default
|
||||
description: Namespace of the referenced object.
|
||||
type: string
|
||||
required:
|
||||
- name
|
||||
type: object
|
||||
type:
|
||||
default: hcl
|
||||
description: Type specifies which Terraform configuration
|
||||
it is, HCL or JSON syntax
|
||||
enum:
|
||||
- hcl
|
||||
- json
|
||||
- remote
|
||||
type: string
|
||||
writeConnectionSecretToRef:
|
||||
description: WriteConnectionSecretToReference specifies the
|
||||
namespace and name of a Secret to which any connection details
|
||||
for this managed resource should be written. Connection
|
||||
details frequently include the endpoint, username, and password
|
||||
required to connect to the managed resource.
|
||||
properties:
|
||||
name:
|
||||
description: Name of the secret.
|
||||
type: string
|
||||
namespace:
|
||||
description: Namespace of the secret.
|
||||
type: string
|
||||
required:
|
||||
- name
|
||||
type: object
|
||||
required:
|
||||
- configuration
|
||||
type: object
|
||||
type: object
|
||||
status:
|
||||
description: Status defines the custom health policy and status message
|
||||
for workload
|
||||
properties:
|
||||
customStatus:
|
||||
description: CustomStatus defines the custom status message that
|
||||
could display to user
|
||||
type: string
|
||||
healthPolicy:
|
||||
description: HealthPolicy defines the health check policy for
|
||||
the abstraction
|
||||
type: string
|
||||
type: object
|
||||
required:
|
||||
- definitionRef
|
||||
type: object
|
||||
status:
|
||||
description: WorkloadDefinitionStatus is the status of WorkloadDefinition
|
||||
properties:
|
||||
conditions:
|
||||
description: Conditions of the resource.
|
||||
items:
|
||||
description: A Condition that may apply to a resource.
|
||||
properties:
|
||||
lastTransitionTime:
|
||||
description: LastTransitionTime is the last time this condition
|
||||
transitioned from one status to another.
|
||||
format: date-time
|
||||
type: string
|
||||
message:
|
||||
description: A Message containing details about this condition's
|
||||
last transition from one status to another, if any.
|
||||
type: string
|
||||
reason:
|
||||
description: A Reason for this condition's last transition from
|
||||
one status to another.
|
||||
type: string
|
||||
status:
|
||||
description: Status of this condition; is it currently True,
|
||||
False, or Unknown?
|
||||
type: string
|
||||
type:
|
||||
description: Type of this condition. At most one of each condition
|
||||
type may apply to a resource at any point in time.
|
||||
type: string
|
||||
required:
|
||||
- lastTransitionTime
|
||||
- reason
|
||||
- status
|
||||
- type
|
||||
type: object
|
||||
type: array
|
||||
type: object
|
||||
type: object
|
||||
served: true
|
||||
storage: true
|
||||
subresources: {}
|
||||
status:
|
||||
acceptedNames:
|
||||
kind: ""
|
||||
plural: ""
|
||||
conditions: []
|
||||
storedVersions: []
|
|
@ -1,482 +0,0 @@
|
|||
|
||||
---
|
||||
apiVersion: apiextensions.k8s.io/v1
|
||||
kind: CustomResourceDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.6.2
|
||||
name: rollouts.standard.oam.dev
|
||||
spec:
|
||||
group: standard.oam.dev
|
||||
names:
|
||||
categories:
|
||||
- oam
|
||||
kind: Rollout
|
||||
listKind: RolloutList
|
||||
plural: rollouts
|
||||
shortNames:
|
||||
- rollout
|
||||
singular: rollout
|
||||
scope: Namespaced
|
||||
versions:
|
||||
- additionalPrinterColumns:
|
||||
- jsonPath: .status.rolloutTargetSize
|
||||
name: TARGET
|
||||
type: string
|
||||
- jsonPath: .status.upgradedReplicas
|
||||
name: UPGRADED
|
||||
type: string
|
||||
- jsonPath: .status.upgradedReadyReplicas
|
||||
name: READY
|
||||
type: string
|
||||
- jsonPath: .status.batchRollingState
|
||||
name: BATCH-STATE
|
||||
type: string
|
||||
- jsonPath: .status.rollingState
|
||||
name: ROLLING-STATE
|
||||
type: string
|
||||
- jsonPath: .metadata.creationTimestamp
|
||||
name: AGE
|
||||
type: date
|
||||
name: v1alpha1
|
||||
schema:
|
||||
openAPIV3Schema:
|
||||
description: Rollout is the Schema for the Rollout API
|
||||
properties:
|
||||
apiVersion:
|
||||
description: 'APIVersion defines the versioned schema of this representation
|
||||
of an object. Servers should convert recognized schemas to the latest
|
||||
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
|
||||
type: string
|
||||
kind:
|
||||
description: 'Kind is a string value representing the REST resource this
|
||||
object represents. Servers may infer this from the endpoint the client
|
||||
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
|
||||
type: string
|
||||
metadata:
|
||||
type: object
|
||||
spec:
|
||||
description: RolloutSpec defines how to describe an update between different
|
||||
compRevision
|
||||
properties:
|
||||
componentName:
|
||||
description: ComponentName specify the component name
|
||||
type: string
|
||||
rolloutPlan:
|
||||
description: RolloutPlan is the details on how to rollout the resources
|
||||
properties:
|
||||
batchPartition:
|
||||
description: All pods in the batches up to the batchPartition
|
||||
(included) will have the target resource specification while
|
||||
the rest still have the source resource This is designed for
|
||||
the operators to manually rollout Default is the the number
|
||||
of batches which will rollout all the batches
|
||||
format: int32
|
||||
type: integer
|
||||
canaryMetric:
|
||||
description: CanaryMetric provides a way for the rollout process
|
||||
to automatically check certain metrics before complete the process
|
||||
items:
|
||||
description: CanaryMetric holds the reference to metrics used
|
||||
for canary analysis
|
||||
properties:
|
||||
interval:
|
||||
description: Interval represents the windows size
|
||||
type: string
|
||||
metricsRange:
|
||||
description: Range value accepted for this metric
|
||||
properties:
|
||||
max:
|
||||
anyOf:
|
||||
- type: integer
|
||||
- type: string
|
||||
description: Maximum value
|
||||
x-kubernetes-int-or-string: true
|
||||
min:
|
||||
anyOf:
|
||||
- type: integer
|
||||
- type: string
|
||||
description: Minimum value
|
||||
x-kubernetes-int-or-string: true
|
||||
type: object
|
||||
name:
|
||||
description: Name of the metric
|
||||
type: string
|
||||
templateRef:
|
||||
description: TemplateRef references a metric template object
|
||||
properties:
|
||||
apiVersion:
|
||||
description: API version of the referent.
|
||||
type: string
|
||||
fieldPath:
|
||||
description: 'If referring to a piece of an object instead
|
||||
of an entire object, this string should contain a
|
||||
valid JSON/Go field access statement, such as desiredState.manifest.containers[2].
|
||||
For example, if the object reference is to a container
|
||||
within a pod, this would take on a value like: "spec.containers{name}"
|
||||
(where "name" refers to the name of the container
|
||||
that triggered the event) or if no container name
|
||||
is specified "spec.containers[2]" (container with
|
||||
index 2 in this pod). This syntax is chosen only to
|
||||
have some well-defined way of referencing a part of
|
||||
an object. TODO: this design is not final and this
|
||||
field is subject to change in the future.'
|
||||
type: string
|
||||
kind:
|
||||
description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
|
||||
type: string
|
||||
name:
|
||||
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
|
||||
type: string
|
||||
namespace:
|
||||
description: 'Namespace of the referent. More info:
|
||||
https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/'
|
||||
type: string
|
||||
resourceVersion:
|
||||
description: 'Specific resourceVersion to which this
|
||||
reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency'
|
||||
type: string
|
||||
uid:
|
||||
description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
|
||||
type: string
|
||||
type: object
|
||||
required:
|
||||
- name
|
||||
type: object
|
||||
type: array
|
||||
numBatches:
|
||||
description: The number of batches, default = 1
|
||||
format: int32
|
||||
type: integer
|
||||
paused:
|
||||
description: Paused the rollout, default is false
|
||||
type: boolean
|
||||
rolloutBatches:
|
||||
description: The exact distribution among batches. its size has
|
||||
to be exactly the same as the NumBatches (if set) The total
|
||||
number cannot exceed the targetSize or the size of the source
|
||||
resource We will IGNORE the last batch's replica field if it's
|
||||
a percentage since round errors can lead to inaccurate sum We
|
||||
highly recommend to leave the last batch's replica field empty
|
||||
items:
|
||||
description: RolloutBatch is used to describe how the each batch
|
||||
rollout should be
|
||||
properties:
|
||||
batchRolloutWebhooks:
|
||||
description: RolloutWebhooks provides a way for the batch
|
||||
rollout to interact with an external process
|
||||
items:
|
||||
description: RolloutWebhook holds the reference to external
|
||||
checks used for canary analysis
|
||||
properties:
|
||||
expectedStatus:
|
||||
description: ExpectedStatus contains all the expected
|
||||
http status code that we will accept as success
|
||||
items:
|
||||
type: integer
|
||||
type: array
|
||||
metadata:
|
||||
additionalProperties:
|
||||
type: string
|
||||
description: Metadata (key-value pairs) for this webhook
|
||||
type: object
|
||||
method:
|
||||
description: Method the HTTP call method, default
|
||||
is POST
|
||||
type: string
|
||||
name:
|
||||
description: Name of this webhook
|
||||
type: string
|
||||
type:
|
||||
description: Type of this webhook
|
||||
type: string
|
||||
url:
|
||||
description: URL address of this webhook
|
||||
type: string
|
||||
required:
|
||||
- name
|
||||
- type
|
||||
- url
|
||||
type: object
|
||||
type: array
|
||||
canaryMetric:
|
||||
description: CanaryMetric provides a way for the batch rollout
|
||||
process to automatically check certain metrics before
|
||||
moving to the next batch
|
||||
items:
|
||||
description: CanaryMetric holds the reference to metrics
|
||||
used for canary analysis
|
||||
properties:
|
||||
interval:
|
||||
description: Interval represents the windows size
|
||||
type: string
|
||||
metricsRange:
|
||||
description: Range value accepted for this metric
|
||||
properties:
|
||||
max:
|
||||
anyOf:
|
||||
- type: integer
|
||||
- type: string
|
||||
description: Maximum value
|
||||
x-kubernetes-int-or-string: true
|
||||
min:
|
||||
anyOf:
|
||||
- type: integer
|
||||
- type: string
|
||||
description: Minimum value
|
||||
x-kubernetes-int-or-string: true
|
||||
type: object
|
||||
name:
|
||||
description: Name of the metric
|
||||
type: string
|
||||
templateRef:
|
||||
description: TemplateRef references a metric template
|
||||
object
|
||||
properties:
|
||||
apiVersion:
|
||||
description: API version of the referent.
|
||||
type: string
|
||||
fieldPath:
|
||||
description: 'If referring to a piece of an object
|
||||
instead of an entire object, this string should
|
||||
contain a valid JSON/Go field access statement,
|
||||
such as desiredState.manifest.containers[2].
|
||||
For example, if the object reference is to a
|
||||
container within a pod, this would take on a
|
||||
value like: "spec.containers{name}" (where "name"
|
||||
refers to the name of the container that triggered
|
||||
the event) or if no container name is specified
|
||||
"spec.containers[2]" (container with index 2
|
||||
in this pod). This syntax is chosen only to
|
||||
have some well-defined way of referencing a
|
||||
part of an object. TODO: this design is not
|
||||
final and this field is subject to change in
|
||||
the future.'
|
||||
type: string
|
||||
kind:
|
||||
description: 'Kind of the referent. More info:
|
||||
https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
|
||||
type: string
|
||||
name:
|
||||
description: 'Name of the referent. More info:
|
||||
https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
|
||||
type: string
|
||||
namespace:
|
||||
description: 'Namespace of the referent. More
|
||||
info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/'
|
||||
type: string
|
||||
resourceVersion:
|
||||
description: 'Specific resourceVersion to which
|
||||
this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency'
|
||||
type: string
|
||||
uid:
|
||||
description: 'UID of the referent. More info:
|
||||
https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
|
||||
type: string
|
||||
type: object
|
||||
required:
|
||||
- name
|
||||
type: object
|
||||
type: array
|
||||
instanceInterval:
|
||||
description: The wait time, in seconds, between instances
|
||||
upgrades, default = 0
|
||||
format: int32
|
||||
type: integer
|
||||
maxUnavailable:
|
||||
anyOf:
|
||||
- type: integer
|
||||
- type: string
|
||||
description: MaxUnavailable is the max allowed number of
|
||||
pods that is unavailable during the upgrade. We will mark
|
||||
the batch as ready as long as there are less or equal
|
||||
number of pods unavailable than this number. default =
|
||||
0
|
||||
x-kubernetes-int-or-string: true
|
||||
podList:
|
||||
description: The list of Pods to get upgraded it is mutually
|
||||
exclusive with the Replicas field
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
replicas:
|
||||
anyOf:
|
||||
- type: integer
|
||||
- type: string
|
||||
description: 'Replicas is the number of pods to upgrade
|
||||
in this batch it can be an absolute number (ex: 5) or
|
||||
a percentage of total pods we will ignore the percentage
|
||||
of the last batch to just fill the gap it is mutually
|
||||
exclusive with the PodList field'
|
||||
x-kubernetes-int-or-string: true
|
||||
type: object
|
||||
type: array
|
||||
rolloutStrategy:
|
||||
description: RolloutStrategy defines strategies for the rollout
|
||||
plan The default is IncreaseFirstRolloutStrategyType
|
||||
type: string
|
||||
rolloutWebhooks:
|
||||
description: RolloutWebhooks provide a way for the rollout to
|
||||
interact with an external process
|
||||
items:
|
||||
description: RolloutWebhook holds the reference to external
|
||||
checks used for canary analysis
|
||||
properties:
|
||||
expectedStatus:
|
||||
description: ExpectedStatus contains all the expected http
|
||||
status code that we will accept as success
|
||||
items:
|
||||
type: integer
|
||||
type: array
|
||||
metadata:
|
||||
additionalProperties:
|
||||
type: string
|
||||
description: Metadata (key-value pairs) for this webhook
|
||||
type: object
|
||||
method:
|
||||
description: Method the HTTP call method, default is POST
|
||||
type: string
|
||||
name:
|
||||
description: Name of this webhook
|
||||
type: string
|
||||
type:
|
||||
description: Type of this webhook
|
||||
type: string
|
||||
url:
|
||||
description: URL address of this webhook
|
||||
type: string
|
||||
required:
|
||||
- name
|
||||
- type
|
||||
- url
|
||||
type: object
|
||||
type: array
|
||||
targetSize:
|
||||
description: The size of the target resource. The default is the
|
||||
same as the size of the source resource.
|
||||
format: int32
|
||||
type: integer
|
||||
type: object
|
||||
sourceRevisionName:
|
||||
description: SourceRevisionName contains the name of the componentRevisionName that
|
||||
we need to upgrade from. it can be empty only when it's the first
|
||||
time to deploy the application
|
||||
type: string
|
||||
targetRevisionName:
|
||||
description: TargetRevisionName contains the name of the componentRevisionName
|
||||
that we need to upgrade to.
|
||||
type: string
|
||||
required:
|
||||
- componentName
|
||||
- rolloutPlan
|
||||
- targetRevisionName
|
||||
type: object
|
||||
status:
|
||||
description: CompRolloutStatus defines the observed state of rollout
|
||||
properties:
|
||||
LastSourceRevision:
|
||||
description: LastSourceRevision contains the name of the componentRevisionName
|
||||
that we need to upgrade from. We will restart the rollout if this
|
||||
is not the same as the spec
|
||||
type: string
|
||||
batchRollingState:
|
||||
description: BatchRollingState only meaningful when the Status is
|
||||
rolling
|
||||
type: string
|
||||
conditions:
|
||||
description: Conditions of the resource.
|
||||
items:
|
||||
description: A Condition that may apply to a resource.
|
||||
properties:
|
||||
lastTransitionTime:
|
||||
description: LastTransitionTime is the last time this condition
|
||||
transitioned from one status to another.
|
||||
format: date-time
|
||||
type: string
|
||||
message:
|
||||
description: A Message containing details about this condition's
|
||||
last transition from one status to another, if any.
|
||||
type: string
|
||||
reason:
|
||||
description: A Reason for this condition's last transition from
|
||||
one status to another.
|
||||
type: string
|
||||
status:
|
||||
description: Status of this condition; is it currently True,
|
||||
False, or Unknown?
|
||||
type: string
|
||||
type:
|
||||
description: Type of this condition. At most one of each condition
|
||||
type may apply to a resource at any point in time.
|
||||
type: string
|
||||
required:
|
||||
- lastTransitionTime
|
||||
- reason
|
||||
- status
|
||||
- type
|
||||
type: object
|
||||
type: array
|
||||
currentBatch:
|
||||
description: The current batch the rollout is working on/blocked it
|
||||
starts from 0
|
||||
format: int32
|
||||
type: integer
|
||||
lastAppliedPodTemplateIdentifier:
|
||||
description: lastAppliedPodTemplateIdentifier is a string that uniquely
|
||||
represent the last pod template each workload type could use different
|
||||
ways to identify that so we cannot compare between resources We
|
||||
update this field only after a successful rollout
|
||||
type: string
|
||||
lastTargetRevision:
|
||||
description: LastUpgradedTargetRevision contains the name of the componentRevisionName
|
||||
that we upgraded to We will restart the rollout if this is not the
|
||||
same as the spec
|
||||
type: string
|
||||
rollingState:
|
||||
description: RollingState is the Rollout State
|
||||
type: string
|
||||
rolloutOriginalSize:
|
||||
description: RolloutTargetSize is the size of the target resources.
|
||||
This is determined once the initial spec verification and does not
|
||||
change until the rollout is restarted
|
||||
format: int32
|
||||
type: integer
|
||||
rolloutTargetSize:
|
||||
description: RolloutTargetSize is the size of the target resources.
|
||||
This is determined once the initial spec verification and does not
|
||||
change until the rollout is restarted
|
||||
format: int32
|
||||
type: integer
|
||||
targetGeneration:
|
||||
description: NewPodTemplateIdentifier is a string that uniquely represent
|
||||
the new pod template each workload type could use different ways
|
||||
to identify that so we cannot compare between resources
|
||||
type: string
|
||||
upgradedReadyReplicas:
|
||||
description: UpgradedReadyReplicas is the number of Pods upgraded
|
||||
by the rollout controller that have a Ready Condition.
|
||||
format: int32
|
||||
type: integer
|
||||
upgradedReplicas:
|
||||
description: UpgradedReplicas is the number of Pods upgraded by the
|
||||
rollout controller
|
||||
format: int32
|
||||
type: integer
|
||||
required:
|
||||
- currentBatch
|
||||
- lastTargetRevision
|
||||
- rollingState
|
||||
- upgradedReadyReplicas
|
||||
- upgradedReplicas
|
||||
type: object
|
||||
type: object
|
||||
served: true
|
||||
storage: true
|
||||
subresources:
|
||||
status: {}
|
||||
status:
|
||||
acceptedNames:
|
||||
kind: ""
|
||||
plural: ""
|
||||
conditions: []
|
||||
storedVersions: []
|
|
@ -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.
|
|
@ -1,311 +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"
|
||||
{{ if .Values.multicluster.clusterGateway.secureTLS.enabled }}
|
||||
- "--cert-dir={{ .Values.multicluster.clusterGateway.secureTLS.certPath }}"
|
||||
{{ end }}
|
||||
image: {{ .Values.imageRegistry }}{{ .Values.multicluster.clusterGateway.image.repository }}:{{ .Values.multicluster.clusterGateway.image.tag }}
|
||||
imagePullPolicy: {{ .Values.multicluster.clusterGateway.image.pullPolicy }}
|
||||
resources:
|
||||
{{- toYaml .Values.multicluster.clusterGateway.resources | nindent 6 }}
|
||||
ports:
|
||||
- containerPort: {{ .Values.multicluster.clusterGateway.port }}
|
||||
{{ if .Values.multicluster.clusterGateway.secureTLS.enabled }}
|
||||
volumeMounts:
|
||||
- mountPath: {{ .Values.multicluster.clusterGateway.secureTLS.certPath }}
|
||||
name: tls-cert-vol
|
||||
readOnly: true
|
||||
{{- end }}
|
||||
{{ if .Values.multicluster.clusterGateway.secureTLS.enabled }}
|
||||
volumes:
|
||||
- name: tls-cert-vol
|
||||
secret:
|
||||
defaultMode: 420
|
||||
secretName: {{ template "kubevela.fullname" . }}-cluster-gateway-tls
|
||||
{{ 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
|
||||
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
|
||||
- --key-name=apiserver.key
|
||||
- --cert-name=apiserver.crt
|
||||
restartPolicy: OnFailure
|
||||
serviceAccountName: {{ template "kubevela.fullname" . }}-cluster-gateway-admission
|
||||
securityContext:
|
||||
runAsGroup: 2000
|
||||
runAsNonRoot: true
|
||||
runAsUser: 2000
|
||||
{{ end }}
|
|
@ -1,270 +0,0 @@
|
|||
{{- if .Values.enableFluxcdAddon -}}
|
||||
apiVersion: core.oam.dev/v1beta1
|
||||
kind: Application
|
||||
metadata:
|
||||
labels:
|
||||
addons.oam.dev/name: fluxcd-def
|
||||
name: addon-fluxcd-def
|
||||
namespace: {{ .Release.Namespace }}
|
||||
annotations:
|
||||
"helm.sh/resource-policy": keep
|
||||
spec:
|
||||
components:
|
||||
- name: fluxc-def-resources
|
||||
properties:
|
||||
objects:
|
||||
- apiVersion: core.oam.dev/v1beta1
|
||||
kind: ComponentDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
definition.oam.dev/description: helm release is a group of K8s resources
|
||||
from either git repository or helm repo
|
||||
name: helm
|
||||
namespace: {{.Values.systemDefinitionNamespace}}
|
||||
spec:
|
||||
schematic:
|
||||
cue:
|
||||
template: "output: {\n\tapiVersion: \"source.toolkit.fluxcd.io/v1beta1\"\n\tmetadata:
|
||||
{\n\t\tname: context.name\n\t}\n\tif parameter.repoType == \"git\"
|
||||
{\n\t\tkind: \"GitRepository\"\n\t\tspec: {\n\t\t\turl: parameter.url\n\t\t\tif
|
||||
parameter.git.branch != _|_ {\n\t\t\t\tref: branch: parameter.git.branch\n\t\t\t}\n\t\t\t_secret\n\t\t\t_sourceCommonArgs\n\t\t}\n\t}\n\tif
|
||||
parameter.repoType == \"oss\" {\n\t\tkind: \"Bucket\"\n\t\tspec: {\n\t\t\tendpoint:
|
||||
\ parameter.url\n\t\t\tbucketName: parameter.oss.bucketName\n\t\t\tprovider:
|
||||
\ parameter.oss.provider\n\t\t\tif parameter.oss.region != _|_ {\n\t\t\t\tregion:
|
||||
parameter.oss.region\n\t\t\t}\n\t\t\t_secret\n\t\t\t_sourceCommonArgs\n\t\t}\n\t}\n\tif
|
||||
parameter.repoType == \"helm\" {\n\t\tkind: \"HelmRepository\"\n\t\tspec:
|
||||
{\n\t\t\turl: parameter.url\n\t\t\t_secret\n\t\t\t_sourceCommonArgs\n\t\t}\n\t}\n}\n\noutputs:
|
||||
release: {\n\tapiVersion: \"helm.toolkit.fluxcd.io/v2beta1\"\n\tkind:
|
||||
\ \"HelmRelease\"\n\tmetadata: {\n\t\tname: context.name\n\t}\n\tspec:
|
||||
{\n\t\ttimeout: parameter.installTimeout\n\t\tinterval: parameter.interval\n\t\tchart:
|
||||
{\n\t\t\tspec: {\n\t\t\t\tchart: parameter.chart\n\t\t\t\tversion:
|
||||
parameter.version\n\t\t\t\tsourceRef: {\n\t\t\t\t\tif parameter.repoType
|
||||
== \"git\" {\n\t\t\t\t\t\tkind: \"GitRepository\"\n\t\t\t\t\t}\n\t\t\t\t\tif
|
||||
parameter.repoType == \"helm\" {\n\t\t\t\t\t\tkind: \"HelmRepository\"\n\t\t\t\t\t}\n\t\t\t\t\tif
|
||||
parameter.repoType == \"oss\" {\n\t\t\t\t\t\tkind: \"Bucket\"\n\t\t\t\t\t}\n\t\t\t\t\tname:
|
||||
\ context.name\n\t\t\t\t}\n\t\t\t\tinterval: parameter.interval\n\t\t\t}\n\t\t}\n\t\tif
|
||||
parameter.targetNamespace != _|_ {\n\t\t\ttargetNamespace: parameter.targetNamespace\n\t\t}\n\t\tif
|
||||
parameter.releaseName != _|_ {\n\t\t\treleaseName: parameter.releaseName\n\t\t}\n\t\tif
|
||||
parameter.values != _|_ {\n\t\t\tvalues: parameter.values\n\t\t}\n\t}\n}\n\n_secret:
|
||||
{\n\tif parameter.secretRef != _|_ {\n\t\tsecretRef: {\n\t\t\tname:
|
||||
parameter.secretRef\n\t\t}\n\t}\n}\n\n_sourceCommonArgs: {\n\tinterval:
|
||||
parameter.pullInterval\n\tif parameter.timeout != _|_ {\n\t\ttimeout:
|
||||
parameter.timeout\n\t}\n}\n\nparameter: {\n\trepoType: *\"helm\" |
|
||||
\"git\" | \"oss\"\n\t// +usage=The interval at which to check for
|
||||
repository/bucket and relese updates, default to 5m\n\tpullInterval:
|
||||
*\"5m\" | string\n // +usage=The Interval at which to reconcile
|
||||
the Helm release, default to 30s\n interval: *\"30s\" | string\n\t//
|
||||
+usage=The Git or Helm repository URL, OSS endpoint, accept HTTP/S
|
||||
or SSH address as git url,\n\turl: string\n\t// +usage=The name of
|
||||
the secret containing authentication credentials\n\tsecretRef?: string\n\t//
|
||||
+usage=The timeout for operations like download index/clone repository,
|
||||
optional\n\ttimeout?: string\n\t// +usage=The timeout for operation
|
||||
`helm install`, optional\n\tinstallTimeout: *\"10m\" | string\n\n\tgit?:
|
||||
{\n\t\t// +usage=The Git reference to checkout and monitor for changes,
|
||||
defaults to master branch\n\t\tbranch: string\n\t}\n\toss?: {\n\t\t//
|
||||
+usage=The bucket's name, required if repoType is oss\n\t\tbucketName:
|
||||
string\n\t\t// +usage=\"generic\" for Minio, Amazon S3, Google Cloud
|
||||
Storage, Alibaba Cloud OSS, \"aws\" for retrieve credentials from
|
||||
the EC2 service when credentials not specified, default \"generic\"\n\t\tprovider:
|
||||
*\"generic\" | \"aws\"\n\t\t// +usage=The bucket region, optional\n\t\tregion?:
|
||||
string\n\t}\n\n\t// +usage=1.The relative path to helm chart for git/oss
|
||||
source. 2. chart name for helm resource 3. relative path for chart
|
||||
package(e.g. ./charts/podinfo-1.2.3.tgz)\n\tchart: string\n\t// +usage=Chart
|
||||
version\n\tversion: *\"*\" | string\n\t// +usage=The namespace for
|
||||
helm chart, optional\n\ttargetNamespace?: string\n\t// +usage=The
|
||||
release name\n\treleaseName?: string\n\t// +usage=Chart values\n\tvalues?:
|
||||
#nestedmap\n}\n\n#nestedmap: {\n\t...\n}\n"
|
||||
status:
|
||||
customStatus: "repoMessage: string\nreleaseMessage: string\nif context.output.status
|
||||
== _|_ {\n\trepoMessage: \"Fetching repository\"\n\treleaseMessage:
|
||||
\"Wating repository ready\"\n}\nif context.output.status != _|_ {\n\trepoStatus:
|
||||
context.output.status\n\tif repoStatus.conditions[0][\"type\"] != \"Ready\"
|
||||
{\n\t\trepoMessage: \"Fetch repository fail\"\n\t}\n\tif repoStatus.conditions[0][\"type\"]
|
||||
== \"Ready\" {\n\t\trepoMessage: \"Fetch repository successfully\"\n\t}\n\n\tif
|
||||
context.outputs.release.status == _|_ {\n\t\treleaseMessage: \"Creating
|
||||
helm release\"\n\t}\n\tif context.outputs.release.status != _|_ {\n\t\tif
|
||||
context.outputs.release.status.conditions[0][\"message\"] == \"Release
|
||||
reconciliation succeeded\" {\n\t\t\treleaseMessage: \"Create helm release
|
||||
successfully\"\n\t\t}\n\t\tif context.outputs.release.status.conditions[0][\"message\"]
|
||||
!= \"Release reconciliation succeeded\" {\n\t\t\treleaseBasicMessage:
|
||||
\"Delivery helm release in progress, message: \" + context.outputs.release.status.conditions[0][\"message\"]\n\t\t\tif
|
||||
len(context.outputs.release.status.conditions) == 1 {\n\t\t\t\treleaseMessage:
|
||||
releaseBasicMessage\n\t\t\t}\n\t\t\tif len(context.outputs.release.status.conditions)
|
||||
> 1 {\n\t\t\t\treleaseMessage: releaseBasicMessage + \", \" + context.outputs.release.status.conditions[1][\"message\"]\n\t\t\t}\n\t\t}\n\t}\n\n}\nmessage:
|
||||
repoMessage + \", \" + releaseMessage"
|
||||
healthPolicy: 'isHealth: len(context.outputs.release.status.conditions)
|
||||
!= 0 && context.outputs.release.status.conditions[0]["status"]=="True"'
|
||||
workload:
|
||||
type: autodetects.core.oam.dev
|
||||
- apiVersion: core.oam.dev/v1beta1
|
||||
kind: TraitDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
definition.oam.dev/description: A list of JSON6902 patch to selected target
|
||||
name: kustomize-json-patch
|
||||
namespace: {{.Values.systemDefinitionNamespace}}
|
||||
spec:
|
||||
schematic:
|
||||
cue:
|
||||
template: "patch: {\n\tspec: {\n\t\tpatchesJson6902: parameter.patchesJson\n\t}\n}\n\nparameter:
|
||||
{\n\t// +usage=A list of JSON6902 patch.\n\tpatchesJson: [...#jsonPatchItem]\n}\n\n//
|
||||
+usage=Contains a JSON6902 patch\n#jsonPatchItem: {\n\ttarget: #selector\n\tpatch:
|
||||
[...{\n\t\t// +usage=operation to perform\n\t\top: string | \"add\"
|
||||
| \"remove\" | \"replace\" | \"move\" | \"copy\" | \"test\"\n\t\t//
|
||||
+usage=operate path e.g. /foo/bar\n\t\tpath: string\n\t\t// +usage=specify
|
||||
source path when op is copy/move\n\t\tfrom?: string\n\t\t// +usage=specify
|
||||
opraation value when op is test/add/replace\n\t\tvalue?: string\n\t}]\n}\n\n//
|
||||
+usage=Selector specifies a set of resources\n#selector: {\n\tgroup?:
|
||||
\ string\n\tversion?: string\n\tkind?: string\n\tnamespace?:
|
||||
\ string\n\tname?: string\n\tannotationSelector?:
|
||||
string\n\tlabelSelector?: string\n}\n"
|
||||
- apiVersion: core.oam.dev/v1beta1
|
||||
kind: TraitDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
definition.oam.dev/description: A list of StrategicMerge or JSON6902 patch
|
||||
to selected target
|
||||
name: kustomize-patch
|
||||
namespace: {{.Values.systemDefinitionNamespace}}
|
||||
spec:
|
||||
schematic:
|
||||
cue:
|
||||
template: "patch: {\n\tspec: {\n\t\tpatches: parameter.patches\n\t}\n}\nparameter:
|
||||
{\n\t// +usage=a list of StrategicMerge or JSON6902 patch to selected
|
||||
target\n\tpatches: [...#patchItem]\n}\n\n// +usage=Contains a strategicMerge
|
||||
or JSON6902 patch\n#patchItem: {\n\t// +usage=Inline patch string,
|
||||
in yaml style\n\tpatch: string\n\t// +usage=Specify the target the
|
||||
patch should be applied to\n\ttarget: #selector\n}\n\n// +usage=Selector
|
||||
specifies a set of resources\n#selector: {\n\tgroup?: string\n\tversion?:
|
||||
\ string\n\tkind?: string\n\tnamespace?: string\n\tname?:
|
||||
\ string\n\tannotationSelector?: string\n\tlabelSelector?:
|
||||
\ string\n}\n"
|
||||
- apiVersion: core.oam.dev/v1beta1
|
||||
kind: ComponentDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
definition.oam.dev/description: kustomize can fetching, building, updating
|
||||
and applying Kustomize manifests from git repo.
|
||||
name: kustomize
|
||||
namespace: {{.Values.systemDefinitionNamespace}}
|
||||
spec:
|
||||
schematic:
|
||||
cue:
|
||||
template: "output: {\n\tapiVersion: \"kustomize.toolkit.fluxcd.io/v1beta1\"\n\tkind:
|
||||
\ \"Kustomization\"\n\tmetadata: {\n\t\tname: context.name\n
|
||||
\ namespace: context.namespace\n\t}\n\tspec: {\n\t\tinterval: parameter.pullInterval\n\t\tsourceRef:
|
||||
{\n\t\t\tif parameter.repoType == \"git\" {\n\t\t\t\tkind: \"GitRepository\"\n\t\t\t}\n\t\t\tif
|
||||
parameter.repoType == \"oss\" {\n\t\t\t\tkind: \"Bucket\"\n\t\t\t}\n\t\t\tname:
|
||||
\ context.name\n\t\t\tnamespace: context.namespace\n\t\t}\n\t\tpath:
|
||||
\ parameter.path\n\t\tprune: true\n\t\tvalidation: \"client\"\n\t}\n}\n\noutputs:
|
||||
{\n repo: {\n\t apiVersion: \"source.toolkit.fluxcd.io/v1beta1\"\n\t
|
||||
\ metadata: {\n\t\t name: context.name\n namespace: context.namespace\n\t
|
||||
\ }\n\t if parameter.repoType == \"git\" {\n\t\t kind: \"GitRepository\"\n\t\t
|
||||
\ spec: {\n\t\t\t url: parameter.url\n\t\t\t if parameter.git.branch
|
||||
!= _|_ {\n\t\t\t\t ref: branch: parameter.git.branch\n\t\t\t }\n
|
||||
\ if parameter.git.provider != _|_ {\n if parameter.git.provider
|
||||
== \"GitHub\" {\n gitImplementation: \"go-git\"\n }\n
|
||||
\ if parameter.git.provider == \"AzureDevOps\" {\n gitImplementation:
|
||||
\"libgit2\"\n }\n }\n\t\t\t _secret\n\t\t\t _sourceCommonArgs\n\t\t
|
||||
\ }\n\t }\n\t if parameter.repoType == \"oss\" {\n\t\t kind: \"Bucket\"\n\t\t
|
||||
\ spec: {\n\t\t\t endpoint: parameter.url\n\t\t\t bucketName:
|
||||
parameter.oss.bucketName\n\t\t\t provider: parameter.oss.provider\n\t\t\t
|
||||
\ if parameter.oss.region != _|_ {\n\t\t\t\t region: parameter.oss.region\n\t\t\t
|
||||
\ }\n\t\t\t _secret\n\t\t\t _sourceCommonArgs\n\t\t }\n\t }\n
|
||||
\ }\n\n if parameter.imageRepository != _|_ {\n imageRepo: {\n
|
||||
\ apiVersion: \"image.toolkit.fluxcd.io/v1beta1\"\n kind:
|
||||
\"ImageRepository\"\n\t metadata: {\n\t\t name: context.name\n
|
||||
\ namespace: context.namespace\n\t }\n spec: {\n image:
|
||||
parameter.imageRepository.image\n interval: parameter.pullInterval\n
|
||||
\ if parameter.imageRepository.secretRef != _|_ {\n secretRef:
|
||||
name: parameter.imageRepository.secretRef\n }\n }\n }\n\n
|
||||
\ imagePolicy: {\n apiVersion: \"image.toolkit.fluxcd.io/v1beta1\"\n
|
||||
\ kind: \"ImagePolicy\"\n\t metadata: {\n\t\t name: context.name\n
|
||||
\ namespace: context.namespace\n\t }\n spec: {\n imageRepositoryRef:
|
||||
name: context.name\n policy: parameter.imageRepository.policy\n
|
||||
\ if parameter.imageRepository.filterTags != _|_ {\n filterTags:
|
||||
parameter.imageRepository.filterTags\n }\n }\n }\n\n
|
||||
\ imageUpdate: {\n apiVersion: \"image.toolkit.fluxcd.io/v1beta1\"\n
|
||||
\ kind: \"ImageUpdateAutomation\"\n\t metadata: {\n\t\t name:
|
||||
context.name\n namespace: context.namespace\n\t }\n spec:
|
||||
{\n interval: parameter.pullInterval\n sourceRef: {\n
|
||||
\ kind: \"GitRepository\"\n name: context.name\n
|
||||
\ }\n git: {\n checkout: ref: branch: parameter.git.branch\n
|
||||
\ commit: {\n author: {\n email: \"kubevelabot@users.noreply.github.com\"\n
|
||||
\ name: \"kubevelabot\"\n }\n if
|
||||
parameter.imageRepository.commitMessage != _|_ {\n messageTemplate:
|
||||
\"Update image automatically.\\n\" + parameter.imageRepository.commitMessage\n
|
||||
\ }\n if parameter.imageRepository.commitMessage
|
||||
== _|_ {\n messageTemplate: \"Update image automatically.\"\n
|
||||
\ }\n }\n push: branch: parameter.git.branch\n
|
||||
\ }\n update: {\n path:\tparameter.path\n strategy:
|
||||
\"Setters\"\n }\n }\n }\n }\n}\n\n_secret: {\n\tif
|
||||
parameter.secretRef != _|_ {\n\t\tsecretRef: {\n\t\t\tname: parameter.secretRef\n\t\t}\n\t}\n}\n\n_sourceCommonArgs:
|
||||
{\n\tinterval: parameter.pullInterval\n\tif parameter.timeout != _|_
|
||||
{\n\t\ttimeout: parameter.timeout\n\t}\n}\n\nparameter: {\n\trepoType:
|
||||
*\"git\" | \"oss\"\n // +usage=The image repository for automatically
|
||||
update image to git\n imageRepository?: {\n // +usage=The image
|
||||
url\n image: string\n // +usage=The name of the secret containing
|
||||
authentication credentials\n secretRef?: string\n // +usage=Policy
|
||||
gives the particulars of the policy to be followed in selecting the
|
||||
most recent image.\n policy: {\n // +usage=Alphabetical set
|
||||
of rules to use for alphabetical ordering of the tags.\n alphabetical?:
|
||||
{\n // +usage=Order specifies the sorting order of the tags.\n
|
||||
\ // +usage=Given the letters of the alphabet as tags, ascending
|
||||
order would select Z, and descending order would select A.\n order?:
|
||||
\"asc\" | \"desc\"\n }\n // +usage=Numerical set of rules
|
||||
to use for numerical ordering of the tags.\n numerical?: {\n
|
||||
\ // +usage=Order specifies the sorting order of the tags.\n
|
||||
\ // +usage=Given the integer values from 0 to 9 as tags, ascending
|
||||
order would select 9, and descending order would select 0.\n order:
|
||||
\"asc\" | \"desc\"\n }\n // +usage=SemVer gives a semantic
|
||||
version range to check against the tags available.\n semver?:
|
||||
{\n // +usage=Range gives a semver range for the image tag;
|
||||
the highest version within the range that's a tag yields the latest
|
||||
image.\n range: string\n }\n }\n // +usage=FilterTags
|
||||
enables filtering for only a subset of tags based on a set of rules.
|
||||
If no rules are provided, all the tags from the repository will be
|
||||
ordered and compared.\n filterTags?: {\n // +usage=Extract
|
||||
allows a capture group to be extracted from the specified regular
|
||||
expression pattern, useful before tag evaluation.\n extract?:
|
||||
string\n // +usage=Pattern specifies a regular expression pattern
|
||||
used to filter for image tags.\n pattern?: string\n }\n //
|
||||
+usage=The image url\n commitMessage?: string\n }\n\t// +usage=The
|
||||
interval at which to check for repository/bucket and release updates,
|
||||
default to 5m\n\tpullInterval: *\"5m\" | string\n\t// +usage=The Git
|
||||
or Helm repository URL, OSS endpoint, accept HTTP/S or SSH address
|
||||
as git url,\n\turl: string\n\t// +usage=The name of the secret containing
|
||||
authentication credentials\n\tsecretRef?: string\n\t// +usage=The
|
||||
timeout for operations like download index/clone repository, optional\n\ttimeout?:
|
||||
string\n\tgit?: {\n\t\t// +usage=The Git reference to checkout and
|
||||
monitor for changes, defaults to master branch\n\t\tbranch: string\n
|
||||
\ // +usage=Determines which git client library to use. Defaults
|
||||
to GitHub, it will pick go-git. AzureDevOps will pick libgit2.\n provider?:
|
||||
*\"GitHub\" | \"AzureDevOps\"\n\t}\n\toss?: {\n\t\t// +usage=The bucket's
|
||||
name, required if repoType is oss\n\t\tbucketName: string\n\t\t//
|
||||
+usage=\"generic\" for Minio, Amazon S3, Google Cloud Storage, Alibaba
|
||||
Cloud OSS, \"aws\" for retrieve credentials from the EC2 service when
|
||||
credentials not specified, default \"generic\"\n\t\tprovider: *\"generic\"
|
||||
| \"aws\"\n\t\t// +usage=The bucket region, optional\n\t\tregion?:
|
||||
string\n\t}\n\t//+usage=Path to the directory containing the kustomization.yaml
|
||||
file, or the set of plain YAMLs a kustomization.yaml should be generated
|
||||
for.\n\tpath: string\n}"
|
||||
workload:
|
||||
type: autodetects.core.oam.dev
|
||||
- apiVersion: core.oam.dev/v1beta1
|
||||
kind: TraitDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
definition.oam.dev/description: A list of strategic merge to kustomize
|
||||
config
|
||||
name: kustomize-strategy-merge
|
||||
namespace: {{.Values.systemDefinitionNamespace}}
|
||||
spec:
|
||||
schematic:
|
||||
cue:
|
||||
template: "patch: {\n\tspec: {\n\t\tpatchesStrategicMerge: parameter.patchesStrategicMerge\n\t}\n}\n\nparameter:
|
||||
{\n\t// +usage=a list of strategicmerge, defined as inline yaml objects.\n\tpatchesStrategicMerge:
|
||||
[...#nestedmap]\n}\n\n#nestedmap: {\n\t...\n}\n"
|
||||
type: k8s-objects
|
||||
|
||||
{{- end }}
|
|
@ -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"
|
||||
}
|
||||
}
|
||||
}'
|
|
@ -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 }}
|
|
@ -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 }}
|
|
@ -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 }}
|
|
@ -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 }}
|
|
@ -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-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:
|
||||
{{ include "kubevela-admission-webhook-patch.Podspec" . | indent 6 }}
|
||||
{{ end }}
|
||||
{{- end }}
|
|
@ -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 }}
|
|
@ -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 }}
|
|
@ -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 }}
|
|
@ -1,150 +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-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 -}}
|
|
@ -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 -}}
|
|
@ -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 -}}
|
|
@ -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 }}
|
|
@ -1,180 +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 }}
|
||||
{{ end }}
|
||||
---
|
||||
{{ if .Values.multicluster.enabled }}
|
||||
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 }}
|
||||
{{ end }}
|
||||
---
|
||||
{{ if .Values.multicluster.enabled }}
|
||||
# 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
|
||||
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 }}
|
||||
{{ end }}
|
||||
---
|
||||
{{ if and .Values.multicluster.enabled .Values.multicluster.clusterGateway.secureTLS.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
|
||||
{{- end }}
|
||||
---
|
||||
{{ if and .Values.multicluster.enabled .Values.multicluster.clusterGateway.secureTLS.enabled }}
|
||||
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 }}
|
||||
{{- end }}
|
||||
---
|
||||
{{ if and .Values.multicluster.enabled .Values.multicluster.clusterGateway.secureTLS.enabled }}
|
||||
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 }}
|
||||
{{- end }}
|
||||
---
|
||||
{{ if and .Values.multicluster.enabled .Values.multicluster.clusterGateway.secureTLS.enabled }}
|
||||
{{ 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 }}
|
||||
{{ end }}
|
||||
---
|
||||
{{ if and .Values.multicluster.enabled .Values.multicluster.clusterGateway.secureTLS.enabled }}
|
||||
{{ 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 }}
|
|
@ -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
|
|
@ -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
|
|
@ -1,35 +0,0 @@
|
|||
# Code generated by KubeVela templates. DO NOT EDIT. Please edit the original cue file.
|
||||
# Definition source cue file: vela-templates/definitions/internal/annotations.cue
|
||||
apiVersion: core.oam.dev/v1beta1
|
||||
kind: TraitDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
definition.oam.dev/description: Add annotations on K8s pod for your workload which follows the pod spec in path 'spec.template'.
|
||||
labels:
|
||||
custom.definition.oam.dev/ui-hidden: "true"
|
||||
name: annotations
|
||||
namespace: {{ include "systemDefinitionNamespace" . }}
|
||||
spec:
|
||||
appliesToWorkloads:
|
||||
- '*'
|
||||
podDisruptive: true
|
||||
schematic:
|
||||
cue:
|
||||
template: |
|
||||
// +patchStrategy=jsonMergePatch
|
||||
patch: {
|
||||
metadata: annotations: {
|
||||
for k, v in parameter {
|
||||
"\(k)": v
|
||||
}
|
||||
}
|
||||
if context.output.spec != _|_ && context.output.spec.template != _|_ {
|
||||
spec: template: metadata: annotations: {
|
||||
for k, v in parameter {
|
||||
"\(k)": v
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
parameter: [string]: string | null
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
# Code generated by KubeVela templates. DO NOT EDIT. Please edit the original cue file.
|
||||
# Definition source cue file: vela-templates/definitions/internal/apply-application-in-parallel.cue
|
||||
apiVersion: core.oam.dev/v1beta1
|
||||
kind: WorkflowStepDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
definition.oam.dev/description: Apply components of an application in parallel for your workflow steps
|
||||
labels:
|
||||
custom.definition.oam.dev/ui-hidden: "true"
|
||||
name: apply-application-in-parallel
|
||||
namespace: {{ include "systemDefinitionNamespace" . }}
|
||||
spec:
|
||||
schematic:
|
||||
cue:
|
||||
template: |
|
||||
import (
|
||||
"vela/op"
|
||||
)
|
||||
|
||||
output: op.#ApplyApplicationInParallel & {}
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
# Code generated by KubeVela templates. DO NOT EDIT. Please edit the original cue file.
|
||||
# Definition source cue file: vela-templates/definitions/internal/apply-application.cue
|
||||
apiVersion: core.oam.dev/v1beta1
|
||||
kind: WorkflowStepDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
definition.oam.dev/description: Apply application for your workflow steps
|
||||
labels:
|
||||
custom.definition.oam.dev/ui-hidden: "true"
|
||||
name: apply-application
|
||||
namespace: {{ include "systemDefinitionNamespace" . }}
|
||||
spec:
|
||||
schematic:
|
||||
cue:
|
||||
template: |
|
||||
import (
|
||||
"vela/op"
|
||||
)
|
||||
|
||||
// apply application
|
||||
output: op.#ApplyApplication & {}
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
# Code generated by KubeVela templates. DO NOT EDIT. Please edit the original cue file.
|
||||
# Definition source cue file: vela-templates/definitions/internal/apply-object.cue
|
||||
apiVersion: core.oam.dev/v1beta1
|
||||
kind: WorkflowStepDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
definition.oam.dev/description: Apply raw kubernetes objects for your workflow steps
|
||||
labels:
|
||||
custom.definition.oam.dev/ui-hidden: "true"
|
||||
name: apply-object
|
||||
namespace: {{ include "systemDefinitionNamespace" . }}
|
||||
spec:
|
||||
schematic:
|
||||
cue:
|
||||
template: |
|
||||
import (
|
||||
"vela/op"
|
||||
)
|
||||
|
||||
apply: op.#Apply & {
|
||||
value: parameter.value
|
||||
cluster: parameter.cluster
|
||||
}
|
||||
parameter: {
|
||||
// +usage=Specify the value of the object
|
||||
value: {...}
|
||||
// +usage=Specify the cluster of the object
|
||||
cluster: *"" | string
|
||||
}
|
||||
|