Skip to main content

Deploying on Nomad

Deploying Pulse Agent on a Nomad cluster is simple. Here is a sample job spec that will deploy just the Pulse Agent, however it would also be possible to place the task into the same job as your existing cluster job.

job "pulse_agent" {
datacenters = ["dc1"]
type = "service"
priority = 50

update {
canary = 1
auto_promote = true
}

group "main" {
network {
port "agent_healthz" {
to = 8080
}
}

task "agent" {
driver = "docker"
config {
image = "r.bigdataboutique.com/pulse-agent"
ports = ["agent_healthz"]

volumes = [
"secrets/config.yml:/etc/pulse-agent/pulse-agent-config.yml",
]
}

template {
destination = "secrets/config.yml"
data = <<-EOF
environmnet: default
pulseToken: PULSE_TOKEN

clusters:
- type: kafka
bootstrap.servers: PLAINTEXT://hostname:9092
- type: elasticsearch
hosts: http://hostname:9200
username: pulse-monitoring-collector
password: pwd
EOF
}

resources {
cpu = 100
memory = 16384
}

service {
name = "pulse-agent"
port = "agent_healthz"
provider = "nomad"

check {
type = "http"
path = "/healthz"
interval = "30s"
timeout = "2s"
}
}
}
}
}

Assuming you use this job spec and save it as pulse_agent.nomad, then upload the job spec to your Nomad cluster:

nomad job run pulse_agent.nomad