feat: Add uptime module for monitoring server availability

This commit is contained in:
Ben Martin 2024-07-27 12:22:23 +00:00
parent 57b37c1c5e
commit 9a4cfd8e8f
Signed by: ben
GPG key ID: 859A655FCD290E4A
3 changed files with 63 additions and 0 deletions

View file

@ -13,3 +13,7 @@ module "media-centre" {
module "coder" { module "coder" {
source = "./modules/coder" source = "./modules/coder"
} }
module "uptime" {
source = "./modules/uptime"
}

View file

@ -0,0 +1,55 @@
{
"ID": "uptime",
"Name": "Uptime",
"TaskGroups": [
{
"Name": "Uptime Servers",
"Tasks": [
{
"Name": "kuma",
"Driver": "docker",
"Config": {
"image": "louislam/uptime-kuma:latest",
"ports": [
"web"
],
"mounts": [
{
"type": "volume",
"target": "/app/data",
"source": "kuma-data"
}
]
},
"Resources": {
"CPU": 1200,
"MemoryMB": 4096
}
}
],
"Services": [
{
"Name": "Kuma",
"Provider": "nomad",
"PortLabel": "web",
"Tags": [
"traefik.enable=true",
"traefik.http.routers.kuma.entrypoints=websecure",
"traefik.http.routers.kuma.rule=Host(`kuma.brmartin.co.uk`)"
]
}
],
"Networks": [
{
"DynamicPorts": [
{
"Label": "web",
"To": 3001
}
]
}
]
}
]
}

4
modules/uptime/main.tf Normal file
View file

@ -0,0 +1,4 @@
resource "nomad_job" "uptime" {
jobspec = file("${path.module}/jobspec.json")
json = true
}