With the version v0.10.0
of Nomad a very important new feature has landed, network namespaces. Network namespaces allows integration with Consul Connect and that allows you to connect to remote services without having to know their address and port. Plus some security stuff but I care more about my services working than being securely broken.
You can read more official information here:
- https://www.nomadproject.io/guides/integrations/consul-connect/index.html
- https://www.hashicorp.com/blog/hashicorp-nomad-0-10-beta/
- https://www.hashicorp.com/blog/consul-connect-integration-in-hashicorp-nomad/
Consul Connect in Nomad are called sidecars. However… sidecars are an advanced feature and the docs and examples are very confusing. At least I found them very confusing. So here is a slightly modified version of the example job file with lots of comments that hopefully explains how to use this great new feature.