Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
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
Jacklull
k3s
Commits
e14d9038
Commit
e14d9038
authored
Jun 08, 2015
by
krousey
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #9367 from justinsb/aws_ssh_check
AWS: Check for SSH connectivity & better logging on failure
parents
f5d0b0d6
72496e73
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
2 deletions
+31
-2
util.sh
cluster/aws/util.sh
+31
-2
No files found.
cluster/aws/util.sh
View file @
e14d9038
...
@@ -735,15 +735,44 @@ function kube-up {
...
@@ -735,15 +735,44 @@ function kube-up {
sleep
10
sleep
10
done
done
# Check for SSH connectivity
attempt
=
0
while
true
;
do
echo
-n
Attempt
"
$((
$attempt
+
1
))
"
to check
for
SSH to master
local
output
local
ok
=
1
output
=
$(
ssh
-oStrictHostKeyChecking
=
no
-i
"
${
AWS_SSH_KEY
}
"
ubuntu@
${
KUBE_MASTER_IP
}
uptime
2>
$LOG
)
||
ok
=
0
if
[[
${
ok
}
==
0
]]
;
then
if
((
attempt
>
30
))
;
then
echo
echo
"(Failed) output was:
${
output
}
"
echo
echo
-e
"
${
color_red
}
Unable to ssh to master on
${
KUBE_MASTER_IP
}
. Your cluster is unlikely"
>
&2
echo
"to work correctly. Please run ./cluster/kube-down.sh and re-create the"
>
&2
echo
-e
"cluster. (sorry!)
${
color_norm
}
"
>
&2
exit
1
fi
else
echo
-e
"
${
color_green
}
[ssh to master working]
${
color_norm
}
"
break
fi
echo
-e
"
${
color_yellow
}
[ssh to master not working yet]
${
color_norm
}
"
attempt
=
$((
$attempt
+
1
))
sleep
10
done
# We need the salt-master to be up for the minions to work
# We need the salt-master to be up for the minions to work
attempt
=
0
attempt
=
0
while
true
;
do
while
true
;
do
echo
-n
Attempt
"
$((
$attempt
+
1
))
"
to check
for
salt-master
echo
-n
Attempt
"
$((
$attempt
+
1
))
"
to check
for
salt-master
local
output
local
output
output
=
$(
ssh
-oStrictHostKeyChecking
=
no
-i
"
${
AWS_SSH_KEY
}
"
ubuntu@
${
KUBE_MASTER_IP
}
pgrep salt-master 2>
$LOG
)
||
output
=
""
local
ok
=
1
if
[[
-z
"
${
output
}
"
]]
;
then
output
=
$(
ssh
-oStrictHostKeyChecking
=
no
-i
"
${
AWS_SSH_KEY
}
"
ubuntu@
${
KUBE_MASTER_IP
}
pgrep salt-master 2>
$LOG
)
||
ok
=
0
if
[[
${
ok
}
==
0
]]
;
then
if
((
attempt
>
30
))
;
then
if
((
attempt
>
30
))
;
then
echo
echo
echo
"(Failed) output was:
${
output
}
"
echo
echo
-e
"
${
color_red
}
salt-master failed to start on
${
KUBE_MASTER_IP
}
. Your cluster is unlikely"
>
&2
echo
-e
"
${
color_red
}
salt-master failed to start on
${
KUBE_MASTER_IP
}
. Your cluster is unlikely"
>
&2
echo
"to work correctly. Please run ./cluster/kube-down.sh and re-create the"
>
&2
echo
"to work correctly. Please run ./cluster/kube-down.sh and re-create the"
>
&2
echo
-e
"cluster. (sorry!)
${
color_norm
}
"
>
&2
echo
-e
"cluster. (sorry!)
${
color_norm
}
"
>
&2
...
...
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