Nomad
nomad-pack run command reference
Use the nomad-pack run command to install the specified Nomad Pack to a configured Nomad cluster.
Usage
nomad-pack run <pack_name> [options]
Options
-registry=<string>: Specific registry name containing the pack to be run.-ref=<string>: Specific Git reference of the pack to retrieve info about. Supports tags, SHA, and@latest. If you do not specify a reference, the value defaults to@latest. Usingrefwith a file path is not supported.-check-index=<uint>: If set, the job is only registered or updated if the passed job modify index matches the server side version. If you pass a value of zero, the job is only registered if it does not yet exist. Passing a non-zero value ensures that the job is being updated from a known state. The use of this flag is most common in conjunction withnomad job plancommand.-consul-token=<string>: If set, the passed Consul token is stored in the job before sending to the Nomad servers. This allows passing the Consul token without storing it in the job file. This overrides the token found in the $CONSUL_HTTP_TOKEN environment variable and that found in the job.-consul-namespace=<string>: If set, any services in the job are registered into the specified Consul namespace. Any template block reading from Consul KV are scoped to the the specified Consul namespace. If Consul ACLs are enabled and theallow_unauthenticatedNomad server Consul configuration is not enabled, then you must supply a Consul token with appropriate service and KV Consul ACL policy permissions.-vault-token=<string>: If set, the passed Vault token is stored in the job before sending to the Nomad servers. This allows passing the Vault token without storing it in the job file. This overrides the token found in the $VAULT_TOKEN environment variable and that found in the job.-vault-namespace=<string>: If set, the passed Vault namespace is stored in the job before sending to the Nomad servers.-policy-override: Sets the flag to force override any soft mandatory Sentinel policies.-preserve-counts: If set, the existing task group count is preserved when updating a job.
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
Run an example pack with the default deployment name "example".
nomad-pack run example
Run an example pack with the specified deployment name "dev".
nomad-pack run example --name=dev
Run an example pack with override variables in a variable file.
nomad-pack run example --var-file="./overrides.hcl"
Run an example pack with CLI variable overrides.
nomad-pack run example --var="redis_image_version=latest" \
--var="redis_resources={"cpu": "1000", "memory": "512"}"
Run a pack under development from the current filesystem.
nomad-pack run .