Change-Id: I3bf02a3714892208dd7440a7edd5ac63f606d7c0
--- /dev/null
+edgenodeusr="root"
+edgenodeip="10.10.0.54"
+edgenodepassword="Huawei@akraino"
+masternodeusr="root"
+masternodeip="10.10.0.45"
+masternodepassword="Huawei@akraino"
take_keedge(){
git clone https://github.com/kubeedge/kubeedge.git $GOPATH/src/github.com/kubeedge/kubeedge
take_keedge(){
git clone https://github.com/kubeedge/kubeedge.git $GOPATH/src/github.com/kubeedge/kubeedge
cd $GOPATH/src/github.com/kubeedge/kubeedge/keadm
make
cd $GOPATH/src/github.com/kubeedge/kubeedge/keadm
make
+ #kubectl apply -f https://docs.projectcalico.org/v3.3/getting-started/kubernetes/installation/hosted/rbac-kdd.yaml
+ #kubectl apply -f https://docs.projectcalico.org/v3.3/getting-started/kubernetes/installation/hosted/rbac-kdd.yaml
-common_steps="git clone https://github.com/kubeedge/kubeedge.git $GOPATH/src/github.com/kubeedge/kubeedge &&\
-cd $GOPATH/src/github.com/kubeedge/kubeedge/keadm &&\
-make &&\
+source config_kubeedge
+common_steps="git clone https://github.com/kubeedge/kubeedge.git $GOPATH/src/github.com/kubeedge/kubeedge && \
+source ~/.profile && \
+cd $GOPATH/src/github.com/kubeedge/kubeedge/keadm && \
+make && \
chmod +x kubeedge"
certif_copy="cd /etc/kubeedge &&\
scp certs.tar.gz"
chmod +x kubeedge"
certif_copy="cd /etc/kubeedge &&\
scp certs.tar.gz"
-edge_start="kubeedge join --edgecontrollerip=${nodeip} --edgenodeid=eliot_edge_01"
+edge_start="cd $GOPATH/src/github.com/kubeedge/kubeedge/keadm && \
+chmod +x kubeedge && \
+./kubeedge join --edgecontrollerip=$masternodeip --edgenodeid=eliotedge02 --k8sserverip=$masternodeip:8080"
execute_keedge_controller(){
cd $GOPATH/src/github.com/kubeedge/kubeedge/keadm
execute_keedge_controller(){
cd $GOPATH/src/github.com/kubeedge/kubeedge/keadm
+ cd $HOME/eliot/scripts/src
+ sshpass -p ${edgenodepassword} scp $HOME/release/eliot/scripts/src/config_kubeedge ${edgenodeusr}@${edgenodeip}:/root
-execute_keedge_controller
+ sshpass -p ${edgenodepassword} ssh ${edgenodeusr}@${edgenodeip} \
+ source config_kubeedge
+
+ source config_kubeedge
+ sshpass -p ${edgenodepassword} ssh ${edgenodeusr}@${edgenodeip} ${common_steps} < /dev/null
+echo "after common_steps"
+ sshpass -p ${edgenodepassword} scp /etc/kubeedge/certs.tgz ${edgenodeusr}@${edgenodeip}:/etc/kubeedge
-while read line
-do
- nodeinfo="${line}"
- nodeusr=$(echo ${nodeinfo} | cut -d"|" -f1)
- nodeip=$(echo ${nodeinfo} | cut -d"|" -f2)
- nodepaswd=$(echo ${nodeinfo} | cut -d"|" -f3)
- masternodeip=$(echo ${nodeinfo} | cut -d"|" -f3)
+ sshpass -p ${edgenodepassword} \
+ ssh ${edgenodeusr}@${edgenodeip} \
+ tar -xvzf /etc/kubeedge/certs.tgz --directory /etc/kubeedge
+
+ sshpass -p ${edgenodepassword} ssh ${edgenodeusr}@${edgenodeip} ${edge_start} < /dev/null
+}
- sshpass -p ${nodepaswd} ssh ${nodeusr}@${nodeip} ${common_steps} < /dev/null
- sshpass -p ${nodepaswd} scp /etc/kubeedge/certs.tar.gz ${nodeusr}@${nodepaswd}:/etc/kubeedge
- sshpass -p ${nodepaswd} \
- tar -xvzf /etc/kubeedge/certs.tgz
+source config_kubeedge
+#sample
+#return
+take_keedge
- sshpass -p ${nodepaswd} ssh ${nodeusr}@${nodeip} kubeedge join --edgecontrollerip=${masternodeip} --edgenodeid=eliot_edge_01 \
- --k8sserverip=${masternodeip}:8080
-done < nodelist
+execute_keedge_controller
+#sample
+#execute_edge
+exec_edge
kubectl get nodes
kubectl create -f deployment.yaml
kubectl get nodes
kubectl create -f deployment.yaml
+++ /dev/null
-<eliotedgenodeusr>|<eliotedgenodeip>|<eliotedgenodepassword>|<eliotmasternodeusr>|<eliotmasternodeip>|<eliotmasternodepassword>