Load balancing preprod API back servers

This commit is contained in:
David Négrier 2020-12-14 22:44:02 +01:00
parent c633de5eed
commit 49c7927e9f

View File

@ -7,10 +7,10 @@
"$schema": "https://raw.githubusercontent.com/thecodingmachine/deeployer/master/deeployer.schema.json", "$schema": "https://raw.githubusercontent.com/thecodingmachine/deeployer/master/deeployer.schema.json",
"version": "1.0", "version": "1.0",
"containers": { "containers": {
"back": { "back1": {
"image": "thecodingmachine/workadventure-back:"+tag, "image": "thecodingmachine/workadventure-back:"+tag,
"host": { "host": {
"url": "api."+url, "url": "api1."+url,
"https": "enable", "https": "enable",
"containerPort": 8080 "containerPort": 8080
}, },
@ -25,6 +25,24 @@
"ADMIN_API_URL": adminUrl, "ADMIN_API_URL": adminUrl,
} else {} } 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": { "pusher": {
"replicas": 2, "replicas": 2,
"image": "thecodingmachine/workadventure-pusher:"+tag, "image": "thecodingmachine/workadventure-pusher:"+tag,
@ -38,7 +56,7 @@
"ADMIN_API_TOKEN": env.ADMIN_API_TOKEN, "ADMIN_API_TOKEN": env.ADMIN_API_TOKEN,
"JITSI_ISS": env.JITSI_ISS, "JITSI_ISS": env.JITSI_ISS,
"JITSI_URL": env.JITSI_URL, "JITSI_URL": env.JITSI_URL,
"API_URL": "back:50051", "API_URL": "back1:50051,back2:50051",
"SECRET_JITSI_KEY": env.SECRET_JITSI_KEY, "SECRET_JITSI_KEY": env.SECRET_JITSI_KEY,
} + if adminUrl != null then { } + if adminUrl != null then {
"ADMIN_API_URL": adminUrl, "ADMIN_API_URL": adminUrl,
@ -100,7 +118,35 @@
}, },
k8sextension(k8sConf):: k8sextension(k8sConf)::
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+: { deployment+: {
spec+: { spec+: {
template+: { template+: {