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

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

View File

@@ -2,10 +2,10 @@ job "resol-gateway" {
datacenters = ["alo"]
group "gw" {
volume "code" {
volume "services" {
type = "host"
read_only = true
source = "code"
source = "services"
}
volume "nix-store" {
type = "host"
@@ -29,12 +29,12 @@ job "resol-gateway" {
config {
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 = "code"
destination = "/code"
volume = "services"
destination = "/data/services"
}
volume_mount {
volume = "nix-store"

View File

@@ -23,7 +23,6 @@ job "vector" {
ports = ["api", "metrics"]
volumes = [
"/var/run/docker.sock:/var/run/docker.sock:ro",
"/var/log/glusterfs:/var/log/glusterfs:ro",
"/var/log/journal:/var/log/journal:ro",
"/etc/machine-id:/etc/machine-id:ro",
]
@@ -98,16 +97,6 @@ if length(result) > 0 {
.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]
type = "journald"
[transforms.journald_transformed]
@@ -122,7 +111,6 @@ if length(result) > 0 {
inputs = [
"vector_transformed",
"docker_transformed",
"glusterfs_transformed",
"journald_transformed",
]
endpoint = "http://[[ range service "loki" ]][[ .Address ]]:[[ .Port ]][[ end ]]"

View File

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