This guide runs the example NoTailCar egress worker in Nomad. If you want private inbound access to a Nomad service instead, use one of the Serve examples in the final section.
- A Nomad cluster with Docker task driver support.
- Tailscale account/Tailnet access.
- A Tailscale auth key scoped for the tag you will advertise.
- Nomad Variables enabled for storing
TS_AUTHKEY.
Create an auth key in the Tailscale admin console.
Recommended settings for disposable Nomad allocations:
- Ephemeral: enabled when possible.
- Preauthorized: enabled only if automation needs it.
- Reusable: disabled unless you understand the blast radius.
- Tags: a narrow tag, for example
tag:nomad-worker.
nomad var put nomad/jobs/notailcar/example/secrets TS_AUTHKEY='<TAILSCALE_AUTH_KEY>'The included examples expect that path by default.
nomad job validate examples/egress-worker/egress-worker.nomad.hclnomad job plan examples/egress-worker/egress-worker.nomad.hclnomad job run examples/egress-worker/egress-worker.nomad.hclnomad job status notailcar-egress-worker
nomad alloc logs <alloc-id> egress-guard
nomad alloc logs <alloc-id> workerA successful worker prints its observed egress IP and the guard state file.
Pass variables through a vars file or CLI var flags:
ts_require_exit_node = "true"
ts_exit_node_primary = "100.x.y.z"
ts_exit_node_fallbacks = "100.a.b.c,100.d.e.f"
ts_egress_expected_ips = "203.0.113.10"Then run:
nomad job plan -var-file=example.vars.hcl examples/egress-worker/egress-worker.nomad.hcl
nomad job run -var-file=example.vars.hcl examples/egress-worker/egress-worker.nomad.hclDo not commit vars files containing real infrastructure details.
Serve examples expose allocation-local services privately over the Tailnet:
nomad job validate examples/private-http-service/private-http-service.nomad.hcl
nomad job validate examples/private-dashboard/private-dashboard.nomad.hcl
nomad job validate examples/private-api-service/private-api-service.nomad.hcl
nomad job validate examples/private-multi-port-service/private-multi-port-service.nomad.hcl
nomad job validate examples/private-tcp-service/private-tcp-service.nomad.hcl
nomad job validate examples/private-serve-config/private-serve-config.nomad.hcl
nomad job validate examples/private-service-acl/private-service-acl.nomad.hclRun one with the same Nomad Variables path:
nomad job plan examples/private-api-service/private-api-service.nomad.hcl
nomad job run examples/private-api-service/private-api-service.nomad.hclEgress examples run workers, agents, crawlers, and scheduled jobs through the local Tailscale HTTP/SOCKS proxy:
nomad job validate examples/agent-worker-egress/agent-worker.nomad.hcl
nomad job validate examples/multi-worker-pool/multi-worker-pool.nomad.hcl
nomad job validate examples/webhook-bridge/webhook-bridge.nomad.hcl
nomad job validate examples/scheduled-batch-egress/scheduled-batch-egress.nomad.hclEach example directory has its own README and Mermaid diagram.