mirror of
https://github.com/kubevela/kubevela.git
synced 2026-02-14 10:00:06 +00:00
Help developer install build-in necessary definitions. (#1907)
* fix * add install def shell * change to make command * fix shell * fix bak
This commit is contained in:
3
Makefile
3
Makefile
@@ -321,3 +321,6 @@ swagger-gen:
|
||||
|
||||
check-license-header:
|
||||
./hack/licence/header-check.sh
|
||||
|
||||
check-install-def:
|
||||
./hack/utils/installdefinition.sh
|
||||
|
||||
@@ -5,7 +5,7 @@ metadata:
|
||||
annotations:
|
||||
definition.oam.dev/description: "raw allow users to specify raw K8s object in properties"
|
||||
name: raw
|
||||
namespace: vela-system
|
||||
namespace: {{.Values.systemDefinitionNamespace}}
|
||||
spec:
|
||||
workload:
|
||||
type: autodetects.core.oam.dev
|
||||
|
||||
@@ -78,8 +78,13 @@ Firstly make sure your cluster has CRDs, below is the command that can help inst
|
||||
make core-install
|
||||
```
|
||||
|
||||
Run locally:
|
||||
To ensure you have created vela-system namespace and install definitions of necessary module.
|
||||
you can run the command:
|
||||
```shell script
|
||||
make check-install-def
|
||||
```
|
||||
|
||||
And then run locally:
|
||||
```shell script
|
||||
make core-run
|
||||
```
|
||||
|
||||
26
hack/utils/installdefinition.sh
Executable file
26
hack/utils/installdefinition.sh
Executable file
@@ -0,0 +1,26 @@
|
||||
#! /bin/bash
|
||||
DEF_PATH="charts/vela-core/templates/defwithtemplate"
|
||||
|
||||
function check_install() {
|
||||
res=`kubectl get namespace -A | grep vela-system`
|
||||
if [ -n "$res" ];then
|
||||
echo 'vela-system namespace exist'
|
||||
else
|
||||
echo 'vela-system namespace do not exist'
|
||||
echo 'creating vela-system namespace ...'
|
||||
kubectl create namespace vela-system
|
||||
fi
|
||||
echo "applying definitions ..."
|
||||
cd $DEF_PATH
|
||||
|
||||
for file in *.yaml ;
|
||||
do
|
||||
echo "Info: changing "$DEF_PATH"/"$file
|
||||
sed -i.bak "s#namespace: {{.Values.systemDefinitionNamespace}}#namespace: vela-system#g" $file
|
||||
kubectl apply -f $file
|
||||
rm $file
|
||||
mv $file".bak" $file
|
||||
done
|
||||
}
|
||||
|
||||
check_install
|
||||
@@ -4,7 +4,7 @@ metadata:
|
||||
annotations:
|
||||
definition.oam.dev/description: "raw allow users to specify raw K8s object in properties"
|
||||
name: raw
|
||||
namespace: vela-system
|
||||
namespace: {{.Values.systemDefinitionNamespace}}
|
||||
spec:
|
||||
workload:
|
||||
type: autodetects.core.oam.dev
|
||||
|
||||
Reference in New Issue
Block a user