app/matrix: adjust resources configuration for prod changes

Change-Id: Ib81847bd65e254cbd650d60456185e681e2b1e88
Reviewed-on: https://gerrit.hackerspace.pl/c/hscloud/+/1390
Reviewed-by: informatic <informatic@hackerspace.pl>
diff --git a/app/matrix/lib/synapse.libsonnet b/app/matrix/lib/synapse.libsonnet
index 0b05795..0d8ef8a 100644
--- a/app/matrix/lib/synapse.libsonnet
+++ b/app/matrix/lib/synapse.libsonnet
@@ -115,6 +115,11 @@
 
             # Mount app.dataVolume in /data
             mountData: false,
+
+            resources: {
+                requests: { cpu: "300m", memory: "1Gi" },
+                limits: { cpu: "1500m", memory: "2Gi" },
+            },
         },
 
         spec+: {
@@ -141,10 +146,7 @@
                                     exec python -m ${SYNAPSE_WORKER} --config-path /conf/homeserver.yaml --config-path /tmp/secrets.yaml --config-path /tmp/local.yaml
                                 |||
                             ],
-                            resources: {
-                                requests: { cpu: "300m", memory: "1Gi" },
-                                limits: { cpu: "1500m", memory: "2Gi" },
-                            },
+                            resources: worker.cfg.resources,
                             ports_: {
                                 http: { containerPort: 8008 },
                                 metrics: { containerPort: 9092 },
@@ -212,7 +214,12 @@
                     notify_appservices: app.config.notify_appservices,
                     # send_federation: app.config.send_federation,
                     # federation_sender_instances: app.config.federation_sender_instances,
-                }
+                },
+
+                resources+: {
+                    limits+: { memory: "4Gi" },
+                    requests+: { memory: "2Gi" },
+                },
             },
             spec+: {
                 strategy+: {