MaaS Pool functional deployment

I asked this in IRC today, but received no response. I decided to post the question here for posterity sake:

<cloaked1> How does one use maas cli to deploy to a node in a pool [by pool ID instead of node ID]?

<cloaked1> and actually, maybe I should be even more specific with my question for the purposes of my use-case; let’s not use maas-cli as the operator performing this operation. Let’s assume we’ve created a k8s operator that is integrating with the gomaas API. Would the operator, in this case, be responsible for determining the maas node to install to vs maas automatically picking a free node within a pool at deploy time? Currently, the gomaasapi is able to select a node given a set of AllocateMachineArgs.

<cloaked1> Hmm, so this is interesting. Looks like, as far as I am able to understand, that gomaasapi doesn’t even allow the use of pools as a means of Allocation (ref AllocateMachineArgs struct)…

<cloaked1> so either I’m completely missing the point of pools or it’s simply not quite supported…

<cloaked1> unless pools are strictly for informational reference only vs any kind of functional use…

<cloaked1> That would seem like a miss imho, though.

you need to allocate the machine first and then deploying it

maas admin machines allocate pool=
maas admin machine deploy <system_id>

TBH, I don’t know if the gomaas API does support resource pools. I would imagine that if it supports constraints then it should support allocating and passing the ‘pool’ constraint. That said, this is maintained by the Juju team, so if you could please file a bug we can have someone look at it.

They are not for reference, they are functional and have more advanced usage with RBAC.

Ah! This is perfect! Seems the documentation for deploy should probably explicitly state that if one wants to deploy to a pool (and maybe a pod?) then one must allocate first, because one can deploy without allocating and allocation will be done automatically.

I appreciate the assist.