This repo is intended to prove that Nomad can automatically manage CIFS mounts required for a job using the Docker driver.
- Vagrant
- Nomad (recommended)
- Consul (optional)
-
Create Vagrant VMs:
vagrant up --provision
.The Vagrantfile here creates one orchestrator VM to run the Consul and Nomad servers, and two worker VMs to run workloads. It also forwards ports 4646 and 8500 to the orchestrator, so the Consul and Nomad UIs can be accessed at http://localhost:8500/ui and http://localhost:4646/ui respectively. Additionally, the
nomad
andconsul
CLIs can be invoked from the host to interact with the cluster. -
Create a consul key at
poc/cifs/config
with JSON data that includesusername
,password
, andshare
keys. This can either be done using theconsul
CLI or the Consul UI.Example JSON:
{ "username": "sharing", "password": "less-insecure", "share": "public" }
-
Run the Nomad jobs. This can either be done using the
nomad
CLI or by pasting the job file contents into the Nomad UI.$ nomad run jobs/nfs.hcl $ nomad run jobs/app.hcl
Using either the nomad
CLI or the Nomad UI,
verify the "app" job has mounted the NFS share provided by the "nfs" job:
$ nomad exec -job app '/bin/cat' '/network/hello.txt'