diff --git a/apps/docs/content/features/backup.mdx b/apps/docs/content/features/backup.mdx index e8abbe8d..0a2331c6 100644 --- a/apps/docs/content/features/backup.mdx +++ b/apps/docs/content/features/backup.mdx @@ -7,7 +7,7 @@ Zerops provides an automated, secure backup system for supported services. This ## Supported Services -Zerops provides automated backup functionality for the following services. For specific backup format details and restore instructions, visit each service's documentation: [MariaDB](/mariadb/how-to/backup), [PostgreSQL](/postgresql/how-to/manage#backups), [Qdrant](/qdrant/overview), [Elasticsearch](/elasticsearch/overview), [NATS](/nats/overview), [Meilisearch](/meilisearch/overview), and [Shared Storage](/shared-storage/how-to/backup). +Zerops provides automated backup functionality for the following services. For specific backup format details and restore instructions, visit each service's documentation: [MariaDB](/mariadb/how-to/backup), [PostgreSQL](/postgresql/how-to/manage#backups), [Qdrant](/qdrant/overview), [Elasticsearch](/elasticsearch/overview), [NATS](/nats/overview), [Meilisearch](/meilisearch/overview), and [Shared Storage](/shared-storage/how-to/manage#backups). ## Managing Backups in the UI diff --git a/apps/docs/content/references/import.mdx b/apps/docs/content/references/import.mdx index 84c9e721..e2d9d525 100644 --- a/apps/docs/content/references/import.mdx +++ b/apps/docs/content/references/import.mdx @@ -128,7 +128,7 @@ services: override: false # REQUIRED. Name of your other service - hostname: teststorage1 - type: shared-storage + type: shared-storage:ha ... ``` @@ -322,7 +322,7 @@ services: # A second, simpler service example - hostname: teststorage1 - type: shared-storage + type: shared-storage:ha ``` This example includes all possible configuration options for Zerops services. Not all options are required or applicable to every service type. The example shows two services in the same YAML file: a fully configured Node.js API service and a simpler static frontend service. @@ -696,6 +696,8 @@ services: The `mount:` parameter allows you to mount a shared storage (which should be created inside the project) to the service. +The `buildFromGit` requirement exists because an import without it only creates an empty service shell with nothing deployed yet, so there is nothing to mount the storage into. With `buildFromGit`, the import also builds and deploys the repository, and the mount is applied to the deployed service. If you import a service without `buildFromGit`, deploy your application first and then connect the shared storage [in the GUI](/shared-storage/how-to/connect). + ### Service Nginx Configuration The nginx configuration defines the nginx settings for the service. diff --git a/apps/docs/content/shared-storage/how-to/backup.mdx b/apps/docs/content/shared-storage/how-to/backup.mdx deleted file mode 100644 index 524e1dc2..00000000 --- a/apps/docs/content/shared-storage/how-to/backup.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -title: Backup Shared Storage -description: Learn how to backup and restore your Shared Storage data in Zerops. ---- - -Zerops provides automated data backup for Shared Storage services with full encryption and flexible management options. - -For general backup information including configuration, scheduling, and management options, see the [Zerops Backups](/features/backup) documentation, which covers: -- Backup scheduling and retention policies -- Tagging system and storage quotas -- Manual backup creation and CLI tools -- Security and encryption details - -## Shared Storage Backup Format - -Shared Storage backups are created using tar archival: - -- **Format**: `.tar.gz` (archive of directory contents) -- **Tooling**: `tar` -- **Content**: Compresses the entire shared volume (`/mnt/`) -- **Storage**: Encrypted and stored in isolated object storage - -### Restoring Backups - -To restore a Shared Storage backup: Download the backup file (`.tar.gz`) from the Zerops UI, extract the archive, and upload the contents back to your Shared Storage. - -## Best Practices - -For Shared Storage backups: -- Regularly clean up unnecessary files from your Shared Storage to reduce backup size -- Create manual backups with protected tags before major file operations or migrations -- Consider adjusting your backup frequency for optimal storage usage -- Test your restore process periodically to ensure data integrity - -For additional best practices and troubleshooting, refer to the [main backup documentation](/features/backup). \ No newline at end of file diff --git a/apps/docs/content/shared-storage/how-to/connect.mdx b/apps/docs/content/shared-storage/how-to/connect.mdx index b1d3af6c..faf05110 100644 --- a/apps/docs/content/shared-storage/how-to/connect.mdx +++ b/apps/docs/content/shared-storage/how-to/connect.mdx @@ -1,43 +1,74 @@ --- -title: Connect shared storage to a runtime service -description: Learn how to connect shared storage to other services in Zerops. +title: Connect & mount shared storage +description: Learn how to connect shared storage to runtime services in Zerops and how the mount behaves. --- -import GroupCards from '@site/src/components/GroupCards'; +This page covers how to connect an existing shared storage to runtime services, how to disconnect it, and how the mount behaves inside your containers. -This page covers how to connect an existing shared storage to runtime services and how to disconnect services when needed. +## How the mount behaves -## In Zerops GUI +Once a shared storage is connected to a runtime service, Zerops mounts it at `/mnt/` in the runtime containers. For example, `/mnt/teststorage` for a `teststorage` shared storage: -### Connect a new shared storage +
+ Mounted shared storage in the file browser +
+ +- The content is shared among **all containers** of the connected runtime service; if you connect multiple runtime services, they all see the same content +- Multiple storages can be mounted to a single service (e.g. `/mnt/files1`, `/mnt/files2`) +- The mount point is owned by the `zerops` user and group (no sudo required) +- Mounting removes any existing content of the mount directory +- The mount is only available in runtime containers, not during build and prepare runtime phases +- The mount process logs its standard output and error to the runtime service logs (tagged `zerops-mount-`); individual file operations are not logged -When creating a new shared storage service, you can directly select which runtime services it should be connected to. See [Create Shared Storage](/shared-storage/how-to/create) for details about the creation process. +:::note +The `df` command may show incorrect or misleading information for shared storage mounts. Refer to the Zerops GUI for accurate storage metrics. +::: -### Connect an existing shared storage +## Connect in Zerops GUI + +When creating a new shared storage service, you can directly select which runtime services it should be connected to. See [Create shared storage](/shared-storage/how-to/create) for the creation process. For existing storage, go to the shared storage service detail page and select **Shared storage connections**. Toggle ON any runtime services you wish to connect to this storage.
Connecting shared storage during creation
-## Disconnect a shared storage in Zerops GUI +To disconnect storage, toggle OFF the desired runtime service in the same place. -To disconnect storage, access the shared storage service detail page, select **Shared storage connections**, and toggle OFF the desired runtime service. +:::note +Connecting and disconnecting a shared storage is applied live; the runtime containers are not restarted. +::: -{/* -## Connect using zsc +## Mount and unmount using zsc -Connect shared storage from the command line with the `zsc connectSharedStorage` command. Specify one or more storage names as parameters: +You can also mount and unmount a shared storage from within a runtime container using the `zsc` command: ```sh -zsc connectSharedStorage sharedstorage0 -zsc connectSharedStorage sharedDisk secondDisk +# Mount a shared storage +zsc shared-storage mount + +# Unmount a shared storage +zsc shared-storage unmount + +# Wait until the storage mount is ready +zsc shared-storage wait ``` -Run this command from within your runtime container via web terminal, SSH, or in your `zerops.yaml` file. For more details, see the [Zerops Setup Control documentation](/references/zsc).*/} \ No newline at end of file +Run these commands from your runtime container via web terminal or SSH, or as part of your `zerops.yaml` commands. For more details, see the [zsc reference](/references/zsc#shared-storage). + +:::caution +The shared storage must be mounted (through the GUI connection toggle or via `zsc shared-storage mount`) before your application can access the `/mnt/` directory. + +Before stopping or deleting a shared storage service, you must first disconnect (unmount) it from all runtime services. +::: diff --git a/apps/docs/content/shared-storage/how-to/create.mdx b/apps/docs/content/shared-storage/how-to/create.mdx index 4ac9a20d..921aafdc 100644 --- a/apps/docs/content/shared-storage/how-to/create.mdx +++ b/apps/docs/content/shared-storage/how-to/create.mdx @@ -6,11 +6,9 @@ description: Learn how to create shared storage which you can use with your othe import GroupCards from '@site/src/components/GroupCards'; import Video from '@site/src/components/Video'; -Shared Storage provides persistent file storage that can be mounted as a POSIX-compatible filesystem to your runtime services. Built on [SeaweedFS ↗](https://github.com/seaweedfs/seaweedfs), it enables reliable data persistence and sharing across services in your infrastructure. - ## Create Using Zerops GUI -First, set up a project in Zerops GUI and add a runtime service. Then go to the project dashboard page and choose **Add new service** in the left menu in the **Services** block. Then add a new Shared Storage service: +Go to your project dashboard and choose **Add new service** in the left menu in the **Services** block. Then add a new Shared Storage service: