2020 fi
2121done
2222if [[ " $host_ip " != " $host_prev_ip " ]]; then
23- echo " IP changed"
24- CHANGE_MSG=" Warning: The Edge Node IP($host_ip ) has changed since k3s install!"
23+ echo " The Edge Node IP($host_ip ) has changed since k3s install"
2524 banner="
2625================================================================================
27- Edge Microvisor Toolkit - cluster bring up problem
28-
29- ****Looks the IP address of the system chnaged since k3s install*****
30-
3126OLD k3s cluster IP $host_prev_ip
3227NEW k3s cluster IP $host_ip
33-
34- IP address of the Node:
35- $host_prev_ip - Ensure IP address is persistent across the reboot!
36- See: https://ranchermanager.docs.rancher.com/getting-started
37- /installation-and-upgrade/installation-requirements#node-ip-
38- addresses $CHANGE_MSG
39-
4028=================================================================================
4129"
4230 # Print the banner
4331 sleep 10
4432 echo " $banner " | sudo tee /dev/tty0
45- else
46- CHANGE_MSG=" IP address remained same after reboot."
33+
4734 while [ true ]
4835 do
4936 k3s_status=$( systemctl is-active k3s)
5037 if [[ " $k3s_status " == " active" ]]; then
51-
52- echo " Waiting for all extensions to complete the deployment..." | sudo tee /dev/tty0
53- while sudo -E KUBECONFIG=/etc/rancher/k3s/k3s.yaml /usr/bin/k3s kubectl get pods --all-namespaces --field-selector=status.phase! =Running,status.phase! =Succeeded --no-headers | grep -q . ; do
54- echo " Some pods are still not ready. Checking again in 5 seconds..." | sudo tee /dev/tty0
55- sleep 5
56- done
38+ echo " Reconfiguring cluster..." | sudo tee /dev/tty0
39+ k3s kubectl delete node edgemicrovisortoolkit
40+ sudo systemctl restart k3s
41+ echo " Restarted k3s" | sudo tee /dev/tty0
5742 break
5843 else
59- echo " Waiting for k3s services to running state,please wait checking again in few seconds" | sudo tee /dev/tty0
60- sleep 30
44+ echo " K3s service is still not active. Checking in 10 seconds... " | sudo tee /dev/tty0
45+ sleep 10
6146 fi
6247 done
48+ echo $host_ip > $IPCHECK
49+ fi
6350
64- # Print banner
51+ while [ true ]
52+ do
53+ k3s_status=$( systemctl is-active k3s)
54+ if [[ " $k3s_status " == " active" ]]; then
55+
56+ echo " Waiting for all extensions to complete the deployment..." | sudo tee /dev/tty0
57+ while sudo -E KUBECONFIG=/etc/rancher/k3s/k3s.yaml /usr/bin/k3s kubectl get pods --all-namespaces --field-selector=status.phase! =Running,status.phase! =Succeeded --no-headers | grep -q . ; do
58+ echo " Some pods are still not ready. Checking again in 5 seconds..." | sudo tee /dev/tty0
59+ sleep 5
60+ done
61+ break
62+ else
63+ echo " Waiting for k3s services to running state,please wait checking again in few seconds" | sudo tee /dev/tty0
64+ sleep 30
65+ fi
66+ done
6567
66- banner="
68+ # Print banner
69+
70+ banner="
6771===================================================================
6872Edge Microvisor Toolkit - cluster bringup complete
6973Logs located at:
@@ -72,12 +76,6 @@ Logs located at:
7276For k3s logs run:
7377 sudo journalctl -fu k3s
7478
75- IP address of the Node:
76- $IP - Ensure IP address is persistent across the reboot!
77- See: https://ranchermanager.docs.rancher.com/getting-started
78- /installation-and-upgrade/installation-requirements#node-ip-
79- addresses $CHANGE_MSG
80-
8179To access and view the cluster's pods run:
8280 source /etc/environment
8381 export KUBECONFIG
@@ -87,6 +85,5 @@ KUBECONFIG available at:
8785 /etc/rancher/k3s/k3s.yaml
8886===================================================================
8987"
90- # Print the banner
91- echo " $banner " | sudo tee /dev/tty0
92- fi
88+ # Print the banner
89+ echo " $banner " | sudo tee /dev/tty0
0 commit comments