Basic questions about LXD cluster


#1

I red the documentation about the cluster mode, but I am still a bit confused. Do container instances still live in specific nodes? What is the advantage of using a cluster instead of just running LXD on every machine?

Is there any extra abstraction build of top of the cluster that allows me to just spin up containers and not worry about which node they end up on?

I want to automate the provision of a DNS record per container on a cloud environment, say AWS. I believe a setup like this won’t work due to lack of vlan support. Are there alternatives? which ones are there?


(Park Kyung Won) #2

In cluster mode, still container goes on specific node but also you can move them
Pros of cluster mode is you get unified database cluster wide. So for example, containers
have unique names for them in entire cluster. Also in cluster mode, if you do not
specify which node container should go on with --target, it will be assigned automatially.

LXD also supports vlan. Like in that post, you can attache VID tagged macvlan interfaces to
you containers. After doing so, I use my master node(one of node in cluster) to do DHCP to assign IP addresses to containers, and DNS server for local DNS resolve by container names.
You can do this with isc-dhcp-server and bind9 DDNS setup.

Then your containers will be pretty much stateless. You don’t have to worry about IP thing
because they’ll be able to communicate with each other by hostname and networks are seperated by VLAN. You can move your container from one to another, but still expect it to
work fine.


(Free Ekanayaka) #3

On top of what @Park_Kyung_Won already said, LXD 3.1 (released) yesterday has support for FAN networking out of the box, so you won’t need a vlan to connect you cluster containers between themselves, even on different nodes. @stgraber can provide more details about this feature.


#4

Hey, thank you for the replies. FAN networking looks interesting and simple to use.

If I understand it correctly, It has a maximum of 64000 containers in the cluster, right? Are there ways to go beyond this limit?


(Free Ekanayaka) #5

As far as I know, you’re correct, that’s a hard limit deriving from the algorithm used by FAN networking. Regardless of that, LXD clustering will likely have problems anyways to scale to 64k containers, but that depends on various factors, so YMMV.