Advertisement
fedorm

Untitled

Jul 11th, 2019
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 2.77 KB | None | 0 0
  1. job "segment-processing-test" {
  2.  
  3.   datacenters = ["dc1"]
  4.  
  5.   type = "service"
  6.  
  7.   update {
  8.     max_parallel = 1
  9.     min_healthy_time = "30s"
  10.     healthy_deadline = "5m"
  11.     auto_revert      = true
  12.   }
  13.  
  14.   group "segment-service" {
  15.     count = 1
  16.  
  17.     task "segment-service" {
  18.       driver = "docker"
  19.      
  20.       config {
  21.         image = "artifactory.setmachine.ru:5001/dbapi/dbapi-service:1.0.0"
  22.    
  23.         auth {
  24.           username = "docker-segment-ro"
  25.           password = "Gf$6f7W*4K32"
  26.         }
  27.  
  28.         args = [
  29.           "java",
  30.           "-Dspring.profiles.active=production,cloud",
  31.           "-jar",
  32.           "/app/dbapi-service.jar"
  33.         ]
  34.  
  35.         port_map = {
  36.           http = 8080,
  37.           debug = 8787
  38.         }
  39.  
  40.         force_pull = true
  41.  
  42.         dns_servers = ["${NOMAD_IP_http}"]
  43.       }
  44.  
  45.       env {
  46.         "spring.application.name" = "segment-service-test"
  47.         "spring.cloud.consul.host" = "${NOMAD_IP_http}"
  48.         "spring.cloud.consul.port" = "8500"
  49.         "spring.cloud.consul.config.format" = "properties"
  50.       }
  51.  
  52.       resources {
  53.         cpu = 1000
  54.         memory = 1000
  55.         network {
  56.           port "http" {
  57.             static = "8080"
  58.           }
  59.           port "tcp" {}
  60.         }
  61.       }
  62.     }
  63.  
  64.     task "log" {
  65.       driver = "docker"
  66.       template {
  67.         data = "{{ key \"config/filebeat\" }}"
  68.         destination = "local/filebeat.yml"
  69.         change_mode = "restart"
  70.       }
  71.       config {
  72.         image = "artifactory.setmachine.ru:5000/filebeat:6.6.1"
  73.         auth {
  74.           username = "developer"
  75.           password = "tc324012"
  76.         }
  77.         args = ["filebeat", "-e", "-c", "/local/filebeat.yml"]
  78.         dns_servers = ["${NOMAD_IP_http}"]
  79.       }
  80.       resources {
  81.         cpu = 200
  82.         memory = 200
  83.       }
  84.     }    
  85.   }
  86.  
  87.  
  88.   group "segments-proxy" {
  89.     count = 1
  90.  
  91.     task "segments-proxy" {
  92.       driver = "docker"
  93.  
  94.       config {
  95.         image = "artifactory.setmachine.ru:5001/segmentation-processing/proxy:1.0.0"
  96.         auth {
  97.           username = "docker-segment-ro"
  98.           password = "Gf$6f7W*4K32"
  99.         }
  100.         port_map = {
  101.           http = 8090
  102.           http_nonsecure = 9999
  103.           stats = 3333
  104.         }
  105.       }
  106.  
  107.       template {
  108.         data = <<EOH
  109.          {{range service "dbapi-service-test"}}server {{.Node}}-{{.Port}} {{.Address}}:{{.Port}},{{end}}
  110.        EOH
  111.        destination = "local/dbapi-endpoints"
  112.      }
  113.  
  114.      service {
  115.        name = "segments-proxy"
  116.        port = "http"
  117.        address_mode = "host"
  118.  
  119.        check {
  120.          name = "alive"
  121.          type = "tcp"
  122.          interval = "10s"
  123.          timeout = "2s"
  124.        }
  125.      }
  126.  
  127.      resources {
  128.        cpu = 1000
  129.        memory = 100
  130.        network {
  131.          port "http" {
  132.          }
  133.          port "http_nonsecure" {
  134.          }
  135.          port "stats" {
  136.          }
  137.        }
  138.      }
  139.    }
  140.  }
  141. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement