Coder Social home page Coder Social logo

droplet-lb's Introduction

droplet-lb

This is an IPv4 DNS server which exposes your Digital Ocean's inventory as regular 'A' records.

How does it work?

Give it a dns zone ( droplet-lb by default ) and query your instances via DNS. Example:

This environment has 2 web servers ( web-01 and web-02 ), droplet-lb will use the first part of the DNS name as a prefix during name lookup.

~ ❯❯❯ dig @localhost -p 8053 web.droplet-lb A +noall +answer

; <<>> DiG 9.8.3-P1 <<>> @localhost -p 8053 web.droplet-lb A +noall +answer
; (1 server found)
;; global options: +cmd
web.droplet-lb.   30  IN  A 104.131.52.84
web.droplet-lb.   30  IN  A 159.203.175.202

A background task will refresh the list of instances every 60 seconds.

Setup

Easiest way to set this up:

  • Get an Ubuntu droplet
  • Install nginx
  • Download the linux binary from the releases page, or go get github.com/lxfontes/droplet-lb
  • Get a Personal Access Token
  • Well.... run droplet-lb with your token and domain
  • For a load-balancer setup, use the file nginx.conf as starting point
  • You can also forward a zone to unbound, dnsmasq and others

Distributed setup

  • Setup a dedicated instance for droplet-lb, binding to your private IP
  • Setup multiple nginx instances, setting resolver to the proper droplet-lb instance
  • Add Floating-IPs to the mix

droplet-lb's People

Contributors

lxfontes avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.