Skip to content
This repository was archived by the owner on Mar 10, 2023. It is now read-only.

Commit 70ea949

Browse files
martindekovalexellis
authored andcommitted
Add memory limits to functions
Adding memory limits to functions all except the dashboard are set to limits.memory 128Mi requests.memory 64Mi the dashboard's limits are doubled. All functions have requests.cpu limit of 50m Signed-off-by: Martin Dekov <mvdekov@gmail.com>
1 parent 0be8582 commit 70ea949

File tree

3 files changed

+85
-0
lines changed

3 files changed

+85
-0
lines changed

dashboard/stack.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,8 @@ functions:
1212
role: openfaas-system
1313
environment_file:
1414
- dashboard_config.yml
15+
limits:
16+
memory: 256Mi
17+
requests:
18+
memory: 64Mi
19+
cpu: 50m

gitlab.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ functions:
2626
- payload-secret
2727
- gitlab-api-token
2828
- customers
29+
limits:
30+
memory: 128Mi
31+
requests:
32+
memory: 32Mi
33+
cpu: 50m
2934

3035
gitlab-push:
3136
lang: go
@@ -44,6 +49,11 @@ functions:
4449
secrets:
4550
- payload-secret
4651
- customers
52+
limits:
53+
memory: 128Mi
54+
requests:
55+
memory: 32Mi
56+
cpu: 50m
4757

4858
gitlab-status:
4959
lang: go
@@ -61,3 +71,8 @@ functions:
6171
secrets:
6272
- gitlab-api-token
6373
- payload-secret
74+
limits:
75+
memory: 128Mi
76+
requests:
77+
memory: 32Mi
78+
cpu: 50m

stack.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ functions:
2323
- github-webhook-secret
2424
- payload-secret
2525
- customers
26+
limits:
27+
memory: 128Mi
28+
requests:
29+
memory: 32Mi
30+
cpu: 50m
2631

2732
github-push:
2833
lang: go
@@ -45,6 +50,11 @@ functions:
4550
- github-webhook-secret
4651
- payload-secret
4752
- customers
53+
limits:
54+
memory: 128Mi
55+
requests:
56+
memory: 32Mi
57+
cpu: 50m
4858

4959
git-tar:
5060
lang: dockerfile
@@ -67,6 +77,11 @@ functions:
6777
- private-key
6878
# Uncomment this for GitLab
6979
# - gitlab-api-token
80+
limits:
81+
memory: 128Mi
82+
requests:
83+
memory: 32Mi
84+
cpu: 50m
7085

7186
buildshiprun:
7287
lang: go
@@ -91,6 +106,11 @@ functions:
91106
- basic-auth-password
92107
- payload-secret
93108
# - swarm-pull-secret
109+
limits:
110+
memory: 128Mi
111+
requests:
112+
memory: 32Mi
113+
cpu: 50m
94114

95115
garbage-collect:
96116
lang: go
@@ -111,6 +131,11 @@ functions:
111131
- basic-auth-user
112132
- basic-auth-password
113133
- payload-secret
134+
limits:
135+
memory: 128Mi
136+
requests:
137+
memory: 32Mi
138+
cpu: 50m
114139

115140
github-status:
116141
lang: go
@@ -132,6 +157,11 @@ functions:
132157
secrets:
133158
- private-key
134159
- payload-secret
160+
limits:
161+
memory: 128Mi
162+
requests:
163+
memory: 32Mi
164+
cpu: 50m
135165

136166
import-secrets:
137167
lang: go
@@ -150,6 +180,11 @@ functions:
150180
- github.yml
151181
secrets:
152182
- payload-secret
183+
limits:
184+
memory: 128Mi
185+
requests:
186+
memory: 32Mi
187+
cpu: 50m
153188

154189
pipeline-log:
155190
lang: go
@@ -169,6 +204,11 @@ functions:
169204
- s3-access-key
170205
- s3-secret-key
171206
- payload-secret
207+
limits:
208+
memory: 128Mi
209+
requests:
210+
memory: 32Mi
211+
cpu: 50m
172212

173213
list-functions:
174214
lang: go
@@ -186,6 +226,11 @@ functions:
186226
secrets:
187227
- basic-auth-user
188228
- basic-auth-password
229+
limits:
230+
memory: 128Mi
231+
requests:
232+
memory: 32Mi
233+
cpu: 50m
189234

190235
audit-event:
191236
lang: go
@@ -196,6 +241,11 @@ functions:
196241
com.openfaas.scale.zero: false
197242
environment_file:
198243
- slack.yml
244+
limits:
245+
memory: 128Mi
246+
requests:
247+
memory: 32Mi
248+
cpu: 50m
199249

200250
echo:
201251
skip_build: true
@@ -207,6 +257,11 @@ functions:
207257
environment:
208258
write_debug: true
209259
read_debug: true
260+
limits:
261+
memory: 128Mi
262+
requests:
263+
memory: 32Mi
264+
cpu: 50m
210265

211266
metrics:
212267
lang: go
@@ -220,6 +275,11 @@ functions:
220275
- gateway_config.yml
221276
environment:
222277
content_type: "application/json"
278+
limits:
279+
memory: 128Mi
280+
requests:
281+
memory: 32Mi
282+
cpu: 50m
223283

224284
function-logs:
225285
lang: go
@@ -237,5 +297,10 @@ functions:
237297
secrets:
238298
- basic-auth-user
239299
- basic-auth-password
300+
limits:
301+
memory: 128Mi
302+
requests:
303+
memory: 32Mi
304+
cpu: 50m
240305

241306

0 commit comments

Comments
 (0)