Search⌘ K

DNS and Registrator

Explore how to implement service discovery in microservices using Registrator to register Docker containers with Consul without code dependencies. Understand DNS configuration in Docker and how Consul handles load balancing, enabling seamless routing and configuration management with Envconsul.

Introduction #

The microservices have code dependencies to the Consul API for registering. This is not necessary, a Registrator can register Docker containers with Consul without the need for code.

When the Docker containers are configured in such a way that they use Consul as a DNS server, the lookup of other microservices can also occur without code dependencies. This eliminates any dependencies on Consul in the project.

Structure of the example #

The drawing above shows an overview of the approach.

  • Registrator runs ...