Skip to content

mauu/nomad-ops

 
 

Repository files navigation

nomad-ops

A simple operator for nomad which reconciles the running jobs in comparison to git repos

Still work in progress, but it should do what it is supposed to :)
See https://nomad-ops.github.io/nomad-ops/ for more information

Getting started with docker

You need nomad and docker installed on your system

  1. Clone the repo
  2. Start 2 terminal sessions at the root of this repo

Run the following in the first terminal:

Make sure that docker volumes are available
You can use the provided .deployment/nomad/agent.hcl as a reference
Remember to set the NOMAD_ADDR environment variable to the address of your nomad cluster

nomad agent -dev -bind 0.0.0.0 -log-level INFO -config .deployment/nomad/agent.hcl

This will bring up a nomad environment with docker volumes enabled. See nomad docs for more info.

Run the following in the second terminal:

nomad namespace apply nomad-ops

This makes sure that the namespace nomad-ops exists.

Deploy Nomad-Ops to nomad by running:

nomad job run .deployment/nomad/docker.hcl

Access the Admin UI

Go to http://localhost:8080/_/. This will bring you to the login screen of pocketbase. Login using admin@nomad-ops.org and simple-nomad-ops.

You only need to access this UI to create additional users. The main UI is available at http://localhost:8080/

Access the Nomad-Ops UI

You can access the UI of Nomad-Ops at http://localhost:8080/ and use your newly created credentials to login.

By default the following user is created:

  • email: user@nomad-ops.org
  • password: simple-nomad-ops

You can change the default user by setting the environment variables DEFAULT_USER_EMAIL and DEFAULT_USER_PASSWORD.

The Admin User admin@nomad-ops.org is only capable to access the pocketbase ui at http://{your-nomad-ops-host}/_/. To access the Nomad-Ops UI you need to use a normal user.

Workload Identity

nomad acl policy apply \
   -namespace nomad-ops -job nomad-ops -group nomad-ops-group -task operator \
   nomad-ops-policy .deployment/nomad/acl.hcl

Requires nomad >= v1.5.x to use Workload Identity
Before that you need to supply a NOMAD_TOKEN yourself

Thanks

Thanks to https://github.com/pocketbase/pocketbase for providing a solid base : ) !

Publishing docs

  1. docker run --rm -it -p 8000:8000 -v ${PWD}:/docs -v ~/.ssh:/root/.ssh --entrypoint /bin/sh --platform linux/amd64 squidfunk/mkdocs-material
  2. apk add -U git openssh
  3. git config --global url."git@github.com:".insteadOf "https://github.com/"
  4. mkdocs gh-deploy

About

A simple operator for nomad which reconciles the running jobs in comparison to git repos. Essentially bringing gitops to nomad

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • TypeScript 50.7%
  • Go 46.9%
  • Other 2.4%