Closed ThinGuy closed 5 years ago
We certainly would be happy with having containers be tied to a MAAS controller rather than an independent MAAS machine, but the API we're provided by MAAS through gomaasapi doesn't allow us to do this.
The concept of nodes in that Go package is pretty lacking, with the majority of API calls being tied to machines. It'd be great if you could file a bug against that project here: https://bugs.launchpad.net/gomaasapi
Then comment in this issue so that anyone else hitting this will know where to look.
Ideally for us, the best fix would be if MachineArgs
(https://godoc.org/github.com/juju/gomaasapi#MachinesArgs) would be extended to support querying of controllers as well, in which case LXD would just always request for that, saving us from having to support two different code paths for everything. Alternatively, if we had function coverage in the package for Nodes, covering the same things we do with Machines currently, we could also switch over to that instead.
Closing as this may not actually need any changes to LXD (just a rebuild once sorted in gomaasapi) or if the approach taken in that project requires additional changes, letting us know in this closed issue will have us re-open it then so we can sort it out.
Issue description
In a MAAS HA environment (n+2), it's very useful to create LXD cluster to run containers that provide services like mirrors, keyservers, simplestreams server, snap-proxy, etc.
However, the current MAAS integration only looks at machines, or node_type=0. Controllers can be a node_type of 2, 3, or 4.
If MAAS integration is performed at server level (and server/cluster members are also maas controllers), the same general error occurs with each operation:
Note that looking at MAAS machines only shows node_types that equal 0. In order to see controllers, you have to look at "nodes"
Just doing MAAS integration at the container/profile level results in the containers showing up in MAAS DNS, but the assigned IP is from the MAAS commissioning range if container is set to use DHCP
If containers are configured for static IP addresses, then container does not register itself with the MAAS DNS server, requiring manual steps to add A records for each container in order for machines deployed by MAAS to use their services (e.g. snap-proxy, repositories, etc)