nomad-job-exec

command module
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 25, 2023 License: MIT Imports: 12 Imported by: 0

README

nomad-job-exec

nomad-job-exec is a CLI tool that allows to execute command on multiple Nomad allocations concurrently or sequentially.

How it works

In a few words, nomad-job-exec does the following:

  • list all the allocations for the given --job,
  • find all the "valid" (running, that have an unambiguous task) allocations:
    • if --task was provided:
      • if the allocation doesn't have the provided task, skip it
      • else add it to the list of "valid" allocations
    • else: retrieve the tasks associated to the allocation
      • if more than one task is found, fail and ask to specify --task
      • else add the allocation to the list of "valid" allocations
  • execute the command on all the "valid" allocations and dump the output to stdout/stderr

Installation

NB: This project is still in development. Releases will be available once stabilized.

Download from the Releases page and put it somewhere in your $PATH.

Usage

Define the NOMAD_ADDR and NOMAD_TOKEN environment variables and then execute a command on multiple Nomad allocations.

❯ nomad-job-exec --command "ps" --job $JOB_NAME
Options
  • In order to execute the command concurrently, use the flag --parallel
  • To execute the command on a specific task only, specify it with the --task flag
  • A default timeout is set to 10m but can be changed with the flag --timeout

Use --help to get the details of all the optional flags available.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL