From ae948489e3e7d0bc2c04696ae7d500d83f2143e3 Mon Sep 17 00:00:00 2001 From: "Dustin C. Hatch" Date: Sun, 18 Feb 2024 10:40:21 -0600 Subject: [PATCH] Deploy Promtail to all non-Kubernetes nodes All the stand-alone FCOS hosts now have Promtail running, forwarding _systemd_ journal messages to Grafana Loki. The Kubernetes nodes will have Promtail deployed as a Kubernetes pod. I would really like to come up with a way to define variables for groups of hosts, so that I do not have to add `promtail: prod.#promtail` to every host's values file individually... --- host/nut0.pyrocufflink.blue.cue | 13 +++++++------ host/nvr1.pyrocufflink.blue.cue | 9 +++++---- host/serial1.pyrocufflink.blue.cue | 2 ++ instructions/nut0.pyrocufflink.blue.cue | 4 +++- instructions/nvr1.pyrocufflink.blue.cue | 4 +++- instructions/serial1.pyrocufflink.blue.cue | 4 +++- 6 files changed, 23 insertions(+), 13 deletions(-) diff --git a/host/nut0.pyrocufflink.blue.cue b/host/nut0.pyrocufflink.blue.cue index 6af1c05..434b0e1 100644 --- a/host/nut0.pyrocufflink.blue.cue +++ b/host/nut0.pyrocufflink.blue.cue @@ -4,15 +4,16 @@ import ( "du5t1n.me/cfg/env/prod" ) +ssh: prod.ssh +sudo: prod.sudo + +promtail: prod.#promtail + +collectd: prod.collectd + nut: prod.nut nut: monitor: prod.#nut_monitor & { #server: "localhost" #username: "upsmon" } - -collectd: prod.collectd - -ssh: prod.ssh - -sudo: prod.sudo diff --git a/host/nvr1.pyrocufflink.blue.cue b/host/nvr1.pyrocufflink.blue.cue index c3a68b8..284310b 100644 --- a/host/nvr1.pyrocufflink.blue.cue +++ b/host/nvr1.pyrocufflink.blue.cue @@ -5,12 +5,13 @@ import ( "du5t1n.me/cfg/app/nut/schema" ) +ssh: prod.ssh +sudo: prod.sudo + +promtail: prod.#promtail + nut: monitor: schema.#NutMonitor nut: monitor: prod.#nut_monitor & { #username: "nvr1" } - -ssh: prod.ssh - -sudo: prod.sudo diff --git a/host/serial1.pyrocufflink.blue.cue b/host/serial1.pyrocufflink.blue.cue index 7c3864b..9801955 100644 --- a/host/serial1.pyrocufflink.blue.cue +++ b/host/serial1.pyrocufflink.blue.cue @@ -6,3 +6,5 @@ import ( ssh: prod.ssh sudo: prod.sudo + +promtail: prod.#promtail diff --git a/instructions/nut0.pyrocufflink.blue.cue b/instructions/nut0.pyrocufflink.blue.cue index cedb29c..88d43e8 100644 --- a/instructions/nut0.pyrocufflink.blue.cue +++ b/instructions/nut0.pyrocufflink.blue.cue @@ -5,13 +5,15 @@ import ( "du5t1n.me/cfg/app/collectd" "du5t1n.me/cfg/app/nut" + "du5t1n.me/cfg/app/promtail" "du5t1n.me/cfg/env/prod" ) render: list.Concat([ + prod.templates, collectd.templates, + promtail.templates, nut.templates, nut.monitor.templates, nut.collectd.templates, - prod.templates, ]) diff --git a/instructions/nvr1.pyrocufflink.blue.cue b/instructions/nvr1.pyrocufflink.blue.cue index d220b9c..05d6782 100644 --- a/instructions/nvr1.pyrocufflink.blue.cue +++ b/instructions/nvr1.pyrocufflink.blue.cue @@ -4,11 +4,13 @@ import ( "list" "du5t1n.me/cfg/app/nut" + "du5t1n.me/cfg/app/promtail" "du5t1n.me/cfg/env/prod" ) render: list.Concat([ + prod.templates, + promtail.templates, nut.sysusers.templates, nut.monitor.templates, - prod.templates, ]) diff --git a/instructions/serial1.pyrocufflink.blue.cue b/instructions/serial1.pyrocufflink.blue.cue index 98c008c..5bbad0b 100644 --- a/instructions/serial1.pyrocufflink.blue.cue +++ b/instructions/serial1.pyrocufflink.blue.cue @@ -4,10 +4,12 @@ import ( "list" "du5t1n.me/cfg/app/collectd" + "du5t1n.me/cfg/app/promtail" "du5t1n.me/cfg/env/prod" ) render: list.Concat([ - collectd.templates, prod.templates, + collectd.templates, + promtail.templates, ])