Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ansible/roles/nomad/templates/25-base.hcl.j2
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
data_dir = "/var/lib/nomad"
plugin_dir = "/usr/libexec/nomad"

advertise {
http = "{{void_mesh[inventory_hostname]}}"
Expand Down
6 changes: 6 additions & 0 deletions ansible/roles/nomad_client/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
---
- name: Install plugins
community.general.xbps:
pkg: nomad-driver-exec2
state: present
tags: [install_nomad]

- name: Install Configuration
ansible.builtin.template:
src: 40-client.hcl
Expand Down
6 changes: 6 additions & 0 deletions ansible/roles/nomad_client/templates/40-client.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,9 @@ plugin "docker" {
allow_caps = {{ ( nomad_default_caps + ( nomad_extra_caps | default([]) ) ) | to_json }}
}
}

plugin "nomad-driver-exec2" {
config {
unveil_by_task = true
}
}
34 changes: 34 additions & 0 deletions services/nomad/monitoring/node_exporter.nomad
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
job "node_exporter" {
datacenters = [
"VOID",
"VOID-MX",
"VOID-MIRROR",
"VOID-CONTROL",
]
namespace = "monitoring"
type = "system"
priority = 99

group "app" {
network {
mode = "bridge"
port "metrics" { to = 9100 }
}

task "vector" {
driver = "exec2"

config {
command = "node_exporter"
args = ["--collector.runit", "--collector.runit.servicedir", "/var/service"]
}

service {
provider = "nomad"
name = "node_exporter"
port = "metrics"
tags = ["prometheus_enable"]
}
}
}
}
8 changes: 0 additions & 8 deletions services/nomad/monitoring/prometheus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,6 @@ scrape_configs:
static_configs:
- targets:
- localhost:9090
- job_name: node
consul_sd_configs:
- server: '{{ env "NOMAD_HOST_IP_http" }}:8500'
datacenter: void
services: ['node-exporter']
relabel_configs:
- source_labels: ['__meta_consul_node']
target_label: instance
# {{ range nomadService 1 $allocID "ssl-exporter?ns=monitoring" }}
- job_name: 'ssl'
metrics_path: /probe
Expand Down
Loading