IP Address Management
- How the virtual bridge network on the nodes assigned an IP subnet?
- How are the pods assigned an IP?
- Where is the information stored and who is responsible for ensuring there are no duplicate IP is assigned?
CNI Plugin Responsibilities
- Must support arguments ADD/DEL/CHECK
- Must support parameters container id, network ns, etc.
- Must manage IP Address assignment to Pods
- Must return results in a specific format.
How do we manage the APIs Kubernetes does not care how we do it. We just to do it by making sure we do not assign any duplicate APIs and manage it properly. The easiest way to do it is to store the list of APIs in a file and make sure we have the necessary code in our script to manage the file properly.
The file would be placed on each host and manages the APIs of pods on the nodes.
Instead of coding that ourselves in our script, CNI comes with two built-in plugins to which you can outsource the task to.
The CNI configuration file has a section called ipam in which we can specify the type of plug in to be used the subnet and route to be used. The details can be read from our script to invoke the appropriate plugin instead of hard coding it to use hosted local every time.
weaveworks manages IP addresses. weave by allocates the appearance 10.32.0.0/12 for the entire network.
10.32.0.1 ~ 10.47.255.254 That is about a milion APIs that you can use for pod on the network.