All Projects → underarmour → libra

underarmour / libra

Licence: other
A Nomad auto scaler

Programming Languages

go
31211 projects - #10 most used programming language
Dockerfile
14818 projects

Projects that are alternatives of or similar to libra

nomad-droplets-autoscaler
DigitalOcean Droplets target plugin for HashiCorp Nomad Autoscaler
Stars: ✭ 42 (-41.67%)
Mutual labels:  hashicorp, nomad, autoscaling, hashicorp-nomad
rundeck-nomad-plugin
Rundeck plugin running jobs on Nomad cluster.
Stars: ✭ 17 (-76.39%)
Mutual labels:  hashicorp, nomad, hashicorp-nomad
Replicator
Automated Cluster and Job Scaling For HashiCorp Nomad
Stars: ✭ 166 (+130.56%)
Mutual labels:  hashicorp, nomad, autoscaling
Sherpa
Sherpa is a highly available, fast, and flexible horizontal job scaling for HashiCorp Nomad. It is capable of running in a number of different modes to suit different requirements, and can scale based on Nomad resource metrics or external sources.
Stars: ✭ 165 (+129.17%)
Mutual labels:  hashicorp, nomad, autoscaling
vim-hcl
Syntax highlighting for HashiCorp Configuration Language (HCL)
Stars: ✭ 83 (+15.28%)
Mutual labels:  hashicorp, nomad
Nomadfiles
A collection of Nomad job files for deploying applications to a cluster
Stars: ✭ 89 (+23.61%)
Mutual labels:  hashicorp, nomad
nomad-consult-ansible-centos
Deploy nomad & consult on centos with ansible
Stars: ✭ 17 (-76.39%)
Mutual labels:  hashicorp, nomad
Levant
An open source templating and deployment tool for HashiCorp Nomad jobs
Stars: ✭ 510 (+608.33%)
Mutual labels:  hashicorp, nomad
damon
A terminal UI (TUI) for HashiCorp Nomad
Stars: ✭ 274 (+280.56%)
Mutual labels:  hashicorp, nomad
nomad-toast
A tool for receiving notifications based on HashiCorp Nomad events.
Stars: ✭ 40 (-44.44%)
Mutual labels:  hashicorp, nomad
Nomad Helper
Useful tools for working with @hashicorp Nomad at scale
Stars: ✭ 96 (+33.33%)
Mutual labels:  hashicorp, nomad
Nomad Firehose
Firehose all nomad job, allocation, nodes and evaluations changes to rabbitmq, kinesis or stdout
Stars: ✭ 96 (+33.33%)
Mutual labels:  hashicorp, nomad
hashidays-london
Code used for the demo of Going Multi-Cloud with Terraform and Nomad
Stars: ✭ 20 (-72.22%)
Mutual labels:  hashicorp, nomad
nomad
Dockerized Nomad
Stars: ✭ 33 (-54.17%)
Mutual labels:  hashicorp, nomad
Trek
Trek is a CLI/ncurses explorer for HashiCorp Nomad clusters.
Stars: ✭ 26 (-63.89%)
Mutual labels:  hashicorp, nomad
Ansible Nomad
⌚️ Ansible role for Nomad
Stars: ✭ 157 (+118.06%)
Mutual labels:  hashicorp, nomad
Python Nomad
Client library Hashicorp Nomad
Stars: ✭ 90 (+25%)
Mutual labels:  hashicorp, nomad
local-hashicorp-stack
Local Hashicorp Stack for DevOps Development without Hypervisor or Cloud
Stars: ✭ 23 (-68.06%)
Mutual labels:  hashicorp, nomad
nomad-box
Nomad Box - Simple Terraform-powered setup to Azure of clustered Consul, Nomad and Traefik Load Balancer that runs Docker/GoLang/Java workloads. NOTE: Only suitable in dev environments at the moment until I learn more Terraform, Consul, Nomad, Vault :P
Stars: ✭ 18 (-75%)
Mutual labels:  hashicorp, nomad
Awesome Nomad
A curated list of amazingly awesome Nomad tools and shiny things.
Stars: ✭ 530 (+636.11%)
Mutual labels:  hashicorp, nomad

