cfg/host
Dustin 45c35c065a promtail: Deploy Loki Promtail Agent
[Promtail][0] is the log collection agent for Grafana Loki.  It reads
logs from various locations, including local files and the _systemd_
journal and sends them to Loki via HTTP.

Loki configuration is a highly-structured YAML document.  Thus, instead
of using Tera template syntax for loops, conditionals, etc., we can use
the full power of CUE to construct the configuration.  Using the
`Marshal` function from the built-in `encoding/yaml` package, we
serialize the final configuration structure as a string and write it
verbatim to the configuration file.

I have modeled most of the Promtail configuration schema in the
`du5t1n.me/cfg/app/promtail/schema` package.  Having the schema modeled
will ensure the generated configuration is valid during development
(i.e. `cue export` will fail if it is not), which will save time pushing
changes to machines and having Loki complain.

The `#promtail` "function" in `du5t1n.me/cfg/env/prod` makes it easy to
build our desired configuration.  It accepts an optional `#scrape`
field, which can be used to provide specific log scraping definitions.
If it is unspecified, the default configuration is to scrape the systemd
journal.  Hosts with additional needs can supply their own list,
probably including the `promtail.scrape.journal` object in it to get the
default journal scrape job.

[0]: https://grafana.com/docs/loki/latest/send-data/promtail/
2024-02-18 11:35:13 -06:00
..
k8s-aarch64-n0.pyrocufflink.blue.cue host: Add k8s-aarch64-n{0,1} 2024-02-03 11:16:52 -06:00
k8s-aarch64-n1.pyrocufflink.blue.cue host: Add k8s-aarch64-n{0,1} 2024-02-03 11:16:52 -06:00
k8s-amd64-n3.pyrocufflink.blue.cue app/ssh: Configure sshd trusted user CA keys 2024-02-03 11:16:52 -06:00
k8s-amd64-n3.pyrocufflink.blue.post.sh host: Add k8s-amd64-n3 2024-02-03 11:12:55 -06:00
k8s-amd64-n3.pyrocufflink.blue.pre.sh host: Add k8s-amd64-n3 2024-02-03 11:12:55 -06:00
loki0.pyrocufflink.blue.cue promtail: Deploy Loki Promtail Agent 2024-02-18 11:35:13 -06:00
loki0.pyrocufflink.blue.post.sh loki: Use fetchcert to manage server certificate 2024-02-18 11:35:13 -06:00
loki0.pyrocufflink.blue.pre.sh host: Add loki0.p.b 2024-02-13 16:55:05 -06:00
nut0.pyrocufflink.blue.cue app/ssh: Configure sshd trusted user CA keys 2024-02-03 11:16:52 -06:00
nut0.pyrocufflink.blue.post.sh sudo: Configure pam_ssh_agent_auth 2024-01-29 09:10:42 -06:00
nut0.pyrocufflink.blue.pre.sh sudo: Configure pam_ssh_agent_auth 2024-01-29 09:10:42 -06:00
nvr1.pyrocufflink.blue.cue app/ssh: Configure sshd trusted user CA keys 2024-02-03 11:16:52 -06:00
nvr1.pyrocufflink.blue.post.sh sudo: Configure pam_ssh_agent_auth 2024-01-29 09:10:42 -06:00
nvr1.pyrocufflink.blue.pre.sh sudo: Configure pam_ssh_agent_auth 2024-01-29 09:10:42 -06:00
serial1.pyrocufflink.blue.cue app/ssh: Configure sshd trusted user CA keys 2024-02-03 11:16:52 -06:00
serial1.pyrocufflink.blue.post.sh sudo: Configure pam_ssh_agent_auth 2024-01-29 09:10:42 -06:00
serial1.pyrocufflink.blue.pre.sh sudo: Configure pam_ssh_agent_auth 2024-01-29 09:10:42 -06:00