diff --git a/README.md b/README.md index 5b277b6..ef514c3 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,61 @@ -# Fornax Bash Scripts for Deployment +# Edge Cluster Multi-Layer Setup using Bash Scripts -### 1. Clone the repository into Node-A -git clone https://github.com/click2cloud-prajwal/fornaxscript.git -### 2. Edit the IP's in the script -#### export a= (ip address of node-a) -#### export b= (ip address of node-b) -#### export c= (ip address of node-c) -### 3. Run the Script -#### sudo bash fornaxscript/fornax1.sh -#### (for node-a run the 'fornax1.sh', Simultaneously run the 'fornax2.sh' for node-b and 'fornax3.sh' for node-c) - -### 4. Verify the Edgecluster in Node-A -#### kubectl get edgecluster +### Virtual Machine Configuration + + +• **3 Ubuntu 18.04 VMs, one for cloud-core, two for edge-core.** +• Open the port of 10000 and 10002 in the security group of the cloud-core machine and edge-core machine +• 16 GB RAM, 16 vCPUs, 128 GB storage. + +#### Machine 1: Cloud Core Node +#### Machine 2: Edge Node with Control Plane +#### Machine 3: Edge Worker Node + + +### NOTE: 'prerequisite_package.sh' contains all the required packages for creating Kubernetes Cluster. + + + +#### Run the Scripts: + + + sudo bash cloudcore_node.sh (Run in machine-1) + sudo bash edgecore_control_plane.sh (Run in machine 2) (run the script only after successfully running the machine-1 script) + sudo bash edge_worker_node.sh (Run in machine 3) (run the script only after successfully running the machine-2 script) + + +#### Input the Private IP's and Password of Machine 1, Machine 2 and Machine 3 : + + + **For Machine 1** + + ![image](https://user-images.githubusercontent.com/95343388/152158030-2d2a26e9-71e9-4abd-8f04-0330424a32f6.png) + + + **For Machine 2** + + + ![image](https://user-images.githubusercontent.com/95343388/152291760-fffbe61f-3158-4f3f-b225-e805c608849c.png) + + + +#### Verify the Edge cluster by running command in 'Cloud Core Node' (Machine-1): + + + kubectl get edgecluster + + + + ![image](https://user-images.githubusercontent.com/95343388/152162045-d6143680-14eb-470c-89c6-6f4a21e54414.png) + + + + +#### To see Cloudcore & Edgecore logs: + + cd $HOME/go/src/github.com/fornax + cat cloudcore.logs + cat edgecore.logs diff --git a/fornax1.sh b/fornax1.sh index 12d1758..959638a 100644 --- a/fornax1.sh +++ b/fornax1.sh @@ -5,9 +5,9 @@ set -x -export a=192.168.2.50 -export b=192.168.2.51 -export c=192.168.2.52 +export a= +export b= +export c= #scp -r /root/fornaxscript/fornax2.sh $b:/root #scp -r /root/fornaxscript/fornax3.sh $c:/root @@ -93,6 +93,7 @@ git clone https://github.com/CentaurusInfra/fornax.git #echo yes | scp -r /etc/kubeedge/ca $c:/etc/kubeedge #scp -r /root/fornaxscript/fornax2.sh $b:/root #scp -r /root/fornaxscript/fornax3.sh $c:/root + sleep 5s cat cloudcore.logs #pushd /root #ssh -t root@$b "sudo bash fornax2.sh" diff --git a/fornax2.sh b/fornax2.sh index 56e390d..ce6058a 100644 --- a/fornax2.sh +++ b/fornax2.sh @@ -5,8 +5,9 @@ set -x -export a=192.168.2.50 -export b=192.168.2.51 +export a= +export b= +export c= pushd /root hostnamectl set-hostname node-b @@ -14,8 +15,8 @@ ufw disable swapoff -a mkdir -p /etc/kubeedge/ca mkdir -p /etc/kubeedge/certs -echo yes | scp -r $a:/etc/kubeedge/certs /etc/kubeedge -echo yes | scp -r $a:/etc/kubeedge/ca /etc/kubeedge +#echo yes | scp -r $a:/etc/kubeedge/certs /etc/kubeedge +#echo yes | scp -r $a:/etc/kubeedge/ca /etc/kubeedge apt-get -y update echo -e 'br_netfilter' | cat > /etc/modules-load.d/k8s.conf echo -e 'net.bridge.bridge-nf-call-ip6tables = 1\nnet.bridge.bridge-nf-call-iptables = 1' | cat >> /etc/sysctl.d/k8s.conf @@ -81,8 +82,8 @@ git clone https://github.com/CentaurusInfra/fornax.git nohup _output/local/bin/edgecore --edgecluster > edgecore.logs 2>&1 & export KUBECONFIG=/etc/kubernetes/admin.conf nohup _output/local/bin/cloudcore > cloudcore.logs 2>&1 & - #ssh -t root@$c "mkdir -p /root/go/src/github.com/kubeedge" - #echo yes | scp -r /etc/kubernetes/admin.conf $c:/root/go/src/github.com/kubeedge + #ssh -t root@$c "mkdir -p /root/go/src/github.com" + echo yes | scp -r /etc/kubernetes/admin.conf $c:/root/ ssh -t root@$c "mkdir -p /etc/kubeedge" echo yes | scp -r /etc/kubeedge/certs $c:/etc/kubeedge echo yes | scp -r /etc/kubeedge/ca $c:/etc/kubeedge diff --git a/fornax3.sh b/fornax3.sh index fc876fa..3349277 100644 --- a/fornax3.sh +++ b/fornax3.sh @@ -5,15 +5,15 @@ set -x -export b=192.168.2.51 -export c=192.168.2.52 +export b= +export c= pushd /root hostnamectl set-hostname node-c ufw disable swapoff -a -mkdir -p /etc/kubeedge/ca -mkdir -p /etc/kubeedge/certs +#mkdir -p /etc/kubeedge/ca +#mkdir -p /etc/kubeedge/certs apt-get -y update echo -e 'br_netfilter' | cat > /etc/modules-load.d/k8s.conf echo -e 'net.bridge.bridge-nf-call-ip6tables = 1\nnet.bridge.bridge-nf-call-iptables = 1' | cat >> /etc/sysctl.d/k8s.conf @@ -53,10 +53,11 @@ pushd /root/go/src/github.com git clone https://github.com/CentaurusInfra/fornax.git mv fornax kubeedge pushd /root/go/src/github.com/kubeedge - ssh -t root@$b "echo yes | scp -r /etc/kubernetes/admin.conf $c:/root/go/src/github.com/kubeedge" + #ssh -t root@$b "echo yes | scp -r /etc/kubernetes/admin.conf $c:/root/go/src/github.com/kubeedge" #echo yes | scp -r $b:/etc/kubeedge/certs /etc/kubeedge #echo yes | scp -r $b:/etc/kubeedge/ca /etc/kubeedge #echo yes | scp -r $b:/etc/kubernetes/admin.conf /root/go/src/github.com/kubeedge + cp /root/admin.conf /root/go/src/github.com/kubeedge make all make WHAT=edgecore mkdir /etc/kubeedge/config -p