From 77af94df2f6d18c02dd95371d39d95e235021c6b Mon Sep 17 00:00:00 2001 From: Piotr Dobrowolski Date: Thu, 16 Sep 2021 22:17:58 +0200 Subject: [PATCH] app/matrix: add healthchecks, increase generic workers Change-Id: I1605919d52c69044963082bbf094ff2ece902471 Reviewed-on: https://gerrit.hackerspace.pl/c/hscloud/+/1147 Reviewed-by: q3k --- app/matrix/lib/media-repo.libsonnet | 16 ++++++++++++++++ app/matrix/lib/synapse.libsonnet | 16 ++++++++++++++++ app/matrix/matrix.hackerspace.pl.jsonnet | 10 +++++++++- 3 files changed, 41 insertions(+), 1 deletion(-) diff --git a/app/matrix/lib/media-repo.libsonnet b/app/matrix/lib/media-repo.libsonnet index 286ffa75..e81c32a5 100644 --- a/app/matrix/lib/media-repo.libsonnet +++ b/app/matrix/lib/media-repo.libsonnet @@ -88,6 +88,22 @@ local kube = import "../../../kube/kube.libsonnet"; 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 ea7bff2b..80ab8f0e 100644 --- a/app/matrix/lib/synapse.libsonnet +++ b/app/matrix/lib/synapse.libsonnet @@ -147,6 +147,22 @@ local kube = import "../../../kube/kube.libsonnet"; } + 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 a30d722f..8d341c43 100644 --- a/app/matrix/matrix.hackerspace.pl.jsonnet +++ b/app/matrix/matrix.hackerspace.pl.jsonnet @@ -42,8 +42,16 @@ matrix { }, }, - // 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+: {