feat: snapshot corestore resources
This commit is contained in:
@@ -100,6 +100,24 @@ curl -X POST http://corestore:3000/volumes/restore \
|
||||
-d '{"name":"sz-api-data-abc123","snapshotId":"<snapshot-id>"}'
|
||||
```
|
||||
|
||||
Snapshot all provisioned DB/S3 resources for a service:
|
||||
|
||||
```bash
|
||||
curl -X POST http://corestore:3000/resources/snapshot \
|
||||
-H 'content-type: application/json' \
|
||||
-H 'authorization: Bearer <CORESTORE_API_TOKEN>' \
|
||||
-d '{"serviceId":"svc-123","snapshotName":"backup-123"}'
|
||||
```
|
||||
|
||||
Restore service DB/S3 resources from snapshots:
|
||||
|
||||
```bash
|
||||
curl -X POST http://corestore:3000/resources/restore \
|
||||
-H 'content-type: application/json' \
|
||||
-H 'authorization: Bearer <CORESTORE_API_TOKEN>' \
|
||||
-d '{"serviceId":"svc-123","snapshots":[{"capability":"database","resourceName":"db","snapshotId":"<snapshot-id>","originalSize":1,"storedSize":1,"createdAt":1,"tags":{}}]}'
|
||||
```
|
||||
|
||||
## Docker Volume Driver
|
||||
|
||||
Corestore implements Docker's legacy VolumeDriver API over a Unix socket. The `corestore` service must bind mount `/run/docker/plugins` from the host so Docker can discover `/run/docker/plugins/corestore.sock`.
|
||||
@@ -124,6 +142,7 @@ The intended cluster behavior is:
|
||||
- provision `database` and `objectstorage` bindings through `/resources/provision`;
|
||||
- mount service volumes through Docker `DriverConfig.Name = corestore`;
|
||||
- snapshot and restore service volumes through `/volumes/snapshot` and `/volumes/restore`;
|
||||
- snapshot and restore managed DB/S3 resources through `/resources/snapshot` and `/resources/restore`;
|
||||
- merge the returned env vars into the workload Docker secret before service creation;
|
||||
- mark Cloudly platform bindings `ready` with endpoint metadata and credential env refs;
|
||||
- deprovision resources when the service binding or workload is deleted.
|
||||
|
||||
Reference in New Issue
Block a user