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
1efee0b4
Commit
1efee0b4
authored
Oct 05, 2015
by
Alex Robinson
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #8255 from iterion/default_dhcp_option_set
AWS: Create DHCP Option Set on kube-up
parents
48c6b7ea
1c771796
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
0 deletions
+25
-0
util.sh
cluster/aws/util.sh
+25
-0
No files found.
cluster/aws/util.sh
View file @
1efee0b4
...
...
@@ -417,6 +417,28 @@ function ensure-master-pd {
fi
}
# Creates a new DHCP option set configured correctly for Kubernetes
# Sets DHCP_OPTION_SET_ID
function
create-dhcp-option-set
()
{
case
"
${
AWS_REGION
}
"
in
us-east-1
)
OPTION_SET_DOMAIN
=
ec2.internal
;;
*
)
OPTION_SET_DOMAIN
=
"
${
AWS_REGION
}
.compute.internal"
esac
DHCP_OPTION_SET_ID
=
$(
$AWS_CMD
create-dhcp-options
--dhcp-configuration
Key
=
domain-name,Values
=
${
OPTION_SET_DOMAIN
}
Key
=
domain-name-servers,Values
=
AmazonProvidedDNS | json_val
'["DhcpOptions"]["DhcpOptionsId"]'
)
add-tag
${
DHCP_OPTION_SET_ID
}
Name kubernetes-dhcp-option-set
add-tag
${
DHCP_OPTION_SET_ID
}
KubernetesCluster
${
CLUSTER_ID
}
$AWS_CMD
associate-dhcp-options
--dhcp-options-id
${
DHCP_OPTION_SET_ID
}
--vpc-id
${
VPC_ID
}
echo
"Using DHCP option set
${
DHCP_OPTION_SET_ID
}
"
}
# Verify prereqs
function
verify-prereqs
{
if
[[
"
$(
which aws
)
"
==
""
]]
;
then
...
...
@@ -694,9 +716,12 @@ function kube-up {
echo
"Using VPC
$VPC_ID
"
create-dhcp-option-set
if
[[
-z
"
${
SUBNET_ID
:-}
"
]]
;
then
SUBNET_ID
=
$(
$AWS_CMD
describe-subnets
--filters
Name
=
tag:KubernetesCluster,Values
=
${
CLUSTER_ID
}
| get_subnet_id
$VPC_ID
$ZONE
)
fi
if
[[
-z
"
$SUBNET_ID
"
]]
;
then
echo
"Creating subnet."
SUBNET_ID
=
$(
$AWS_CMD
create-subnet
--cidr-block
$INTERNAL_IP_BASE
.0/24
--vpc-id
$VPC_ID
--availability-zone
${
ZONE
}
| json_val
'["Subnet"]["SubnetId"]'
)
...
...
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