Add a persistent volume | Databases And Persistence | Northflank Application docs
v1

Databases And Persistence /

Add a persistent volume

Volumes can be added to your deployment services to persist data across restarts. This can be useful if you require a storage solution other than the available databases. Volumes are highly configurable and can be moved between services.

Adding a volume to a deployment will limit that service to 1 instance, and during restarts the running container will always be terminated before the new one starts (regardless of any health check settings).

Persistent volumes use SSDs for best performance.

Create a persistent volume

You can create a volume on the volumes page of a combined or deployment service. Select add volume, choose a name, and select the size of the volume to create. Volume storage cannot be scaled down after creation.

You must add at least one container mount path, and optionally a volume mount path.

You can attach multiple volumes to the same service.

Configuring a persistent volume in the Northflank application

Volume mount configuration

The container mount path allows you to specify where to make the volume available in the running container for a service. For example setting only the container mount path to /mnt would make the whole volume accessible in the container in that directory.

The volume mount path is optional, and allows you to specify which directories on the volume to mount. For example, using the container mount path /mnt and the volume mount path mydata would make the subdirectory mydata on the volume accessible in running containers from /mnt.

You can add multiple mount rules for each volume.

Scale a volume

To scale an attached volume, navigate to the volumes page of the service that has the volume attached. To scale a detached volume, navigate to any service's volumes page.

Select edit volume and open the storage dropdown to resize the volume. Volume storage cannot be scaled down.

Move or delete a volume

Volumes can be detached on the volumes page of the service they are currently linked to. Detaching a volume will redeploy any running containers in the service.

A volume must be detached from its current service before being attached to another. Attach a volume to another service by navigating to the detached section on the volumes page of the service you want to link it to and select on the volume to attach. Attaching a volume will redeploy any running containers in the service.

Volumes can be deleted by first detaching them, and then selecting delete .

© 2024 Northflank Ltd. All rights reserved.