- Notifications
You must be signed in to change notification settings - Fork56
License
hashicorp/nomad-pack
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Nomad Pack is a templating and packaging tool used withHashiCorp Nomad. Nomad Pack is currently Generally Available (GA) as ofnomad-pack
v0.1.0.
Nomad Pack is used to:
- Easily deploy popular applications to Nomad
- Re-use common patterns across internal applications
- Find and share job specifications with the Nomad community
To simplify the getting started experience, you can download aprecompiled binaryand run it on your machine locally. After downloading Nomad Pack, unzip the package. Make sure thatthe nomad binary is available on your PATH. You can inspect the locations available on your path byrunning this command:
$ echo $PATH/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
The output is a list of locations separated by colons. You can make Nomad Pack available by movingthe binary to one of the listed locations, or by adding Nomad Pack's location to your PATH.
Nomad Pack is also available as aDocker image. With Docker installed on your localmachine, you can pull the latest image by running the following command:
$ docker pull hashicorp/nomad-pack:0.2.0
Nomad Pack is under constant updates, so every day thenightly
release is updated withbinaries built off the latest code in themain
branch. This should make it easier for you to trynew features and bug fixes.
Each commit tomain
also generates a preview Docker image that can be accessed from thehashicorppreview/nomad-pack
repository on Docker Hub.
Nomad Pack users must have Nomad running and accessible at the address defined in theNOMAD_ADDR
environment variable.
If Nomad ACLs are enabled, a token with proper permissions must be defined in theNOMAD_TOKEN
environment variable.
First, run thelist
command to see which packs are available to deploy.
nomad-pack list
If you don't see the default registry (nomad registry list
), it can be added with theregistry add
command.
nomad-pack registry add default github.com/hashicorp/nomad-pack-community-registry
To deploy one of these packs, use therun
command. This deploys each jobs defined in the pack to Nomad.To deploy thehello_world
pack, you would run the following command:
nomad-pack run hello_world
Each pack defines a set of variables that can be provided by the user. To get information on the packand to see which variables can be passed in, run theinfo
command.
nomad-pack info hello_world
Values for these variables are provided using the--var
flag.
nomad-pack run hello_world --var message=hola
Values can also be provided by passing in a variables file. See the variables section of theDetailed usage guide for details.
tee -a ./my-variables.hcl<<ENDmessage="bonjour"ENDnomad-pack run hello_world -f ./my-variables.hcl
If you want to remove all of the resources deployed by a pack, run thedestroy
command with thepack name.
nomad-pack destroy hello_world
When using Nomad Pack, the default registry for packs isthe Nomad Pack Community Registry.Packs from this registry will be made automatically available.
You can add additional registries by using theregistry add
command. For instance, if you wantedto addan example Gitlab registry,you would run the following command to download the registry.
nomad-pack registry add example gitlab.com/mikenomitch/pack-registry
To view the packs you can now deploy, run theregistry list
command.
nomad-pack registry list
Packs from this registry can now be deployed using therun
command.
Nomad Pack is valuable when used with official and community packs, but many users will also want touse their own.
Converting your existing Nomad job specifications into reusable packs is achievable in a few steps,see theWriting Packs documentation for more details.
Packs are organized into "registries" which contain multiple packs and shared templates.
TheNomad Pack Community Registry isa public registry for community-maintained packs. Nomad community members are encouraged to sharetheir packs and collaborate with one another in this repo.
Pull Requests and feedback on both repositories are welcome!
- Support for Volumes and ACLs
- Support for other Version Control Systems
- Pack search command
- Integration into the official Nomad CLI