⚠️ This repository is not under active use or maintenance by Under Armour. ⚠️

If you're still interested in using it, there are a few active forks.

Libra

Libra autoscales Nomad task groups so you don't have to. View the API documentation here.

Design

Libra takes heavy inspiration from the design of Nomad itself and uses a client/server model. Much like Nomad, the Libra CLI makes HTTP API calls to the Libra server.

The skeleton of this project is from jippi/nomad-auto-scale, and could not have been completed without the architecture exemplified there.

How do I add a command?

  1. Add an API endpoint in /api/.
  2. Register the endpoint with the server in /command/server.go
  3. Document the endpoint in /api/README.md
  4. Add a new command in /command/ that calls the API endpoint.
  5. Register the command with the CLI in /commands.go

Todo:

  • Randomly stagger cron jobs to avoid conflict
  • Improve configuration management (perhaps add a submission API)
  • Handle Nomad errors more robustly

Configuration

You can (and probably should) configure five environment variables as well, LIBRA_ADDR, LIBRA_CONFIG, GRAPHITE_PASSWORD, AWS_ACCESS_KEY_ID, and AWS_SECRET_ACCESS_KEY.

Libra gets most of its configuration from HCL config files located in a config directory (default /etc/libra). Here's an example config.hcl file:

// Nomad Client configuration
nomad {
  address = "http://localhost:4646"
}

backend "test-backend" {
  kind     = "cloudwatch"
  region   = "us-east-1"
}

backend "other-backend" {
  kind     = "graphite"
  host     = "https://my-grafana.hosted-metrics.grafana.net"
  username = "api_key"  
}

// Scale for the job "nginx-prod"
// job and group must correspond to a valid Nomad job and group that is running in the Nomad cluster
job "nginx-prod" {
  // For group "nginx"
  group "nginx" {
    // (required) The minimum nuber of tasks to run for this job
    min_count = 1

    // (required) The maximum number of tasks to run for this job
    max_count = 3

    // Scale by a rule
    rule "cloudwatch asg cpu usage upper bound" {
      // (required) What backend to use, this will define which configuration
      // is valid and which checks you can execute
      backend = "test-backend"

      // (required) The CloudWatch dimension name and value
      dimension_name = "AutoScalingGroupName"
      dimension_value = "infra-httpapi-asg"

      // (required) The CloudWatch metric name and namespace
      metric_namespace = "AWS/EC2"
      metric_name = "CPUUtilization"

      // (required) The comparison to check, one of:
      //
      //   - above (>)
      //   - below (<)
      //   - equal (==)
      //   - not_equal (!=)
      //   - above_or_equal (>=)
      //   - below_or_equal (<=)
      comparison = "above_or_equal"

      // (required) The value to compare to, this should be a float
      comparison_value = 90.0

      // (optional) How often this rule should be checked, by default it will be checked every minute
      cron = "* * * * *"

      action       = "increase_count"
      action_value = 1
    }

    rule "cloudwatch asg cpu usage lower bound" {
      backend          = "test-backend"
      dimension_name   = "AutoScalingGroupName"
      dimension_value  = "infra-httpapi-asg"
      metric_namespace = "AWS/EC2"
      metric_name      = "CPUUtilization"
      comparison       = "below"
      comparison_value = 20.0
      cron             = "* * * * *"
      action           = "decrease_count"
      action_value     = 1
    }
    
    rule "graphite nomad statsd cpu lower bound" {
      backend          = "other-backend"
      metric_name      = "stats.*.nomad.*.domain.*.allocs.statsd.statsd.*.*.cpu.total_percent"
      comparison       = "below"
      comparison_value = 20.0
      cron             = "* * * * *"
      action           = "decrease_count"
      action_value     = 1
    }
  }
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].