What is Shared Volume across services?

Shared Volume enables a Volume to be read/write accessible by multiple services within an application. For eg. Consul Service can generate and distribute TLS certificates for other Services within the Deployment Template to establish mutual TLS connections. Consul and the other services that need mutual TLS connection can use a Shared Volume to store and read TLS certificates. This is one of the ways in which the services can share data.

NOTE: Shared Volumes are different from Shared Folders. Shared Folders are used to share data between Containers in a Single Service, whereas Shared Volumes are persistent Volumes that are used to shared data across Services within a single application. 

How to configure Shared Volume across Services?

Step 1: Create a Volume Claim Policy with Shared Volume enabled. To create a Volume claim policy, refer to the documentation here.

Step 2: Create one or more Stateful services using the same Volume Claim Policy with Shared Volume enabled.

For eg. If gpfsshared is the Volume Claim Policy with Shared Volume enabled, then if there are two stateful services, then while creating the services, in step 2, add a persistent volume label and select the Volume Policy as gpfsshared. Give a Volume Label name and click Add to add the Volume Label. while adding a Container to the Service, use this volume Label to attach a Data path in the Container .

Step 3: Create a Deployment template and add the stateful services by following the steps here.


Did this answer your question?