From 49c7927e9fabee2191c0f73068497d9d14b14445 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20N=C3=A9grier?= Date: Mon, 14 Dec 2020 22:44:02 +0100 Subject: [PATCH] Load balancing preprod API back servers --- deeployer.libsonnet | 54 +++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 50 insertions(+), 4 deletions(-) diff --git a/deeployer.libsonnet b/deeployer.libsonnet index f974f4dd..8770ba6f 100644 --- a/deeployer.libsonnet +++ b/deeployer.libsonnet @@ -7,10 +7,10 @@ "$schema": "https://raw.githubusercontent.com/thecodingmachine/deeployer/master/deeployer.schema.json", "version": "1.0", "containers": { - "back": { + "back1": { "image": "thecodingmachine/workadventure-back:"+tag, "host": { - "url": "api."+url, + "url": "api1."+url, "https": "enable", "containerPort": 8080 }, @@ -25,6 +25,24 @@ "ADMIN_API_URL": adminUrl, } else {} }, + "back2": { + "image": "thecodingmachine/workadventure-back:"+tag, + "host": { + "url": "api2."+url, + "https": "enable", + "containerPort": 8080 + }, + "ports": [8080, 50051], + "env": { + "SECRET_KEY": "tempSecretKeyNeedsToChange", + "ADMIN_API_TOKEN": env.ADMIN_API_TOKEN, + "JITSI_ISS": env.JITSI_ISS, + "JITSI_URL": env.JITSI_URL, + "SECRET_JITSI_KEY": env.SECRET_JITSI_KEY, + } + if adminUrl != null then { + "ADMIN_API_URL": adminUrl, + } else {} + }, "pusher": { "replicas": 2, "image": "thecodingmachine/workadventure-pusher:"+tag, @@ -38,7 +56,7 @@ "ADMIN_API_TOKEN": env.ADMIN_API_TOKEN, "JITSI_ISS": env.JITSI_ISS, "JITSI_URL": env.JITSI_URL, - "API_URL": "back:50051", + "API_URL": "back1:50051,back2:50051", "SECRET_JITSI_KEY": env.SECRET_JITSI_KEY, } + if adminUrl != null then { "ADMIN_API_URL": adminUrl, @@ -100,7 +118,35 @@ }, k8sextension(k8sConf):: k8sConf + { - back+: { + back1+: { + deployment+: { + spec+: { + template+: { + metadata+: { + annotations+: { + "prometheus.io/port": "8080", + "prometheus.io/scrape": "true" + } + } + } + } + } + }, + back2+: { + deployment+: { + spec+: { + template+: { + metadata+: { + annotations+: { + "prometheus.io/port": "8080", + "prometheus.io/scrape": "true" + } + } + } + } + } + }, + pusher+: { deployment+: { spec+: { template+: {