This commit is contained in:
kento2 2026-08-18 19:19:33 +02:00
parent dede9ce18d
commit 15f60f0465
7 changed files with 111 additions and 270 deletions

View file

@ -22,20 +22,40 @@ us connect to the resolved IPs. With a single node, that's fine but if we want t
access a service on another node, we need wireguard(or something similar).
Actually if we run all nodes in the same network and it'd be fine without.
## Most Basic Implementation
- single node
- runs `nomad agent -dev` and `consul agent -dev`
- runs `dnsmasq -d`, `nomad agent -dev`, and `consul agent -dev` as root
- /etc/nomad.d/consul.hcl:
consul {
address = "127.0.0.1:8500"
}
- /etc/dnsmasq.conf:
server=/consul/127.0.0.1#8600
- all jobs define a consul service
- TODO: make dns/connect work
## useful commands
## useful stuff
- `nomad job run <job>.hcl`
- `consul catalog services` <- list registered services
- http://localhost:4646/ui/jobs <- web UI accessible after `nomad agent -dev`
- https://developer.hashicorp.com/nomad/docs/configuration
- https://developer.hashicorp.com/nomad/docs/job-declare/service-discovery
## Storage/SPOT
the papermc container already copies all files in /mnt/*
to /data, so it's easy to add overwrites.
in ./lobby.nomad.hcl I just use a prestart container that downloads the plugin
to a temporary volume that is then used as /mnt.
A lot of boilerplate and it's also not easy to add other files.
Ideally, we'd just copy a whole directory over sftp. it would look
like this:
/.gitignore <- data
/Makefile <- downloads plugins specified to /data/plugins
/static <- static files that are copied by make to /data
But ig that wouldn't play nice with CI/CD...
Also currently we need to duplicate a lot of this boilerplate btw.