Sign inSign up

multipathmaster/nomadrcm

By multipathmaster

Updated about 9 years ago

Send Nomad job alerts to Rocket.Chat: 10MB

Image
0

309

multipathmaster/nomadrcm repository overview

https://github.com/multipathmaster/nomadrcm

#QUICK OVERVIEW: DEPLOYMENT RECENTLY RAN AGAINST CONSUL 1.0.0 and NOMAD 0.7.0 - WORKS - YES the deployment assumes you already have hashi-ui running or some other fork/clone. docker-entrypoint.sh is the entrypoint. It calls upon dead_man_switch.sh. dead_man_switch.sh starts the nmd_evnt_mntr.sh instances, as well a providing other options. nmd_evnt_mntr.sh is a collection of event monitors that call upon rocketc_alert.sh once a condition is met. rocketc_alert.sh is the alerting mechanism.

STEPS FOR SOLO DEPLOYMENT:

  1. docker run -it -e NOMAD_JOB_IPHN='http://NOMAD_SERVER_IP:4646/v1/jobs' -e NOMAD_SRV_JOB_PATH='http://NOMAD_SERVER_IP:3000/nomad/REGION/jobs' -e RC_SRV_PRT='http://Rocket.Chat.SERVER:3000' -e RC_AUTH='username=BOTNAME&password=BOTPASSWD' multipathmaster/nomadrcm
  2. docker ps #FIND CONTAINER
  3. docker exec -it "CONTAINER" bash

STEPS FOR DEPLOYING ON THE HASHICORP STACK: (CONSUL/NOMAD):

  1. docker pull latest image and store it or use the raw download link. i use a local repo w/ a simple registry container on port 5000. i.e. you can use artifactory or something similar instead.
  2. copy the below config into nomadrcm.nomad (or whatever_name_you_wish.nomad/json/etc...)
job "nomadrcm" {
  region = "YOUR_REGION"
  datacenters = ["YOUR_DC"]
  type = "service"
   constraint {
     attribute = "${attr.kernel.name}"
     value     = "linux"
   }
  update {
    stagger = "15s"
    max_parallel = 1
  }
  group "nomadrcm" {
    count = 1
    constraint {
      operator = "distinct_hosts"
      value    = "true"
    }
    restart {
      attempts = 10
      interval = "5m"
      delay = "25s"
      mode = "delay"
    }
    ephemeral_disk {
      size = 128
    }
    task "nomadrcm" {
      driver = "docker"
      config {
        image = "multipathmaster/nomadrcm:latest"
        network_mode = "host"
        port_map = {
        }
        #volumes = [ "" ]
      }
      env {
        NOMAD_JOB_IPHN="http://NOMAD_SERVER_IP:4646/v1/jobs"
        NOMAD_SRV_JOB_PATH="http://NOMAD_SERVER_IP:3000/nomad/REGION/jobs"
        RC_SRV_PRT="http://Rocket.Chat.SERVER:3000"
        RC_AUTH="username=BOTNAME&password=BOTPASSWD"
      }
      resources {
        cpu    = 32
        memory = 64
        network {
          mbits = 10
        }
      }
      service {
        name = "nomadrcm"
        tags = ["nomadrcm"]
        #port = "nomadrcm"
        #check {
        #  name     = "alive"
        #  type     = "tcp"
        #  interval = "15s"
        #  timeout  = "3s"
        #}
      }
    }
  }
}
  1. nomad plan nomadrcm.nomad
  2. make any adjustments to the plan as you see fit(i.e. task/group/resources/service changes).
  3. nomad run nomadrcm.nomad

Tag summary

Content type

Image

Digest

Size

4.2 MB

Last updated

about 9 years ago

docker pull multipathmaster/nomadrcm