Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

kubernetes set service cidr and pod cidr the same

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:

  1. If I use 10.244.0.0./12 for pod-network-cidr, do I need to save that IP range for Kubernetes? What happens if we already start to use 10.244.0.0/12 for other machines.

  2. Can I set service-cidr and the pod-network-cidr the same range? I don't understand how service-cidr works.

like image 640
xren Avatar asked Aug 27 '17 08:08

xren


1 Answers

To reply briefly:

    1. 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.
    1. You have to use separate ranges.

Check out these slides for explanation about the different networks in play.

like image 187
Janos Lenart Avatar answered Sep 20 '22 15:09

Janos Lenart