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
1f042845
Commit
1f042845
authored
Jun 12, 2015
by
Justin Santa Barbara
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
AWS: Create our own route table & tag it for management
parent
3ce7fe83
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
4 deletions
+22
-4
util.sh
cluster/aws/util.sh
+22
-4
No files found.
cluster/aws/util.sh
View file @
1f042845
...
@@ -636,11 +636,21 @@ function kube-up {
...
@@ -636,11 +636,21 @@ function kube-up {
echo
"Using Internet Gateway
$IGW_ID
"
echo
"Using Internet Gateway
$IGW_ID
"
echo
"Associating route table."
echo
"Associating route table."
ROUTE_TABLE_ID
=
$(
$AWS_CMD
describe-route-tables
--filters
Name
=
vpc-id,Values
=
$VPC_ID
| json_val
'["RouteTables"][0]["RouteTableId"]'
)
ROUTE_TABLE_ID
=
$(
$AWS_CMD
--output
text describe-route-tables
\
--filters
Name
=
vpc-id,Values
=
${
VPC_ID
}
\
Name
=
tag:KubernetesCluster,Values
=
${
CLUSTER_ID
}
\
--query
RouteTables[].RouteTableId
)
if
[[
-z
"
${
ROUTE_TABLE_ID
}
"
]]
;
then
echo
"Creating route table"
ROUTE_TABLE_ID
=
$(
$AWS_CMD
--output
text create-route-table
\
--vpc-id
=
${
VPC_ID
}
\
--query
RouteTable.RouteTableId
)
add-tag
${
ROUTE_TABLE_ID
}
KubernetesCluster
${
CLUSTER_ID
}
fi
echo
"Associating route table
${
ROUTE_TABLE_ID
}
to subnet
${
SUBNET_ID
}
"
$AWS_CMD
associate-route-table
--route-table-id
$ROUTE_TABLE_ID
--subnet-id
$SUBNET_ID
>
$LOG
||
true
$AWS_CMD
associate-route-table
--route-table-id
$ROUTE_TABLE_ID
--subnet-id
$SUBNET_ID
>
$LOG
||
true
echo
"Configuring route table."
echo
"Adding route to route table
${
ROUTE_TABLE_ID
}
"
$AWS_CMD
describe-route-tables
--filters
Name
=
vpc-id,Values
=
$VPC_ID
>
$LOG
||
true
echo
"Adding route to route table."
$AWS_CMD
create-route
--route-table-id
$ROUTE_TABLE_ID
--destination-cidr-block
0.0.0.0/0
--gateway-id
$IGW_ID
>
$LOG
||
true
$AWS_CMD
create-route
--route-table-id
$ROUTE_TABLE_ID
--destination-cidr-block
0.0.0.0/0
--gateway-id
$IGW_ID
>
$LOG
||
true
echo
"Using Route Table
$ROUTE_TABLE_ID
"
echo
"Using Route Table
$ROUTE_TABLE_ID
"
...
@@ -1066,6 +1076,14 @@ function kube-down {
...
@@ -1066,6 +1076,14 @@ function kube-down {
for
route_table_id
in
${
route_table_ids
}
;
do
for
route_table_id
in
${
route_table_ids
}
;
do
$AWS_CMD
delete-route
--route-table-id
$route_table_id
--destination-cidr-block
0.0.0.0/0
>
$LOG
$AWS_CMD
delete-route
--route-table-id
$route_table_id
--destination-cidr-block
0.0.0.0/0
>
$LOG
done
done
route_table_ids
=
$(
$AWS_CMD
--output
text describe-route-tables
\
--filters
Name
=
vpc-id,Values
=
$vpc_id
\
Name
=
tag:KubernetesCluster,Values
=
${
CLUSTER_ID
}
\
--query
RouteTables[].RouteTableId
\
|
tr
"
\t
"
"
\n
"
)
for
route_table_id
in
${
route_table_ids
}
;
do
$AWS_CMD
delete-route-table
--route-table-id
$route_table_id
>
$LOG
done
$AWS_CMD
delete-vpc
--vpc-id
$vpc_id
>
$LOG
$AWS_CMD
delete-vpc
--vpc-id
$vpc_id
>
$LOG
fi
fi
...
...
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