-
Notifications
You must be signed in to change notification settings - Fork 69
/
services_redis_cups.prolific
65 lines (43 loc) · 2.94 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
60
61
62
63
Create a RedisLabs user-provided service
### What?
Cloud Foundry offers a marketplace of services 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).
### 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, onboarding-lite
---
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.
**Note:** The instructions above actually have a slight error; the command `cf cups redis -p` should accept JSON format, not a comma-separated list. For example, `cf cups redis -p '{"username":"..."}'`. A PR has been created to fix this, so disregard this message and consider contributing back to the onboarding repo to remove this message when that PR is accepted.
**P.S.:** Don't forget to register for an account on https://redislabs.com/ and create a DB!
### 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, onboarding-lite
---
[RELEASE] Services: Redis CUPS ⇧