app/matrix: add healthchecks, increase generic workers

Change-Id: I1605919d52c69044963082bbf094ff2ece902471
Reviewed-on: https://gerrit.hackerspace.pl/c/hscloud/+/1147
Reviewed-by: q3k <q3k@hackerspace.pl>
diff --git a/app/matrix/lib/media-repo.libsonnet b/app/matrix/lib/media-repo.libsonnet
index 286ffa7..e81c32a 100644
--- a/app/matrix/lib/media-repo.libsonnet
+++ b/app/matrix/lib/media-repo.libsonnet
@@ -88,6 +88,22 @@
                                 config: { mountPath: "/config" },
                                 tempdir: { mountPath: "/tmp/mediarepo_s3_upload" },
                             },
+                            readinessProbe: {
+                                httpGet: {
+                                    path: "/healthz",
+                                    port: "http",
+                                },
+                                initialDelaySeconds: 5,
+                                periodSeconds: 10,
+                            },
+                            livenessProbe: {
+                                httpGet: {
+                                    path: "/healthz",
+                                    port: "http",
+                                },
+                                initialDelaySeconds: 60,
+                                periodSeconds: 30,
+                            },
                         },
                     },
                 },
diff --git a/app/matrix/lib/synapse.libsonnet b/app/matrix/lib/synapse.libsonnet
index ea7bff2..80ab8f0 100644
--- a/app/matrix/lib/synapse.libsonnet
+++ b/app/matrix/lib/synapse.libsonnet
@@ -147,6 +147,22 @@
                             } + if worker.cfg.mountData then {
                                 data: { mountPath: "/data" },
                             } else {},
+                            readinessProbe: {
+                                httpGet: {
+                                    path: "/health",
+                                    port: "http",
+                                },
+                                initialDelaySeconds: 5,
+                                periodSeconds: 10,
+                            },
+                            livenessProbe: {
+                                httpGet: {
+                                    path: "/health",
+                                    port: "http",
+                                },
+                                initialDelaySeconds: 60,
+                                periodSeconds: 30,
+                            },
                         },
                     },
                     securityContext: {
diff --git a/app/matrix/matrix.hackerspace.pl.jsonnet b/app/matrix/matrix.hackerspace.pl.jsonnet
index a30d722..8d341c4 100644
--- a/app/matrix/matrix.hackerspace.pl.jsonnet
+++ b/app/matrix/matrix.hackerspace.pl.jsonnet
@@ -42,8 +42,16 @@
         },
     },
 
-    // Synapse media worker has been replaced by matrix-media-repo deployment
     synapse+: {
+        genericWorker+: {
+            deployment+: {
+                spec+: {
+                    replicas: 4,
+                },
+            },
+        },
+
+        // Synapse media worker has been replaced by matrix-media-repo deployment
         mediaWorker+: {
             deployment+: {
                 spec+: {