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
api: support hot reload of registry authentication (#15)
Add HTTP API endpoints to update and query daemon configuration at
runtime without restarting nydusd. This is particularly useful for
refreshing registry credentials when tokens expire.
Key changes:
- Add GET/PUT /api/v1/config endpoints for configuration management
- Add config module in utils for centralized configuration updates
- Add smoke test cases for hot reload configuration API
- Update documentation with hot reload usage examples
Signed-off-by: imeoer <yansong.ys@antgroup.com>
Co-authored-by: imeoer <yansong.ys@antgroup.com>
Copy file name to clipboardExpand all lines: docs/nydusd.md
+45Lines changed: 45 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -454,3 +454,48 @@ mnt
454
454
├── pseudo_1
455
455
└── pseudo_2
456
456
```
457
+
458
+
### Hot Reload Configuration
459
+
460
+
Nydusd supports hot reloading of configuration without restarting the daemon. This is useful for updating credentials or other settings at runtime.
461
+
462
+
#### Update Configuration
463
+
464
+
To update configuration (e.g., registry authentication):
465
+
466
+
```shell
467
+
curl --unix-socket /path/to/api.sock \
468
+
-X PUT "http://localhost/api/v1/config?id=/" \
469
+
-H "Content-Type: application/json" \
470
+
-d '{
471
+
"registry_auth": "<base64_encoded_auth>"
472
+
}'
473
+
```
474
+
475
+
#### Query Current Configuration
476
+
477
+
To retrieve the current configuration:
478
+
479
+
```shell
480
+
curl --unix-socket /path/to/api.sock \
481
+
-X GET "http://localhost/api/v1/config?id=/"
482
+
```
483
+
484
+
Example response:
485
+
486
+
```json
487
+
{
488
+
"registry_auth": "<base64_encoded_auth>"
489
+
}
490
+
```
491
+
492
+
> **Note**: The `id` parameter specifies which mountpoint to configure. Use `/` for the root mountpoint or specify a sub-mountpoint path for multi-mount scenarios.
493
+
494
+
#### Supported Configuration Fields
495
+
496
+
The following fields can be updated via the hot reload API:
0 commit comments