Ten definitions name each access by id; the path stays as the default an assignment may replace,
and the host side of every mount says ${access:<id>}. Resolved with no placement, every definition
names exactly the paths it named before (TestPlacedDirectoriesKeepTheirPaths, extended). On an
adopted machine the assignment now says `accesses: {<id>: <path>}` and the mount follows.
Needs the controller that knows an access id (mesh-controller #176); the running one refuses the
field at registration.
95 lines
2.0 KiB
JSON
95 lines
2.0 KiB
JSON
{
|
|
"module": "route-adapter",
|
|
"version": "1",
|
|
"slug": "radapt",
|
|
"capabilities": [
|
|
"container-runtime"
|
|
],
|
|
"provides": [
|
|
{
|
|
"name": "route",
|
|
"scope": "mesh"
|
|
}
|
|
],
|
|
"serves": {
|
|
"route": {}
|
|
},
|
|
"receives": {
|
|
"route": "${dir:routes-dir}/mesh.json"
|
|
},
|
|
"accesses": [
|
|
{
|
|
"id": "dynamic",
|
|
"path": "/services/traefik/dynamic",
|
|
"mode": "read-write"
|
|
}
|
|
],
|
|
"resources": [
|
|
{
|
|
"id": "state",
|
|
"type": "directory",
|
|
"mode": "0700",
|
|
"place": "."
|
|
},
|
|
{
|
|
"id": "routes-dir",
|
|
"type": "directory",
|
|
"path": "/var/lib/route-adapter/routes",
|
|
"mode": "0700"
|
|
},
|
|
{
|
|
"id": "config",
|
|
"type": "file",
|
|
"path": "${dir:state}/config.json",
|
|
"merge": "json",
|
|
"mode": "0644",
|
|
"content": "{\n \"dynamic\": \"/services/traefik/dynamic\",\n \"entrypoint\": \"websecure\",\n \"certificate-resolver\": \"le\",\n \"machine\": \"host.docker.internal\"\n}\n"
|
|
},
|
|
{
|
|
"id": "adapt",
|
|
"type": "container",
|
|
"name": "mesh-route-adapter",
|
|
"artifact": "runtime",
|
|
"run-once": true,
|
|
"volumes": [
|
|
"${dir:routes-dir}/mesh.json:${dir:routes-dir}/mesh.json:ro",
|
|
"${dir:state}/config.json:/run/config/config.json:ro",
|
|
"${access:dynamic}:/services/traefik/dynamic"
|
|
],
|
|
"env": {
|
|
"MESH_RECEIVES": "${dir:routes-dir}/mesh.json",
|
|
"MESH_ROUTE_ADAPTER_CONFIG": "/run/config/config.json"
|
|
},
|
|
"args": [
|
|
"run",
|
|
"/app/modules/route-adapter/dist/index.js"
|
|
],
|
|
"restart-on": [
|
|
"received-route",
|
|
"config"
|
|
]
|
|
}
|
|
],
|
|
"build": {
|
|
"on": [
|
|
{
|
|
"arg": "BUILD_BASE",
|
|
"module": "mesh-tools",
|
|
"artifact": "build"
|
|
},
|
|
{
|
|
"arg": "RUNTIME_BASE",
|
|
"module": "mesh-tools",
|
|
"artifact": "runtime"
|
|
}
|
|
],
|
|
"artifacts": [
|
|
{
|
|
"name": "runtime",
|
|
"kind": "image",
|
|
"from": "Dockerfile"
|
|
}
|
|
]
|
|
}
|
|
}
|