Demo
This commit is contained in:
21
k8s/start-demo.sh
Executable file
21
k8s/start-demo.sh
Executable file
@@ -0,0 +1,21 @@
|
||||
#!/bin/bash
|
||||
mode=${1:-demo}
|
||||
branch=${2:-main}
|
||||
|
||||
start=1
|
||||
end=${3:-1}
|
||||
|
||||
cp $HOME/.kube/config $HOME/.kube/config_past
|
||||
|
||||
|
||||
for ((i=start; i<=end; i++)); do
|
||||
sudo cp /etc/rancher/k3s/k3s.yaml $HOME/.kube/config
|
||||
|
||||
./start.sh $mode $branch "cluster-$i"
|
||||
|
||||
sudo cp $HOME/.kube/config $HOME/.kube/configCluster$i
|
||||
sudo chown $(id -u):$(id -g) $HOME/.kube/configCluster$i
|
||||
export KUBECONFIG="$HOME/.kube/configCluster$i"
|
||||
cd ./oc-deploy/k8s
|
||||
done
|
||||
export KUBECONFIG=~/.kube/config
|
||||
16
k8s/start.sh
16
k8s/start.sh
@@ -1,8 +1,7 @@
|
||||
#!/bin/bash
|
||||
mode=${1:-dev}
|
||||
branch=${2:-main}
|
||||
|
||||
cd ../..
|
||||
clustername=${3:-opencloud}
|
||||
|
||||
if [ ! -d "oc-k8s" ]; then
|
||||
echo "Cloning repository: $repo_name"
|
||||
@@ -12,10 +11,11 @@ if [ ! -d "oc-k8s" ]; then
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
echo "Repository 'oc-k8s' already exists. Pulling latest changes..."
|
||||
cd "oc-k8s" && git checkout $branch && git pull
|
||||
|
||||
./create_kind_cluster.sh
|
||||
./clone_opencloud_microservices.sh $branch
|
||||
./build_opencloud_microservices.sh
|
||||
./install.sh $mode
|
||||
cp -rf ./datas/$clustername ./oc-k8s/opencloud/charts/mongodb/start_files
|
||||
|
||||
echo "Repository 'oc-k8s' already exists. Pulling latest changes..."
|
||||
cd "oc-k8s" && git checkout main && git pull
|
||||
|
||||
export CLUSTER_NAME=$clustername ./oc-k8s.sh create values $mode
|
||||
./oc-k8s.sh start $mode $branch
|
||||
@@ -2,8 +2,6 @@
|
||||
mode=${1:-dev}
|
||||
branch=${2:-main}
|
||||
|
||||
cd ../..
|
||||
|
||||
if [ ! -d "oc-k8s" ];
|
||||
echo "Cloning repository: $repo_name"
|
||||
git clone "https://cloud.o-forge.io/core/oc-k8s.git"
|
||||
@@ -15,6 +13,5 @@ fi
|
||||
echo "Repository 'oc-k8s' already exists. Pulling latest changes..."
|
||||
cd "oc-k8s" && git checkout $branch && git pull
|
||||
|
||||
./uninstall.sh $mode
|
||||
./delete_kind_cluster.sh
|
||||
./oc-k8s.sh stop $mode
|
||||
|
||||
|
||||
Reference in New Issue
Block a user