cloudfoundry/cf-app-sd-release

Name: cf-app-sd-release

Owner: Cloud Foundry

Description: Service Discovery for CloudFoundry

Created: 2017-09-20 18:31:50.0

Updated: 2018-05-07 20:54:42.0

Pushed: 2018-05-07 20:54:40.0

Homepage:

Size: 1240

Language: Go

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

CF App Service Discovery Release (EXPERIMENTAL)

DEPRECATED

This release has been deprecated. All of jobs in this release have been moved into CF-Networking-Release.

Table of Contents
High Level Overview
Problem we are trying to solve

Application Developers who want to use container to container networking today are required to bring their own service discovery. While we have provided examples with Eureka and Amalgam8, we have received user feedback that usage of c2c is very difficult, with some common themes emerging:

In order to support all types of apps, languages and frameworks, we plan to build service discovery for c2c into the platform. With this feature, users will no longer have to bring their own service discovery.

App Developer Experience

With capi-release version greater than 1.49.0:

The internal domain apps.internal is automatically created for you. You can run map-route with the internal domain to create and map an internal route for your app.

Interaction with Policy

By default, apps cannot talk to each other over cf networking. In order for an app to talk to another app, you must still set a policy allowing access.

Example usage

For example usage, please reference our repo of example apps.

Architecture
Architecture Diagram

Deployment Instructions

Enable local DNS on your bosh director as specified here.

BOSH-lite

Run the scripts/deploy-to-bosh-lite script.

To deploy you will need cf-networking-release, bosh-deployment, and cf-deployment.

All other platforms

To add service discovery to cf-deployment, include the following experimental ops-files:

Example steps

Assumes you're running a recent environment from cf-deployment

Logging
Debugging problems

To switch back to info logging:

 -X POST -d 'info' localhost:8055/log-level

To switch back to info logging:

 -X POST -d 'info' localhost:8066/log-level
Metrics

bosh_dns_adapter.GetIPsRequestTime - duration of get ip request in nanoseconds bosh_dns_adapter.GetIPsRequestCount - number of get ip requests bosh_dns_adapter.DNSRequstFailures - number of failed requests to the Service Discovery Controller bosh_dns_adapter.uptime - process uptime, emitted on 10 second interval service_discovery_controller.RegistrationRequestTime - duration of registration request in nanoseconds service_discovery_controller.RegistrationRequestCount - number of registration requests service_discovery_controller.addressTableLookupTime - duration of looking up address table in nanoseconds service_discovery_controller.uptime - process uptime, emitted on 10 second interval service_discovery_controller.dnsRequest - count of successful dnsRequests, emitted on a 10 second interval service_discovery_controller.registerMessagesReceived - count of route register messages received via NATS from route emitter

To deploy a firehose nozzle to see the metrics, upload the datadog-firehose-nozzle-release and follow the instructions here to deploy.

Tests
Unit

Unit tests should be run if making a PR or changes to the repo.

ripts/test-unit
Smoke

Smoke tests can be run periodically against live environments to check basic service discovery remains functional.

You must set the environment variable $CONFIG which points to a JSON file that contains several pieces of data that will be used to configure the acceptance tests, e.g. telling the tests how to target your running Cloud Foundry deployment and what tests to run.

The following can be pasted into a terminal and will set up a sufficient $CONFIG to run the core test suites against a BOSH-Lite deployment of CF.

> integration_config.json <<EOF

pi": "api.bosh-lite.com",
pps_domain": "bosh-lite.com",
dmin_user": "admin",
dmin_password": "admin",
refix": "smoke-test-",
moke_org": "smoke_org",
moke_space": "smoke_space"


rt CONFIG=$PWD/integration_config.json
The full set of config parameters is explained below: Required parameters: Optional parameters:

Once the config is set, to run the smoke tests do the following

go -r ./src/smoke
Acceptance

Acceptance tests should be run to see that service discovery is still functional at a CF level.

Running the full acceptance test on bosh-lite
ripts/run-locally.sh
Running the full acceptance test on specific env

You must set the environment variable $CONFIG which points to a JSON file that contains several pieces of data that will be used to configure the acceptance tests, e.g. telling the tests how to target your running Cloud Foundry deployment and what tests to run.

The following can be pasted into a terminal and will set up a sufficient $CONFIG to run the core test suites against a BOSH-Lite deployment of CF. admin-password and admin-secret need to be replaced with proper values.

> integration_config.json <<EOF

pi": "api.bosh-lite.com",
dmin_user": "admin",
dmin_password": "{{admin-password}}",
dmin_secret": "{{admin-secret}}",
pps_domain": "bosh-lite.com",
kip_ssl_validation": true,


rt CONFIG=$PWD/integration_config.json
The full set of config parameters is explained below: Required parameters:

Once the config is set, to run the acceptance tests do the following

go -r ./src/acceptance

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.