@@ -146,9 +146,17 @@ spec:
146
146
Parameters is used in the expression string \n Available
147
147
expression evaluation functions are: \n int() returns
148
148
1 if the expression is true otherwise 0, example: int(phase
149
- == 'Running') \n percentage(a, b) returns the value of
150
- (a * b%) example: percentage(replicas, maxUnavailable)
151
- \n cpuCores() returns the cpu in unit core example: cpuCores(cpu),
149
+ == 'Running') \n percentage(percent, total, roundUp) returns
150
+ the value of (percent * total%) when `percent` contains
151
+ the percent(%) value. If percent represents an Integer
152
+ value, then it will simply return it. roundUp is an optional
153
+ field. By default, its value is false. If roundUp is set
154
+ as `true`, the resultant value will be rounded up. example:
155
+ (i) percentage(\" 25%\" , 4) will return 1. (ii)
156
+ percentage(\" 25%\" , 1 , true) will return 1 as roundUp
157
+ is set as true. (iii) percentage(2, 4) will return
158
+ 2 as percent is representing an Integer value. \n cpu_cores()
159
+ returns the cpu in unit core example: cpu_cores(cpu),
152
160
for cpu value 150m, it will return 0.15 \n bytes() returns
153
161
the memory size in byte example: bytes(memory), for memory
154
162
value 1 ki, it will return 1024 \n unix() returns the
@@ -259,22 +267,32 @@ spec:
259
267
the expression string \n Available expression
260
268
evaluation functions are: \n int() returns 1
261
269
if the expression is true otherwise 0, example:
262
- int(phase == 'Running') \n percentage(a, b)
263
- returns the value of (a * b%) example: percentage(replicas,
264
- maxUnavailable) \n cpuCores() returns the cpu
265
- in unit core example: cpuCores(cpu), for cpu
266
- value 150m, it will return 0.15 \n bytes() returns
267
- the memory size in byte example: bytes(memory),
268
- for memory value 1 ki, it will return 1024 \n
269
- unix() returns the DateTime string into unix
270
- format. example: unix(dateTime) will return
271
- the corresponding unix value for the given dateTime
272
- \n in above examples phase, replicas, maxUnavailable,
273
- cpu, memory, dateTime are Parameter's key those
274
- values will come from corresponding Parameter's
275
- value \n Some expression evaluation functions
276
- are used for calculating resource requests and
277
- limits. Those functions are stated here: https://github.com/kmodules/resource-metrics/blob/master/eval.go"
270
+ int(phase == 'Running') \n percentage(percent,
271
+ total, roundUp) returns the value of (percent
272
+ * total%) when `percent` contains the percent(%)
273
+ value. If percent represents an Integer value,
274
+ then it will simply return it. roundUp is an
275
+ optional field. By default, its value is false.
276
+ If roundUp is set as `true`, the resultant value
277
+ will be rounded up. example: (i) percentage(\" 25%\" ,
278
+ 4) will return 1. (ii) percentage(\" 25%\" ,
279
+ 1 , true) will return 1 as roundUp is set as
280
+ true. (iii) percentage(2, 4) will return
281
+ 2 as percent is representing an Integer value.
282
+ \n cpu_cores() returns the cpu in unit core
283
+ example: cpu_cores(cpu), for cpu value 150m,
284
+ it will return 0.15 \n bytes() returns the memory
285
+ size in byte example: bytes(memory), for memory
286
+ value 1 ki, it will return 1024 \n unix() returns
287
+ the DateTime string into unix format. example:
288
+ unix(dateTime) will return the corresponding
289
+ unix value for the given dateTime \n in above
290
+ examples phase, replicas, maxUnavailable, cpu,
291
+ memory, dateTime are Parameter's key those values
292
+ will come from corresponding Parameter's value
293
+ \n Some expression evaluation functions are
294
+ used for calculating resource requests and limits.
295
+ Those functions are stated here: https://github.com/kmodules/resource-metrics/blob/master/eval.go"
278
296
type : string
279
297
valueFromPath :
280
298
description : " ValueFromPath contains the field
0 commit comments