Open protochron opened 2 years ago
https://github.com/hashicorp/nomad-autoscaler/issues/255 seems related, but it's pretty old and I think predates being able to filter nodes by datacenter.
Thanks for the report @protochron, and apologies for taking this long to get back to you.
I will need some time to investigate this further, but yeah, I think node_class
is only one of the possible node selection options, so it should be optional.
And thanks for pointing ou #255, I will try to tackle that documentation gap as well 🙂
It seems that even though the code doesn't require it, the autoscaler will not select any nodes unless
node_class
is set in a target. The check errors out with a messagefailed to query source: no nodes identified within pool
. I had hoped to let the autoscaler manage all nodes in a single datacenter, since both the docs and the code imply that is supported.Example config:
Output:
Setting the
node_class
field fixes the error and the autoscaler is able to identify nodes to manage with the policy. The fix in my case is pretty straightforward: just set the samenode_class
value on every node in the datacenter. But is this behavior intentional? It doesn't seem like it if the code in https://github.com/hashicorp/nomad-autoscaler/blob/main/sdk/helper/scaleutils/nodepool/nodepool.go#L35-L47 is anything to go by.