0.1.0 • Published 10 years ago
seneca-rancher-balance v0.1.0
A Seneca.js plugin that provides some ha functionality in rancher environment using seneca-balance-client
seneca-rancher-balance
Description
This module is a plugin for the Seneca framework.
Install
npm install seneca-rancher-balanceAnd 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 testLicense
Copyright (c) 2016, Ronny Dudeck Licensed under MIT.