My Docker Swarm setup with deconz and more

I’ve been migrating my home network to Docker Swarm for the last few month. As the last part and that was the trigger of the whole project I begun installing homeassistant. For now homeassistant core and deconz (I’m using Raspbee on a RPI3) is running.

Do get this up and running I related highly on My Docker Swarm Setup and [workaround] Docker Stack device mapping

As I’m new to homeassistant as well as docker it wasn’t easy to get it up and running and for now I don’t understand all of what I have done so far. :wink:

This is how my stack looks for the moment:

version: '3.3'
services:
  homeassistant:
    image: homeassistant/home-assistant:stable
    volumes:
     - /var/lib/gluster-vol/swarm/homeassistant/config:/config
     - /etc/localtime:/etc/localtime:ro
    networks:
     - macvlan_swarm
     - traefik-public
    logging:
      driver: json-file
    deploy:
      labels:
        traefik.enable: 'true'
        traefik.http.routers.homeassistant.entrypoints: web
        traefik.http.routers.homeassistant.rule: Host(`ha.pyramid.lan`)
        traefik.http.services.homeassistant.loadbalancer.server.port: '8123'
  deconz:
    container_name: deconz
    restart: always
    image: marthoc/deconz
    ports:
      - '85:80'
      - '9443:9443'
      - '5900:5900'
    environment:
      - DECONZ_WEB_PORT=80
      - DECONZ_WS_PORT=9443
      - DECONZ_VNC_MODE=1
      - DECONZ_DEVICE=/dev/serial0
    volumes:
      - '/etc/localtime:/etc/localtime:ro'
      - '/dev/serial0:/dev/serial0'
      - '/opt/deconz:/root/.local/share/dresden-elektronik/deCONZ'
    networks:
      - traefik-public
    deploy:
      mode: replicated
      replicas: 1
      placement:
        constraints: [node.hostname == ant]
      labels:
        - "traefik.enable=true"
        - "traefik.http.routers.deconz.rule=Host(`phoscon.pyramid.lan`)"
        - "traefik.http.routers.deconz.entrypoints=web"
        - "traefik.http.services.deconz.loadbalancer.server.port=80"
networks:
  macvlan_swarm:
    external: true
  traefik-public:
    external: true

So far this is running now, but there are some more things todo I don’t understand right now.

When installing homeassistant (supervised) three additional containers hassio_dns, hassio_supervisor and hass-audio get installed.
I think I understand supervisor quite well, it controls the installation, provides snapshot creation and the add-on store. As I have to setup services for everything the only I’m missing from there is Snapshot creation, but I think I can overcome this.

hass-audio I don’t unterstand at all, I hope somebody can tell me for what this is used.

last but not least there is hassio_dns, as DNS resolution does not work in homeassistant container it is obvious that this one is needed. What does this container and how could I setup this as a service?

Edit:
I know hassio_dns does DNS resolution, but how it’s integrated and as I read in other posts resolution of internal Domains doesn’t work in homeassistant. What I don’t understand is why is DNS resolution not working at all and why hassio_dns is used in homeassistant? Other container resolv DNS internal and external without problems.

I just removed the macvlan network. DNS resolution now works and homeassistant as far as I can see as well.

@Edzilla why you have choosen macvlan and @all why ist host network needed in homeassistant supervised.

The other thing which is still not clear for me, for what is hassio_dns needed?

If you don’t have either host networking or a dedicated IP given to you by macvlan in the physical network, none of the integration that rely on broadcast will work (such as Lifx or chromecast for example)

Ok, I understand. I didn’t knew Lifx before, Chromecast however, seems to work without broadcast regarding https://www.home-assistant.io/integrations/cast/ . I think I’ll give it a try without macvlan until I get at the point something is not working without it.
I just did a reinstall of homeassistant to see if everything (Logitech Media Server and deConz) does work. As autodiscovery of deConz didn’t work and I don’t know how do configure it I just enabled macvlan for this step. After discovery I disabled macvlan again and changed the deConz configuration from it’s IP address to tasks.deconz. Everything seems to work at this point, and even if the deConz service is recreated and it’s ip address changed it continues to work.
@Edzilla have you gone further with your configuration since you documented it on the forum? How you get around the DNS issue?