forked from cloudfoundry/docs-cf-admin
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy-vol-services.html.md.erb
More file actions
268 lines (214 loc) · 10.4 KB
/
deploy-vol-services.html.md.erb
File metadata and controls
268 lines (214 loc) · 10.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
---
title: Adding Volume Services to your Deployment
owner: Diego Persistence
---
This document describes how Cloud Foundry (CF) operators can deploy volume services.
<p class="note"><strong>Note</strong>: Volume services are only available to CF deployments that use the <a href="../concepts/diego/diego-architecture.html">Diego architecture</a>.</p>
##<a id="overview"></a> Overview
A volume service gives apps access to an ephemeral 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 as outlined below in [Example: Deploy NFS to AWS](#example).
### Additional Information
For more information about volume services and the drivers and brokers available to CF, see the following links:
* [Volume Services Google Doc](https://docs.google.com/document/d/1YtPMY9EjxlgJPa4SVVwIinfid_fshCF48xRhzyoZhrQ/edit?usp=sharing)
* [NFS volume release repository](https://github.com/cloudfoundry-incubator/nfs-volume-release)
* [EFS volume release repository](https://github.com/cloudfoundry-incubator/efs-volume-release)
* [CEPHFS release repository](https://github.com/cloudfoundry-incubator/cephfs-bosh-release)
<p class="note"><strong>Note</strong>: For test purposes, you can deploy the <a href="https://github.com/cloudfoundry-incubator/local-volume-release.git">Local Volume Release</a> if running a single Diego Cell CF deployment. This is not intended for production deployments.</p>
### Contact
If you have any questions, you can contact the team that develops volume services for Cloud Foundry on the **#persi** channel in the [Cloud Foundry (Open Source)](https://cloudfoundry.slack.com) Slack organization.
##<a id="example"></a> Example: Deploy NFS Volume Service to AWS
The following procedure provides an example of how to deploy the NFS broker and corresponding driver on AWS.
###<a id="pre"></a>Prerequisites
This procedure requires the following:
* A CF deployment that uses the [Diego architecture](../concepts/diego/diego-architecture.html).
* A BOSH Director, v260 or later. Refer to the [NFS volume release repository](https://github.com/cloudfoundry-incubator/nfs-volume-release) for more information.
<% if vars.product_name == 'CF' %>
###<a id="cf"></a> Enable Volume Services in Cloud Foundry
1. Run the BOSH CLI `bosh vms` command to list the virtual machines (VMs) deployed by your BOSH Director.
<pre class="terminal">$ bosh vms </pre>
* Examine the output for the CF Cloud Controller VM and record the corresponding `deployment name` for use in the next step.
1. Run `bosh download manifest YOUR-CF-DEPLOYMENT-NAME > cf.yml` to download your CF deployment manifest. Replace `YOUR-CF-DEPLOYMENT-NAME` with the `deployment name` you recorded in the previous step.
<pre class="terminal"> $ bosh download manifest YOUR-CF-DEPLOYMENT-NAME > cf.yml</pre>
1. Add the following property to the `cf.yml` manifest if it does not already exist:
`properties: cc: volume_services_enabled: true`
1. Run `bosh -d cf.yml deploy` to redeploy Cloud Foundry with volume services enabled.
<pre class="terminal">$ bosh -d cf.yml deploy</pre>
<% else %>
<% end %>
###<a id="driver"></a> Add the NFS Driver to Diego Cells
1. Download the `nfs-volume-release` release from [bosh.io](http://bosh.io/releases/github.com/cloudfoundry-incubator/nfs-volume-release).
1. Target your deployment using the BOSH CLI.
<pre class="terminal">$ bosh target BOSH-DIRECTOR-IP</pre>
1. Upload the release to your BOSH Director
<pre class="terminal">$ bosh upload release PATH-TO-DOWNLOADED-NFS-VOLUME-RELEASE</pre>
* Examine the output and record the `version` of the release you uploaded for later use.
<pre>
Release info
------------
Name: nfs-volume
<b>Version: 0.0.11</b>
</pre>
1. Run the following command to list the VMs deployed by your BOSH Director:
<pre class="terminal">$ bosh vms </pre>
* Examine the output for the diego cell VMs labeled `cell_*` and record the corresponding `deployment name` for use in the next step.
1. Create a new `runtime-config.yml` with the following content:
* Replace `YOUR-VERSION` with the `version` you previously recorded.
* For `YOUR-DIEGO-DEPLOYMENT-NAME`, use the `deployment name` from the previous step.
```
---
releases:
- name: nfs-volume
version: YOUR-VERSION
addons:
- name: voldrivers
include:
deployments:
- YOUR-DIEGO-DEPLOYMENT-NAME
jobs:
- name: rep
release: diego
jobs:
- name: nfsv3driver
release: nfs-volume
properties: {}
```
1. Update the BOSH runtime configuration:
<pre class="terminal">$ bosh update runtime-config runtime-config.yml</pre>
1. Download the Diego manifest:
<pre class="terminal">$ bosh download manifest YOUR-DIEGO-DEPLOYMENT-NAME > diego.yml</pre>
1. Deploy Diego:
<pre class="terminal"> $ bosh -d diego.yml deploy</pre>
###<a id="stubs"></a> Generate a Manifest for the NFS Broker
To create an NFS Service Broker, you must combine several pieces of information into a single BOSH manifest to deploy. Follow the steps below to put this information into stubs, then use a script to combine the stubs into a manifest.
#### Create the Cloud Foundry Stub
1. Run the following command to list the VMs deployed by your BOSH Director:
<pre class="terminal">$ bosh vms </pre>
* Examine the output for the Cloud Foundry NATS VM labeled `nats_*` and record the corresponding `deployment name` for use in the next step.
1. Run the following command using the `deployment name` from the previous step to download your CF deployment manifest:
<pre class="terminal"> $ bosh download manifest YOUR-CF-DEPLOYMENT-NAME > cf.yml</pre>
#### Create the Director Stub
1. Run the following command to determine the UUID of your BOSH Director:
<pre class="terminal"> $ bosh status --uuid</pre>
2. Create a new `director.yml` file with the following contents from the last step:
```
---
director_uuid: YOUR-UUID
---
```
#### Create the IaaS Settings Stub
<p class="note"><strong>Note</strong>: This is an AWS-specific IaaS Settings Stub. If you want to deploy on another IaaS, use the templates available in the <code>templates</code> directory of each volume services release respository.</p>
1. Create an `iaas.yml` stub for IaaS-specific settings by copying the template below:
```
---
jobs:
- name: nfsbroker
networks:
- name: public
static_ips: [PUBLIC-BROKER-IP]
networks:
- name: nfsvolume-subnet
subnets:
- cloud_properties:
security_groups:
- SECURITY-GROUP
subnet: SUBNET
dns:
- DNS
gateway: GATEWAY
range: SUBNET-RANGE
reserved:
- [RESERVED-IPs]
static:
- [STATIC-IPs]
resource_pools:
- name: medium
stemcell:
name: bosh-aws-xen-hvm-ubuntu-trusty-go_agent
version: latest
cloud_properties:
instance_type: m3.medium
availability_zone: us-east-1c
- name: large
stemcell:
name: bosh-aws-xen-hvm-ubuntu-trusty-go_agent
version: latest
cloud_properties:
instance_type: m3.large
availability_zone: us-east-1c
```
1. Replace each of the below parameters in the stub:
<table>
<tr>
<th width="25%">For this value...</th>
<th>Replace with...</th>
</tr>
<tr>
<td><code>PUBLIC-BROKER-IP</code></td>
<td>A pre-allocated AWS Elastic IP address.</td>
</tr>
<tr>
<td><code>SECURITY-GROUP</code></td>
<td>A Security Group in which to create the NFS Broker. Ensure this security group can access the security group that contains your CF deployment.</td>
</tr>
<tr>
<td><code>SUBNET</code></td>
<td>A subnet in which to create the NFS Broker. Ensure this subnet can access the subnet that contains your CF deployment.</td>
</tr>
<tr>
<td><code>DNS</code></td>
<td>Typically the DNS for your CF system domain, unless you want to host the broker outside of CF.</td>
</tr>
<tr>
<td><code>GATEWAY</code></td>
<td>Typically the gateway address for your CF system domain, unless you want to host the broker outside of CF.</td>
</tr>
<tr>
<td><code>SUBNET-RANGE</code></td>
<td>The CIDR range of the subnet in which to create the NFS Broker.</td>
</tr>
<tr>
<td><code>RESERVED-IPs</code></td>
<td>An array of IP addresses that BOSH cannot use for the NFS Broker, such as <code>10.10.200.0 - 10.10.200.10</code>.</td>
</tr>
<tr>
<td><code>STATIC-IPs</code></td>
<td>An array of IP addresses that BOSH can use for the NFS Broker, such as <code>10.10.200.10 - 10.10.200.100</code>.</td>
</tr>
</table>
#### Create the Credentials Stub
Create a `creds.yml` file and paste in the following contents, replacing the indicated values with a username and password of your choosing:
```
---
properties:
nfsbroker:
username: BROKER-USERNAME
password: BROKER-PASSWORD
```
#### Generate the Deployment Manifest
1. Clone the NFS volume release repository.
<pre class="terminal">
$ git clone http<span>s</span>://github.com/cloudfoundry-incubator/nfs-volume-release.git
</pre>
1. Navigate into the directory you cloned.
<pre class="terminal">
$ cd nfs-volume-release
</pre>
1. Run the script below to generate a deployment manifest based on your stubs, You must specify the path to each stub file you created.
<pre class="terminal">
$ ./scripts/generate_manifest.sh cf.yml director-uuid.yml iaas.yml creds.yml
</pre>
###<a id="broker"></a>Deploy the NFS Broker
1. Deploy the broker using the generated manifest.
<pre class="terminal">
$ bosh -d nfsvolume-aws-manifest.yml deploy
</pre>
1. Register the broker using the credentials specified in the `creds.yml` stub.
<pre class="terminal">
$ cf create-service-broker nfsbroker BROKER_USERNAME BROKER_PASSWORD http://nfs-broker.YOUR-SYSTEM-DOMAIN
</pre>
1. Grant access to the service of the broker.
<pre class="terminal">
$ cf enable-service-access nfs
</pre>
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)](../devguide/services/using-vol-services.html) topic.
###<a id="server"></a>(Optional) Deploy a Test NFS Server
If you want to use NFS and do not currently have a server available, you can deploy the test NFS server bundled with the NFS Volume release. Follow the instructions from the NFS volume release repository: [Deploying the Test NFS Server (Optional)](https://github.com/cloudfoundry-incubator/nfs-volume-release#deploying-the-test-nfs-server-optional).