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
c8beaac5
Commit
c8beaac5
authored
Dec 17, 2015
by
Carles Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add root device detection to boot correctly
parent
0f144fd3
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
2 deletions
+23
-2
util.sh
cluster/aws/util.sh
+23
-2
No files found.
cluster/aws/util.sh
View file @
c8beaac5
...
@@ -85,8 +85,6 @@ NODE_SG_NAME="kubernetes-minion-${CLUSTER_ID}"
...
@@ -85,8 +85,6 @@ NODE_SG_NAME="kubernetes-minion-${CLUSTER_ID}"
# TODO: Actually mount the correct number (especially if we have more), though this is non-trivial, and
# TODO: Actually mount the correct number (especially if we have more), though this is non-trivial, and
# only affects the big storage instance types, which aren't a typical use case right now.
# only affects the big storage instance types, which aren't a typical use case right now.
BLOCK_DEVICE_MAPPINGS_BASE
=
"{
\"
DeviceName
\"
:
\"
/dev/sdc
\"
,
\"
VirtualName
\"
:
\"
ephemeral0
\"
},{
\"
DeviceName
\"
:
\"
/dev/sdd
\"
,
\"
VirtualName
\"
:
\"
ephemeral1
\"
},{
\"
DeviceName
\"
:
\"
/dev/sde
\"
,
\"
VirtualName
\"
:
\"
ephemeral2
\"
},{
\"
DeviceName
\"
:
\"
/dev/sdf
\"
,
\"
VirtualName
\"
:
\"
ephemeral3
\"
}"
BLOCK_DEVICE_MAPPINGS_BASE
=
"{
\"
DeviceName
\"
:
\"
/dev/sdc
\"
,
\"
VirtualName
\"
:
\"
ephemeral0
\"
},{
\"
DeviceName
\"
:
\"
/dev/sdd
\"
,
\"
VirtualName
\"
:
\"
ephemeral1
\"
},{
\"
DeviceName
\"
:
\"
/dev/sde
\"
,
\"
VirtualName
\"
:
\"
ephemeral2
\"
},{
\"
DeviceName
\"
:
\"
/dev/sdf
\"
,
\"
VirtualName
\"
:
\"
ephemeral3
\"
}"
MASTER_BLOCK_DEVICE_MAPPINGS
=
"[{
\"
DeviceName
\"
:
\"
/dev/sda1
\"
,
\"
Ebs
\"
:{
\"
DeleteOnTermination
\"
:true,
\"
VolumeSize
\"
:
${
MASTER_ROOT_DISK_SIZE
}
,
\"
VolumeType
\"
:
\"
${
MASTER_ROOT_DISK_TYPE
}
\"
}},
${
BLOCK_DEVICE_MAPPINGS_BASE
}
]"
NODE_BLOCK_DEVICE_MAPPINGS
=
"[{
\"
DeviceName
\"
:
\"
/dev/sda1
\"
,
\"
Ebs
\"
:{
\"
DeleteOnTermination
\"
:true,
\"
VolumeSize
\"
:
${
NODE_ROOT_DISK_SIZE
}
,
\"
VolumeType
\"
:
\"
${
NODE_ROOT_DISK_TYPE
}
\"
}},
${
BLOCK_DEVICE_MAPPINGS_BASE
}
]"
# TODO (bburns) Parameterize this for multiple cluster per project
# TODO (bburns) Parameterize this for multiple cluster per project
...
@@ -330,6 +328,27 @@ function detect-trusty-image () {
...
@@ -330,6 +328,27 @@ function detect-trusty-image () {
fi
fi
}
}
# Detects the RootDevice to use in the Block Device Mapping (considering the AMI)
#
# Vars set:
# MASTER_BLOCK_DEVICE_MAPPINGS
# NODE_BLOCK_DEVICE_MAPPINGS
#
function
detect-root-device
{
local
master_image
=
${
AWS_IMAGE
}
local
node_image
=
${
KUBE_NODE_IMAGE
}
ROOT_DEVICE_MASTER
=
$(
$AWS_CMD
describe-images
--image-ids
${
master_image
}
--query
'Images[].RootDeviceName'
)
if
[[
"
${
master_image
}
"
==
"
${
node_image
}
"
]]
;
then
ROOT_DEVICE_NODE
=
${
ROOT_DEVICE_MASTER
}
else
ROOT_DEVICE_NODE
=
$(
$AWS_CMD
describe-images
--image-ids
${
node_image
}
--query
'Images[].RootDeviceName'
)
fi
MASTER_BLOCK_DEVICE_MAPPINGS
=
"[{
\"
DeviceName
\"
:
\"
${
ROOT_DEVICE_MASTER
}
\"
,
\"
Ebs
\"
:{
\"
DeleteOnTermination
\"
:true,
\"
VolumeSize
\"
:
${
MASTER_ROOT_DISK_SIZE
}
,
\"
VolumeType
\"
:
\"
${
MASTER_ROOT_DISK_TYPE
}
\"
}},
${
BLOCK_DEVICE_MAPPINGS_BASE
}
]"
NODE_BLOCK_DEVICE_MAPPINGS
=
"[{
\"
DeviceName
\"
:
\"
${
ROOT_DEVICE_NODE
}
\"
,
\"
Ebs
\"
:{
\"
DeleteOnTermination
\"
:true,
\"
VolumeSize
\"
:
${
NODE_ROOT_DISK_SIZE
}
,
\"
VolumeType
\"
:
\"
${
NODE_ROOT_DISK_TYPE
}
\"
}},
${
BLOCK_DEVICE_MAPPINGS_BASE
}
]"
}
# Computes the AWS fingerprint for a public key file ($1)
# Computes the AWS fingerprint for a public key file ($1)
# $1: path to public key file
# $1: path to public key file
# Note that this is a different hash from the OpenSSH hash.
# Note that this is a different hash from the OpenSSH hash.
...
@@ -728,6 +747,8 @@ function kube-up {
...
@@ -728,6 +747,8 @@ function kube-up {
detect-image
detect-image
detect-minion-image
detect-minion-image
detect-root-device
find-release-tars
find-release-tars
ensure-temp-dir
ensure-temp-dir
...
...
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