I am using nomad and i want to configure the scaling policy inside my nomad file.
Right now i am using
check "allocations-counts" {
source = "prometheus"
query = "nomad_client_allocations_running{node_class="myclass"}"
strategy "threshold" {
upper_bound = 3
delta = -1
}
}
After deploying this above config does not work and it says “
failed to query source: query returned 4 metric streams, only 1 is
expected
”
So actually in my prometheus if i run this query it gives me lots o results saying like
node_class=abcd count 5,
node_class=ebhg count 2,
node_class=kklj count 19,
node_class=erty count 7
Basically what i want to achieve is:
- If we haev any allocation with 2 (this is the excat number i want) like in above result qualifying is ebhg, then my auto scaling target for aws asg should reduce the ec2 (basically
delta = -1
)
Anyone suggest what config should i use?