Adding Volume Services to Your Deployment

This topic describes how Cloud Foundry (CF) operators can deploy volume services.

Overview

A volume service gives apps access to a remote filesystem, such as NFS. To provide a volume service for CF developers to use with their apps, you must deploy a driver and broker pair. For current versions of CF that have been been deployed with cf-deployment, deploying brokers and drivers is typically accomplished using operations files as outlined below in Example: Deploy NFS to CF.

Additional Information

For more information about volume services and the drivers and brokers available to CF, see the following:

Note: For test purposes, you can deploy the Local Volume Release if running a single Diego Cell CF deployment. This is not intended for production deployments.

Contact

If you have any questions, you can contact the team that develops volume services for CF on the #persi channel in the Cloud Foundry (Open Source) Slack organization.

Example: Deploy NFS Volume Service to CF

The following procedure provides an example of how to deploy the NFS broker and corresponding driver to an existing CF deployment.

Prerequisites

This procedure requires the following:

Redeploy CF with NFS Enabled

  1. Clone the cf-deployment repository from Git, if you do not already have it:

    $ cd ~/workspace
    $ git clone https://github.com/cloudfoundry/cf-deployment.git
    $ cd ~/workspace/cf-deployment

  2. Redeploy your cf-deployment while including the NFS ops file:

    $ bosh -e my-env -d cf deploy cf.yml -v deployment-vars.yml \
        -o operations/enable-nfs-volume-service.yml

    Note: The above bosh deploy command is an example, but your deployment command should match the one you used to deploy CF initially, with the addition of a -o operations/enable-nfs-volume-service.yml option.

  3. Run the nfsbrokerpush errand to deploy the NFS service broker application:

    $ bosh -e my-env -d cf run-errand nfsbrokerpush

Your CF deployment now has a running service broker and volume drivers and is ready to mount NFS volumes.

Deploying the NFS Test Server

To deploy the NFS test server, you can fetch the operations file from the persi-ci GitHub repository and include that operation with a -o flag. This creates a separate VM with nfs exports you can use to experiment with volume mounts.

Note: By default, the NFS test server expects that your CF deployment is deployed to a 10.x.x.x subnet. If you are deploying to a subnet that is not 10.x.x.x (e.g. 192.168.x.x), you must override the “export_cidr” property.
Edit the operations file, and replace this line:
nfstestserver: {}
with something like this:
nfstestserver: {export_cidr: 192.168.0.0/16}

Grant Access to the NFS Broker

Grant access to the services of the broker.

$ cf enable-service-access nfs

CF Developers can now create an NFS service and bind instances to their apps as outlined in the Using an External File System (Volume Services) topic.

(Optional) LDAP Support

For better security, configure your deployment of nfs-volume-release to connect to an external LDAP server to resolve user credentials into UIDs. For more information, see this note.

Example 2: Deploy SMB Volume Service to CF

The following procedure provides an example of how to deploy the SMB broker and corresponding driver to an existing CF deployment.

Prerequisites

This procedure requires the following:

Redeploy CF with SMB Enabled

  1. Clone the cf-deployment repository from Git, if you do not already have it:

    $ cd ~/workspace
    $ git clone https://github.com/cloudfoundry/cf-deployment.git
    $ cd ~/workspace/cf-deployment

  2. Redeploy your cf-deployment while including the SMB ops file:

    $ bosh -e my-env -d cf deploy cf.yml -v deployment-vars.yml \
        -o operations/experimental/enable-smb-volume-service.yml

    Note: The above bosh deploy command is an example, but your deployment command should match the one you used to deploy CF initially, with the addition of a -o operations/experimental/enable-smb-volume-service.yml option.

  3. Run the smbbrokerpush errand to deploy the SMB service broker application:

    $ bosh -e my-env -d cf run-errand smbbrokerpush

Your CF deployment now has a running service broker and volume drivers and is ready to mount existing SMB shares.

Deploying the SMB Test Server

To deploy the SMB test server, you can fetch the operations file from the persi-ci GitHub repository and include that operation with a -o flag. This creates a separate VM with SMB shares you can use to experiment with volume mounts.

Note: By default, the SMB test server expects that your CF deployment is deployed to a 10.x.x.x subnet. If you are deploying to a subnet that is not 10.x.x.x (e.g. 192.168.x.x), you must override the `export_cidr` property.
Edit the operations file, and add a line in the properties section:
export_cidr: 192.168.0.0/16

Grant Access to the SMB Broker

Grant access to the services of the broker.

$ cf enable-service-access smb

CF developers can now create an SMB service and bind instances to their apps as outlined in the Using an External File System (Volume Services) topic.

Create a pull request or raise an issue on the source for this page in GitHub