I'm in the process of setting up a Kubernetes cluster from scratch. I am looking to install Flannel as part of the installation process. When I look at online guides/examples I can see that it is necessary to configure the Flannel subnetwork.
I can see that some guides (deploying-kubernetes-using-ansible.html) set up the flannel network like this:
{
"Network": "172.16.0.0/12",
"SubnetLen": 24,
"Backend": {
"Type": "vxlan"
}
}
whereas another guide here (Kubernetes – simple install on CentOS 7) sets up the network like this:
{"Network":"172.17.0.0/16"}
I am still learning about CIDR notation, so I can see that there are more IP addresses available with the first approach than the second. The second URL states that:
All your kubernetes nodes will be in 3 different subnets at the same time:
External interface subnet: 10.0.1.0/24
Flannel subnet: 172.17.0.0/16 #Do not use existing subnet
Service cluster subnet: 10.10.10.0/24 # Do not use existing subnet
I can see from Wikipedia (Private IPv4 address spaces) that the 172 range is a private address space of up to /12.
The implications of the quote as I see them are:
What are the practical implications of changing the Flannel config to /12 (or any other number from 12..31)?
Same question for service-cluster-ip-range
and how do you deconflict the service IPs from the IPs of pods?
Actually flannel config Network
(/12) must be smaller than SubnetLen
(/24).External interface subnet is the subnet of your host. service-cluster-ip-range
is the scope of clusterIP
which is virtual (default implement by iptables in kubernetes). Iptables and routes conflicts will appear when they have the same ip range. so we should specific different ip range for them.