mirror of
https://git.sr.ht/~magic_rb/dotfiles
synced 2024-11-21 23:54:22 +01:00
Add terranix config for gateway-mesh
Signed-off-by: Magic_RB <magic_rb@redalder.org>
This commit is contained in:
parent
85d06f4c71
commit
86d13b4f40
16
terranix/containers/gateway-mesh/default.nix
Normal file
16
terranix/containers/gateway-mesh/default.nix
Normal file
|
@ -0,0 +1,16 @@
|
|||
{ elib, ... }:
|
||||
let
|
||||
inherit (elib)
|
||||
nomadJob;
|
||||
in
|
||||
{
|
||||
resource."nomad_job"."mesh" = nomadJob {
|
||||
jobspec = ./job.hcl;
|
||||
vars = {
|
||||
"datacenters" = builtins.toJSON [
|
||||
"do-1"
|
||||
"homelab-1"
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
30
terranix/containers/gateway-mesh/job.hcl
Normal file
30
terranix/containers/gateway-mesh/job.hcl
Normal file
|
@ -0,0 +1,30 @@
|
|||
variable "datacenters" {
|
||||
type = list(string)
|
||||
}
|
||||
|
||||
job "gateway-mesh" {
|
||||
datacenters = var.datacenters
|
||||
|
||||
group "envoy" {
|
||||
network {
|
||||
mode = "bridge"
|
||||
|
||||
port "mesh_wan" {
|
||||
host_network = "mesh"
|
||||
}
|
||||
}
|
||||
|
||||
service {
|
||||
name = "mesh-gateway"
|
||||
|
||||
port = "mesh_wan"
|
||||
|
||||
connect {
|
||||
gateway {
|
||||
mesh {}
|
||||
proxy {}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue