0.1.0 • Published 8 years ago

seneca-rancher-balance v0.1.0

Weekly downloads
3
License
MIT
Repository
github
Last release
8 years ago

A Seneca.js plugin that provides some ha functionality in rancher environment using seneca-balance-client

seneca-rancher-balance

npm version

Description

This module is a plugin for the Seneca framework.

Install

npm install seneca-rancher-balance

And in your code:

require('seneca')()
  .use('seneca-balance-client', { ... options ... })
  .use('seneca-rancher-balance', { ... options ... })

Quick Example

client.js

require('seneca')()
    .use('seneca-balance-client').client({type: 'balance', pin: 'role:test'})
    .use('seneca-rancher-balance', {pin: 'role:test', service: 'awsome-rancher-service', port: 47111});
    ...

The plugin polls the rancher metadata for available ips of the provided service. If one ip (or more) is removed from metadata the client is also removed from balanced pool. If one ip (or more) are added, the clients are added to the balanced pool too.

Test

To run tests, simply use npm:

npm run test

License

Copyright (c) 2016, Ronny Dudeck Licensed under MIT.