josephxsxn

HCL - http docker test nomad consul job

Apr 11th, 2018
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.76 KB | None | 0 0
  1. job "http-test" {
  2.   region = "global"
  3.   datacenters = ["troy"]
  4.   type = "service"
  5.  
  6.   group "http-test" {
  7.     count = 1
  8.  
  9.     task "http-daemon" {
  10.       driver = "docker"
  11.       config {
  12.         image = "192.168.96.192:5000/helloworld-http:latest"
  13.         port_map = {
  14.           http = 80
  15.         }
  16.       }
  17.  
  18.       service {
  19.         port = "http"
  20.         check {
  21.           type     = "http"
  22.           path     = "/"
  23.           interval = "10s"
  24.           timeout  = "2s"
  25.         }
  26.       }
  27.  
  28.       env {
  29.         "SOMEVAL" = "EXAMPLE"
  30.       }
  31.  
  32.       resources {
  33.         cpu    = 500 # MHz
  34.         memory = 128 # MB
  35.  
  36.         network {
  37.           mbits = 100
  38.  
  39.           #dynamic port allocation
  40.           port "http" {}
  41.  
  42.         }
  43.       }
  44.     }
  45.   }
  46. }
Advertisement
Add Comment
Please, Sign In to add comment