https://github.com/nomad-ops/nomad-ops
A simple operator for nomad which reconciles the running jobs in comparison to git repos
https://github.com/nomad-ops/nomad-ops
git-ops go golang nomad pocketbase react reactjs typescript
Last synced: 13 days ago
JSON representation
A simple operator for nomad which reconciles the running jobs in comparison to git repos
- Host: GitHub
- URL: https://github.com/nomad-ops/nomad-ops
- Owner: nomad-ops
- License: mit
- Created: 2023-03-17T09:50:44.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-09-18T08:30:32.000Z (over 1 year ago)
- Last Synced: 2024-04-26T08:33:27.867Z (12 months ago)
- Topics: git-ops, go, golang, nomad, pocketbase, react, reactjs, typescript
- Language: TypeScript
- Homepage: http://nomad-ops.org/
- Size: 34.1 MB
- Stars: 53
- Watchers: 5
- Forks: 1
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-pocketbase - GitHub
- awesome-pocketbase - GitHub
- awesome-nomad - nomad-ops/nomad-ops - A simple way to deploy workloads via GitOps. Similar to ArgoCD with a UI. (CI / CD)
README
# 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/](https://nomad-ops.github.io/nomad-ops/) for more information## Getting started with docker
> You need [nomad](https://developer.hashicorp.com/nomad/docs/install) and docker installed on your system
1. Clone the repo
2. Start 2 terminal sessions at the root of this repoRun 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](https://developer.hashicorp.com/nomad/docs/operations/nomad-agent) 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/_/](http://localhost:8080/_/).
This will bring you to the login screen of [pocketbase](https://pocketbase.io).
Login using `[email protected]` and `simple-nomad-ops`.> You only need to access this UI to create additional users. The main UI is available at [http://localhost:8080/](http://localhost:8080/)
### Access the Nomad-Ops UI
You can access the UI of Nomad-Ops at [http://localhost:8080/](http://localhost:8080/) and use your newly created credentials to login.
By default the following user is created:
- email: `[email protected]`
- 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 `[email protected]` 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](https://developer.hashicorp.com/nomad/docs/concepts/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."[email protected]:".insteadOf "https://github.com/"`
4. `mkdocs gh-deploy`