Today we released minimesos 0.12.0. In this version we have added support for Mesos DNS and an integration with dnsmasq. With this change the minimesos containers and Marathon apps are available on the
.mm domain. You can install the new version using the usual installer command:
curl -sSL https://minimesos.org/install | sh. The Docker images are available on Docker Hub and the jar is available via Jitpack.
Predictable DNS vs unpredictable container IPs
One of my major pet peeves during development is working with unpredictable container IP addresses instead of predictable DNS names. Predictable DNS names provide easier configuration and a better Developer Experience (DX). Luckily we have an initial implementation to solve this problem with our support for Mesos DNS and dnsmasq. See the animated gif below. We can resolve the master and the deployed nginx container dircectly using predictible DNS names.
Mesos DNS is designed specifically for Mesos and created by our friends from Mesosphere. Mesos DNS monitors the master and automatically created DNS records for each task. By using Mesos DNS you can resolve the processes. The top level domain is configurable so we have used the
.mm domain to create predictable naming conventions:
- Master - master.mm
- Zookeeper - zookeeper.mm
- Agent - agent.mm
- Marathon Application - app.marathon.mm
The Mesos DNS container is defined as one of the cluster processes you can configure in your
mesosdns snippet is now added to the
minimesosFile when you do
The second piece of the puzzle is dnsmasq. It is a local DNS server that runs on many systems by default. When a program attempts to resolve a domain name it uses name services defined in
/etc/nsswitch.conf. If dnsmasq is installed it is also listed as one of the name services besides your host file and your ISPs DNS. The key feature we use it that dnsmasq can forward DNS requests to another server, in our case Mesos DNS. By doing this every application the host machine can resolve minimesos containers and applications. This forwarding is done by adding a small line of configuration to dnsmasq. It is printed on
Minimesos cluster is running: 68739552 Mesos version: 1.0.0 export MINIMESOS_NETWORK_GATEWAY=172.17.0.1 export MINIMESOS_AGENT=http://172.17.0.5:5051; export MINIMESOS_AGENT_IP=172.17.0.5 export MINIMESOS_ZOOKEEPER=zk://172.17.0.3:2181/mesos; export MINIMESOS_ZOOKEEPER_IP=172.17.0.3 export MINIMESOS_MARATHON=http://172.17.0.6:8080; export MINIMESOS_MARATHON_IP=172.17.0.6 export MINIMESOS_CONSUL=http://172.17.0.7:8500; export MINIMESOS_CONSUL_IP=172.17.0.7 export MINIMESOS_MESOSDNS=http://172.17.0.8:5353; export MINIMESOS_MESOSDNS_IP=172.17.0.8 export MINIMESOS_MASTER=http://172.17.0.4:5050; export MINIMESOS_MASTER_IP=172.17.0.4 Running dnsmasq? Add 'server=/mm/172.17.0.8#5353' to /etc/dnsmasq.d/10-minimesos to resolve master.mm, zookeeper.mm and Marathon apps on app.marathon.mm.
When this configuration is in place all
.mm addresses will be resolved through dnsmasq hence through Mesos DNS.
Keep in touch
Thanks for reading! Keep in touch by commenting on the blog, talking to us at @minimesos and @ContainerSoluti or ask a question on the mailing list. Do you have an idea on how to improve minimesos? Please open an issue or add a PR at the minimesos Github repo. We hope you find minimesos useful. See you next time!