open-nomad/website/content/docs/job-specification
Michael Schurter 1256c8ef66
docs: update json jobs docs (#12766)
* docs: update json jobs docs

Did you know that Nomad has not 1 but 2 JSON formats for jobs? 2½ if you
want to acknowledge that sometimes our JSON job representations have a
Job top-level wrapper and sometimes do not.

The 2½ formats are:
```
 1.   HCL JSON
 2.   Input API JSON (top-level Job field)
 2.5. Output API JSON (lacks top-level Job field)
```

`#2` is what our docs consider our API JSON. `#2.5` seems to be an
accident of history we can't fix with breaking API compatibility.

`#1` is an even more interesting accident of history: the `jobspec2`
package automatically detects if the input to Parse is JSON and switches
to a JSON parser. This behavior is undocumented, the format is
unspecified, and there is no official HashiCorp tooling to produce this
JSON from HCL. The plot thickens when you discover popular third party
tools like hcl2json.com and https://github.com/tmccombs/hcl2json seem to
produce JSON that `nomad run` accepts!

Since we have no telemetry around whether or not anyone passes HCL JSON
to `nomad run`, and people don't file bugs around features that Just
Work, I'm choosing to leave that code path in place and *acknowledged
but not suggested* in documentation.

See https://github.com/hashicorp/hcl/issues/498 for a more comprehensive
discussion of what officially supporting HCL JSON in Nomad would look
like.

(I also added some of the missing fields to the (Input API flavor) JSON
Job documentation, but it still needs a lot of work to be
comprehensive.)

Co-authored-by: Tim Gross <tgross@hashicorp.com>
2022-04-22 15:57:27 -07:00
..
hcl2 docs: update json jobs docs (#12766) 2022-04-22 15:57:27 -07:00
affinity.mdx docs: fix examples for set_contains_all and set_contains_any (#12093) 2022-03-07 13:55:57 -05:00
artifact.mdx git example - suggest providing real repo 2021-05-03 08:12:10 -04:00
check_restart.mdx feat(website): migrates to new nav data format (#10264) 2021-03-31 08:43:17 -05:00
connect.mdx feat(website): migrates to new nav data format (#10264) 2021-03-31 08:43:17 -05:00
constraint.mdx feat(website): migrates to new nav data format (#10264) 2021-03-31 08:43:17 -05:00
csi_plugin.mdx docs: updates for CSI plugin improvements for 1.3.0 (#12466) 2022-04-05 17:13:51 -04:00
device.mdx feat(website): migrates to new nav data format (#10264) 2021-03-31 08:43:17 -05:00
dispatch_payload.mdx feat(website): migrates to new nav data format (#10264) 2021-03-31 08:43:17 -05:00
env.mdx docs: note env and meta map assignment syntax (#11095) 2021-08-29 14:35:09 -04:00
ephemeral_disk.mdx feat(website): migrates to new nav data format (#10264) 2021-03-31 08:43:17 -05:00
expose.mdx feat(website): migrates to new nav data format (#10264) 2021-03-31 08:43:17 -05:00
gateway.mdx Add grpc and http2 listeners to gateway docs (#12367) 2022-03-24 17:09:19 -04:00
group.mdx Add max client disconnect docs (#12467) 2022-04-06 08:54:14 -04:00
index.mdx feat(website): migrates to new nav data format (#10264) 2021-03-31 08:43:17 -05:00
job.mdx docs: add Nomad version requirement note for sysbatch (#11231) 2021-09-29 15:14:51 -04:00
lifecycle.mdx feat(website): migrates to new nav data format (#10264) 2021-03-31 08:43:17 -05:00
logs.mdx feat(website): migrates to new nav data format (#10264) 2021-03-31 08:43:17 -05:00
meta.mdx docs: add some extra documentation around client host environment variables (#11208) 2021-09-21 17:23:30 -04:00
migrate.mdx feat(website): migrates to new nav data format (#10264) 2021-03-31 08:43:17 -05:00
multiregion.mdx feat(website): migrates to new nav data format (#10264) 2021-03-31 08:43:17 -05:00
network.mdx docs: elaborate on networking issues with firewalld (#12214) 2022-03-08 09:49:29 -05:00
parameterized.mdx mention sysbatch in addition to batch (#11587) 2021-12-06 19:12:03 -05:00
periodic.mdx mention sysbatch in addition to batch (#11587) 2021-12-06 19:12:03 -05:00
proxy.mdx feat(website): migrates to new nav data format (#10264) 2021-03-31 08:43:17 -05:00
reschedule.mdx core: implement system batch scheduler 2021-08-03 10:30:47 -04:00
resources.mdx add a section about memory oversubscription (#10573) 2021-05-13 13:35:51 -04:00
restart.mdx docs: clarify restart inheritance and add examples (#12275) 2022-03-14 15:49:08 -04:00
scaling.mdx feat(website): extract /plugins /tools docs (#11584) 2021-12-09 14:25:18 -05:00
service.mdx services: cr followup 2022-04-22 09:14:29 -05:00
sidecar_service.mdx documentation for disable_default_tcp_check 2021-05-07 13:16:39 -04:00
sidecar_task.mdx feat(website): migrates to new nav data format (#10264) 2021-03-31 08:43:17 -05:00
spread.mdx scheduler: fix quadratic performance with spread blocks (#11712) 2021-12-21 10:10:01 -05:00
task.mdx feat(website): migrates to new nav data format (#10264) 2021-03-31 08:43:17 -05:00
template.mdx docs: fix broken link from template to client config (#12733) 2022-04-21 11:04:04 -04:00
update.mdx docs: clarify that a default update strategy is used when update strategy is omitted 2021-05-10 08:27:22 -04:00
upstreams.mdx consul/connect: fix upstream mesh gateway default mode setting 2021-06-04 08:53:12 -05:00
vault.mdx vault: revert support for entity aliases (#12723) 2022-04-22 10:46:34 -04:00
volume.mdx docs: mount_flags takes a slice of strings (#11583) 2021-11-29 10:07:34 -05:00
volume_mount.mdx feat(website): migrates to new nav data format (#10264) 2021-03-31 08:43:17 -05:00