Storage
Disks in Arvancloud Container are equivalent to Persistent Volumes in Kubernetes. By default, application data is stored in Ephemeral Storage, meaning it gets deleted with each application restart. Therefore, if you need to store data permanently or persistently, you should use disks.
Generally, disks are useful for the following types of applications:
- Infrastructure services such as Kafka, ElasticSearch, etc.
- Content management platforms and CMSs like WordPress, Ghost, Strapi, etc.
- Communication tools like Mattermost, Discourse, etc.
- Databases like PostgreSQL, MySQL, etc.
Disks in Arvancloud Container are independent of applications. This means that even after deleting an application, the disk and its contents can still be accessible at the project level.
In the "Storage" section in the user panel, you can view all the disks available in the project along with their status, capacity, lifespan, and accessibility.
Furthermore, to add, edit, or delete a disk connected to an application, you can click on the application name in the user panel and navigate to the "Disk" section.
Add a Disk
To add a new disk, after clicking on the application name and selecting the "Disk" tab, click on the "New Disk" option.
Then, specify the size of the disk and the mount path to the application. The deployment path is the same as container-path
in Docker.
docker run -d -p <hostPort>:<containePort> -v <host-path>:<container-path> <image>
For example, the command:
docker run -d -p 5000:5000 -v /app:/app myflaskimage
or the following Docker Compose file:
version: '3'
services:
web:
image: myflaskimage
ports:
- "5000:5000"
volumes:
- /app:/app
To implement these settings in the user panel, you can enter /app
in the deployment path.
Note that creating a new disk will restart the application.
After restarting the application, the new disk will be available.
Attach/Detach a Disk
To detach a disk from an application, you can use the "Detach Disk" option next to its name.
Note that detaching a disk will restart the application.
Also, if you had previously detached a disk from an application, you can reattach it by clicking on the "Attach" button. Then, specify the capacity and the new mount path for the disk.
Note that attaching a disk will restart the application.
After restarting the application, the disk will be accessible to the app.
Update a Disk
If you need to make changes to the disk settings, you can edit them at any time by clicking on the "Edit" option.
Here, you can change the mount path and the size of the disk.
In Arvancloud Container, you can only increase the disk size, and decreasing it is not possible. Also, the value entered for the disk size must be an integer.
Note that creating a new disk will restart the application.
After restarting the application, the changes will take effect.
Delete a Disk
To delete a disk, click on the "Delete" option and confirm the operation.
Note that after deleting a disk, its data is irretrievable.