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
9f4b504e
Commit
9f4b504e
authored
Jun 19, 2015
by
Satnam Singh
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #9921 from justinsb/aws_asg
AWS: Run minions in Auto Scaling Group
parents
6c0d3249
2a5ed2f0
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
31 additions
and
5 deletions
+31
-5
config-default.sh
cluster/aws/config-default.sh
+0
-1
config-test.sh
cluster/aws/config-test.sh
+0
-1
common.sh
cluster/aws/ubuntu/common.sh
+1
-3
util.sh
cluster/aws/util.sh
+0
-0
aws.go
pkg/cloudprovider/aws/aws.go
+6
-0
aws_routes.go
pkg/cloudprovider/aws/aws_routes.go
+20
-0
aws_test.go
pkg/cloudprovider/aws/aws_test.go
+4
-0
No files found.
cluster/aws/config-default.sh
View file @
9f4b504e
...
...
@@ -38,7 +38,6 @@ IAM_PROFILE_MINION="kubernetes-minion"
LOG
=
"/dev/null"
MASTER_NAME
=
"
${
INSTANCE_PREFIX
}
-master"
MINION_NAMES
=(
$(
eval echo
${
INSTANCE_PREFIX
}
-minion-
{
1..
${
NUM_MINIONS
}
}
)
)
MASTER_TAG
=
"
${
INSTANCE_PREFIX
}
-master"
MINION_TAG
=
"
${
INSTANCE_PREFIX
}
-minion"
MINION_SCOPES
=
""
...
...
cluster/aws/config-test.sh
View file @
9f4b504e
...
...
@@ -34,7 +34,6 @@ IAM_PROFILE_MINION="kubernetes-minion"
LOG
=
"/dev/null"
MASTER_NAME
=
"
${
INSTANCE_PREFIX
}
-master"
MINION_NAMES
=(
$(
eval echo
${
INSTANCE_PREFIX
}
-minion-
{
1..
${
NUM_MINIONS
}
}
)
)
MASTER_TAG
=
"
${
INSTANCE_PREFIX
}
-master"
MINION_TAG
=
"
${
INSTANCE_PREFIX
}
-minion"
MINION_SCOPES
=
""
...
...
cluster/aws/ubuntu/common.sh
View file @
9f4b504e
...
...
@@ -25,7 +25,6 @@ function detect-minion-image() {
}
function
generate-minion-user-data
{
i
=
$1
# We pipe this to the ami as a startup script in the user-data field. Requires a compatible ami
echo
"#! /bin/bash"
echo
"SALT_MASTER='
${
MASTER_INTERNAL_IP
}
'"
...
...
@@ -37,8 +36,7 @@ function generate-minion-user-data {
}
function
check-minion
()
{
local
minion_name
=
$1
local
minion_ip
=
$2
local
minion_ip
=
$1
local
output
=
$(
ssh
-oStrictHostKeyChecking
=
no
-i
"
${
AWS_SSH_KEY
}
"
${
SSH_USER
}
@
$minion_ip
sudo
docker ps
-a
2>/dev/null
)
if
[[
-z
"
${
output
}
"
]]
;
then
...
...
cluster/aws/util.sh
View file @
9f4b504e
This diff is collapsed.
Click to expand it.
pkg/cloudprovider/aws/aws.go
View file @
9f4b504e
...
...
@@ -90,6 +90,8 @@ type EC2 interface {
DescribeRouteTables
(
request
*
ec2
.
DescribeRouteTablesInput
)
([]
*
ec2
.
RouteTable
,
error
)
CreateRoute
(
request
*
ec2
.
CreateRouteInput
)
(
*
ec2
.
CreateRouteOutput
,
error
)
DeleteRoute
(
request
*
ec2
.
DeleteRouteInput
)
(
*
ec2
.
DeleteRouteOutput
,
error
)
ModifyInstanceAttribute
(
request
*
ec2
.
ModifyInstanceAttributeInput
)
(
*
ec2
.
ModifyInstanceAttributeOutput
,
error
)
}
// This is a simple pass-through of the ELB client interface, which allows for testing
...
...
@@ -414,6 +416,10 @@ func (s *awsSdkEC2) DeleteRoute(request *ec2.DeleteRouteInput) (*ec2.DeleteRoute
return
s
.
ec2
.
DeleteRoute
(
request
)
}
func
(
s
*
awsSdkEC2
)
ModifyInstanceAttribute
(
request
*
ec2
.
ModifyInstanceAttributeInput
)
(
*
ec2
.
ModifyInstanceAttributeOutput
,
error
)
{
return
s
.
ec2
.
ModifyInstanceAttribute
(
request
)
}
func
init
()
{
cloudprovider
.
RegisterCloudProvider
(
ProviderName
,
func
(
config
io
.
Reader
)
(
cloudprovider
.
Interface
,
error
)
{
creds
:=
credentials
.
NewChainCredentials
(
...
...
pkg/cloudprovider/aws/aws_routes.go
View file @
9f4b504e
...
...
@@ -69,9 +69,29 @@ func (s *AWSCloud) ListRoutes(clusterName string) ([]*cloudprovider.Route, error
return
routes
,
nil
}
// Sets the instance attribute "source-dest-check" to the specified value
func
(
s
*
AWSCloud
)
configureInstanceSourceDestCheck
(
instanceID
string
,
sourceDestCheck
bool
)
error
{
request
:=
&
ec2
.
ModifyInstanceAttributeInput
{}
request
.
InstanceID
=
aws
.
String
(
instanceID
)
request
.
SourceDestCheck
=
&
ec2
.
AttributeBooleanValue
{
Value
:
aws
.
Boolean
(
sourceDestCheck
)}
_
,
err
:=
s
.
ec2
.
ModifyInstanceAttribute
(
request
)
if
err
!=
nil
{
return
fmt
.
Errorf
(
"error configuring source-dest-check on instance %s: %v"
,
instanceID
,
err
)
}
return
nil
}
// CreateRoute implements Routes.CreateRoute
// Create the described route
func
(
s
*
AWSCloud
)
CreateRoute
(
clusterName
string
,
nameHint
string
,
route
*
cloudprovider
.
Route
)
error
{
// In addition to configuring the route itself, we also need to configure the instance to accept that traffic
// On AWS, this requires turning source-dest checks off
err
:=
s
.
configureInstanceSourceDestCheck
(
route
.
TargetInstance
,
false
)
if
err
!=
nil
{
return
err
}
table
,
err
:=
s
.
findRouteTable
(
clusterName
)
if
err
!=
nil
{
return
err
...
...
pkg/cloudprovider/aws/aws_test.go
View file @
9f4b504e
...
...
@@ -372,6 +372,10 @@ func (s *FakeEC2) DeleteRoute(request *ec2.DeleteRouteInput) (*ec2.DeleteRouteOu
panic
(
"Not implemented"
)
}
func
(
s
*
FakeEC2
)
ModifyInstanceAttribute
(
request
*
ec2
.
ModifyInstanceAttributeInput
)
(
*
ec2
.
ModifyInstanceAttributeOutput
,
error
)
{
panic
(
"Not implemented"
)
}
type
FakeELB
struct
{
aws
*
FakeAWSServices
}
...
...
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