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
ac12665f
Commit
ac12665f
authored
Mar 25, 2015
by
Justin Santa Barbara
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Quote AWS_SSH_KEY
parent
80ba56a3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
12 deletions
+12
-12
util.sh
cluster/aws/util.sh
+12
-12
No files found.
cluster/aws/util.sh
View file @
ac12665f
...
@@ -341,13 +341,13 @@ function kube-up {
...
@@ -341,13 +341,13 @@ function kube-up {
local
htpasswd
local
htpasswd
htpasswd
=
$(
cat
"
${
KUBE_TEMP
}
/htpasswd"
)
htpasswd
=
$(
cat
"
${
KUBE_TEMP
}
/htpasswd"
)
if
[[
!
-f
$AWS_SSH_KEY
]]
;
then
if
[[
!
-f
"
$AWS_SSH_KEY
"
]]
;
then
ssh-keygen
-f
$AWS_SSH_KEY
-N
''
ssh-keygen
-f
"
$AWS_SSH_KEY
"
-N
''
fi
fi
detect-image
detect-image
$AWS_CMD
import-key-pair
--key-name
kubernetes
--public-key-material
file://
$AWS_SSH_KEY
.pub
>
$LOG
2>&1
||
true
$AWS_CMD
import-key-pair
--key-name
kubernetes
--public-key-material
"file://
$AWS_SSH_KEY
.pub"
>
$LOG
2>&1
||
true
VPC_ID
=
$(
$AWS_CMD
describe-vpcs | get_vpc_id
)
VPC_ID
=
$(
$AWS_CMD
describe-vpcs | get_vpc_id
)
...
@@ -474,7 +474,7 @@ function kube-up {
...
@@ -474,7 +474,7 @@ function kube-up {
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
=
""
output
=
$(
ssh
-oStrictHostKeyChecking
=
no
-i
"
${
AWS_SSH_KEY
}
"
ubuntu@
${
KUBE_MASTER_IP
}
pgrep salt-master 2>
$LOG
)
||
output
=
""
if
[[
-z
"
${
output
}
"
]]
;
then
if
[[
-z
"
${
output
}
"
]]
;
then
if
((
attempt
>
30
))
;
then
if
((
attempt
>
30
))
;
then
echo
echo
...
@@ -561,7 +561,7 @@ function kube-up {
...
@@ -561,7 +561,7 @@ function kube-up {
sleep
10
sleep
10
done
done
echo
"Re-running salt highstate"
echo
"Re-running salt highstate"
ssh
-oStrictHostKeyChecking
=
no
-i
${
AWS_SSH_KEY
}
ubuntu@
${
KUBE_MASTER_IP
}
sudo
salt
'*'
state.highstate
>
$LOG
ssh
-oStrictHostKeyChecking
=
no
-i
"
${
AWS_SSH_KEY
}
"
ubuntu@
${
KUBE_MASTER_IP
}
sudo
salt
'*'
state.highstate
>
$LOG
echo
"Waiting for cluster initialization."
echo
"Waiting for cluster initialization."
echo
echo
...
@@ -594,9 +594,9 @@ function kube-up {
...
@@ -594,9 +594,9 @@ function kube-up {
(
(
mkdir
-p
"
${
config_dir
}
"
mkdir
-p
"
${
config_dir
}
"
umask
077
umask
077
ssh
-oStrictHostKeyChecking
=
no
-i
${
AWS_SSH_KEY
}
ubuntu@
${
KUBE_MASTER_IP
}
sudo cat
/srv/kubernetes/kubecfg.crt
>
"
${
config_dir
}
/
${
kube_cert
}
"
2>
$LOG
ssh
-oStrictHostKeyChecking
=
no
-i
"
${
AWS_SSH_KEY
}
"
ubuntu@
${
KUBE_MASTER_IP
}
sudo cat
/srv/kubernetes/kubecfg.crt
>
"
${
config_dir
}
/
${
kube_cert
}
"
2>
$LOG
ssh
-oStrictHostKeyChecking
=
no
-i
${
AWS_SSH_KEY
}
ubuntu@
${
KUBE_MASTER_IP
}
sudo cat
/srv/kubernetes/kubecfg.key
>
"
${
config_dir
}
/
${
kube_key
}
"
2>
$LOG
ssh
-oStrictHostKeyChecking
=
no
-i
"
${
AWS_SSH_KEY
}
"
ubuntu@
${
KUBE_MASTER_IP
}
sudo cat
/srv/kubernetes/kubecfg.key
>
"
${
config_dir
}
/
${
kube_key
}
"
2>
$LOG
ssh
-oStrictHostKeyChecking
=
no
-i
${
AWS_SSH_KEY
}
ubuntu@
${
KUBE_MASTER_IP
}
sudo cat
/srv/kubernetes/ca.crt
>
"
${
config_dir
}
/
${
ca_cert
}
"
2>
$LOG
ssh
-oStrictHostKeyChecking
=
no
-i
"
${
AWS_SSH_KEY
}
"
ubuntu@
${
KUBE_MASTER_IP
}
sudo cat
/srv/kubernetes/ca.crt
>
"
${
config_dir
}
/
${
ca_cert
}
"
2>
$LOG
"
${
kubectl
}
"
config set-cluster
"
${
context
}
"
--server
=
"https://
${
KUBE_MASTER_IP
}
"
--certificate-authority
=
"
${
config_dir
}
/
${
ca_cert
}
"
--global
"
${
kubectl
}
"
config set-cluster
"
${
context
}
"
--server
=
"https://
${
KUBE_MASTER_IP
}
"
--certificate-authority
=
"
${
config_dir
}
/
${
ca_cert
}
"
--global
"
${
kubectl
}
"
config set-credentials
"
${
user
}
"
--auth-path
=
"
${
config_dir
}
/
${
kube_auth
}
"
--global
"
${
kubectl
}
"
config set-credentials
"
${
user
}
"
--auth-path
=
"
${
config_dir
}
/
${
kube_auth
}
"
--global
...
@@ -634,7 +634,7 @@ EOF
...
@@ -634,7 +634,7 @@ EOF
local
minion_name
=
${
MINION_NAMES
[
$i
]
}
local
minion_name
=
${
MINION_NAMES
[
$i
]
}
local
minion_ip
=
${
KUBE_MINION_IP_ADDRESSES
[
$i
]
}
local
minion_ip
=
${
KUBE_MINION_IP_ADDRESSES
[
$i
]
}
echo
-n
Attempt
"
$((
$attempt
+
1
))
"
to check Docker on node
"
${
minion_name
}
@
${
minion_ip
}
"
...
echo
-n
Attempt
"
$((
$attempt
+
1
))
"
to check Docker on node
"
${
minion_name
}
@
${
minion_ip
}
"
...
local
output
=
$(
ssh
-oStrictHostKeyChecking
=
no
-i
${
AWS_SSH_KEY
}
ubuntu@
$minion_ip
sudo
docker ps
-a
2>/dev/null
)
local
output
=
$(
ssh
-oStrictHostKeyChecking
=
no
-i
"
${
AWS_SSH_KEY
}
"
ubuntu@
$minion_ip
sudo
docker ps
-a
2>/dev/null
)
if
[[
-z
"
${
output
}
"
]]
;
then
if
[[
-z
"
${
output
}
"
]]
;
then
if
((
attempt
>
9
))
;
then
if
((
attempt
>
9
))
;
then
echo
echo
...
@@ -658,7 +658,7 @@ EOF
...
@@ -658,7 +658,7 @@ EOF
fi
fi
echo
-e
"
${
color_yellow
}
[not working yet]
${
color_norm
}
"
echo
-e
"
${
color_yellow
}
[not working yet]
${
color_norm
}
"
# Start Docker, in case it failed to start.
# Start Docker, in case it failed to start.
ssh
-oStrictHostKeyChecking
=
no
-i
${
AWS_SSH_KEY
}
ubuntu@
$minion_ip
sudo
service docker start
>
$LOG
2>&1
ssh
-oStrictHostKeyChecking
=
no
-i
"
${
AWS_SSH_KEY
}
"
ubuntu@
$minion_ip
sudo
service docker start
>
$LOG
2>&1
attempt
=
$((
$attempt
+
1
))
attempt
=
$((
$attempt
+
1
))
sleep
30
sleep
30
done
done
...
@@ -758,7 +758,7 @@ function kube-push {
...
@@ -758,7 +758,7 @@ function kube-push {
echo
"echo Executing configuration"
echo
"echo Executing configuration"
echo
"sudo salt '*' mine.update"
echo
"sudo salt '*' mine.update"
echo
"sudo salt --force-color '*' state.highstate"
echo
"sudo salt --force-color '*' state.highstate"
)
| ssh
-oStrictHostKeyChecking
=
no
-i
${
AWS_SSH_KEY
}
ubuntu@
${
KUBE_MASTER_IP
}
sudo
bash
)
| ssh
-oStrictHostKeyChecking
=
no
-i
"
${
AWS_SSH_KEY
}
"
ubuntu@
${
KUBE_MASTER_IP
}
sudo
bash
get-password
get-password
...
@@ -811,7 +811,7 @@ function ssh-to-node {
...
@@ -811,7 +811,7 @@ function ssh-to-node {
fi
fi
for
try
in
$(
seq
1 5
)
;
do
for
try
in
$(
seq
1 5
)
;
do
if
ssh
-oLogLevel
=
quiet
-oStrictHostKeyChecking
=
no
-i
${
AWS_SSH_KEY
}
ubuntu@
${
ip
}
"
${
cmd
}
"
;
then
if
ssh
-oLogLevel
=
quiet
-oStrictHostKeyChecking
=
no
-i
"
${
AWS_SSH_KEY
}
"
ubuntu@
${
ip
}
"
${
cmd
}
"
;
then
break
break
fi
fi
done
done
...
...
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