mirror of
https://git.sr.ht/~magic_rb/cluster
synced 2024-11-25 09:36:14 +01:00
6835af938c
Signed-off-by: main <magic_rb@redalder.org>
75 lines
997 B
HCL
75 lines
997 B
HCL
variable "flake_ref" {
|
|
type = string
|
|
}
|
|
|
|
variable "flake_sha" {
|
|
type = string
|
|
}
|
|
|
|
job "website" {
|
|
datacenters = [ "homelab-1" ]
|
|
type = "service"
|
|
|
|
constraint {
|
|
attribute = "${attr.unique.hostname}"
|
|
value = "blowhole"
|
|
}
|
|
|
|
group "website" {
|
|
count = 2
|
|
|
|
update {
|
|
max_parallel = 1
|
|
}
|
|
|
|
network {
|
|
mode = "bridge"
|
|
}
|
|
|
|
service {
|
|
name = "website"
|
|
port = "80"
|
|
|
|
check {
|
|
type = "http"
|
|
address_mode = "alloc"
|
|
path = "/"
|
|
port = "80"
|
|
interval = "10s"
|
|
timeout = "10s"
|
|
}
|
|
|
|
connect {
|
|
sidecar_service {}
|
|
|
|
sidecar_task {
|
|
resources {
|
|
cpu = 75
|
|
memory = 48
|
|
}
|
|
|
|
config {
|
|
memory_hard_limit = 96
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
task "apache" {
|
|
driver = "containerd-driver"
|
|
|
|
config {
|
|
flake_ref = "${var.flake_ref}#nixngSystems.website.config.system.build.toplevel"
|
|
flake_sha = var.flake_sha
|
|
entrypoint = [ "init" ]
|
|
}
|
|
|
|
resources {
|
|
cpu = 128
|
|
memory = 32
|
|
memory_max = 64
|
|
}
|
|
}
|
|
}
|
|
}
|