Skip to content

open-wander/example-job

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Nomad Job Example

This directory contains an example Nomad job specification (example.nomad.hcl) that deploys a Redis cache service.

Prerequisites

  • Nomad installed and running.
  • Docker installed (since the example job uses the Docker driver).

Usage

1. Validate the Job

Before running the job, you can validate the syntax of the job file:

nomad job validate example.nomad.hcl

2. Plan the Job

Run a plan to see what changes Nomad will make:

nomad job plan example.nomad.hcl

3. Run the Job

Submit the job to your Nomad cluster:

nomad job run example.nomad.hcl

4. Check Job Status

Verify the status of the job:

nomad job status example

To see the logs of the allocations:

nomad alloc logs <alloc-id>

(Replace <alloc-id> with the actual allocation ID from the status command).

5. Stop the Job

To stop and purge the job:

nomad job stop -purge example

Job Details

  • Job Name: example
  • Type: service
  • Task Group: cache
  • Task: redis (uses redis:7 Docker image)
  • Resources: 500 MHz CPU, 256 MB Memory
  • Network: Exposes port 6379 (mapped to db port)

About

Example Job repository

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages