docker-volume-sheepdog

command module
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 3, 2017 License: MIT Imports: 17 Imported by: 0

README

docker-volume-sheepdog

TravisCI Go Report Card

Docker Volume plugin to create persistent volumes in a sheepdog cluster.

The driver is based on the Docker Volume Plugin framework and it integrates sheepdog into the Docker ecosystem by automatically creating a iSCSI storage volume(tgt) to a sheepdog vdi and making the volume available to Docker containers running.

Usage

First create a volume:

$ docker volume create -d sheepdog vol1

In this case, it will be created with default volume size (DefaultVolSz is be used. e.g. 10G)

If you want to specify it explicitly, can use the -o size= option. The syntax is equivalent to the dog command.(10G, 10M ...)

For other options please check ours wiki.

$ docker volume create -d sheepdog vol1 -o size=12G

Then use the volume by passing the name (vol1):

$ docker run -it -v vol1:/data docker.io/alpine sh

List the volume:

$ docker volume list
DRIVER              VOLUME NAME
sheepdog            vol1

Inspect the volume:

$ docker volume inspect vol1
[
    {
        "Driver": "sheepdog",
        "Labels": {},
        "Mountpoint": "/mnt/sheepdog/vol1",
        "Name": "vol1",
        "Options": {},
        "Scope": "global"
    }
]

Remove the volume:

$ docker volume rm vol1

Install

Preconditions
  • sheepdog cluster has to be set up and running
  • install and start required service and software
System Requirements
  • Docker Engine: 1.13.0+
  • sudo command
  • xfsprogs (mkfs.xfs command)
  • iscsi-initiator-utils (iscsiadm command)
  • scsi-target-utils (tgtadm command)
  • sheepdog (dog command)
from distribution packages

A pre-built binary as well as rpm and deb packages are available from the github release page.

Supported Distributions:

  • RHEL based distributions 7.x (docker 1.13.x is provided in docker-latest package)
  • Ubuntu 16.04 LTS (Xenial)

Then install and start the service:

$ sudo yum install ./docker-volume-sheepdog-*.rpm
$ sudo systemctl start docker-volume-sheepdog
from source

It uses govendor to manage dependencies.

$ go get -u github.com/kardianos/govendor
$ cd ${PATH-TO-GIT-REPO}
$ govendor sync
$ make

Configuration file

Example /etc/docker-volume-plugin.d/sheepdog.json file:

{
    "MountPoint": "/mnt/sheepdog",
    "DefaultVolSz": "10G",
    "VdiSuffix": "dvp"
}

Probably in most cases you will not need to change this setting. but if you need to change it, please check ours wiki.

License

MIT, please see the LICENSE file.

Disclaimer

This repository and all files that are included in this, there is no relationship at all with the upstream and vendor.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL