Setting up Pure Docker Plugin

Pure Storage Docker Plugin

This is a quick guide and how to install the Pure plugin for docker 1.13 and above. For full details check out Pure Volume Plugin on Store.docker.com.

Requirements

Operating Systems Supported

  • CentOS Linux 7.3
  • CoreOS (Ladybug 1298.6.0 and above)
  • Ubuntu (Trusty 14.04 LTS, Xenial 16.04.2 LTS)

Environments Supported

  • Docker 1.13+ I am on 17.03-ce
  • Swarm
  • Mesos 1.8 and above

Other dependencies

  • Latest iSCSI initiator SW
  • Latest Multipath package (This made a difference for me on Ubuntu remember to update!)

Hosts Before

Here I am just listing the Pure hosts on my array before I install the plugin.

Volumes Before

Also listing out my volumes, these are all pre-existing.

Pull and Install the plugin (Docker 1.13 and above)

Create /etc/pure-docker-plugin/pure.json

edit the file pure.json in /etc/pure-docker-plugin and add your array and API token
to get a token from the Pure CLI - (or go to the GUI of the array and copy the API token for your user).


pureeadmin create --api-token [user]  
pureadmin list --api-token [user] --expose

Pull the plugin and install

docker plugin install store/purestorage/docker-plugin:1.0 --alias pure

Grant the plugins to the directories it requests.

Done. Easy.

Next Steps

Next steps:

  • Configure the plugin (see Pure Volume Plugin for options and more info)
    • Don’t forget pure.json and any PURE_DOCKER_NAMESPACE requirements for the environment!! *

For Docker Swarm

Setting the PURE_DOCKER_NAMESPACE variable can be done with the command:

docker plugin set pure PURE_DOCKER_NAMESPACE=<clusterid>

My next blog post will dive more into setting up the plugin with Docker Swarm. The clusterid is just a unique string. Keep it simple.

Test it

$docker volume create -d pure -o size=200GiB Demo

Remember if you want to create the volume with other units the information is in the README but here it is for now:<Units can be specified as xB, xiB, or x. If no units are specified MiB is assumed.

My host created by the plugin

Now that I created a volume on the array the host docker01 is now added to the list of hosts. The plugin automates adding the iSCSI IQN and creating the host.

My new volume all ready to go.

You also see the docker01-Demo is listed and sized to my requested 200GiB The PURE_DOCKER_NAMESPACE will prepend the volume name you create. The default will use the docker hostname. In a Mesos and Swarm environment the namespace setting mentioned above is used. This is only identified this way on the array.

Now the volume can be mounted to a container using


#docker run --volume Demo:/data [image] [command]

You could also create a new volume and mount it to a container all in the same line with:


#docker run --volume-driver pure --volume myvolume:/data [image] [command]

###Youtube Demo

Demo on YouTube

Written on June 1, 2017