Commit Graph
83 Commits
Author SHA1 Message Date
klaatu 53ef9af83a feat: mount restic-credentials secret into Prometheus 2026-03-27 13:07:31 +00:00
root 2d874d3969 fix: two observability bugs from initial deployment
buildbot/nix-eval Build done. (1 warning)
buildbot/nix-build Build done.
Fix 1 - UnPoller 404 on UDM Pro:
  Remove :8443 from UP_UNIFI_DEFAULT_URL. UniFi OS devices (UDM Pro,
  UDM, UXG, CloudKey) use a different API path and do NOT use port 8443.
  URL should be https://10.42.1.1 (no port); unpoller handles the
  /proxy/network path internally for UniFi OS devices.

Fix 2 - Grafana dashboards showing invalid datasource:
  Add uid = "prometheus" to the provisioned Prometheus datasource.
  Without an explicit UID, Grafana auto-generates one on first run.
  All dashboard JSON references datasource uid "prometheus" which
  only works if the provisioning explicitly sets that UID.
2026-03-25 12:37:29 -05:00
root df2f9d69fe fix: address PR feedback + expand infrastructure coverage
buildbot/nix-eval Build done. (1 warning)
- Replace unpoller-credentials plain Secret with ExternalSecret
  pulling from Bitwarden item 15bfc957-5de5-49b2-ab6c-b41800e71564
  via bitwarden-login ClusterSecretStore (username + password)
- Pull UP_UNIFI_DEFAULT_USER from secret as well (was hardcoded)

- Add OpenWRT access point (10.42.0.3) to genesis DNS hosts file
  as ap.thehellings.lan (discovered during network scan)

- Add blackbox exporter to genesis (port 9115, ICMP module)
  for probing non-NixOS infrastructure that has no node_exporter:
  OpenWRT AP, Joel, pve1, chronicles, nas1, odoo, mattermost,
  homeassistant, USW-Pro-HD-24 UniFi switch

- Add infra_ping scrape job to Prometheus using blackbox prober
  targeting all non-NixOS LAN hosts via genesis blackbox exporter
2026-03-25 09:25:16 -05:00
root ab6e1d24fe feat: comprehensive observability stack
- Add restic_backups and mattermost scrape jobs to Prometheus config
- Add UnPoller deployment+service+secret for UniFi metrics (unpoller.yaml)
- Add unifi scrape job targeting unpoller in-cluster
- Add 4 Grafana dashboards as NixOS-managed etc files on hosea:
  - system-health: CPU, memory, disk, network per host
  - backup-health: restic backup freshness and duration
  - kubernetes: pod counts, restart rates, node resources
  - network: DNS queries, DHCP leases, UniFi ports, ping latency
