2022-06-01 08:41:51 +02:00
|
|
|
variable "flake_ref" {
|
|
|
|
type = string
|
|
|
|
}
|
|
|
|
|
|
|
|
variable "flake_sha" {
|
|
|
|
type = string
|
|
|
|
}
|
|
|
|
|
2021-05-12 17:31:15 +02:00
|
|
|
job "website" {
|
|
|
|
datacenters = [ "homelab-1" ]
|
|
|
|
type = "service"
|
|
|
|
|
|
|
|
constraint {
|
|
|
|
attribute = "${attr.unique.hostname}"
|
|
|
|
value = "blowhole"
|
|
|
|
}
|
|
|
|
|
|
|
|
group "website" {
|
2021-06-12 17:11:37 +02:00
|
|
|
count = 2
|
|
|
|
|
|
|
|
update {
|
|
|
|
max_parallel = 1
|
|
|
|
}
|
2021-05-12 17:31:15 +02:00
|
|
|
|
|
|
|
network {
|
2021-06-23 11:41:06 +02:00
|
|
|
mode = "bridge"
|
2021-05-12 17:31:15 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
service {
|
|
|
|
name = "website"
|
2021-06-23 11:41:06 +02:00
|
|
|
port = "80"
|
|
|
|
|
|
|
|
check {
|
2022-07-30 23:27:40 +02:00
|
|
|
type = "http"
|
|
|
|
address_mode = "alloc"
|
|
|
|
path = "/"
|
|
|
|
port = "80"
|
|
|
|
interval = "10s"
|
|
|
|
timeout = "10s"
|
2021-06-23 11:41:06 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
connect {
|
2022-07-30 23:27:40 +02:00
|
|
|
sidecar_service {}
|
2021-06-23 11:41:06 +02:00
|
|
|
|
2022-07-30 23:27:40 +02:00
|
|
|
sidecar_task {
|
|
|
|
resources {
|
|
|
|
cpu = 75
|
|
|
|
memory = 48
|
|
|
|
}
|
2021-06-23 11:41:06 +02:00
|
|
|
|
2022-07-30 23:27:40 +02:00
|
|
|
config {
|
|
|
|
memory_hard_limit = 96
|
|
|
|
}
|
|
|
|
}
|
2021-06-23 11:41:06 +02:00
|
|
|
}
|
2021-05-12 17:31:15 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
task "apache" {
|
2022-06-01 08:41:51 +02:00
|
|
|
driver = "containerd-driver"
|
2021-05-12 17:31:15 +02:00
|
|
|
|
|
|
|
config {
|
2022-07-30 23:27:40 +02:00
|
|
|
flake_ref = "${var.flake_ref}#nixngSystems.website.config.system.build.toplevel"
|
|
|
|
flake_sha = var.flake_sha
|
|
|
|
entrypoint = [ "init" ]
|
2021-06-23 11:41:06 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
resources {
|
2022-07-30 23:27:40 +02:00
|
|
|
cpu = 128
|
|
|
|
memory = 32
|
|
|
|
memory_max = 64
|
2021-05-12 17:31:15 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|