Giter VIP home page Giter VIP logo

betterdns's Introduction

betterdns

We would like to register new vms to the DNS as soon as they're up & running. To randomly assign any IPs to new vms/container or use DHCP.

The goal of this project is to achieve service discovery.

Issues:

  • How do we unregister vms/containers that might shut down in a non-gracefully manner?
    • Use health checks.
    • Try to terminate non-healthy vms/containers.
    • Then unregister them from the DNS.

Repository structure

Path Description
src/dns_manifest_parser Parser for dns zone manifest.
src/dns_operator Operator of the dns server. Highly decoupled into 3 internal services:
controller.rs, runtime.rs & watcher.rs.
src/rest_api REST API server.

TODO: Next steps

  • Write tests.

Getting started

This binary will create 2 threads:

  • One thread serving the REST API to {create,read,update,delete} records of the dns zone manifest.
  • Another one will act as an operator, watching the dns zone manifest for change & updating the nameserver.
    • The operator is responsible for running the nameserver as a child process.
Endpoint Method Description
/ GET get the whole dns manifest
/a GET get all A records.
/a/<name> GET get one A record by name.
/a POST create a new A record.
/a/<name> PUT update an A record by name.
/a/<name> DELETE delete an A record by name.

Installation

git clone https://gitlab.com/alexandre.mahdhaoui/betterdns
mv betterdns "$HOME"
"$HOME/betterdns/scripts/update.sh"

Please make sure to have a customized copy of Corefile, dns_manifest & Rocket.toml in the directory that runs betterdns.

If you want to secure your alpine with a firewall:

Considerations

We will have a problem when we will try to authenticate/authorize clients. Indeed, we'll maybe try to use JWT tokens to authenticate new VM/container trying to register to the DNS.

betterdns's People

Contributors

alexandremahdhaoui avatar

Stargazers

Sven avatar Kamel Mahdhaoui avatar David avatar

Watchers

 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.