Skip to content

Nomad Pack Destroy

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

Command: nomad-pack destroy

Delete an existing pack

Usage

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

Stop and delete the specified Nomad Pack from the configured Nomad cluster. This is the same as using the command "nomad-pack stop --purge". By default, the destroy command will delete ALL jobs in the pack deployment. If a pack was run using var overrides to specify the job name(s), the var overrides MUST be provided when destroying the pack to guarantee nomad-pack targets the correct job(s) in the pack deployment.

Examples

Stop an example pack in deployment "dev" and delete it from the cluster

nomad-pack destroy example --name=dev

Stop and delete an example pack in deployment "dev" that has a job named "test"

If the same pack has been installed in deployment "dev" but overriding the job name to "hello", only "test" will be deleted

nomad-pack destroy example --name=dev --var=job_name=test	

Options

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.

Destroy Command Options

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

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

  • -global - Destroy multi-region pack in all its regions. By default, pack destroy will destroy only a single region at a time. Ignored for single-region packs.