-
Notifications
You must be signed in to change notification settings - Fork 4
Rules
A rule is an instruction used by the scaler to take a scaling decision based on the probe value.
Rules are specified under the rules:
section of the configuration file. Here's a sample from the test configuration:
rules:
whoami-cpu-scale: # name of the rule, must be unique
probe: "mock.sin" # related probe
up: "> 0.5" # up condition
down: "< 0.5" # down condition
scaler: whoami-compose # related scaler
refresh: 3s # refresh rate
The specified probe retrieve a float64
value. This value is tested against up and down rules. If it:
- matches both up and down, nothing happen
- matches
up
rule only, call theUp()
function of the related scaler - matches
down
rule only, call theDown()
function of the related scaler
Then the scaler forward the order to the orchestrator.
String parameter probe
. See the related wiki page for available probes and parameters.
String parameter scaler
. Must be defined beforehand, else the parser check will fail. See the related wiki page.
Golang time.Duration
parsable, parameter of refresh
. Duration between each probe polling and rule update.
up
and down
entries. String parameter is defined by a comparative symbol among >
, <
, ==
or !=
followed by a float64
value. Float "==" and "!=" check are performed as exact equality
up: "< 5.0"
down: "!= 1.0"