You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/nydusd.md
+58-2Lines changed: 58 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -319,8 +319,64 @@ or
319
319
}
320
320
}
321
321
```
322
-
-
323
-
- The `HttpProxy` backend also supports the `Proxy` configuration for remote usage like the `Registry backend` described above.
322
+
323
+
The `HttpProxy` backend also supports the `Proxy` and `Mirrors` configurations for remote usage like the `Registry backend` described above.
324
+
325
+
##### Enable Mirrors for Storage Backend (Recommend)
326
+
327
+
Nydus is deeply integrated with [Dragonfly](https://d7y.io/) P2P mirror mode, please refer the [doc](https://d7y.io/docs/next/operations/integrations/container-runtime/nydus/) to learn how configuring Nydus to use Dragonfly.
328
+
329
+
Add `device.backend.config.mirrors` field to enable mirrors for storage backend. The mirror can be a P2P distribution server or registry. If the request to mirror server failed, it will fall back to the original registry.
330
+
Currently, the mirror mode is only tested in the registry backend, and in theory, the OSS backend also supports it.
331
+
332
+
<fontcolor='red'>!!</font> The `mirrors` field conflicts with `proxy` field.
333
+
334
+
```
335
+
{
336
+
"device": {
337
+
"backend": {
338
+
"type": "registry",
339
+
"config": {
340
+
"mirrors": [
341
+
{
342
+
// Mirror server URL (including scheme), e.g. Dragonfly dfdaemon server URL
343
+
"host": "http://dragonfly1.io:65001",
344
+
// Headers for mirror server
345
+
"headers": {
346
+
// For Dragonfly dfdaemon server URL, we need to specify "X-Dragonfly-Registry" (including scheme).
347
+
// When Dragonfly does not cache data, nydusd will pull it from "X-Dragonfly-Registry".
348
+
// If not set "X-Dragonfly-Registry", Dragonfly will pull data from proxy.registryMirror.url.
349
+
"X-Dragonfly-Registry": "https://index.docker.io"
350
+
},
351
+
// This URL endpoint is used to check the health of mirror server, and if the mirror is unhealthy,
352
+
// the request will fallback to the next mirror or the original registry server.
353
+
// Use $host/v2 as default if left empty.
354
+
"ping_url": "http://127.0.0.1:40901/server/ping",
355
+
// Interval time (s) to check and recover unavailable mirror. Use 5 as default if left empty.
356
+
"health_check_interval": 5,
357
+
// Failure counts before disabling this mirror. Use 5 as default if left empty.
358
+
"failure_limit": 5,
359
+
// Elapsed time to pause mirror health check when the request is inactive, in seconds.
360
+
// Use 300 as default if left empty.
361
+
"health_check_pause_elapsed": 300,
362
+
},
363
+
{
364
+
"host": "http://dragonfly2.io:65001",
365
+
"headers": {
366
+
"X-Dragonfly-Registry": "https://index.docker.io"
367
+
},
368
+
}
369
+
],
370
+
...
371
+
}
372
+
},
373
+
...
374
+
},
375
+
...
376
+
}
377
+
```
378
+
379
+
324
380
##### Enable P2P Proxy for Storage Backend
325
381
326
382
Add `device.backend.config.proxy` field to enable HTTP proxy for storage backend. For example, use P2P distribution service to reduce network workload and latency in large scale container cluster using [Dragonfly](https://d7y.io/) (enable centralized dfdaemon mode).
0 commit comments