Giter VIP home page Giter VIP logo

touareg-nomad-ui's Introduction

Touareg

Touareg is a web GUI for HashiCorp Nomad, made using vue.js.

To use it, simply rename index.html.example to index.html and adjust the variables to match your setup :

  • window.nomad_url: should point to the API endpoint of any Nomad node in the cluster
  • window.nomad_node_url: should point to the API endpoint of a specific node: the tag {node} in the URL will be replaced by the hostname. It is used for the live log streaming feature.
  • window.consul_url: should point to the API endpoint of a Consul cluster. It is not required but is used to provide a "reload" feature for allocations/task groups/jobs that Nomad does not provide yet.

Build Setup

# install dependencies
npm install

# serve with hot reload at localhost:8080
npm run dev

# build for production with minification
npm run build

For detailed explanation on how things work, consult the docs for vue-loader.

The "reload" feature

That feature allows to restart an allocation, task group or whole job from Touareg, whithout having to make changes to the job specification. It makes use of a special templated file configured for each task, that fetches some keys from Consul. By changing their value, we can trigger a restart.

The configuration to use in the tasks is as follows :

template {
    destination = "local/reload_token"
    data = <<EOT
           {{ keyOrDefault (print "nomad_reload/allocation/" (env "NOMAD_ALLOC_NAME")) "" }}
           {{ keyOrDefault (print "nomad_reload/job/" (env "NOMAD_JOB_NAME")) "" }}
           {{ keyOrDefault (print "nomad_reload/job/" (env "NOMAD_JOB_NAME") "/" (env "NOMAD_TASK_NAME")) "" }}
           {{ keyOrDefault (print "nomad_reload/job/" (env "NOMAD_JOB_NAME") "/" (env "NOMAD_TASK_NAME") "/" (env "NOMAD_ALLOC_INDEX")) "" }}
    EOT
}

touareg-nomad-ui's People

Contributors

setaou avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.