From 70ea9498648da1a42992603fd9efdbb4cbf58458 Mon Sep 17 00:00:00 2001 From: Martin Dekov Date: Sat, 21 Mar 2020 19:13:26 +0200 Subject: [PATCH] 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 --- dashboard/stack.yml | 5 ++++ gitlab.yml | 15 +++++++++++ stack.yml | 65 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 85 insertions(+) diff --git a/dashboard/stack.yml b/dashboard/stack.yml index f7bd2e7ae..b2c33fa1f 100644 --- a/dashboard/stack.yml +++ b/dashboard/stack.yml @@ -12,3 +12,8 @@ functions: role: openfaas-system environment_file: - dashboard_config.yml + limits: + memory: 256Mi + requests: + memory: 64Mi + cpu: 50m \ No newline at end of file diff --git a/gitlab.yml b/gitlab.yml index 56a18e0dc..73ab66640 100644 --- a/gitlab.yml +++ b/gitlab.yml @@ -26,6 +26,11 @@ functions: - payload-secret - gitlab-api-token - customers + limits: + memory: 128Mi + requests: + memory: 32Mi + cpu: 50m gitlab-push: lang: go @@ -44,6 +49,11 @@ functions: secrets: - payload-secret - customers + limits: + memory: 128Mi + requests: + memory: 32Mi + cpu: 50m gitlab-status: lang: go @@ -61,3 +71,8 @@ functions: secrets: - gitlab-api-token - payload-secret + limits: + memory: 128Mi + requests: + memory: 32Mi + cpu: 50m diff --git a/stack.yml b/stack.yml index 9cc112b8a..39f291d4a 100644 --- a/stack.yml +++ b/stack.yml @@ -23,6 +23,11 @@ functions: - github-webhook-secret - payload-secret - customers + limits: + memory: 128Mi + requests: + memory: 32Mi + cpu: 50m github-push: lang: go @@ -45,6 +50,11 @@ functions: - github-webhook-secret - payload-secret - customers + limits: + memory: 128Mi + requests: + memory: 32Mi + cpu: 50m git-tar: lang: dockerfile @@ -67,6 +77,11 @@ functions: - private-key # Uncomment this for GitLab # - gitlab-api-token + limits: + memory: 128Mi + requests: + memory: 32Mi + cpu: 50m buildshiprun: lang: go @@ -91,6 +106,11 @@ functions: - basic-auth-password - payload-secret # - swarm-pull-secret + limits: + memory: 128Mi + requests: + memory: 32Mi + cpu: 50m garbage-collect: lang: go @@ -111,6 +131,11 @@ functions: - basic-auth-user - basic-auth-password - payload-secret + limits: + memory: 128Mi + requests: + memory: 32Mi + cpu: 50m github-status: lang: go @@ -132,6 +157,11 @@ functions: secrets: - private-key - payload-secret + limits: + memory: 128Mi + requests: + memory: 32Mi + cpu: 50m import-secrets: lang: go @@ -150,6 +180,11 @@ functions: - github.yml secrets: - payload-secret + limits: + memory: 128Mi + requests: + memory: 32Mi + cpu: 50m pipeline-log: lang: go @@ -169,6 +204,11 @@ functions: - s3-access-key - s3-secret-key - payload-secret + limits: + memory: 128Mi + requests: + memory: 32Mi + cpu: 50m list-functions: lang: go @@ -186,6 +226,11 @@ functions: secrets: - basic-auth-user - basic-auth-password + limits: + memory: 128Mi + requests: + memory: 32Mi + cpu: 50m audit-event: lang: go @@ -196,6 +241,11 @@ functions: com.openfaas.scale.zero: false environment_file: - slack.yml + limits: + memory: 128Mi + requests: + memory: 32Mi + cpu: 50m echo: skip_build: true @@ -207,6 +257,11 @@ functions: environment: write_debug: true read_debug: true + limits: + memory: 128Mi + requests: + memory: 32Mi + cpu: 50m metrics: lang: go @@ -220,6 +275,11 @@ functions: - gateway_config.yml environment: content_type: "application/json" + limits: + memory: 128Mi + requests: + memory: 32Mi + cpu: 50m function-logs: lang: go @@ -237,5 +297,10 @@ functions: secrets: - basic-auth-user - basic-auth-password + limits: + memory: 128Mi + requests: + memory: 32Mi + cpu: 50m