seneca-rancher-balance

0.1.0 • Public • Published

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.

Package Sidebar

Install

npm i seneca-rancher-balance

Weekly Downloads

3

Version

0.1.0

License

MIT

Last publish

Collaborators

  • rdudeck