variable "flake_ref" { type = string } variable "flake_sha" { type = string } job "ingress" { datacenters = [ "do-1", "homelab-1" ] type = "service" group "ingress-toothpick" { count = 1 constraint { attribute = "${attr.unique.hostname}" value = "toothpick" } volume "ingress-letsencrypt" { type = "csi" source = "ingress-letsencrypt" read_only = false attachment_mode = "file-system" access_mode = "single-node-writer" } network { mode = "bridge" port "http" { static = 80 to = 80 host_network = "public" } port "https" { static = 443 to = 443 host_network = "public" } port "minecraft" { static = 25565 to = 25565 host_network = "public" } } service { name = "ingress-toothpick" port = "http" connect { sidecar_service { proxy { upstreams { destination_name = "gitea" local_bind_port = 3000 datacenter = "homelab-1" mesh_gateway { mode = "local" } } upstreams { destination_name = "hydra" local_bind_port = 8666 datacenter = "homelab-1" mesh_gateway { mode = "local" } } upstreams { destination_name = "nextcloud" local_bind_port = 8777 datacenter = "homelab-1" mesh_gateway { mode = "local" } } upstreams { destination_name = "website" local_bind_port = 8080 datacenter = "homelab-1" mesh_gateway { mode = "local" } } upstreams { destination_name = "minecraft" local_bind_port = 2666 datacenter = "homelab-1" mesh_gateway { mode = "local" } } upstreams { destination_name = "reicio" local_bind_port = 8000 datacenter = "homelab-1" mesh_gateway { mode = "local" } } } } } } task "nginx" { driver = "docker" volume_mount { volume = "ingress-letsencrypt" destination = "/etc/letsencrypt" read_only = false } # artifact { # source = "http://hydra/build/99/download/1/image.tar.gz" # } config { # load = "nixng-ingress.tar.gz" image = "nixng-ingress:local" ports = ["http", "https", "minecraft"] memory_hard_limit = 128 } resources { cpu = 200 memory = 32 } template { data = <