Give each settings-config runtime a mergeable config file with its own id (runtime-config) — the previous "config" collided with modules that already own a config directory, so ten runtimes mounted a config file no resource declared. Point each runtime's restart-on at it, so a settings change recreates the runtime and it re-reads the new value (needs the mesh-host container restart-on fix on issue/009-container-restart-on). Proven: runtime-restart-on-config e2e green. Claude-Session: https://claude.ai/code/session_01LrgweAeERJYBg88c5cKDzF
101 lines
2.7 KiB
JSON
101 lines
2.7 KiB
JSON
{
|
|
"module": "influxdb",
|
|
"version": "1",
|
|
"capabilities": [
|
|
"container-runtime"
|
|
],
|
|
"own-secrets": {
|
|
"admin": "/var/lib/influxdb-module/admin.secret",
|
|
"admin-token": "/var/lib/influxdb-module/admin-token.secret",
|
|
"broker": "/var/lib/mesh/influxdb/broker"
|
|
},
|
|
"listens": [
|
|
{
|
|
"port": 8086,
|
|
"protocol": "tcp",
|
|
"from": "mesh",
|
|
"why": "queries and writes, over http"
|
|
}
|
|
],
|
|
"resources": [
|
|
{
|
|
"id": "mesh-state",
|
|
"type": "directory",
|
|
"path": "/var/lib/mesh/influxdb",
|
|
"mode": "0700"
|
|
},
|
|
{
|
|
"id": "state",
|
|
"type": "directory",
|
|
"path": "/var/lib/influxdb-module",
|
|
"mode": "0700"
|
|
},
|
|
{
|
|
"id": "server-env",
|
|
"type": "file",
|
|
"path": "/var/lib/influxdb-module/server.env",
|
|
"mode": "0600",
|
|
"content": "DOCKER_INFLUXDB_INIT_MODE=setup\nDOCKER_INFLUXDB_INIT_USERNAME=admin\nDOCKER_INFLUXDB_INIT_PASSWORD=${secret:admin}\nDOCKER_INFLUXDB_INIT_ADMIN_TOKEN=${secret:admin-token}\nDOCKER_INFLUXDB_INIT_ORG=mesh\nDOCKER_INFLUXDB_INIT_BUCKET=default\n"
|
|
},
|
|
{
|
|
"id": "data",
|
|
"type": "directory",
|
|
"path": "/services/influxdb/data",
|
|
"mode": "0700",
|
|
"owner": "1000:1000"
|
|
},
|
|
{
|
|
"id": "config",
|
|
"type": "directory",
|
|
"path": "/services/influxdb/config",
|
|
"mode": "0700",
|
|
"owner": "1000:1000"
|
|
},
|
|
{
|
|
"id": "server",
|
|
"type": "container",
|
|
"name": "influxdb",
|
|
"image": "influxdb@sha256:f75e48af0598e8aec7986e991a848d19a119101a7d563a2e5db1dfaac9c45daa",
|
|
"env-file": [
|
|
"/var/lib/influxdb-module/server.env"
|
|
],
|
|
"ports": [
|
|
"8086"
|
|
],
|
|
"volumes": [
|
|
"/services/influxdb/data:/var/lib/influxdb2",
|
|
"/services/influxdb/config:/etc/influxdb2"
|
|
]
|
|
},
|
|
{
|
|
"id": "runtime-config",
|
|
"type": "file",
|
|
"path": "/var/lib/mesh/influxdb/config.json",
|
|
"mode": "0600",
|
|
"content": "{}\n",
|
|
"merge": "json"
|
|
},
|
|
{
|
|
"id": "runtime",
|
|
"type": "container",
|
|
"name": "mesh-influxdb",
|
|
"image": "mesh-runtime-influxdb@sha256:0000000000000000000000000000000000000000000000000000000000000000",
|
|
"network": "host",
|
|
"volumes": [
|
|
"/var/lib/mesh/influxdb/broker:/run/secrets/broker:ro",
|
|
"/var/lib/mesh/influxdb/config.json:/run/config/config.json:ro",
|
|
"/services/influxdb/config:/var/lib/influxdb/config:ro"
|
|
],
|
|
"env": {
|
|
"MESH_BROKER_FILE": "/run/secrets/broker",
|
|
"MESH_INFLUXDB_URL": "http://127.0.0.1:8086",
|
|
"MESH_INFLUXDB_CONFIG_FILE": "/run/config/config.json",
|
|
"MESH_INFLUXDB_CONFIG_DIR": "/var/lib/influxdb/config"
|
|
},
|
|
"restart-on": [
|
|
"runtime-config"
|
|
]
|
|
}
|
|
]
|
|
}
|