Nomad
nomad-pack destroy command reference
Use the nomad-pack destroy command to stop and delete the specified Nomad pack
from the configured Nomad cluster. This is the same as using the command
nomad-pack stop <pack_name> --purge.
By default, the nomad-pack destroy command deletes all jobs in the pack
deployment. If you ran a pack with var overrides to specify the job name, you
must provide the var override when destroying the pack to guarantee this command
targets the correct job in the pack deployment.
Usage
nomad-pack destroy <pack_name> [options]
Options
-registry=<string>: Specific registry name containing the pack to be destroyed.-ref=<string>: Specific Git reference of the pack to destroy. Supports tags, SHA, and latest. If no ref is specified, defaults to latest. Usingrefwith a file path is not supported.-global: Destroy multi-region pack in all its regions. By default,destroyonly destroys a single region at a time. Ignored for single-region packs.
Operation options
-var-file=<string>: Specifies the path to a variable override file. You may provide this multiple times on a single command for multiple files.-allow-unset-vars: Suppress errors from unset variables without default values. Equivalent of setting the NOMAD_PACK_ALLOW_UNSET_VARS environment variable to1ortrue.-ignore-missing-vars: Determines whether the command should override variables not present in the pack or should produce an error.-var=<key=value>: Specifies single override variables in the form of HCL syntax. You may specify multiple times per command.-name=<string>: If set, this is the unique identifier of this deployed instance of the specified pack. If not set, the pack name becomes the unique identifier. Setting a name 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 re-submits the same pack and applies changes if you have made any to the underlying pack. Be mindful that, whether you have made changes or not, the underlying allocations are replaced.When managing packs, the name specified here is the name that you should be pass to Nomad Packs'plananddestroycommands.-parser-v1: Use the legacy syntax parser to parse your job. This enables pack to run packs for earlier versions while you are migrating them to the new syntax
Nomad cluster options
-address=<string>: The address of the Nomad server. Overrides the NOMAD_ADDR environment variable if set.-namespace=<string>: The target namespace for queries and actions bound to a namespace. Overrides the NOMAD_NAMESPACE environment variable if set.-region=<string>: The region of the Nomad servers to forward commands to. Overrides the NOMAD_REGION environment variable if set.-ca-cert=<string>: Path to a PEM encoded CA cert file to use to verify the Nomad server SSL certificate. Overrides the NOMAD_CACERT environment variable if set.-client-cert=<string>: Path to a PEM encoded client certificate for TLS authentication to the Nomad server. Must also specify--client-key. Overrides the NOMAD_CLIENT_CERT environment variable if set.-client-key=<string>: Path to an unencrypted PEM encoded private key matching the client certificate from--client-cert. Overrides the NOMAD_CLIENT_KEY environment variable if set.-tls-server-name=<string>: The server name to use as the SNI host when connecting via TLS. Overrides the NOMAD_TLS_SERVER_NAME environment variable if set.-token=<string>: The SecretID of an ACL token to use to authenticate API requests with. Overrides the NOMAD_TOKEN environment variable if set.-tls-skip-verify: Do not verify TLS certificate. We do not recommend this. Verification is also skipped if you set the NOMAD_SKIP_VERIFY environment variable.
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 you have installed the same pack in deployment "dev" but override the job name to "hello", this command only destroys "test".
nomad-pack destroy example --name=dev --var=job_name=test