问题
When we use kubeadm to set up a k8s cluster, there are two options to config:
--pod-network-cidr
--service-cidr
(default ‘10.96.0.0/12’)
Question is:
If I use
10.244.0.0./12
forpod-network-cidr
, do I need to save that IP range for Kubernetes? What happens if we already start to use10.244.0.0/12
for other machines.Can I set
service-cidr
and thepod-network-cidr
the same range? I don't understand howservice-cidr
works.
回答1:
To reply briefly:
- You do have to reserve both the pod-network range and the service network range. You can't use those on your LAN (and you can't have routes to it). Both ranges are configurable so you can pick something that is not used. Use ipcalc if you are unsure.
- You have to use separate ranges.
Check out these slides for explanation about the different networks in play.
来源:https://stackoverflow.com/questions/45903123/kubernetes-set-service-cidr-and-pod-cidr-the-same