Skip to content

Commit 25ccc12

Browse files
authored
shared storage (#216)
1 parent c03670f commit 25ccc12

File tree

4 files changed

+37
-12
lines changed

4 files changed

+37
-12
lines changed

apps/docs/content/references/zsc.mdx

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -81,24 +81,35 @@ zsc backup-create db
8181

8282
---
8383

84-
### connectSharedStorage
84+
### shared-storage
8585

86-
Connects a shared storage volume to your service for persistent data storage.
86+
Manages shared storage volumes for persistent data storage.
8787

8888
```sh
89-
zsc connectSharedStorage [...name]
89+
zsc shared-storage [command]
9090
```
9191

92-
#### Parameters
93-
- `name`: Optional name(s) of the shared storage to connect
92+
#### Available sub-commands
93+
- `mount`: Mounts the shared storage
94+
- `unmount`: Unmounts the shared storage
95+
- `wait`: Waits for readiness of the storage mount
9496

9597
#### Available flags
96-
- `-h, --help`: Help for the connectSharedStorage command
98+
- `-h, --help`: Help for the shared-storage command
9799

98100
#### Examples
99101
```sh
100-
zsc connectSharedStorage sharedstorage0
101-
zsc connectSharedStorage sharedDisk secondDisk
102+
# View shared-storage help
103+
zsc shared-storage --help
104+
105+
# Mount a shared storage volume
106+
zsc shared-storage mount <storage-name>
107+
108+
# Unmount a shared storage volume
109+
zsc shared-storage unmount <storage-name>
110+
111+
# Wait for a storage mount to be ready
112+
zsc shared-storage wait <storage-name>
102113
```
103114

104115
---

apps/docs/content/shared-storage/how-to/connect.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ For existing storage, go to the shared storage service detail page and select **
3030

3131
To disconnect storage, access the shared storage service detail page, select **Shared storage connections**, and toggle OFF the desired runtime service.
3232

33+
{/*
3334
## Connect using zsc
3435
3536
Connect shared storage from the command line with the `zsc connectSharedStorage` command. Specify one or more storage names as parameters:
@@ -39,4 +40,4 @@ zsc connectSharedStorage sharedstorage0
3940
zsc connectSharedStorage sharedDisk secondDisk
4041
```
4142
42-
Run this command from within your runtime container via web terminal, SSH, or in your `zerops.yml` file. For more details, see the [Zerops Setup Control documentation](/references/zsc).
43+
Run this command from within your runtime container via web terminal, SSH, or in your `zerops.yml` file. For more details, see the [Zerops Setup Control documentation](/references/zsc).*/}

apps/docs/content/shared-storage/how-to/use.mdx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ If you connect multiple runtimes, the content of the folder will be shared among
2525
## Mount Points and Multiple Volumes
2626

2727
- Multiple storage volumes can be mounted to a single service (e.g., `/mnt/files1`, `/mnt/files2`, etc.)
28+
- Shared storage mount is only available in runtime containers, not during build and prepare runtime phases
2829
- All filesystem operations are automatically logged to runtime logs
2930

3031
For technical details about mount behavior and filesystem capabilities, see the [Technical Details](/shared-storage/technical-details#mount-integration) page.
@@ -46,4 +47,10 @@ When using Shared Storage, keep in mind:
4647
- For write-heavy workloads, consider batching operations
4748
- Minimize operations with many small files for better performance
4849

49-
For more detailed information about performance constraints and limitations, see the [Technical Details](/shared-storage/technical-details#performance-considerations) page.
50+
For more detailed information about performance constraints and limitations, see the [Technical Details](/shared-storage/technical-details#performance-considerations) page.
51+
52+
## Troubleshooting
53+
54+
### Common Issues
55+
56+
- The `df` command may show incorrect or misleading information when used with shared storage mounts. Please refer to the Zerops GUI for accurate storage metrics.

apps/docs/content/shared-storage/tech-details.mdx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,16 @@ Shared Storage consists of three main components:
1414
- **Volume Servers**: Store the actual file data
1515
- **Filer**: Provides a POSIX-compatible interface for file operations
1616

17+
An **automatic vacuum process** helps maintain optimal storage performance by reclaiming space from deleted files. This process is triggered when the size of deleted content exceeds 15% (reduced from the default 30%).
18+
1719
### Mount Integration
1820

1921
When connected to a runtime service:
2022
- Storage is mounted at `/mnt/<storage-hostname>`
2123
- Mount point is owned by the `zerops` user and group (no sudo required)
2224
- All filesystem operations are logged to runtime logs (tagged as `zerops-mount-<service-hostname>`)
2325
- Mounting will overwrite any existing content in the mount directory
26+
- Shared storage mount is only available in runtime containers, not during build and prepare runtime phases
2427

2528
## Deployment Modes
2629

@@ -90,8 +93,11 @@ Vertical auto scaling has the following default configuration:
9093

9194
<ResourceTable resources={{
9295
ram: {
93-
min: '0.25 GB',
94-
}
96+
min: '0.5 GB',
97+
},
98+
disk: {
99+
min: '5 GB'
100+
}
95101
}} />
96102

97103
For most cases, the default parameters will work without issues. If you need to limit the cost of the Shared Storage service, lower the maximal resources. Zerops will never scale above the selected maximums.

0 commit comments

Comments
 (0)