2022-07-30 23:27:40 +02:00
|
|
|
data "local_file" "ingress-upstreams" {
|
|
|
|
filename = "${path.module}/ingress-upstreams.conf"
|
2022-06-01 08:41:51 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
resource "nomad_volume" "ingress-letsencrypt" {
|
|
|
|
type = "csi"
|
|
|
|
plugin_id = "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.1.201"
|
|
|
|
share = "/var/nfs/ingress-letsencrypt"
|
|
|
|
}
|
|
|
|
|
|
|
|
mount_options {
|
|
|
|
fs_type = "nfs"
|
|
|
|
mount_flags = [ "nolock", "hard" ]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "nomad_job" "ingress" {
|
2022-07-30 23:27:40 +02:00
|
|
|
jobspec = file("${path.module}/ingress.hcl")
|
2022-06-01 08:41:51 +02:00
|
|
|
|
|
|
|
hcl2 {
|
|
|
|
enabled = true
|
|
|
|
vars = {
|
2022-07-30 23:27:40 +02:00
|
|
|
flake_ref = "${var.flake_host_alt}?rev=${var.flake_rev}"
|
2022-06-01 08:41:51 +02:00
|
|
|
flake_sha = var.flake_sha
|
2022-07-30 23:27:40 +02:00
|
|
|
|
|
|
|
upstreams = data.local_file.ingress-upstreams.content
|
2022-06-01 08:41:51 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|