Skip to content

Nomad Pack Plan

Charlie Voiselle edited this page Feb 11, 2022 · 1 revision

Command: nomad-pack plan

Dry-run a pack update to determine its effects

Usage

Usage: nomad-pack plan <pack-name> [options]

Determine the effects of submitting a new or updated Nomad Pack

Plan will return one of the following exit codes:

  • code 0: No objects will be created or destroyed.
  • code 1: Objects will be created or destroyed.
  • code 255: An error occurred determining the plan.

Examples

Plan an example pack with the default deployment name

nomad-pack plan example

Plan an example pack at a specific ref

nomad-pack plan example --ref=v0.0.1

Plan a pack from a registry other than the default registry

nomad-pack plan traefik --registry=community --ref=v0.0.1

Plan an example pack without showing the diff

nomad-pack plan example --diff=false

Plan a pack under development from the filesystem

This feature supports current working directory or a relative path.

	nomad-pack plan . 

Pack Options

  • -var-file=<string> - Specifies the path to a variable override file. This can be provided multiple times on a single command to result in a list of files.

  • -var=<key=value> - Specifies single override variables in the form of HCL syntax and can be specified multiple times per command.

  • -name=<string> - If set, this will be the unique identifier of this deployed instance of the specified pack. If not set, the pack name will be used. This is useful for running more than one instance of a pack within the same cluster. Note that this name must be globally unique within a cluster. Running the run command multiple times with the same name, will just re-submit the same pack, and apply changes if you have made any to the underlying pack. Be mindful that, whether you have made changes or not, the underlying Allocations will be replaced. When managing packs, the name specified here is the name that should be passed to the plan or destroy commands.

Plan Command Options

  • -registry=<string> - Specific registry name containing the pack to be planned.

  • -ref=<string> - Specific git ref of the pack to be planned. Supports tags, SHA, and latest. If no ref is specified, defaults to latest. Using ref with a file path is not supported.

  • -diff - Determines whether the diff between the remote job and planned job is shown. Defaults to true.

  • -policy-override - Sets the flag to force override any soft mandatory Sentinel policies.

  • -hcl1 - If set, HCL1 parser is used for parsing the job spec.

  • -verbose - Increase diff verbosity.