Coder Social home page Coder Social logo

lionelnicolas / dalidock Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 1.0 109 KB

A dockerized DNS server and load balancer with automatic discovery

License: Apache License 2.0

Shell 12.08% Python 81.77% Dockerfile 6.15%
docker load-balancer dns dns-server dnsmasq haproxy service-discovery resolver libvirt kvm

dalidock's People

Contributors

lionelnicolas avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

aiminickwong

dalidock's Issues

exception when using malformed label

When using --label lb.http=no-port-specified :

Traceback (most recent call last):
  File "/usr/sbin/dalidock", line 1110, in <module>
    main()
  File "/usr/sbin/dalidock", line 1103, in main
    docker_evt_handler.serve()
  File "/usr/sbin/dalidock", line 579, in serve
    self.loadAllContainers()
  File "/usr/sbin/dalidock", line 644, in loadAllContainers
    self.handleContainerSafe(container["Id"], "start")
  File "/usr/sbin/dalidock", line 664, in handleContainerSafe
    self.handleContainer(containerid, status)
  File "/usr/sbin/dalidock", line 710, in handleContainer
    self.lb.update()
  File "/usr/sbin/dalidock", line 1067, in update
    new_haproxy_config = self.generate()
  File "/usr/sbin/dalidock", line 946, in generate
    http_host, http_port = http_entry.split(":")

timing issue when fetch addresses from qemu guest agent

Sometimes hitting this issue when qemu-guest-agent is starting :

Exception in thread Thread-3:
Traceback (most recent call last):
  File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.6/threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/sbin/dalidock", line 432, in handleDomainSafe
    _ = self.libvirt.getIPAddress(dom, timeout=LIBVIRT_IP_TIMEOUT)
  File "/usr/sbin/dalidock", line 207, in getIPAddress
    return self.getIPAddressFromGuestAgent(dom, timeout=timeout)
  File "/usr/sbin/dalidock", line 265, in getIPAddressFromGuestAgent
    for addr in data.get("addrs", []):
TypeError: 'NoneType' object is not iterable

DNS binding

Hi,
I'm trying to run this service but i see that the DNS that will start into the container, it's binded to his internal ip address, so, it's not possible to have a DNS service exposed to the network.

With this limitation, it's not possible to configure a container/virtualization host on network with services published via domain names.

As you can see from netstat, service is binded to internal container ip address:

udp        0      0 $_container_ip_:53            0.0.0.0:*                           1654/conmon

that is not reachable from network, also with publish costraint

I've also tried to not specify binding address, but i get error:

Error: cannot listen on the UDP port: listen udp4 :53: bind: address already in use

because there are other services running that are related to libvirt

add libvirt support

add service discovery from libvirt/qemu/kvm virtual machines in addition to docker containers.

doesn't works with PODMAN

Hi,
docker it's been replaced by podman on new Red Hat systems so i'm trying to run this awesome tool on it for running some tests.

I'm trying to run on a libvirt server, but the error that I get is:

During handling of the above exception, another exception occurred:
                                               
Traceback (most recent call last):             
  File "/usr/sbin/dalidock", line 1110, in <module>
    main()                                                                             
  File "/usr/sbin/dalidock", line 1096, in main
    docker_evt_handler = DockerEventsHandler(dns_entries, lb_entries, config_lock)           
  File "/usr/sbin/dalidock", line 565, in __init__ 
    self.docker = DockerClient(DOCKER_SOCKET)                    
  File "/usr/sbin/dalidock", line 482, in __init__                
    self.showInformations()                                            
  File "/usr/sbin/dalidock", line 485, in showInformations
    docker_infos = self.conn.info()                                 
  File "/usr/lib/python3/dist-packages/docker/api/daemon.py", line 33, in info
    return self._result(self._get(self._url("/info")), True)          
  File "/usr/lib/python3/dist-packages/docker/utils/decorators.py", line 47, in inner
    return f(self, *args, **kwargs)                          
  File "/usr/lib/python3/dist-packages/docker/client.py", line 139, in _get
    return self.get(url, **self._set_request_timeout(kwargs))                            
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 546, in get
    return self.request('GET', url, **kwargs)         
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 533, in request
    resp = self.send(prep, **send_kwargs)                          
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 646, in send
    r = adapter.send(request, **kwargs)
  File "/usr/lib/python3/dist-packages/requests/adapters.py", line 498, in send
    raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))

For run this, there are some options that doesn't works, so, my CLI was:

podman run \
   --name dalidock \
   --net bridge \
   --log-opt max-size=50m \
   --log-opt max-file=3 \
   --cap-add NET_ADMIN \
   --publish $_IP_ADDRESS_:53:53/udp \
   --publish 80:80 \
   --env DNS_DOMAIN=my.local.env \
   --env LB_DOMAIN=my.local.env \
   --volume /run/NetworkManager:/run/NetworkManager:ro \
   --volume /var/run/libvirt:/var/run/libvirt:ro \
   lionelnicolas/dalidock

I don't used --detached for see what happens, so i see that it detects libvirt engine

dalidock[3798]: [INFO]  ----- LIBVIRT INFOS -----
[...]

So i think that for that errors, if i try to reach server via telnet to see if DNS service is running, i obtain Connection timed out also if via netstat i see correct bind $_IP:53

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.