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
70b448b5
Commit
70b448b5
authored
Mar 12, 2015
by
Justin Santa Barbara
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Choose AWS image by region
Also update to the latest LTS image (fewer security updates needed)
parent
a3fd0a9f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
65 additions
and
10 deletions
+65
-10
config-default.sh
cluster/aws/config-default.sh
+0
-4
config-test.sh
cluster/aws/config-test.sh
+0
-4
util.sh
cluster/aws/util.sh
+65
-2
No files found.
cluster/aws/config-default.sh
View file @
70b448b5
...
@@ -20,10 +20,6 @@ MASTER_SIZE=t2.micro
...
@@ -20,10 +20,6 @@ MASTER_SIZE=t2.micro
MINION_SIZE
=
t2.micro
MINION_SIZE
=
t2.micro
NUM_MINIONS
=
${
NUM_MINIONS
:-
4
}
NUM_MINIONS
=
${
NUM_MINIONS
:-
4
}
# This is the ubuntu 14.04 image for us-west-2 + ebs
# See here: http://cloud-images.ubuntu.com/locator/ec2/ for other images
# This will need to be updated from time to time as amis are deprecated
IMAGE
=
ami-39501209
INSTANCE_PREFIX
=
"
${
KUBE_AWS_INSTANCE_PREFIX
:-
kubernetes
}
"
INSTANCE_PREFIX
=
"
${
KUBE_AWS_INSTANCE_PREFIX
:-
kubernetes
}
"
AWS_SSH_KEY
=
${
AWS_SSH_KEY
:-
$HOME
/.ssh/kube_aws_rsa
}
AWS_SSH_KEY
=
${
AWS_SSH_KEY
:-
$HOME
/.ssh/kube_aws_rsa
}
IAM_PROFILE
=
"kubernetes"
IAM_PROFILE
=
"kubernetes"
...
...
cluster/aws/config-test.sh
View file @
70b448b5
...
@@ -20,10 +20,6 @@ MASTER_SIZE=t2.micro
...
@@ -20,10 +20,6 @@ MASTER_SIZE=t2.micro
MINION_SIZE
=
t2.micro
MINION_SIZE
=
t2.micro
NUM_MINIONS
=
${
NUM_MINIONS
:-
2
}
NUM_MINIONS
=
${
NUM_MINIONS
:-
2
}
# This is the ubuntu 14.04 image for us-west-2 + ebs
# See here: http://cloud-images.ubuntu.com/locator/ec2/ for other images
# This will need to be updated from time to time as amis are deprecated
IMAGE
=
ami-39501209
INSTANCE_PREFIX
=
"
${
KUBE_AWS_INSTANCE_PREFIX
:-
e2e
-test-
${
USER
}}
"
INSTANCE_PREFIX
=
"
${
KUBE_AWS_INSTANCE_PREFIX
:-
e2e
-test-
${
USER
}}
"
AWS_SSH_KEY
=
${
AWS_SSH_KEY
:-
$HOME
/.ssh/kube_aws_rsa
}
AWS_SSH_KEY
=
${
AWS_SSH_KEY
:-
$HOME
/.ssh/kube_aws_rsa
}
IAM_PROFILE
=
"kubernetes"
IAM_PROFILE
=
"kubernetes"
...
...
cluster/aws/util.sh
View file @
70b448b5
...
@@ -93,6 +93,67 @@ function detect-minions () {
...
@@ -93,6 +93,67 @@ function detect-minions () {
fi
fi
}
}
# Detects the AMI to use (considering the region)
#
# Vars set:
# AWS_IMAGE
function
detect-image
()
{
# This is the ubuntu 14.04 image for <region>, amd64, hvm:ebs-ssd
# See here: http://cloud-images.ubuntu.com/locator/ec2/ for other images
# This will need to be updated from time to time as amis are deprecated
if
[[
-z
"
${
AWS_IMAGE
-
}
"
]]
;
then
case
"
${
ZONE
}
"
in
ap-northeast-1
)
AWS_IMAGE
=
ami-93876e93
;;
ap-southeast-1
)
AWS_IMAGE
=
ami-66546234
;;
eu-central-1
)
AWS_IMAGE
=
ami-e2a694ff
;;
eu-west-1
)
AWS_IMAGE
=
ami-d7fd6ea0
;;
sa-east-1
)
AWS_IMAGE
=
ami-a357eebe
;;
us-east-1
)
AWS_IMAGE
=
ami-6089d208
;;
us-west-1
)
AWS_IMAGE
=
ami-cf7d998b
;;
cn-north-1
)
AWS_IMAGE
=
ami-d436a4ed
;;
us-gov-west-1
)
AWS_IMAGE
=
ami-01523322
;;
ap-southeast-2
)
AWS_IMAGE
=
ami-cd4e3ff7
;;
us-west-2
)
AWS_IMAGE
=
ami-3b14370b
;;
*
)
echo
"Please specify AWS_IMAGE directly (region not recognized)"
exit
1
esac
fi
}
# Verify prereqs
# Verify prereqs
function
verify-prereqs
{
function
verify-prereqs
{
if
[
"
$(
which aws
)
"
==
""
]
;
then
if
[
"
$(
which aws
)
"
==
""
]
;
then
...
@@ -237,6 +298,8 @@ function kube-up {
...
@@ -237,6 +298,8 @@ function kube-up {
ssh-keygen
-f
$AWS_SSH_KEY
-N
''
ssh-keygen
-f
$AWS_SSH_KEY
-N
''
fi
fi
detect-image
aws iam get-instance-profile
--instance-profile-name
${
IAM_PROFILE
}
||
{
aws iam get-instance-profile
--instance-profile-name
${
IAM_PROFILE
}
||
{
echo
"You need to set up an IAM profile and role for kubernetes"
echo
"You need to set up an IAM profile and role for kubernetes"
exit
1
exit
1
...
@@ -323,7 +386,7 @@ function kube-up {
...
@@ -323,7 +386,7 @@ function kube-up {
echo
"Starting Master"
echo
"Starting Master"
master_id
=
$(
$AWS_CMD
run-instances
\
master_id
=
$(
$AWS_CMD
run-instances
\
--image-id
$IMAGE
\
--image-id
$
AWS_
IMAGE
\
--iam-instance-profile
Name
=
$IAM_PROFILE
\
--iam-instance-profile
Name
=
$IAM_PROFILE
\
--instance-type
$MASTER_SIZE
\
--instance-type
$MASTER_SIZE
\
--subnet-id
$SUBNET_ID
\
--subnet-id
$SUBNET_ID
\
...
@@ -396,7 +459,7 @@ function kube-up {
...
@@ -396,7 +459,7 @@ function kube-up {
grep
-v
"^#"
"
${
KUBE_ROOT
}
/cluster/aws/templates/salt-minion.sh"
grep
-v
"^#"
"
${
KUBE_ROOT
}
/cluster/aws/templates/salt-minion.sh"
)
>
"
${
KUBE_TEMP
}
/minion-start-
${
i
}
.sh"
)
>
"
${
KUBE_TEMP
}
/minion-start-
${
i
}
.sh"
minion_id
=
$(
$AWS_CMD
run-instances
\
minion_id
=
$(
$AWS_CMD
run-instances
\
--image-id
$IMAGE
\
--image-id
$
AWS_
IMAGE
\
--iam-instance-profile
Name
=
$IAM_PROFILE
\
--iam-instance-profile
Name
=
$IAM_PROFILE
\
--instance-type
$MINION_SIZE
\
--instance-type
$MINION_SIZE
\
--subnet-id
$SUBNET_ID
\
--subnet-id
$SUBNET_ID
\
...
...
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