Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Support interop with Azure CNI IPAM plugin. #626
Add support for Azure IPAM, which requires a few things:
In order to do that, we need to store information about azure endpoints as well as networks so that we can provide that information to the IPAM plugin when we call it.
This PR implements that by writing configuration to disk in
Oct 24, 2018
left a comment
Just a few nits (and would be nice to have some tests!)
Would also be nice to break up the god function at some point too but that might make conflicts with my team's work if we do it right now.
left a comment
Looks like it should work and thanks for the incremental cleanups(!) but I'm a bit wary of all this file writing; a lot can go wrong with writing files and it's quite different to our tried-and-true approach of using a highly-consistent central datastore for our state.
Where does the Azure IPAM plugin store its state; if it stores on disk too then this approach would be a nice fit. OTOH, if it stores its state in k8s CRDs.... (I suspect the answer is neither?)
You probably should at least switch to something like this: https://github.com/natefinch/atomic, and in future, you'll need a file lock to prevent races when multiple CNI plugins try to add different subnets to the file.
Yup, the Azure IPAM plugin stores its state to disk as well in the
From my own experimentation, it seems rebooting the node clears all IP allocations in the Azure IPAM plugin. The IPAM plugin keeps a local pool of IPs and manages them locally rather than relying on allocations being stored centrally.