nomad icon indicating copy to clipboard operation
nomad copied to clipboard

Add docs about -dev flag for `nomad agent` CLI command

Open GuyAtTheFront opened this issue 1 year ago • 1 comments

Proposal

Add docs about -dev flag for nomad agent CLI command

Use-cases

It is unclear what -dev flag actually does:

  • It is possible to run client and server on the same instance without -dev
  • When starting nomad with / without -dev flag, client fingerprinting behaves differently:
    • With -dev: unique.network.ip-address = 127.0.0.1 (lo)
    • Without -dev: unique.network.ip-address = HOST_IP (eth0)
    • Some attributes (eg. unique.platform) are not picked up with -dev

It is common to start a POC by following Nomad Quick-Start guide, which recommends starting nomad with nomad agent -dev. However, it is difficult to know the exact steps required to move to the no--dev agent, since we have no information on what that does. In fact, I suspect (not tested) this flag is no longer necessary.

Attempted Solutions

NIL

GuyAtTheFront avatar Apr 08 '24 17:04 GuyAtTheFront

Hi @GuyAtTheFront! You're right that there are some details missing from the -dev docs. There's a fairly large set of changes that the flag makes on top of the default configuration, as you can see from config.go#L1219-L1252. What I'll probably do is add a new section to that page describing the list of items.

In fact, I suspect (not tested) this flag is no longer necessary.

It never was! But the major thing that -dev mode does is ensures that the agent doesn't leave anything behind. For example, it creates the datadir inside of /tmp (or equivalent), and it stops workloads on exit instead of letting them persist. It also makes some choices around address binding that make local development and "messing around" easier that we wouldn't want to use for production. The "client + server in one agent" part of it is only a small portion.

tgross avatar Apr 08 '24 19:04 tgross