Commit 8077df69 authored by Spiros Koulouzis's avatar Spiros Koulouzis

connect weave both ways

parent f26a9370
...@@ -4,4 +4,5 @@ sudo curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add ...@@ -4,4 +4,5 @@ sudo curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add
echo "deb http://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.list echo "deb http://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.list
sudo apt-get update sudo apt-get update
sudo apt-get install -y docker-engine sudo apt-get install -y docker-engine
sudo apt-get install -y kubelet kubeadm kubectl kubernetes-cni sudo apt-get install -y kubelet kubeadm kubectl kubernetes-cni
\ No newline at end of file
...@@ -111,10 +111,11 @@ def connect_wave(vm_list,master): ...@@ -111,10 +111,11 @@ def connect_wave(vm_list,master):
paramiko.util.log_to_file("deployment.log") paramiko.util.log_to_file("deployment.log")
ssh = paramiko.SSHClient() ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect(master.ip, username=master.user, key_filename=master.key)
for i in vm_list: for i in vm_list:
if i.role == "slave": if i.role == "slave":
ssh.connect(master.ip, username=master.user, key_filename=master.key)
logger.info("weave connect "+(i.ip)) logger.info("weave connect "+(i.ip))
stdin, stdout, stderr = ssh.exec_command("sudo weave connect "+i.ip) stdin, stdout, stderr = ssh.exec_command("sudo weave connect "+i.ip)
out = stdout.read() out = stdout.read()
...@@ -122,6 +123,13 @@ def connect_wave(vm_list,master): ...@@ -122,6 +123,13 @@ def connect_wave(vm_list,master):
logger.info("stdout: "+(out)) logger.info("stdout: "+(out))
logger.info("stderr: "+(err)) logger.info("stderr: "+(err))
ssh.connect(i.ip, username=master.user, key_filename=i.key)
stdin, stdout, stderr = ssh.exec_command("sudo weave connect "+master.ip)
out = stdout.read()
err = stderr.read()
logger.info("stdout: "+(out))
logger.info("stderr: "+(err))
logger.info("Finished wave connection on: "+(master.ip)) logger.info("Finished wave connection on: "+(master.ip))
except Exception as e: except Exception as e:
global retry global retry
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment