Volumes

Volumes exist at the node level rather than the swarm level, but you can manage them in UCP across all the swarm nodes. How you manage volumes in the swarm depends on the type of volume you're using. Local volumes are fine for scenarios such as global services that write logs and metrics to the disk and then forward them centrally.

Persistent data stores running as clustered services could also use local storage. You might create a local volume on every node but add labels to servers with high-volume RAID arrays. When you create the data service, you can use a constraint to limit it to RAID nodes, so other nodes will never have a task scheduled on them, and where the tasks are running, they will write data to the volume on the RAID array.

For on-premises data centers and in the cloud, you can use shared storage with volume plugins. With shared storage, services can continue to access data even if containers move to different swarm nodes. Service tasks will read and write data to the volume that gets persisted on the shared storage device. There are many volume plugins available on Docker Store, including for-cloud services such as AWS and Azure, physical infrastructure from HPE and Nimble, and virtualization platforms, such as vSphere.

Docker Enterprise uses the Cloudstor plugin to provide cluster-wide storage, and if you deploy with Docker Certified Infrastructure, then this is configured for you. At the time of writing, the plugin is only supported on Linux nodes, so Windows nodes are restricted to running local volumes. There are still many stateful application architectures that can work well in Docker Swarm with local volumes, but you need to configure them carefully.

Storage is an area that there is a lot of focus on in the container ecosystem. Technologies are emerging that create cluster-wide storage options, without the need for specific infrastructure. As these mature, you will be able to run stateful services with high availability and scale, just by pooling the disks on your cluster.

Volumes have a limited number of options, so creating them is a case of specifying the Driver and applying any driver Options:

Permissions can be applied to volumes, such as other resources, by specifying a collection where the resource belongs to. Collections are how UCP enforces role-based access control to limit access.

Local volumes are created on each node, so containers that need a named volume can run on any node and still find the volume. In a hybrid swarm that UCP creates, local volumes are created on each node, and show the physical location on the server where the volume data is mounted:

UCP gives you a single view for all the resources in your cluster, including the volumes on each node and the images which are available for running containers.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.216.44.143