A quick check before I waste hours:
From my reading, I think I need a “source” of IP Addresses for containers if I’m to use MACVLAN. The subnet which I’ll be using has no DHCP on it and has traffic for this LXD cluster as well as a K8S cluster.
I think that means I’ll need to either:
- write a small program to manage containers <-> ip addresses in a database and assign the IP Address when the container is created
- start a dnsmasq service for this subnet, possibly running on 127.x.x.x or a socket and get the containers to get their IP Address from it.
I can see that the first option could use dnsmasq with a simple wrapper to maintain this database of container_name <=> IP address.
I’d prefer to not supply a general DHCP server on this subnet, so I’d like some means of ensuring all requests are from LXD containers.
I believe LXD already starts dnsmasq for BRIDGE subnets. Is there some way to get it to start the same service for MACVLAN subnets?
I’m interested in going down this route as the firewalling is a pain in the neck with the clustered bridged networks, and the NAT involved is an unnecessary overhead.