This commit is contained in:
mr
2026-01-12 13:35:25 +01:00
parent cc8d599ce5
commit be080d7511
14 changed files with 78 additions and 12 deletions

21
k8s/start-demo.sh Executable file
View 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

View File

@@ -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

View File

@@ -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