- Add grafana-api-token agenix secret placeholder on hosea
- Open firewall ports 9100/9427/9558 for prometheus exporters in baseline.nix
2026-03-25 09:23:31 -05:00
greg 0050f866bf Merge pull request 'fix: security and monitoring improvements (issues 1-3)' (#1) from klaatu/nixos:fix/security-and-monitoring into main
buildbot/nix-eval Build done. (1 warning)
buildbot/nix-build Build done.
buildbot/nix-effects Build done.
Reviewed-on: https://src.thehellings.com/greg/nixos/pulls/1
2026-03-25 12:09:28 +00:00
Greg Hellings d5796c19b4 feat: Enable shared registration secret for Dendrite 2026-03-25 06:28:27 -05:00
Greg Hellings 568ff119d9 feat: add backup retention limits for Postgres 2026-03-25 06:28:27 -05:00
Greg Hellings b687b9d229 fix: enable immich database backups 2026-03-25 06:28:27 -05:00
Greg Hellings d0380f15be fix: prevent scheduling on Zeke hard drives 2026-03-25 06:28:27 -05:00
root 7fee882488 fix: security and monitoring improvements
buildbot/nix-eval Build done.
Issue 1 - Grafana secret key:
- Replace hardcoded '123456789' secret_key in hosea Grafana config
  with an agenix-managed secret ($__file interpolation)
- Add age.secrets.grafana-secret-key declaration to hosea config
- Register grafana-secret-key.age in secrets/secrets.nix (publicKeys=everyone)
- NOTE: The .age file still needs to be created by running:
    agenix -e secrets/grafana-secret-key.age
  and entering a strong random secret (e.g. from 'pwgen -s 64 1')

Issue 2 - Prometheus stale targets:
- Remove retired vm-gitlab host from all three scrape jobs
  (node, systemd, ping) in manifests/monitoring/config.yaml
- linode was already present in all scrape jobs

Issue 3 - Prometheus alerting gaps:
- Wire up rule_files in prometheus.yml pointing at alerts.yml
- Add manifests/monitoring/alerts.yaml with alerting rules:
    * HostDown (node unreachable > 2m) - critical
    * HighCPULoad (>90% for 10m) - warning
    * LowDiskSpace (<10% free) - warning
    * CriticalDiskSpace (<5% free) - critical
    * HighMemoryUsage (>90% for 10m) - warning
    * ResticBackupStaleness (no success > 26h) - warning
    * PodCrashLooping - warning
    * PodNotReady (>10m) - warning
- Mount alerts ConfigMap as separate volume subPath in deployment
  so prometheus.yml and alerts.yml are both accessible at
  /etc/prometheus/ without conflicts
2026-03-25 06:02:17 -05:00
Greg Hellings 993912f2e3 chore: update longhorn version 2026-03-09 17:33:36 -05:00
Greg Hellings e2e39a98eb chore: update gitea version
buildbot/nix-eval Build done. (2 warnings)
buildbot/nix-build gitea:greg/nixos#checks.x86_64-linux.nixos-linode Build done.
buildbot/nix-build gitea:greg/nixos#checks.x86_64-linux.nixos-zeke Build done.
buildbot/nix-build gitea:greg/nixos#checks.x86_64-linux.pkg-zim Build done.
buildbot/nix-build Build done.
2026-03-05 20:12:02 -06:00
Greg Hellings 26c33dd7c0 Setup helm chart dependencies to improve the running next time
buildbot/nix-eval Build started.
2026-02-23 15:13:55 -06:00
Greg Hellings a5bb763c86 Use new registry URL 2026-02-02 10:41:23 -06:00
Greg Hellings fba2c7a002 Simplify Postgres running
buildbot/nix-eval Build started.
2026-01-15 22:40:57 -06:00
Greg Hellings fa696305cc Disable registration on gitea
buildbot/nix-eval Build done. (2 warnings)
buildbot/nix-build Build done.
buildbot/nix-effects Build done.
2026-01-08 10:46:05 -06:00
Greg Hellings f5a1b900fb Increase disk space for Postgres instances 2026-01-08 10:43:02 -06:00
Greg Hellings 6373bea915 Allow push-to-create 2025-12-29 01:19:58 -06:00
Greg Hellings e0f18a4d47 Expand Longhorn volume sizes 2025-12-29 00:42:14 -06:00
Greg Hellings 6eb270233b Update Longhorn auto-balancing 2025-12-29 00:41:55 -06:00
Greg Hellings 8e602da466 Expose new node drive to longhorn 2025-12-28 23:40:19 -06:00
Greg Hellings 1ddd5faece Give Gitea its own database 2025-12-28 22:08:56 -06:00
Greg Hellings 264504050c Avoid creating gitlab-runner stuff 2025-12-22 12:22:45 -06:00
Greg Hellings 993bf004aa Upgrade immich to 2.4.1 2025-12-22 12:19:27 -06:00
Greg Hellings afbc6e4fef Increase disk size for Immich and Prometheus 2025-12-15 20:28:19 -06:00
Greg Hellings a80f3bcc7f Set domains for gitea 2025-12-04 16:23:06 -06:00
Greg Hellings 2d58a31816 Do not overwrite host SSH 2025-12-04 09:19:44 -06:00
Greg Hellings 4f9a2732bc Add Gitea to my infra 2025-12-04 00:45:46 -06:00
Greg Hellings 4acccbe392 Remove aborted kanboard, add donetick 2025-11-27 19:45:39 -06:00
Greg Hellings 4620265ead Add Uptime Kuma to Kubernetes 2025-11-27 01:20:09 -06:00
Greg Hellings 0a887d8cad Enable MariaDB 2025-11-26 22:55:17 -06:00
Greg Hellings 5dc90c13d5 Add Smokeping to monitoring 2025-11-26 20:44:43 -06:00
Greg Hellings be3f188432 Use home-built immich container
Using the immich conatiner for locally cached immich-go binaries, rather
than pulling the binary every time we run.
2025-11-25 23:52:47 -06:00
Greg Hellings 5133b8dd21 Update Immich to 2.3.1 2025-11-25 23:33:56 -06:00
Greg Hellings d633f73e56 Update gitlab-runner chart 2025-11-25 23:32:39 -06:00
Greg Hellings e027afc63f Step up to 3 Postgres instances 2025-11-25 23:32:20 -06:00
Greg Hellings 893db983e0 Fix broken auto-deployments 2025-11-23 14:43:36 -06:00
Greg Hellings bfd8e7cf95 Tailscale is now auto-applied 2025-11-23 14:43:15 -06:00
Greg Hellings 582dabc398 Add pinchflat to kustomization 2025-11-23 02:27:06 -06:00
Greg Hellings 05a8dc1bc5 Add pinchflat to Kubernetes 2025-11-23 02:26:22 -06:00
Greg Hellings 572419b8d3 Enable node level monitoring 2025-11-23 01:12:20 -06:00
Greg Hellings 9938c40330 Enable metrics for gitlab-runner 2025-11-22 21:32:09 -06:00
Greg Hellings 08b0ebf05f Fix Kubernetes access
Give the pods the proper authorization
Clarify the jobs endpoint names
2025-11-22 21:22:51 -06:00
Greg Hellings 82acff5857 Add Prometheus scraping to Kubernetes 2025-11-22 20:15:40 -06:00
Greg Hellings c4119dd9b7 Move jellyfin to hardware box
Rather than running Jellyfin on a VM as before, just move the service
over to Hosea, which isn't doing anything graphical
2025-11-08 15:37:02 -06:00
Greg Hellings af41fd6b92 Lint yaml better 2025-11-02 23:45:16 -06:00
Greg Hellings 4e5320847b Add backups for Immich
Add a nightly cron backup to push Immich backups onto the NAS
2025-10-25 01:06:31 -05:00
Greg Hellings 5e3d02843c Add kubernetes dashboard 2025-10-22 16:18:02 -05:00
Greg Hellings ecf97ea72c Tailscale now needs an opaque secret
Somewhere in the definition of the Tailscale operator the configuraiton
changed from taking a basic-auth formatted secret to needing a
customized one. This makes that happen
2025-10-19 21:51:24 -05:00
Greg Hellings 89460c4e21 Upgrade Immich to v2.1.0
Move to using kustomize'd helm charts to deploy it
Update the new version of the helm chart, which has very different
values structure
Move database into the db namespace
Upgrade the db to include vectorchord
Upgrade CNPG to now include barman cloud natively
Migrate databases to Barman Cloud plugin, completely
Eliminate yet another shell script step in applying my k8s config
2025-10-19 21:48:30 -05:00