layout | page_title | description |
---|---|---|
docs |
Commands: job init |
The job init command is used to generate a skeleton jobspec template.
|
Alias: nomad init
The job init
command creates an example job specification in the
current directory that demonstrates some common configurations for tasks, task
groups, runtime constraints, and resource allocation.
nomad job init [options] [filename]
You may optionally supply a filename for the example job to be written to. The default filename for the generated file is "example.nomad.hcl".
Please refer to the jobspec and drivers pages to learn how to customize the template.
-short
: If set, a minimal jobspec without comments is emitted.-connect
: If set, the jobspec includes Consul Connect integration.-template=<template>
: Specifies a predefined template to emit. Must be a Nomad Variable that lives atnomad/job-templates/<template>
These are commonly created via the UI, and accessible with the -list-templates flag.-list-templates
: Display a list of possible job templates to pass to -template. Reads from all variables pathed atnomad/job-templates/<template>
.
Generate an example job file:
$ nomad job init
Example job file written to example.nomad.hcl