Thanks to the efforts of our tremendous community, libStorage also has built-in support for DigitalOcean!
DO Block Storage
The DigitalOcean Block Storage (DOBS) driver registers a driver named
with the libStorage service registry and is used to attach and mount
DigitalOcean block storage devices to DigitalOcean instances.
The DigitalOcean block storage driver has the following requirements:
- Valid DigitalOcean account
- Valid DigitalOcean access token
The following is an example with all possible fields configured. For a running example see the Examples section.
dobs: token: 123456 region: nyc1 statusMaxAttempts: 10 statusInitialDelay: 100ms statusTimeout: 2m convertUnderscores: false
tokencontains your DigitalOcean access token
regionspecifies the DigitalOcean region where volumes should be created
statusMaxAttemptsis the number of times the status of a volume will be queried before giving up when waiting on a status change
statusInitialDelayspecifies a time duration used to wait when polling volume status. This duration is used in exponential backoff, such that the first wait will be for this duration, the second for 2x, the third for 4x, etc. The units of the duration must be given (e.g. "100ms" or "1s").
statusTimeoutis a maximum length of time that polling for volume status can occur. This serves as a backstop against a stuck request of malfunctioning API that never returns.
convertUnderscoresis a boolean flag that controls whether the driver will automatically convert underscores to dashes during a volume create request. Digital Ocean does not allow underscores in the volume name, but some container orchestrators (e.g. Docker Swarm) automatically prefix volume names with a string containing a dash. This flag enables such requests to proceed, but with the volume name modified.
The DigitalOcean service currently only supports block storage volumes in specific regions. Make sure to use a suuported region.
The standard environment variable for the DigitalOcean access token is
DIGITALOCEAN_ACCESS_TOKEN. However, the environment variable mapped to
dobs.token property is
DOBS_TOKEN. This choice was made
to ensure that the driver must be explicitly configured for access instead
of detecting a default token that may not be intended for the driver.
Below is a full
config.yml that works with DOBS
libstorage: # The libstorage.service property directs a libStorage client to direct its # requests to the given service by default. It is not used by the server. service: dobs server: services: dobs: driver: dobs dobs: token: 123456 region: nyc1