Skip to content

LOQ9/nomad-gitops-operator

 
 

Repository files navigation

Nomoporator

Nomoporator is a GitOps operator for Hashicorp Nomad.

How to use

Setting up Nomoporator

Environment variables

It's also possible configure Nomoporator via environment variables by setting them like this:

NOMAD_ADDR - Required to overide the default of http://127.0.0.1:4646.
NOMAD_TOKEN - Required with ACLs enabled.
NOMAD_CACERT - Required with TLS enabled.
NOMAD_CLIENT_CERT - Required with TLS enabled.
NOMAD_CLIENT_KEY - Required with TLS enabled.

Bootstrapping using a git repository

Get help with ./nomoporator bootstrap git -h

Bootstrap Nomad using a git repository

Usage:
  nomad-gitops-operator bootstrap git [git repo] [flags]

Flags:
      --branch string   git branch (default "main")
  -h, --help            help for git
      --path string     path relative to the repository root (default "/")
      --url string      git repository URL

Global Flags:
  -a, --address string   Address of the Nomad server

Use it like this:

./nomad-gitops-operator bootstrap git --url https://github.com/jonasvinther/nomad-state.git --path /jobs --branch main

Run as Nomad job

job "nomad-gitops-operator" {
  datacenters = ["dc1"]
  group "nomad-gitops-operator" {
    count = 1
    task "nomad-gitops-operator" {
      driver = "exec"
      config {
        command = "nomad-gitops-operator"
        args    = ["bootstrap", "git", "--url", "https://github.com/jonasvinther/nomad-state.git", "--branch", "main", "--path", "/prod-env"]
      }
      artifact {
        source      = "https://github.com/jonasvinther/nomad-gitops-operator/releases/download/v0.0.1/nomad-gitops-operator_0.0.1_linux_amd64.tar.gz"
        destination = "local"
        mode        = "any"
      }
    }
  }
}

About

A GitOps operator for Hashicorp Nomad

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 75.1%
  • HCL 19.5%
  • Makefile 5.2%
  • Shell 0.2%