Volumes

Volumes are persistent data stores for your applications running on levv cloud. Top-level volumes declaration let you list volumes that can be reused across services and applications. Each service requiring the volume must specify it within the volumes attribute, together with its mounting point on the container's file system.

services:
  nginx:
    image: nginx
    deploy:
      replicas: 1
    labels:
      io.levv.size: "micro"
      io.levv.public: "80/http"
    ports:
      - "80:80" # ServicePort:ContainerPort
    volumes:
      - disk-one:/usr/share/nginx/html
      - disk-two:/usr/local/extra
  writer:
    image: myrepo/myimage:latest
    deploy:
      replicas: 1
    volumes:
      - disk-one:/usr/local/data
volumes:
  disk-one:
  disk-two:
    driver_opts:
      size: 2G

In the example above, we require two volumes hosted on levv cloud: disk-one and disk-two, which are then mounted in the corresponding services.

An entry under the top-level volumes section can be empty, in which case it uses the levv's default configuration (see below). Optionally, you can configure it with the following key:

  • driver_opts specifies a list of options as key-value pairs. The available options are:
  • size specifies the volume size in byte quantities (default: 1G). The volume size is measured in byte quantities. You can express storage as a plain integer or as a fixed-point number using one of these suffixes: G, M, k.

Volumes are project-scoped, which implicates that different applications within the same project can mount and access the information within these volumes.

Note

  • Volumes can be resized.
  • Shrinking volumes is not supported.
  • Only multiples of gigabyte (10^9 bytes) are supported at the moment.