Ansible playbook to create a Nomad cluster with Consul and Traefik using LXD
The cluster contains 10 nodes:
- 3 Consul nodes
- 3 Nomad server nodes
- 3 Nomad client nodes
- 1 Traefik node
Consul is used to bootstrap the Nomad cluster, for service discovery and for the service mesh
Traefik is the entrypoint of the cluster. It will use Consul service catalog to expose the services.
The proxy configuration exposes the services at {{ service name }}.service.127.0.0.1.nip.io
,
so when you deploy the service hello.nomad,
it will be exposed at hello-world.service.127.0.0.1.nip.io
There are 2 example jobs:
- hello.nomad, a simples hello world
- countdash.nomad, shows the usage of consul connect