How to allow containerized Heimdall see Pi-Hole

I’ve got both Heimdall and Pi-Hole running in docker. They both work fine, but I’d like to get the Pi-Hole advanced statistics in Heimdall. The others, I just put on the bridge network, but I’m not sure I can have the Pi-Hole on bridge and the macvlan network. Is that possible, or is there a better way to accomplish this?

Rik ,

I haven’t been able to figure this out either, my dashboard is just links to my other containers with no obvious way to get at the juicy stats.

atfergs OP ,
@atfergs@lemmy.world avatar

You can get access to most of them by setting them all to use the bridge network (network_mode: bridge). Then if you inspect the bridge network, you can see the bridge network ip’s of them all and use that for Heimdall. The Pi-Hole is an exception though since it requires a different network.

ABeeinSpace ,

Can Heimdall use the Docker socket?

Fenzik , (edited )

Why not? You can just connect the PiHole container to both networks and inter-container communication should work as usual. I haven’t tried this with PiHole specifically but I’ve done it with other services in the past

atfergs OP ,
@atfergs@lemmy.world avatar

Maybe I just don’t know how… Do you have a compose script you could share?

Fenzik ,

Not for PiHole but I was testing this recently with traefik. This has a bunch of traefik stuff in there (I’m on mobile so it’s too hard to edit it) but hopefully you see how the networks work


