2021-07-20 14:05:39 +08:00
|
|
|
#! /bin/bash
|
|
|
|
|
DEF_PATH="charts/vela-core/templates/defwithtemplate"
|
|
|
|
|
|
|
|
|
|
function check_install() {
|
|
|
|
|
res=`kubectl get namespace -A | grep vela-system`
|
|
|
|
|
if [ -n "$res" ];then
|
2023-01-06 17:45:50 +08:00
|
|
|
echo 'checking: vela-system namespace exist'
|
2021-07-20 14:05:39 +08:00
|
|
|
else
|
|
|
|
|
echo 'vela-system namespace do not exist'
|
|
|
|
|
echo 'creating vela-system namespace ...'
|
|
|
|
|
kubectl create namespace vela-system
|
|
|
|
|
fi
|
|
|
|
|
echo "applying definitions ..."
|
2022-05-09 11:23:45 +08:00
|
|
|
cd "$DEF_PATH"
|
2021-07-20 14:05:39 +08:00
|
|
|
|
|
|
|
|
for file in *.yaml ;
|
|
|
|
|
do
|
2022-05-09 11:23:45 +08:00
|
|
|
echo "Info: changing "$DEF_PATH"/""$file"
|
|
|
|
|
sed -i.bak "s#namespace: {{ include \"systemDefinitionNamespace\" . }}#namespace: vela-system#g" "$file"
|
|
|
|
|
kubectl apply -f "$file"
|
|
|
|
|
rm "$file"
|
|
|
|
|
mv "$file"".bak" "$file"
|
2021-07-20 14:05:39 +08:00
|
|
|
done
|
2021-09-13 14:17:12 +08:00
|
|
|
|
|
|
|
|
cd -
|
2021-07-20 14:05:39 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
check_install
|
2021-09-13 14:17:12 +08:00
|
|
|
|
|
|
|
|
DEF_PATH="charts/vela-core/templates/definitions"
|
|
|
|
|
|
2022-03-08 12:26:25 +08:00
|
|
|
check_install
|
2023-01-06 17:45:50 +08:00
|
|
|
|
|
|
|
|
DEF_PATH="charts/vela-core/templates/velaql"
|
|
|
|
|
|
|
|
|
|
check_install
|