My team is - like many here, it seems - in the midst of migrating from a kludge of Docker-Compose stuff over to Nomad. I came here with a best practice question!
Let’s say I have:
- 2 services in Nomad that are Consul Connect’d
- 2 integration-test containers that we want to interface with those two services, respectively
Question 1 is: Should these integration test containers themselves be deployed to Nomad? Is that the simplest/most idiomatic way to let them service-discover the services they depend on?
The alternatives I can think of would be:
- run them bare on the host OS and just do some
staticport stuff - seems messy
- run them bare on the host OS and include some Consul Connect library in the container - also seems messy
Question 2 is: let’s assume the answer to question 1 is “yes, use Nomad”.
What’s the best way to deploy a one-shot job and retrieve an exit code/logs from it?
For example, In the docker-compose world, we could just
docker-compose run <an integration test> and receive a nice exit code at the end.
In Nomad, so far it looks like the best thing to do is a no-restarts-no-reschedules-Batch-job + poll for status on that job.
Thanks in advance!