You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/reference/profiles.md
+34-1Lines changed: 34 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -71,6 +71,9 @@ Profiles in Kubernetes work by injecting the supplied configuration directly int
71
71
72
72
The configuration use the exact options that you find in the Kubernetes documentation.
73
73
74
+
!!! note "Configuration priority"
75
+
Resources set in the function spec take precedence over resources set through Profiles.
76
+
74
77
### Examples
75
78
76
79
#### Use an Alternative RuntimeClass
@@ -428,4 +431,34 @@ spec:
428
431
resources:
429
432
limits:
430
433
nvidia.com/gpu: 1 # requesting 1 GPU
431
-
```
434
+
```
435
+
436
+
#### Set default RAM/CPU for all functions
437
+
438
+
You might want to set default memory and CPU resources for all your functions. This can be done by creating a Profile and applying it to all your functions by default.
439
+
440
+
Example of a profile that sets Memory/CPU limits and requests:
441
+
442
+
```yaml
443
+
kind: Profile
444
+
apiVersion: openfaas.com/v1
445
+
metadata:
446
+
name: default-resources
447
+
namespace: openfaas
448
+
spec:
449
+
resources:
450
+
requests:
451
+
memory: "64Mi"
452
+
cpu: "250m"
453
+
limits:
454
+
memory: "128Mi"
455
+
cpu: "500m"
456
+
```
457
+
458
+
Add the profiles annotation to all functions to apply this profile.
459
+
460
+
```yaml
461
+
com.openfaas.profile: default-resources
462
+
```
463
+
464
+
It is still possible to override the default settings on a per function basis by setting different values in the function `stack.yaml`: see [Memory/CPU limits](/reference/yaml/#function-memorycpu-limits). Resources set in the function spec take precedence over resources set through Profiles.
0 commit comments