feat: Add uptime module for monitoring server availability
This commit is contained in:
parent
57b37c1c5e
commit
9a4cfd8e8f
3 changed files with 63 additions and 0 deletions
4
main.tf
4
main.tf
|
@ -13,3 +13,7 @@ module "media-centre" {
|
||||||
module "coder" {
|
module "coder" {
|
||||||
source = "./modules/coder"
|
source = "./modules/coder"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
module "uptime" {
|
||||||
|
source = "./modules/uptime"
|
||||||
|
}
|
||||||
|
|
55
modules/uptime/jobspec.json
Normal file
55
modules/uptime/jobspec.json
Normal 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
4
modules/uptime/main.tf
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
resource "nomad_job" "uptime" {
|
||||||
|
jobspec = file("${path.module}/jobspec.json")
|
||||||
|
json = true
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue