mirror of
https://git.sr.ht/~magic_rb/cluster
synced 2024-12-01 20:46:12 +01:00
2e61e7ef3c
Signed-off-by: main <magic_rb@redalder.org>
59 lines
969 B
HCL
59 lines
969 B
HCL
variable "flake_ref" {
|
|
type = string
|
|
}
|
|
|
|
variable "flake_sha" {
|
|
type = string
|
|
}
|
|
|
|
job "camptules" {
|
|
datacenters = [ "homelab-1" ]
|
|
type = "service"
|
|
|
|
group "camptules" {
|
|
count = 1
|
|
|
|
network {
|
|
mode = "bridge"
|
|
}
|
|
|
|
task "camptules" {
|
|
driver = "containerd-driver"
|
|
|
|
config {
|
|
flake_ref = "${var.flake_ref}#nixngSystems.camptules.config.system.build.toplevel"
|
|
flake_sha = var.flake_sha
|
|
entrypoint = [ "init" ]
|
|
}
|
|
|
|
resources {
|
|
cpu = 512
|
|
memory = 128
|
|
memory_max = 192
|
|
}
|
|
|
|
vault {
|
|
policies = ["camptules-policy"]
|
|
}
|
|
|
|
template {
|
|
data = <<EOF
|
|
{{ with secret "kv/data/camptules" }}
|
|
{{ .Data.data.token }}
|
|
{{ end }}
|
|
EOF
|
|
destination = "secrets/cfg"
|
|
}
|
|
|
|
template {
|
|
data = <<EOF
|
|
{{ with secret "kv/data/camptules" }}
|
|
{{ .Data.data.ytb_api_key }}
|
|
{{ end }}
|
|
EOF
|
|
destination = "secrets/ytb-api-key"
|
|
}
|
|
}
|
|
}
|
|
}
|