Hi,
I'm running NSD and Unbound on Kubernetes, and I wanted to run the DNS Stats Collector alongside them. To this end I created a Docker image for Collector (
https://github.com/SeanBurford/dns-stats-docker). I'm sharing it here in case others find it useful.
There are README.md files throughout the tree recording my thoughts, but here are the main points:
- Dockerfile (https://github.com/SeanBurford/dns-stats-docker/blob/main/compactor/Dockerfile) contains the directions used to build the binaries and then the container.
- bin/start_compactor.sh adds the hostname to the output file template, which is handy when you're running multiple instances on Kubernetes (they all have unique hostnames).
- I use a Unix socket to pass dnstap messages from the name servers to the compactors, with one compactor instance per name server instance.
- I'm using NFS to mount a shared log directory across the instances, though there are plenty of options for cluster filesystems.
- I would have preferred to use Alpine Linux, however various dependencies made Ubuntu (Focal) an easier choice. This is fine, Alpine Linux containers run alongside Ubuntu containers in a single Kubernetes pod (sharing the dnstap Unix socket).
Feel free to send pull requests or suggestions.
--
Thanks,
Sean Burford