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
1f86bce9
Commit
1f86bce9
authored
Mar 01, 2019
by
Yu-Ju Hong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
GCE/Windows: exclude gateways from the IPAM subnet
Exclude IPs assigned for gateways in the IPAM configuration.
parent
098075c4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletion
+9
-1
k8s-node-setup.psm1
cluster/gce/windows/k8s-node-setup.psm1
+9
-1
No files found.
cluster/gce/windows/k8s-node-setup.psm1
View file @
1f86bce9
...
@@ -819,9 +819,15 @@ function Configure-CniNetworking {
...
@@ -819,9 +819,15 @@ function Configure-CniNetworking {
Log-Output
(
"using mgmt IP
${
mgmt_ip
}
and mgmt subnet
${
mgmt_subnet
}
for "
+
Log-Output
(
"using mgmt IP
${
mgmt_ip
}
and mgmt subnet
${
mgmt_subnet
}
for "
+
"CNI config"
)
"CNI config"
)
# We reserve .1 and .2 for gateways. Start the CIDR range from ".3" so that
# IPAM does not allocate those IPs to pods.
$cidr_range_start
=
`
${
env
:POD_CIDR
}
.substring
(
0,
${
env
:POD_CIDR
}
.lastIndexOf
(
'.'
))
+
'.3'
# Explanation of the CNI config values:
# Explanation of the CNI config values:
# CLUSTER_CIDR: the cluster CIDR from which pod CIDRs are allocated.
# CLUSTER_CIDR: the cluster CIDR from which pod CIDRs are allocated.
# POD_CIDR: the pod CIDR assigned to this node.
# POD_CIDR: the pod CIDR assigned to this node.
# CIDR_RANGE_START: start of the pod CIDR range.
# MGMT_SUBNET: the subnet on which the Windows pods + kubelet will
# MGMT_SUBNET: the subnet on which the Windows pods + kubelet will
# communicate with the rest of the cluster without NAT (i.e. the subnet
# communicate with the rest of the cluster without NAT (i.e. the subnet
# that VM internal IPs are allocated from).
# that VM internal IPs are allocated from).
...
@@ -841,7 +847,8 @@ function Configure-CniNetworking {
...
@@ -841,7 +847,8 @@ function Configure-CniNetworking {
},
},
"ipam": {
"ipam": {
"type": "host-local",
"type": "host-local",
"subnet": "POD_CIDR"
"subnet": "POD_CIDR",
"rangeStart": "CIDR_RANGE_START"
},
},
"dns": {
"dns": {
"Nameservers": [
"Nameservers": [
...
@@ -881,6 +888,7 @@ function Configure-CniNetworking {
...
@@ -881,6 +888,7 @@ function Configure-CniNetworking {
}
}
]
]
}'
.replace
(
'POD_CIDR'
,
${
env
:POD_CIDR
}
)
.
`
}'
.replace
(
'POD_CIDR'
,
${
env
:POD_CIDR
}
)
.
`
replace
(
'CIDR_RANGE_START'
,
${
cidr_range_start
}
)
.
`
replace
(
'DNS_SERVER_IP'
,
${
kube_env
}
[
'DNS_SERVER_IP'
])
.
`
replace
(
'DNS_SERVER_IP'
,
${
kube_env
}
[
'DNS_SERVER_IP'
])
.
`
replace
(
'DNS_DOMAIN'
,
${
kube_env
}
[
'DNS_DOMAIN'
])
.
`
replace
(
'DNS_DOMAIN'
,
${
kube_env
}
[
'DNS_DOMAIN'
])
.
`
replace
(
'MGMT_IP'
,
${
mgmt_ip
}
)
.
`
replace
(
'MGMT_IP'
,
${
mgmt_ip
}
)
.
`
...
...
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