Skip to content
This repository was archived by the owner on Jan 29, 2025. It is now read-only.

Commit cfc30bb

Browse files
togashidmmadalazar
authored andcommitted
Update doc to describe logical operators
1 parent 43299c9 commit cfc30bb

File tree

1 file changed

+36
-2
lines changed

1 file changed

+36
-2
lines changed

telemetry-aware-scheduling/README.md

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,42 @@ There can be four strategy types in a policy file and rules associated with each
183183
If neither metric would be greater than 100, no label would be created. When there are multiple candidates with equal values, the resulting label is
184184
random among the equal candidates. Label cleanup happens automatically. An example of the labeling strategy can be found in [here](docs/strategy-labeling-example.md)
185185

186-
dontschedule and deschedule - which incorporate multiple rules - function with an OR operator. That is if any single rule is broken the strategy is considered violated.
187-
Telemetry policies are namespaced, meaning that under normal circumstances a workload can only be associated with a pod in the same namespaces.
186+
Telemetry policies are namespaced, meaning that under normal circumstances a workload can only be associated with a pod in the same namespaces.
187+
dontschedule and deschedule strategies - which incorporate multiple rules - works with an OR operator (default value). That is if any single rule is broken the strategy is considered violated.
188+
For the user-cases that request the use of other operators, the policy allows more descriptive operators such as `anyOf` and `allOf` which are equivalent to OR and AND operators, respectively. For example:
189+
190+
````
191+
apiVersion: telemetry.intel.com/v1alpha1
192+
kind: TASPolicy
193+
metadata:
194+
name: multirules-policy
195+
namespace: default
196+
spec:
197+
strategies:
198+
deschedule:
199+
logicalOperator: allOf
200+
rules:
201+
- metricname: temperature
202+
operator: GreaterThan
203+
target: 80
204+
- metricname: freeRAM
205+
operator: LessThan
206+
target: 200
207+
dontschedule:
208+
logicalOperator: anyOf
209+
rules:
210+
- metricname: temperature
211+
operator: GreaterThan
212+
target: 80
213+
- metricname: freeRAM
214+
operator: LessThan
215+
target: 200
216+
scheduleonmetric:
217+
rules:
218+
- metricname: freeRAM
219+
operator: LessThan
220+
````
221+
The deschedule strategy rule will be violated only if both metric rules are violated, while for dontschedule the violation will occur if one of the rules are broken. Note that the key:value map for the logicalOperator `anyOf` can be omitted, i.e., it has the same effect of the previous policy example (OR as default operator).
188222

189223
### Configuration flags
190224
The below flags can be passed to the binary at run time.

0 commit comments

Comments
 (0)