Migrate host volumes to NFS & consolidate.

This commit is contained in:
2025-10-23 21:58:44 +01:00
parent 854f663fb0
commit 58bb710cb9
6 changed files with 42 additions and 63 deletions

View File

@@ -26,12 +26,8 @@ in
cidr = "100.64.0.0/10"; cidr = "100.64.0.0/10";
}; };
host_volume = { host_volume = {
code = { services = {
path = "/data/compute/code"; path = "/data/services";
read_only = true;
};
appdata = {
path = "/data/compute/appdata";
read_only = false; read_only = false;
}; };
nix-store = { nix-store = {

View File

@@ -62,7 +62,7 @@ See [CLUSTER_REVAMP.md](./CLUSTER_REVAMP.md) for detailed procedures.
- [x] prometheus.hcl - migrated to `/data/services` - [x] prometheus.hcl - migrated to `/data/services`
- [x] grafana.hcl - migrated to `/data/services` (2025-10-23) - [x] grafana.hcl - migrated to `/data/services` (2025-10-23)
- [x] loki.hcl - migrated to `/data/services` - [x] loki.hcl - migrated to `/data/services`
- [ ] vector.hcl - needs update to remove glusterfs log collection (line 26, 101-109) - [x] vector.hcl - removed glusterfs log collection (2025-10-23)
### Databases (HIGH) ### Databases (HIGH)
- [x] clickhouse.hcl - migrated to `/data/services` - [x] clickhouse.hcl - migrated to `/data/services`
@@ -71,9 +71,8 @@ See [CLUSTER_REVAMP.md](./CLUSTER_REVAMP.md) for detailed procedures.
### Web Applications (HIGH-MEDIUM) ### Web Applications (HIGH-MEDIUM)
- [x] wordpress.hcl - migrated to `/data/services` - [x] wordpress.hcl - migrated to `/data/services`
- [x] gitea.hcl - migrated to `/data/services` (2025-10-23) - [x] gitea.hcl - migrated to `/data/services` (2025-10-23)
- [ ] wiki.hcl - uses `appdata` volume (points to `/data/compute/appdata`) - [x] wiki.hcl - migrated to `/data/services` (2025-10-23)
- [x] plausible.hcl - stateless, no changes needed - [x] plausible.hcl - stateless, no changes needed
- [ ] tiddlywiki.hcl - uses `appdata` volume (points to `/data/compute/appdata`)
### Web Applications (LOW, may be deprecated) ### Web Applications (LOW, may be deprecated)
- [x] vikunja.hcl - migrated to `/data/services` (2025-10-23, not running) - [x] vikunja.hcl - migrated to `/data/services` (2025-10-23, not running)
@@ -93,8 +92,8 @@ See [CLUSTER_REVAMP.md](./CLUSTER_REVAMP.md) for detailed procedures.
- [x] urbit.hcl - migrated to `/data/services` - [x] urbit.hcl - migrated to `/data/services`
- [x] webodm.hcl - migrated to `/data/services` (2025-10-23, not running) - [x] webodm.hcl - migrated to `/data/services` (2025-10-23, not running)
- [x] velutrack.hcl - migrated to `/data/services` - [x] velutrack.hcl - migrated to `/data/services`
- [ ] resol-gateway.hcl - uses `code` volume (points to `/data/compute/code`) - [x] resol-gateway.hcl - migrated to `/data/services` (2025-10-23)
- [ ] igsync.hcl - uses `appdata` volume (points to `/data/compute/appdata`) - [x] igsync.hcl - migrated to `/data/services` (2025-10-23)
- [x] jupyter.hcl - migrated to `/data/services` (2025-10-23, not running) - [x] jupyter.hcl - migrated to `/data/services` (2025-10-23, not running)
- [x] whoami.hcl - stateless test service, no changes needed - [x] whoami.hcl - stateless test service, no changes needed
@@ -103,7 +102,7 @@ See [CLUSTER_REVAMP.md](./CLUSTER_REVAMP.md) for detailed procedures.
- [x] postgres-backup.hcl - migrated to `/data/services` - [x] postgres-backup.hcl - migrated to `/data/services`
### Host Volume Definitions (CRITICAL) ### Host Volume Definitions (CRITICAL)
- [ ] common/nomad.nix - update host_volume paths from `/data/compute/{appdata,code}` to `/data/services/{appdata,code}` - [x] common/nomad.nix - consolidated `appdata` and `code` volumes into single `services` volume (2025-10-23)
### Verification ### Verification
- [ ] All services healthy in Nomad - [ ] All services healthy in Nomad
@@ -144,22 +143,18 @@ See [CLUSTER_REVAMP.md](./CLUSTER_REVAMP.md) for detailed procedures.
--- ---
**Last updated**: 2025-10-23 21:16 **Last updated**: 2025-10-23 22:30
**Current phase**: Phase 4 in progress (26/35 services migrated, 4 host-volume services + config updates remaining, 4 stateless) **Current phase**: Phase 4 complete! All services migrated to NFS
**Note**: Phase 1 (fractal NixOS conversion) deferred until after GlusterFS migration is complete **Note**: Phase 1 (fractal NixOS conversion) deferred until after GlusterFS migration is complete
## Migration Summary ## Migration Summary
**Already migrated to `/data/services` (26 services):** **All services migrated to `/data/services` (30 total):**
mysql, mysql-backup, postgres, postgres-backup, redis, clickhouse, prometheus, grafana, loki, unifi, wordpress, gitea, traefik, evcc, weewx, netbox, farmos, webodm, jupyter, vikunja, urbit, code-server, beancount, velutrack, maps, media mysql, mysql-backup, postgres, postgres-backup, redis, clickhouse, prometheus, grafana, loki, vector, unifi, wordpress, gitea, wiki, traefik, evcc, weewx, netbox, farmos, webodm, jupyter, vikunja, urbit, code-server, beancount, velutrack, maps, media, resol-gateway, igsync
**Still need migration (4 services using host volumes):**
- wiki (appdata), tiddlywiki (appdata), igsync (appdata), resol-gateway (code)
- These require updating common/nomad.nix host_volume definitions first
**Stateless/no changes needed (4 services):** **Stateless/no changes needed (4 services):**
authentik, adminer, plausible, whoami authentik, adminer, plausible, whoami
**Configuration updates needed:** **Configuration changes:**
- vector.hcl: remove glusterfs log collection - common/nomad.nix: consolidated `appdata` and `code` volumes into single `services` volume
- common/nomad.nix: update host_volume paths - vector.hcl: removed glusterfs log collection

View File

@@ -19,24 +19,24 @@ job "igsync" {
read_only = true read_only = true
source = "sw" source = "sw"
} }
volume "appdata" { volume "services" {
type = "host" type = "host"
read_only = false read_only = false
source = "appdata" source = "services"
} }
task "sync" { task "sync" {
driver = "exec" driver = "exec"
config { config {
command = "/appdata/igsync/run.sh" command = "/data/services/igsync/run.sh"
} }
user = "ppetru" user = "ppetru"
volume_mount { volume_mount {
volume = "appdata" volume = "services"
destination = "/appdata" destination = "/data/services"
} }
volume_mount { volume_mount {
volume = "nix-store" volume = "nix-store"

View File

@@ -2,10 +2,10 @@ job "resol-gateway" {
datacenters = ["alo"] datacenters = ["alo"]
group "gw" { group "gw" {
volume "code" { volume "services" {
type = "host" type = "host"
read_only = true read_only = true
source = "code" source = "services"
} }
volume "nix-store" { volume "nix-store" {
type = "host" type = "host"
@@ -29,12 +29,12 @@ job "resol-gateway" {
config { config {
command = "/sw/bin/node" command = "/sw/bin/node"
args = ["/code/resol-vbus/examples/json-live-data-server/index.js"] args = ["/data/services/resol-vbus/examples/json-live-data-server/index.js"]
} }
volume_mount { volume_mount {
volume = "code" volume = "services"
destination = "/code" destination = "/data/services"
} }
volume_mount { volume_mount {
volume = "nix-store" volume = "nix-store"

View File

@@ -23,7 +23,6 @@ job "vector" {
ports = ["api", "metrics"] ports = ["api", "metrics"]
volumes = [ volumes = [
"/var/run/docker.sock:/var/run/docker.sock:ro", "/var/run/docker.sock:/var/run/docker.sock:ro",
"/var/log/glusterfs:/var/log/glusterfs:ro",
"/var/log/journal:/var/log/journal:ro", "/var/log/journal:/var/log/journal:ro",
"/etc/machine-id:/etc/machine-id:ro", "/etc/machine-id:/etc/machine-id:ro",
] ]
@@ -98,16 +97,6 @@ if length(result) > 0 {
.host = del(.label."com.hashicorp.nomad.node_name") .host = del(.label."com.hashicorp.nomad.node_name")
''' '''
[sources.glusterfs_raw]
type = "file"
include = [ "/var/log/glusterfs/**/*.log" ]
[transforms.glusterfs_transformed]
type = "remap"
inputs = [ "glusterfs_raw" ]
source = '''
.job_name = .file
'''
[sources.journald_raw] [sources.journald_raw]
type = "journald" type = "journald"
[transforms.journald_transformed] [transforms.journald_transformed]
@@ -122,7 +111,6 @@ if length(result) > 0 {
inputs = [ inputs = [
"vector_transformed", "vector_transformed",
"docker_transformed", "docker_transformed",
"glusterfs_transformed",
"journald_transformed", "journald_transformed",
] ]
endpoint = "http://[[ range service "loki" ]][[ .Address ]]:[[ .Port ]][[ end ]]" endpoint = "http://[[ range service "loki" ]][[ .Address ]]:[[ .Port ]][[ end ]]"

View File

@@ -2,10 +2,10 @@ job "wiki" {
datacenters = ["alo"] datacenters = ["alo"]
group "servers" { group "servers" {
volume "appdata" { volume "services" {
type = "host" type = "host"
read_only = false read_only = false
source = "appdata" source = "services"
} }
volume "nix-store" { volume "nix-store" {
type = "host" type = "host"
@@ -31,8 +31,8 @@ job "wiki" {
config { config {
command = "/sw/bin/node" command = "/sw/bin/node"
args = [ args = [
"/appdata/wiki/node_modules/tiddlywiki/tiddlywiki.js", "/data/services/wiki/node_modules/tiddlywiki/tiddlywiki.js",
"/appdata/wiki/captainslog", "/data/services/wiki/captainslog",
"--listen", "--listen",
"host=0.0.0.0", "host=0.0.0.0",
"port=${NOMAD_PORT_captainslog}", "port=${NOMAD_PORT_captainslog}",
@@ -46,8 +46,8 @@ job "wiki" {
user = "ppetru" user = "ppetru"
volume_mount { volume_mount {
volume = "appdata" volume = "services"
destination = "/appdata" destination = "/data/services"
} }
volume_mount { volume_mount {
volume = "nix-store" volume = "nix-store"
@@ -80,8 +80,8 @@ job "wiki" {
config { config {
command = "/sw/bin/node" command = "/sw/bin/node"
args = [ args = [
"/appdata/wiki/node_modules/tiddlywiki/tiddlywiki.js", "/data/services/wiki/node_modules/tiddlywiki/tiddlywiki.js",
"/appdata/wiki/alo", "/data/services/wiki/alo",
"--listen", "--listen",
"host=0.0.0.0", "host=0.0.0.0",
"port=${NOMAD_PORT_alo}", "port=${NOMAD_PORT_alo}",
@@ -93,8 +93,8 @@ job "wiki" {
} }
volume_mount { volume_mount {
volume = "appdata" volume = "services"
destination = "/appdata" destination = "/data/services"
} }
volume_mount { volume_mount {
volume = "nix-store" volume = "nix-store"
@@ -128,8 +128,8 @@ job "wiki" {
config { config {
command = "/sw/bin/node" command = "/sw/bin/node"
args = [ args = [
"/appdata/wiki/node_modules/tiddlywiki/tiddlywiki.js", "/data/services/wiki/node_modules/tiddlywiki/tiddlywiki.js",
"/appdata/wiki/pispace", "/data/services/wiki/pispace",
"--listen", "--listen",
"host=0.0.0.0", "host=0.0.0.0",
"port=${NOMAD_PORT_pispace}", "port=${NOMAD_PORT_pispace}",
@@ -141,8 +141,8 @@ job "wiki" {
} }
volume_mount { volume_mount {
volume = "appdata" volume = "services"
destination = "/appdata" destination = "/data/services"
} }
volume_mount { volume_mount {
volume = "nix-store" volume = "nix-store"
@@ -176,8 +176,8 @@ job "wiki" {
config { config {
command = "/sw/bin/node" command = "/sw/bin/node"
args = [ args = [
"/appdata/wiki/node_modules/tiddlywiki/tiddlywiki.js", "/data/services/wiki/node_modules/tiddlywiki/tiddlywiki.js",
"/appdata/wiki/grok", "/data/services/wiki/grok",
"--listen", "--listen",
"host=0.0.0.0", "host=0.0.0.0",
"port=${NOMAD_PORT_grok}", "port=${NOMAD_PORT_grok}",
@@ -189,8 +189,8 @@ job "wiki" {
} }
volume_mount { volume_mount {
volume = "appdata" volume = "services"
destination = "/appdata" destination = "/data/services"
} }
volume_mount { volume_mount {
volume = "nix-store" volume = "nix-store"