X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=blobdiff_plain;f=scripts%2Fsetup.sh;h=5b246c505d97b35b52760730a87f180b14fb3ba2;hb=HEAD;hp=a619e864d4b77945282625c7e28e415c67c6bc17;hpb=e299906980a364a46c3566a5ea30be86e894e826;p=eliot.git diff --git a/scripts/setup.sh b/scripts/setup.sh index a619e86..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() @@ -60,8 +60,8 @@ setup_k8sworkers() #SETUP_WORKER_COMMON="cd eliot/scripts/ && source common.sh" SETUP_WORKER="cd eliot/scripts/ && source k8sworker.sh" - KUBEADM_JOIN=$(grep "kubeadm join" ./kubeadm.log) - KUBEADM_JOIN="sudo ${KUBEADM_JOIN}" + KUBEADM_TOKEN=$(kubeadm token create --print-join-command) + KUBEADM_JOIN="sudo ${KUBEADM_TOKEN}" # Read all the Worker Node details from nodelist file. while read line @@ -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(){ @@ -126,6 +141,12 @@ verify_k8s_status(){ source verifyk8s.sh | tee verifyk8s.log } + +install_edgex(){ + set -o xtrace + cd edgex && source edgexonk8s.sh +} + install_cadvisor_edge(){ set -o xtrace SETUP_CADVISOR_ATEDGE="cd eliot/scripts/ && source cadvisorsetup.sh" @@ -166,3 +187,12 @@ sleep 10 install_prometheus sleep 5 sudo docker ps | grep prometheus + +install_edgex +sleep 20 + +# Removing the taint from master node +kubectl taint nodes --all node-role.kubernetes.io/master- || true + +echo "ELIOT Setup execution is Completed..." +