forked from pivotal/cf-onboarding
-
Notifications
You must be signed in to change notification settings - Fork 0
/
services_redis_cups.prolific
61 lines (42 loc) · 2.7 KB
/
services_redis_cups.prolific
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
Create a RedisLabs user-provided service
### What?
Cloud Foundry offers a [marketplace of services](https://docs.run.pivotal.io/marketplace/) from which users can provision reserved resources on-demand. Think of a service as a factory that delivers service instances. Examples include databases on a shared or dedicated server or accounts on a Software as a Service (SaaS) application.
As an alternative, you can also provide your own service instances in the form of [User-Provided Service Instances](https://docs.cloudfoundry.org/devguide/services/user-provided.html), which enable developers to use services that are not available in their Cloud Foundry marketplace.
Let's create one backed by [RedisLabs](https://redislabs.com/).
### How?
1. Create an account with [RedisLabs](https://redislabs.com/) and generate a New Redis Subscription (select the free 30MB option).
1. As part of setting up that Redis database, set the password (by default there is no password).
1. Run `cf cups redis -p "host, port, password"` and it will prompt you for those attributes. Fill them with the endpoint and port RedisLabs provides, and the password you used when setting up your database.
### Expected Result
I can see my new user-provided service in `cf services`.
### Resources
[Creating a user-provided service](https://docs.cloudfoundry.org/devguide/services/user-provided.html)
### Relevant Repos and Teams
**CAPI:** https://github.com/cloudfoundry/cloud_controller_ng
L: app-dev, services
---
Deploy an application for use with a RedisLabs user-provided service
### What?
To play around with the RedisLabs user-provided service instance we just created, we're going to need an app to use it. Let's deploy and bind one now!
### How?
Use this [sample app](https://github.com/pivotal-cf/cf-redis-example-app) and the [instructions](https://github.com/pivotal-cf/cf-redis-example-app#using-redis-labs-cups) provided in the `README` to deploy the sample application and bind your service instance to it.
### Expected Result
You can see the sample app listed under `cf apps`.
You can see the service listed under `cf services`, and see that it is bound to the sample app.
From your terminal, run:
```
export APP=APP_NAME.YOUR_CF_DOMAIN.com
curl -X PUT $APP/foo -d 'data=some-value'
```
This should return `success`. Next run:
```
curl -X GET $APP/foo
```
This should return `some-value`.
The value should also be present in your RedisLabs Dashboard.
### Resources
[User Provided Services (CUPS) Documentation](https://docs.cloudfoundry.org/devguide/services/user-provided.html)
[Bind a Service Instance Documentation](https://docs.cloudfoundry.org/devguide/services/application-binding.html)
L: app-dev, services
---
[RELEASE] Services: Redis CUPS ⇧