X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=blobdiff_plain;f=scripts%2Fsetup.sh;h=5b246c505d97b35b52760730a87f180b14fb3ba2;hb=c4fec5378030c1652c8bfcad929a5c6983838974;hp=9b2a6955723295ff6c8478bddda36f886b93014f;hpb=fd64df9852e4701aaa074676e35518f9b53d1b74;p=eliot.git diff --git a/scripts/setup.sh b/scripts/setup.sh index 9b2a695..5b246c5 100755 --- a/scripts/setup.sh +++ b/scripts/setup.sh @@ -46,7 +46,7 @@ setup_k8smaster() source common.sh | tee eliotcommon.log source k8smaster.sh | tee kubeadm.log # Setup ELIOT Node - setup_k8sworkers + oscheck_edge } setup_k8sworkers() @@ -85,11 +85,7 @@ setup_k8smaster_centos() source k8smaster_centos.sh | tee kubeadm_centos.log # Setup ELIOT Node - setup_k8sworkers_centos - - kubectl apply -f cni/calico/rbac.yaml - kubectl apply -f cni/calico/calico.yaml - + oscheck_edge } @@ -119,6 +115,25 @@ setup_k8sworkers_centos() } +# 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. verify_k8s_status(){