2 ##############################################################################
3 # Copyright (c) 2019 Huawei Tech and others.
5 # All rights reserved. This program and the accompanying materials
6 # are made available under the terms of the Apache License, Version 2.0
7 # which accompanies this distribution, and is available at
8 # http://www.apache.org/licenses/LICENSE-2.0
9 ##############################################################################
13 git clone https://github.com/kubeedge/kubeedge.git $GOPATH/src/github.com/kubeedge/kubeedge
14 cd $GOPATH/src/github.com/kubeedge/kubeedge/keadm
19 common_steps="git clone https://github.com/kubeedge/kubeedge.git $GOPATH/src/github.com/kubeedge/kubeedge &&\
20 cd $GOPATH/src/github.com/kubeedge/kubeedge/keadm &&\
24 certif_copy="cd /etc/kubeedge &&\
27 edge_start="kubeedge join --edgecontrollerip=${nodeip} --edgenodeid=eliot_edge_01"
29 execute_keedge_controller(){
30 cd $GOPATH/src/github.com/kubeedge/kubeedge/keadm
31 sudo chmod +x kubeedge
40 execute_keedge_controller
45 nodeusr=$(echo ${nodeinfo} | cut -d"|" -f1)
46 nodeip=$(echo ${nodeinfo} | cut -d"|" -f2)
47 nodepaswd=$(echo ${nodeinfo} | cut -d"|" -f3)
48 masternodeip=$(echo ${nodeinfo} | cut -d"|" -f3)
50 sshpass -p ${nodepaswd} ssh ${nodeusr}@${nodeip} ${common_steps} < /dev/null
51 sshpass -p ${nodepaswd} scp /etc/kubeedge/certs.tar.gz ${nodeusr}@${nodepaswd}:/etc/kubeedge
53 sshpass -p ${nodepaswd} \
54 tar -xvzf /etc/kubeedge/certs.tgz
56 sshpass -p ${nodepaswd} ssh ${nodeusr}@${nodeip} kubeedge join --edgecontrollerip=${masternodeip} --edgenodeid=eliot_edge_01 \
57 --k8sserverip=${masternodeip}:8080
62 kubectl create -f deployment.yaml