mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-30 23:15:14 +00:00
Merge pull request #74836 from yujuhong/update-win-cni-config
GCE/Windows: exclude gateways from the IPAM subnet
This commit is contained in:
commit
e001276b1d
@ -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 {
|
|||||||
},
|
},
|
||||||
"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 {
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
}'.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}).`
|
||||||
|
Loading…
Reference in New Issue
Block a user