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
e4eb02af
Commit
e4eb02af
authored
Feb 07, 2016
by
k8s-merge-robot
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #18736 from miry/existen-subnet-with-ten
Auto commit by PR queue bot
parents
f15996d5
55e2906f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
12 deletions
+13
-12
util.sh
cluster/aws/util.sh
+13
-12
No files found.
cluster/aws/util.sh
View file @
e4eb02af
...
@@ -76,13 +76,15 @@ AWS_ASG_CMD="aws autoscaling"
...
@@ -76,13 +76,15 @@ AWS_ASG_CMD="aws autoscaling"
VPC_CIDR_BASE
=
172.20
VPC_CIDR_BASE
=
172.20
MASTER_IP_SUFFIX
=
.9
MASTER_IP_SUFFIX
=
.9
MASTER_INTERNAL_IP
=
${
VPC_CIDR_BASE
}
.0
${
MASTER_IP_SUFFIX
}
VPC_CIDR
=
${
VPC_CIDR_BASE
}
.0.0/16
VPC_CIDR
=
${
VPC_CIDR_BASE
}
.0.0/16
SUBNET_CIDR
=
${
VPC_CIDR_BASE
}
.0.0/24
SUBNET_CIDR
=
${
VPC_CIDR_BASE
}
.0.0/24
if
[[
-n
"
${
KUBE_SUBNET_CIDR
:-}
"
]]
;
then
if
[[
-n
"
${
KUBE_SUBNET_CIDR
:-}
"
]]
;
then
echo
"Using subnet CIDR override:
${
KUBE_SUBNET_CIDR
}
"
echo
"Using subnet CIDR override:
${
KUBE_SUBNET_CIDR
}
"
SUBNET_CIDR
=
${
KUBE_SUBNET_CIDR
}
SUBNET_CIDR
=
${
KUBE_SUBNET_CIDR
}
fi
fi
if
[[
-z
"
${
MASTER_INTERNAL_IP
-
}
"
]]
;
then
MASTER_INTERNAL_IP
=
"
${
SUBNET_CIDR
%.*
}${
MASTER_IP_SUFFIX
}
"
fi
MASTER_SG_NAME
=
"kubernetes-master-
${
CLUSTER_ID
}
"
MASTER_SG_NAME
=
"kubernetes-master-
${
CLUSTER_ID
}
"
NODE_SG_NAME
=
"kubernetes-minion-
${
CLUSTER_ID
}
"
NODE_SG_NAME
=
"kubernetes-minion-
${
CLUSTER_ID
}
"
...
@@ -506,13 +508,13 @@ function ensure-master-ip {
...
@@ -506,13 +508,13 @@ function ensure-master-ip {
else
else
KUBE_MASTER_IP
=
`
$AWS_CMD
allocate-address
--domain
vpc
--query
PublicIp
`
KUBE_MASTER_IP
=
`
$AWS_CMD
allocate-address
--domain
vpc
--query
PublicIp
`
echo
"Allocated Elastic IP for master:
${
KUBE_MASTER_IP
}
"
echo
"Allocated Elastic IP for master:
${
KUBE_MASTER_IP
}
"
# We can't tag elastic ips. Instead we put the tag on the persistent disk.
# It is a little weird, perhaps, but it sort of makes sense...
# The master mounts the master PD, and whoever mounts the master PD should also
# have the master IP
add-tag
${
MASTER_DISK_ID
}
${
TAG_KEY_MASTER_IP
}
${
KUBE_MASTER_IP
}
fi
fi
# We can't tag elastic ips. Instead we put the tag on the persistent disk.
# It is a little weird, perhaps, but it sort of makes sense...
# The master mounts the master PD, and whoever mounts the master PD should also
# have the master IP
add-tag
${
MASTER_DISK_ID
}
${
TAG_KEY_MASTER_IP
}
${
KUBE_MASTER_IP
}
fi
fi
}
}
...
@@ -790,11 +792,10 @@ function subnet-setup {
...
@@ -790,11 +792,10 @@ function subnet-setup {
else
else
EXISTING_CIDR
=
$(
$AWS_CMD
describe-subnets
--subnet-ids
${
SUBNET_ID
}
--query
Subnets[].CidrBlock
)
EXISTING_CIDR
=
$(
$AWS_CMD
describe-subnets
--subnet-ids
${
SUBNET_ID
}
--query
Subnets[].CidrBlock
)
echo
"Using existing subnet with CIDR
$EXISTING_CIDR
"
echo
"Using existing subnet with CIDR
$EXISTING_CIDR
"
VPC_CIDR
=
$(
$AWS_CMD
describe-vpcs
--vpc-ids
${
VPC_ID
}
--query
Vpcs[].CidrBlock
)
if
[
!
$SUBNET_CIDR
=
$EXISTING_CIDR
]
;
then
echo
"VPC CIDR is
$VPC_CIDR
"
MASTER_INTERNAL_IP
=
"
${
EXISTING_CIDR
%.*
}${
MASTER_IP_SUFFIX
}
"
VPC_CIDR_BASE
=
${
VPC_CIDR
%.*.*
}
echo
"Assuming MASTER_INTERNAL_IP=
${
MASTER_INTERNAL_IP
}
"
MASTER_INTERNAL_IP
=
${
VPC_CIDR_BASE
}
.0
${
MASTER_IP_SUFFIX
}
fi
echo
"Assuming MASTER_INTERNAL_IP=
${
MASTER_INTERNAL_IP
}
"
fi
fi
echo
"Using subnet
$SUBNET_ID
"
echo
"Using subnet
$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