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
15 cd $GOPATH/src/github.com/kubeedge/kubeedge/keadm
17 #kubectl apply -f https://docs.projectcalico.org/v3.3/getting-started/kubernetes/installation/hosted/rbac-kdd.yaml
18 #kubectl apply -f https://docs.projectcalico.org/v3.3/getting-started/kubernetes/installation/hosted/rbac-kdd.yaml
21 source config_kubeedge
22 common_steps="git clone https://github.com/kubeedge/kubeedge.git $GOPATH/src/github.com/kubeedge/kubeedge && \
23 source ~/.profile && \
24 cd $GOPATH/src/github.com/kubeedge/kubeedge/keadm && \
28 certif_copy="cd /etc/kubeedge &&\
31 edge_start="cd $GOPATH/src/github.com/kubeedge/kubeedge/keadm && \
32 chmod +x kubeedge && \
33 ./kubeedge join --edgecontrollerip=$masternodeip --edgenodeid=eliotedge02 --k8sserverip=$masternodeip:8080"
35 execute_keedge_controller(){
36 cd $GOPATH/src/github.com/kubeedge/kubeedge/keadm
37 sudo chmod +x kubeedge
44 cd $HOME/eliot/scripts/src
45 sshpass -p ${edgenodepassword} scp $HOME/release/eliot/scripts/src/config_kubeedge ${edgenodeusr}@${edgenodeip}:/root
47 sshpass -p ${edgenodepassword} ssh ${edgenodeusr}@${edgenodeip} \
48 source config_kubeedge
50 source config_kubeedge
51 sshpass -p ${edgenodepassword} ssh ${edgenodeusr}@${edgenodeip} ${common_steps} < /dev/null
52 echo "after common_steps"
53 sshpass -p ${edgenodepassword} scp /etc/kubeedge/certs.tgz ${edgenodeusr}@${edgenodeip}:/etc/kubeedge
55 sshpass -p ${edgenodepassword} \
56 ssh ${edgenodeusr}@${edgenodeip} \
57 tar -xvzf /etc/kubeedge/certs.tgz --directory /etc/kubeedge
59 sshpass -p ${edgenodepassword} ssh ${edgenodeusr}@${edgenodeip} ${edge_start} < /dev/null
64 source config_kubeedge
69 execute_keedge_controller
76 kubectl create -f deployment.yaml