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
784f555f
Commit
784f555f
authored
Feb 13, 2016
by
k8s-merge-robot
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #18821 from rastut/add_aws_detect_root_device
Auto commit by PR queue bot
parents
44a8ca9f
c8beaac5
Hide 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 @
784f555f
...
...
@@ -93,8 +93,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
# 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
\"
}"
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
...
...
@@ -349,6 +347,27 @@ function detect-trusty-image () {
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)
# $1: path to public key file
# Note that this is a different hash from the OpenSSH hash.
...
...
@@ -818,6 +837,8 @@ function kube-up {
detect-image
detect-minion-image
detect-root-device
find-release-tars
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