+setup_k8sworkers_centos()
+{
+ set -o xtrace
+ # Install Docker on ELIOT Node
+
+ SETUP_WORKER_COMMON_CENTOS="sudo rm -rf ~/eliot &&\
+ git clone ${ELIOT_REPO} &&\
+ cd eliot/scripts/ && source common_centos.sh"
+
+ # SETUP_WORKER_COMMON_CENTOS="cd /root/eliot/scripts/ && source common_centos.sh"
+
+ KUBEADM_TOKEN=$(sudo kubeadm token create --print-join-command)
+ KUBEADM_JOIN_CENTOS="sudo ${KUBEADM_TOKEN}"
+ # Read all the Worker Node details from nodelist file.
+ while read line
+ do
+ nodeinfo="${line}" < /dev/null 2>&1
+ nodeusr=$(echo ${nodeinfo} | cut -d"|" -f1) < /dev/null
+ nodeip=$(echo ${nodeinfo} | cut -d"|" -f2) < /dev/null
+ nodepaswd=$(echo ${nodeinfo} | cut -d"|" -f3) < /dev/null
+ sudo sshpass -p ${nodepaswd} ssh ${nodeusr}@${nodeip} ${SETUP_WORKER_COMMON_CENTOS} < /dev/null
+ sudo sshpass -p ${nodepaswd} ssh ${nodeusr}@${nodeip} ${KUBEADM_JOIN_CENTOS} < /dev/null
+ done < nodelist > /dev/null 2>&1
+
+}
+
+# ELIOT edgenode os check and setup edge node
+oscheck_edge()
+{
+ while read line
+ do
+ nodeinfo="${line}"
+ nodeusr=$(echo ${nodeinfo} | cut -d"|" -f1)
+ nodeip=$(echo ${nodeinfo} | cut -d"|" -f2)
+ nodepaswd=$(echo ${nodeinfo} | cut -d"|" -f3)
+ if sshpass -p ${nodepaswd} ssh ${nodeusr}@${nodeip} [ $OSPLATFORM="*Ubuntu*" ]; then
+ setup_k8sworkers
+ elif sshpass -p ${nodepaswd} ssh ${nodeusr}@${nodeip} [ $OSPLATFORM="*CentOS*" ]; then
+ setup_k8sworkers_centos
+ kubectl apply -f cni/calico/rbac.yaml
+ kubectl apply -f cni/calico/calico.yaml
+ fi
+ done < nodelist > /dev/null 2>&1
+}
+
+# verify kubernetes setup by deploying nginx server.