<span style="font-style:italic;color:#969896;"># Testing macvlan setup for traefik
</span><span style="font-style:italic;color:#969896;"># Will only work on linux because of macvlan network
</span><span style="color:#323232;">
</span><span style="color:#63a35c;">version</span><span style="color:#323232;">: </span><span style="color:#183691;">'3'
</span><span style="color:#323232;">
</span><span style="color:#63a35c;">services</span><span style="color:#323232;">:
</span><span style="color:#323232;">  </span><span style="color:#63a35c;">traefik-whoami</span><span style="color:#323232;">:
</span><span style="color:#323232;">    </span><span style="color:#63a35c;">image</span><span style="color:#323232;">: </span><span style="color:#183691;">traefik/whoami
</span><span style="color:#323232;">    </span><span style="color:#63a35c;">container_name</span><span style="color:#323232;">: </span><span style="color:#183691;">traefik_whoami
</span><span style="color:#323232;">    </span><span style="color:#63a35c;">networks</span><span style="color:#323232;">:
</span><span style="color:#323232;">      - </span><span style="color:#183691;">bridge_network
</span><span style="color:#323232;">    </span><span style="color:#63a35c;">labels</span><span style="color:#323232;">:
</span><span style="color:#323232;">      - </span><span style="color:#183691;">"traefik.enable=true"
</span><span style="color:#323232;">      - </span><span style="color:#183691;">"traefik.http.routers.whoami.rule=Host(`whoami.test`)"
</span><span style="color:#323232;">      - </span><span style="color:#183691;">"traefik.http.routers.whoami.entrypoints=http"
</span><span style="color:#323232;">  
</span><span style="color:#323232;">  </span><span style="color:#63a35c;">traefik-reverse-proxy</span><span style="color:#323232;">:
</span><span style="color:#323232;">    </span><span style="color:#63a35c;">image</span><span style="color:#323232;">: </span><span style="color:#183691;">traefik:v2.10
</span><span style="color:#323232;">    </span><span style="color:#63a35c;">container_name</span><span style="color:#323232;">: </span><span style="color:#183691;">traefik_reverse_proxy
</span><span style="color:#323232;">    </span><span style="color:#63a35c;">command</span><span style="color:#323232;">:
</span><span style="color:#323232;">      - </span><span style="color:#183691;">"--api.insecure=true"  </span><span style="font-style:italic;color:#969896;"># Enable the API dashboard (insecure for testing)
</span><span style="color:#323232;">      - </span><span style="color:#183691;">"--providers.docker=true"  </span><span style="font-style:italic;color:#969896;"># Enable Docker provider
</span><span style="color:#323232;">      - </span><span style="color:#183691;">"--providers.docker.exposedbydefault=false"  </span><span style="font-style:italic;color:#969896;"># Disable exposing all containers by default
</span><span style="color:#323232;">      - </span><span style="color:#183691;">"--entrypoints.http.address=:80"  </span><span style="font-style:italic;color:#969896;"># HTTP entrypoint
</span><span style="color:#323232;">      - </span><span style="color:#183691;">"--entrypoints.http.forwardedheaders.insecure=true"  </span><span style="font-style:italic;color:#969896;"># Insecure forwarding (for testing)
</span><span style="color:#323232;">      - </span><span style="color:#183691;">"--providers.docker.network=bridge_network"  </span><span style="font-style:italic;color:#969896;"># Use bridge network for traefik discovery
</span><span style="color:#323232;">    </span><span style="color:#63a35c;">ports</span><span style="color:#323232;">:
</span><span style="color:#323232;">      - </span><span style="color:#183691;">"1180:80"  </span><span style="font-style:italic;color:#969896;"># Expose HTTP entrypoint
</span><span style="color:#323232;">      - </span><span style="color:#183691;">"12345:8080"  </span><span style="font-style:italic;color:#969896;"># Expose Traefik dashboard
</span><span style="color:#323232;">    </span><span style="color:#63a35c;">networks</span><span style="color:#323232;">:
</span><span style="color:#323232;">      </span><span style="color:#63a35c;">bridge_network</span><span style="color:#323232;">: {}
</span><span style="color:#323232;">      </span><span style="color:#63a35c;">macvlan_network</span><span style="color:#323232;">:
</span><span style="color:#323232;">        </span><span style="color:#63a35c;">ipv4_address</span><span style="color:#323232;">: </span><span style="color:#0086b3;">192.168.1.69
</span><span style="color:#323232;">    </span><span style="color:#63a35c;">volumes</span><span style="color:#323232;">:
</span><span style="color:#323232;">      </span><span style="font-style:italic;color:#969896;"># TODO: Use docker.sock proxy instead of mounting directly
</span><span style="color:#323232;">      </span><span style="font-style:italic;color:#969896;"># https://github.com/Tecnativa/docker-socket-proxy
</span><span style="color:#323232;">      - </span><span style="color:#183691;">/var/run/docker.sock:/var/run/docker.sock:ro
</span><span style="color:#323232;">    </span><span style="color:#63a35c;">labels</span><span style="color:#323232;">:
</span><span style="color:#323232;">      - </span><span style="color:#183691;">"traefik.enable=true"
</span><span style="color:#323232;">      - </span><span style="color:#183691;">"traefik.http.routers.reverse-proxy.rule=Host(`traefik.test`)"
</span><span style="color:#323232;">      - </span><span style="color:#183691;">"traefik.http.routers.reverse-proxy.entrypoints=http"
</span><span style="color:#323232;">
</span><span style="color:#63a35c;">networks</span><span style="color:#323232;">:
</span><span style="color:#323232;">  </span><span style="color:#63a35c;">bridge_network</span><span style="color:#323232;">:
</span><span style="color:#323232;">    </span><span style="color:#63a35c;">driver</span><span style="color:#323232;">: </span><span style="color:#183691;">bridge
</span><span style="color:#323232;">
</span><span style="color:#323232;">  </span><span style="color:#63a35c;">macvlan_network</span><span style="color:#323232;">:
</span><span style="color:#323232;">    </span><span style="color:#63a35c;">driver</span><span style="color:#323232;">: </span><span style="color:#183691;">macvlan
</span><span style="color:#323232;">    </span><span style="color:#63a35c;">driver_opts</span><span style="color:#323232;">:
</span><span style="color:#323232;">      </span><span style="color:#63a35c;">parent</span><span style="color:#323232;">: </span><span style="color:#183691;">eth0
</span><span style="color:#323232;">    </span><span style="color:#63a35c;">ipam</span><span style="color:#323232;">:
</span><span style="color:#323232;">      </span><span style="color:#63a35c;">config</span><span style="color:#323232;">:
</span><span style="color:#323232;">        - </span><span style="color:#63a35c;">subnet</span><span style="color:#323232;">: </span><span style="color:#183691;">192.168.1.0/24
</span><span style="color:#323232;">          </span><span style="color:#63a35c;">gateway</span><span style="color:#323232;">: </span><span style="color:#0086b3;">192.168.1.1
</span><span style="color:#323232;">          </span><span style="color:#63a35c;">ip_range</span><span style="color:#323232;">: </span><span style="color:#183691;">192.168.1.69/32  </span><span style="font-style:italic;color:#969896;"># Must be outside router's DHCP range
</span>
atfergs OP ,
@atfergs@lemmy.world avatar

This is great, thank you!

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • [email protected]
  • All magazines