How kubernetes decides which network plugin to call for IPAM?

2/5/2019

I am trying to understand how kubernetes knows whom to call to get IP address to the pod? Is it mentioned in the ConfigMap?

Can you share any pointers to learn more on this?

-- Bharath Thiruveedula
flannel
kubernetes
project-calico

1 Answer

2/6/2019

I think it has been explained pretty well in this article:

Automating Kubernetes Networking with CNI

Kubernetes uses CNI plug-ins to orchestrate networking. Every time a POD is initialized or removed, the default CNI plug-in is called with the default configuration.

CNI plugin will create a pseudo interface and will attach the relevant underlay network also setting up the IP and routes which are mapped to the Pod namespace. When it gets the information about deployed container it will become responsible for IP address and iptables rules and routing on the node.

The process itself varies on different CNI - so topics like how iptables rules are created and how routing information is exchanged by nodes etc.

It is a lot of writing and it has been already written so I will just link the pointers as you requested:

Calico IPAM Calico:

How do I configure the Pod IP range?

When using Calico IPAM, IP addresses are assigned from IP Pools. By default, all enabled IP Pool are used. However, you can specify which IP Pools to use for IP address management in the CNI network config, or on a per-Pod basis using Kubernetes annotations.

Flannel networking with IPAM section

-- aurelius
Source: StackOverflow