Skip to content

szaouam/cf-redis-release

 
 

Repository files navigation

Cloud Foundry Redis Service Broker

This repository contains a BOSH release for a Cloud Foundry Redis service broker.

Prepare Workspace

Clone the cf-redis-release repo into ~/workspace using:

git clone https://github.com/pivotal-cf/cf-redis-release ~/workspace/cf-redis-release
~/workspace/cf-redis-release/scripts/update-release

The routing-release is a dependent release of cf-redis-release, clone it using:

git clone https://github.com/cloudfoundry-incubator/routing-release ~/workspace/routing-release

Deploying

Modify the sample stubs in templates/sample_stubs to suit your deployment environment.

Run the scripts/generate-deployment-manifest script to generate a deployment manifest. Change the to aws, vsphere or warden.

./scripts/generate-deployment-manifest templates/sample_stubs/infrastructure-<INFRA>.yml templates/sample_stubs/meta.yml > manifests/cf-redis-custom.yml

Run the scripts/deploy-release script. Examples as follows:

# Deploying locally to BOSH lite
export BOSH_MANIFEST=manifests/cf-redis-custom.yml
./scripts/deploy-release lite

# Deploying to a different BOSH director
export BOSH_MANIFEST=manifests/cf-redis-custom.yml
./scripts/deploy-release my-bosh-alias

Note that the argument is a BOSH alias, which you must have configured prior to running the script. E.G.

bosh target https://192.168.50.4:25555 lite

Configuration

BOSH Lite

You can generate an example bosh-lite deployment manifest as follows:

bosh target lite
./scripts/generate-deployment-manifest warden templates/sample_stubs/infrastructure-warden.yml > cf-redis-lite.yml
  • You can increase the count of the dedicated-vm plan nodes from the example of 1
# templates/sample_stubs/sample_warden_stub.yml

properties:
  template_only:
    dedicated_plan:
      instance_count: 1

Increase the instance_count: 1 to the value you want.

Properties

All required properties are listed in the templates/sample_stubs/sample_*_stub.yml files. There are a number of other optional properties. Descriptions for all properties can be found in the relevant spec files for each job.

Broker Registrar

By default, the broker registrar will enable access to your deployed service to all orgs. You can specify which orgs you wish to grant access to by adding the following configuration to your manifest:

properties:
  redis:
    broker:
      enable_service_access: true
      service_access_orgs:
      - dev_org
      - prod_org

AWS

Subnet ACL

Allow the following:

  • Destination port 80 access to the service broker from the cloud controllers
  • Destination port 6379 access to all dedicated nodes from the DEA network(s)
  • Destination ports 32768 to 61000 on the service broker from the DEA network(s). This is only required for the shared service plan.

Deployment Steps

  1. depending on your IAAS, pick one of the sample Spiff stubs in templates/sample_stubs/
  2. adjust the spiff stub based on your environment, i.e. replace all PLACEHOLDERs with actual values (see above details for the Subnet ACL)
  3. target your bosh director, e.g. bosh target https://192.168.50.4:25555
  4. create a deployment manifest using the scripts/generate_deployment_manifest script, e.g. ./scripts/generate_deployment_manifest warden templates/sample_stubs/sample_warden_stub.yml > cf-redis.yml
  5. set bosh deployment using the new manifest, i.e. bosh deployment cf-redis.yml
  6. upload a cf-redis release, e.g. bosh upload release releases/cf-redis/cf-redis-[version].yml
  7. bosh deploy
  8. register service broker by runing bosh run errand broker-registrar
  9. optionally, run smoke tests to verify your deployment, i.e. bosh run errand smoke-tests

Testing

To test first deploy locally using the Bosh-lite instructions above.

System Tests

To run the system tests locally, just run: BOSH_MANIFEST=manifests/cf-redis-lite.yml ./scripts/system-tests.

To run the system tests in docker, just run: BOSH_MANIFEST=manifests/cf-redis-lite.yml ./scripts/system-tests-in-docker.

Unit Tests

The unit tests are run along with the system tests above, you can run them independently also:

To run the unit tests locally, just run: bundle exec rake spec:unit.

You can run it from docker by using ./scripts/from-docker bundle exec rake spec:unit.

Related Documentation

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 44.6%
  • HTML 41.6%
  • Shell 13.8%