Kubernetes 101 : Explicitly defining the CIDR pod IP addresses for the nodes



When using the below command, we give the kubernetes cluster a range of IP addresses to use for its pod network:


The "kubeadm" utility is a tool that helps us set up a kubernetes cluster.

The above commands also allows kubernetes to set the "--cluster-cidr" parameter.
It allocate a "/24" range of IP addresses default setting - to each node of the cluster based on the "--cluster-cidr"

We could change the default mask parameter using the "--node-cidr-mask-size-ipv4" parameter in the controller manager, which watches the kubernetes cluster and its objects, making sure that they correspond to the way we have defined them.

We could change the CIDR netmask using the below command:


We could also explicitly set the CIDR on the node level using the below Yaml file for example:


The IP range assigned to the "node1" is "10.11.56.0" to "10.11.56.255", and we get IP addresses for "254" for our pods.

Remark:

We need to make sure that our pod's IP addresses and our nodes IP addresses don't overlap.

Comments

Leave as a comment:

Archive