Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CONF
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
UvA
CONF
Commits
fcc0bb18
Commit
fcc0bb18
authored
May 09, 2017
by
Spiros Koulouzis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed file not found bug
parent
cef30a0f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
1 deletion
+10
-1
docker_kubernetes.py
drip-deployer/docker_kubernetes.py
+10
-1
docker_kubernetes.pyc
drip-deployer/docker_kubernetes.pyc
+0
-0
No files found.
drip-deployer/docker_kubernetes.py
View file @
fcc0bb18
...
@@ -35,6 +35,10 @@ def PrintException():
...
@@ -35,6 +35,10 @@ def PrintException():
def
install_manager
(
vm
):
def
install_manager
(
vm
):
try
:
try
:
print
"
%
s: ====== Start Kubernetes Master Installing ======"
%
(
vm
.
ip
)
print
"
%
s: ====== Start Kubernetes Master Installing ======"
%
(
vm
.
ip
)
parentDir
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
vm
.
key
))
os
.
chmod
(
parentDir
,
0o700
)
os
.
chmod
(
vm
.
key
,
0o600
)
ssh
=
paramiko
.
SSHClient
()
ssh
=
paramiko
.
SSHClient
()
ssh
.
set_missing_host_key_policy
(
paramiko
.
AutoAddPolicy
())
ssh
.
set_missing_host_key_policy
(
paramiko
.
AutoAddPolicy
())
ssh
.
connect
(
vm
.
ip
,
username
=
vm
.
user
,
key_filename
=
vm
.
key
)
ssh
.
connect
(
vm
.
ip
,
username
=
vm
.
user
,
key_filename
=
vm
.
key
)
...
@@ -48,8 +52,10 @@ def install_manager(vm):
...
@@ -48,8 +52,10 @@ def install_manager(vm):
stdout
.
read
()
stdout
.
read
()
stdin
,
stdout
,
stderr
=
ssh
.
exec_command
(
"sudo sh /tmp/kubernetes_setup.sh"
)
stdin
,
stdout
,
stderr
=
ssh
.
exec_command
(
"sudo sh /tmp/kubernetes_setup.sh"
)
stdout
.
read
()
stdout
.
read
()
stdin
,
stdout
,
stderr
=
ssh
.
exec_command
(
"sudo kubeadm reset"
)
stdout
.
read
()
stdin
,
stdout
,
stderr
=
ssh
.
exec_command
(
"sudo kubeadm init --api
-advertise-addresse
s=
%
s"
%
(
vm
.
ip
))
stdin
,
stdout
,
stderr
=
ssh
.
exec_command
(
"sudo kubeadm init --api
server-advertise-addres
s=
%
s"
%
(
vm
.
ip
))
retstr
=
stdout
.
readlines
()
retstr
=
stdout
.
readlines
()
stdin
,
stdout
,
stderr
=
ssh
.
exec_command
(
"sudo cp /etc/kubernetes/admin.conf /tmp/"
)
stdin
,
stdout
,
stderr
=
ssh
.
exec_command
(
"sudo cp /etc/kubernetes/admin.conf /tmp/"
)
...
@@ -87,6 +93,8 @@ def install_worker(join_cmd, vm):
...
@@ -87,6 +93,8 @@ def install_worker(join_cmd, vm):
stdout
.
read
()
stdout
.
read
()
stdin
,
stdout
,
stderr
=
ssh
.
exec_command
(
"sudo sh /tmp/kubernetes_setup.sh"
)
stdin
,
stdout
,
stderr
=
ssh
.
exec_command
(
"sudo sh /tmp/kubernetes_setup.sh"
)
stdout
.
read
()
stdout
.
read
()
stdin
,
stdout
,
stderr
=
ssh
.
exec_command
(
"sudo kubeadm reset"
)
stdout
.
read
()
stdin
,
stdout
,
stderr
=
ssh
.
exec_command
(
"sudo
%
s"
%
(
join_cmd
))
stdin
,
stdout
,
stderr
=
ssh
.
exec_command
(
"sudo
%
s"
%
(
join_cmd
))
stdout
.
read
()
stdout
.
read
()
print
"
%
s: ========= Kubernetes Slave Installed ========="
%
(
vm
.
ip
)
print
"
%
s: ========= Kubernetes Slave Installed ========="
%
(
vm
.
ip
)
...
@@ -113,6 +121,7 @@ def run(vm_list):
...
@@ -113,6 +121,7 @@ def run(vm_list):
if
"ERROR"
in
worker_cmd
:
if
"ERROR"
in
worker_cmd
:
return
worker_cmd
return
worker_cmd
file_path
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))
kuber_file
=
open
(
file_path
+
"/admin.conf"
,
"r"
)
kuber_file
=
open
(
file_path
+
"/admin.conf"
,
"r"
)
kuber_string
=
kuber_file
.
read
()
kuber_string
=
kuber_file
.
read
()
kuber_file
.
close
()
kuber_file
.
close
()
...
...
drip-deployer/docker_kubernetes.pyc
View file @
fcc0bb18
No preview for this file type
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment