From 2a4aaa3c21cd0d41870a36bdbb58467c030773d5 Mon Sep 17 00:00:00 2001 From: Daniel Pawlik Date: Wed, 15 Jul 2026 07:38:12 +0200 Subject: [PATCH] Add resource limits to Smart Gateway containers Set CPU/memory requests and limits on all three containers (oauth-proxy, bridge, sg-core) in the generated Smart Gateway deployment to prevent unbounded resource consumption. Signed-off-by: Daniel Pawlik --- .../smartgateway/templates/deployment.yaml.j2 | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/roles/smartgateway/templates/deployment.yaml.j2 b/roles/smartgateway/templates/deployment.yaml.j2 index 325679e..fa61fed 100644 --- a/roles/smartgateway/templates/deployment.yaml.j2 +++ b/roles/smartgateway/templates/deployment.yaml.j2 @@ -39,6 +39,13 @@ spec: capabilities: drop: - ALL + resources: + limits: + cpu: '2' + memory: 8Gi + requests: + cpu: 300m + memory: 512Mi args: - -https-address=:8083 - -tls-cert=/etc/tls/private/tls.crt @@ -68,6 +75,13 @@ spec: capabilities: drop: - ALL + resources: + limits: + cpu: '2' + memory: 8Gi + requests: + cpu: 300m + memory: 512Mi args: {% if sg_vars.bridge.amqp_url is defined and sg_vars.bridge.amqp_url != "" %} - --amqp_url @@ -125,6 +139,13 @@ spec: capabilities: drop: - ALL + resources: + limits: + cpu: '2' + memory: 8Gi + requests: + cpu: 300m + memory: 512Mi args: - -config - /etc/sg-core/sg-core.conf.yaml