mirror of
https://git.sr.ht/~magic_rb/cluster
synced 2024-11-24 09:06:15 +01:00
766e15b326
Signed-off-by: main <magic_rb@redalder.org>
43 lines
969 B
HCL
43 lines
969 B
HCL
data "local_file" "ingress-upstreams" {
|
|
filename = "${path.module}/ingress-upstreams.conf"
|
|
}
|
|
|
|
resource "nomad_volume" "ingress-letsencrypt" {
|
|
type = "csi"
|
|
plugin_id = "org.democratic-csi.nfs"
|
|
volume_id = "ingress-letsencrypt"
|
|
name = "ingress-letsencrypt"
|
|
external_id = "ingress-letsencrypt"
|
|
|
|
capability {
|
|
access_mode = "single-node-writer"
|
|
attachment_mode = "file-system"
|
|
}
|
|
|
|
context = {
|
|
server = "10.64.2.1"
|
|
share = "/var/nfs/ingress-letsencrypt"
|
|
node_attach_driver = "nfs"
|
|
provisioner_driver = "node-manual"
|
|
}
|
|
|
|
mount_options {
|
|
fs_type = "nfs"
|
|
mount_flags = [ "nolock", "hard" ]
|
|
}
|
|
}
|
|
|
|
resource "nomad_job" "ingress" {
|
|
jobspec = file("${path.module}/ingress.hcl")
|
|
|
|
hcl2 {
|
|
enabled = true
|
|
vars = {
|
|
flake_ref = "${var.flake_host_alt}?rev=${var.flake_rev}&ref=${var.flake_ref}"
|
|
flake_sha = var.flake_sha
|
|
|
|
upstreams = data.local_file.ingress-upstreams.content
|
|
}
|
|
}
|
|
}
|