Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

License

NotificationsYou must be signed in to change notification settings

hashicorp/nomad-pack

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

Installation

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

Nightly Builds and Docker Image Preview

Nomad Pack is under constant updates, so every day thenightlyrelease 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-packrepository on Docker Hub.

Usage

Dependencies

Nomad Pack users must have Nomad running and accessible at the address defined in theNOMAD_ADDRenvironment variable.

If Nomad ACLs are enabled, a token with proper permissions must be defined in theNOMAD_TOKENenvironment variable.

Basic Use

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

Adding Non-Default Pack Registries

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.

Writing your own Packs

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.

Pack Registries

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!

Upcoming Features and Changes

  • Support for Volumes and ACLs
  • Support for other Version Control Systems
  • Pack search command
  • Integration into the official Nomad CLI

Additional Resources

Tutorials


[8]ページ先頭

©2009-2025 Movatter.jp