Commit graph

30 commits

Author SHA1 Message Date
fe0aa89ffa
feat(security): durcissement edge funklab.online (vraie IP client + rate-limit + TLS/headers) (#95)
- Traefik externalTrafficPolicy: Local → IP client réelle (fin du SNAT kube-proxy)
- middleware ratelimit par IP (100/min, burst 200) sur les 6 routes publiques
- middleware security-headers (HSTS, nosniff, X-Frame SAMEORIGIN, Referrer-Policy)
- TLSOption globale : plancher TLS 1.2 + ciphers modernes
- Guacamole REMOTE_IP_VALVE → ban anti-bruteforce par IP (fin du piège n°5)
- nftables : fermeture des ports Internet legacy 9080/9081 (HTTP clair redondant)
- allowCrossNamespace pour mutualiser les middlewares depuis infra
- docs : section Durcissement (public-domain.md) + CAA OVH + pièges à jour

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-07 22:58:24 +02:00
c0cbd74a9c
feat(grafana): bascule sur le domaine public HTTPS (grafana.funklab.online) (#90)
- IngressRoute websecure + Let's Encrypt
- OIDC : root_url + auth_url sur le domaine (token/api restent internes)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-07 16:41:21 +02:00
cd0dacbc9a
feat(infra): domaine public funklab.online + HTTPS Let's Encrypt (fondation) (#88)
- traefik : values.yaml versionné (réplique existant + certResolver ACME
  HTTP-01 + acme.json persistant) — appliqué par helm upgrade (hors ArgoCD).
  Redirect HTTP→HTTPS scopée funklab.online (ne casse pas *.lab.local).
- gateway : DNAT 80/443 → Traefik + rate-limit
- dnsmasq : split-horizon *.funklab.online → Traefik (var public_domain)
- doc : admin/k8s/public-domain.md (archi, OVH/Freebox, helm, ajout d'app)

Appliqué et vérifié : helm upgrade OK (services *.lab.local intacts),
resolver ACME chargé, DNAT/dnsmasq en place. En attente DNS OVH + Freebox
pour l'émission des certificats.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-07 15:59:26 +02:00
f9a916988b
fix(grafana): login OIDC pour les users sans email (repli username) (#87)
bbarthe (et tout compte Authentik sans email) échouait au login SSO :
Grafana, email vide, tentait l'endpoint /emails inexistant chez Authentik
→ 404 InternalError. email_attribute_path avec repli preferred_username +
login_attribute_path évitent le fallback. Plus besoin d'email par user.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-07 12:31:20 +02:00
514cb89579
feat(grafana): SSO OIDC via Authentik + admin par groupe lab-admins (#86)
- values.yaml monitoring : auth.generic_oauth (auth_url navigateur,
  token/api sur le Service interne), root_url, mapping lab-admins→Admin /
  sinon Viewer. Login local conservé (break-glass).
- vault : vault_grafana_oauth_client_secret (= secret k8s
  monitoring/grafana-oauth-secret, déjà créé)
- doc : runbook « ajouter une app » complété (exemple Grafana concret +
  groupe lab-admins) et procédure SQL pour promouvoir un compte SSO admin
  Guacamole (appliquée à Alkatrazz)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-07 12:11:00 +02:00
470c69881c
chore(gpu-01): retire les serveurs llama CPU system/monitor/dev (inutilisés) (#31)
Trois instances llama-server CPU manuelles (hors Ansible) tournaient sur gpu-01
sans servir : déjà orphelines de LiteLLM (alias absents de config.yaml, d'où le
bruit "Invalid model name"). Suppression complète :

gpu-01 (opérationnel, déjà fait) :
- systemctl disable --now + rm des units llama-server-{system,monitor,dev}
- ports firewall 1235/1236/1237 fermés

Repo :
- monitoring : scrape jobs (values.yaml) + alertes LlamaServer{System,Monitor}Down
  (alerts-ai.yaml) retirés → plus de "target down"/alertes fantômes ; panneaux de
  statut dashboard-infrastructure recyclés (system→llama-embed, monitor supprimé).
- docs admin/ + hermes-skills (souls funk-ai/brain, SKILL agent-delegation) mises à
  jour : inventaire modèles, profils Hermès system/monitor sans backend (à repointer
  sur qwen3-8b), litellm, ops, monitoring.

Les profils Hermès system/monitor existent toujours mais sans backend dédié.
Dashboards Grafana dashboard-ai (panneaux graphiques CPU) laissés tels quels
(cosmétique, séries vides, aucune alerte).

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-20 13:25:50 +02:00
alkatrazz
91e648f55e feat(monitoring): métriques conso électrique CPU+GPU (RAPL + ROCm power)
- node_exporter : activer --collector.rapl (CPU power package, storage-01 + gpu-01 + nœuds k8s)
- rocm_scraper : ajouter rocm_gpu_power_watts + rocm_gpu_power_cap_watts via sysfs hwmon
- gpu-01 : activer rocm_exporter_enabled
- kube-prometheus-stack : propager --collector.rapl aux DaemonSet Talos via prometheus-node-exporter.extraArgs

Déployé sur storage-01 et gpu-01. ArgoCD prend en charge les nœuds Talos.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-02 22:54:51 +02:00
alkatrazz
0df9ccf812 feat(alertmanager): ajouter webhook n8n pour résumés alertes par email
AlertManager envoie maintenant les alertes à deux receivers :
- hermes-monitor (webhook Hermes existant)
- n8n webhook → LLM summary → Gmail

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-29 17:28:50 +02:00
alkatrazz
d39b083342 fix(grafana): corriger envFromSecrets (était envFromSecretRef)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-25 15:31:35 +02:00
alkatrazz
92ea6c60a5 fix(grafana): migrer SQLite→PostgreSQL — DDL NFS trop lent au boot
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-25 15:26:39 +02:00
alkatrazz
2bd7b2c602 fix(grafana): désactiver initChownData — perms déjà 472:472 + NFS writes bloquées sur compute-03
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-25 14:30:24 +02:00
alkatrazz
719cd4bf8c feat(monitoring): dashboard infra — section services systemd + NFS I/O
Nouvelle section "Services — état systemd" en bas du dashboard :

storage-01 (8 panels verts/rouges) :
  DNS (dnsmasq), NFS server, PostgreSQL, Qdrant, LiteLLM,
  Hermes Agent, nftables, chronyd (NTP)

gpu-01 (4 panels) :
  llama-server GPU (:1234), llama-server system (:1236),
  llama-server monitor (:1237), chronyd (NTP)

Timeseries NFS :
  - Débit NFS disque (read/write bytes/s)
  - Requêtes NFS/s par type (read/write/getattr/lookup)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-14 19:02:27 +02:00
alkatrazz
428fa4ce2a feat(monitoring): dashboard infra — 10 nouveaux panels
Compute (compute-01/02/03) :
  - Uptime min (dtdurations, jaune<12h / vert>12h / bleu>7j)
  - Disk /var % avg (xfs, seuil 60%/85%)

storage-01 :
  - RAID5 état (mapping 1→ACTIF vert / 0→DÉGRADÉ rouge)
  - RAID5 disques HS (vert=0 / rouge>=1)
  - Uptime (dtdurations)
  - Temp CPU (hwmon pci AMD, seuil 60°/80°)

gpu-01 :
  - Uptime (dtdurations)
  - Temp CPU Tdie (hwmon AMD, seuil 70°/90°)
  - Swap % (16GB configuré, actuellement 0%)
  - Timeseries GPU edge/hotspot/VRAM (hwmon RX 6700XT)
  - Timeseries CPU Tdie/Tctl (hwmon AMD)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-14 18:57:15 +02:00
alkatrazz
a21b986d54 fix(monitoring): dashboard infra — remplace regex instance par job=node-exporter
instance=~"192\.168\.10\.(11|12|13):9100" → job="node-exporter"

La barre oblique inversée dans les regex PromQL string literals causait
une erreur "unknown escape sequence" (\.  n'est pas un escape PromQL valide).
job="node-exporter" est équivalent (seuls les 3 compute nodes ont ce job)
et ne dépend pas d'adresses IP hardcodées.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-14 18:48:00 +02:00
alkatrazz
0498d770f2 fix(monitoring): dashboard infra nodata — nftables pod CIDR + mountpoint
nftables.conf.j2 :
  - Ajoute 10.42.0.0/16 (CIDR pods k8s) pour port 9100 (node_exporter)
    et port 8080 (hermes webhook AlertManager)
  - Appliqué live sur storage-01 + persisté dans /etc/sysconfig/nftables.conf
  - storage-01 était up=0 (timeout) car pods Prometheus ne pouvaient pas
    l'atteindre malgré node_exporter actif

dashboard-infrastructure.yaml :
  - Corrige mountpoint /srv → /srv/data (RAID5 monté sur /srv/data)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-14 18:42:11 +02:00
alkatrazz
d552abd2ef fix(monitoring): Grafana memory limit 512Mi → 1Gi
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 23:55:33 +02:00
alkatrazz
273d4b2a23 fix(monitoring): augmenter limite mémoire Grafana 256Mi → 512Mi
Grafana 13 était OOMKilled régulièrement (exit code 137, 5 restarts
observés) avec la limite à 256Mi — cause des "no available server"
Traefik pendant les redémarrages.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 23:15:37 +02:00
alkatrazz
18da44a89f feat: monitoring — dashboards Grafana + alertes Prometheus
Dashboards (ConfigMaps, auto-importés par sidecar Grafana) :
- dashboard-kubernetes : cluster overview, pods, PVCs, restarts
- dashboard-infrastructure : compute/storage-01/gpu-01 CPU/RAM/disque/réseau + GPU ROCm
- dashboard-ai : llama-server GPU/CPU tokens/s, requêtes, VRAM, température GPU

Alertes (PrometheusRule) :
- alerts-node : CPU>90%, RAM>90%, disque>80%, storage-01/gpu-01 down, load élevé
- alerts-k8s : NodeNotReady, PodCrashLoop, PodPending, DeploymentUnavailable, PVCNotBound, ArgoCDOutOfSync
- alerts-ai : llama-server GPU/system/monitor down, GPU temp>80°C, VRAM>95%, queue élevée

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 22:47:49 +02:00
alkatrazz
83c10feae7 fix: monitoring — collecte métriques externes (nftables, llama --metrics, ROCm via 9100)
- nftables storage-01 : ports 9100 (node_exporter) + 9093 (webhook) ouverts pour 192.168.10.0/24
- llama-server : ajout --metrics pour exposer /metrics sur les 3 instances
- values.yaml : suppression job gpu-01-rocm:9101 inexistant (ROCm passe par node_exporter 9100 textfile_collector)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 22:41:19 +02:00
alkatrazz
e0d233da02 fix: alertmanager — receiver null manquant (Watchdog heartbeat)
Le chart kube-prometheus-stack génère une sous-route pour l'alerte
Watchdog qui référence le receiver "null". Notre config le remplaçait
sans le définir → ReconciliationFailed, StatefulSet jamais créé.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 22:29:19 +02:00
alkatrazz
d23d464372 fix: monitoring — Ingress Prometheus/AlertManager, paths + pathType requis
Le chart kube-prometheus-stack nécessite paths:[/] et pathType:Prefix
contrairement au sous-chart Grafana qui a des defaults.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 22:27:01 +02:00
alkatrazz
7fa790c8d3 feat: monitoring — Ingress Prometheus et AlertManager (traefik, lab.local)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 22:23:31 +02:00
alkatrazz
f42c6c17dc fix: nfs-provisioner helmrelease — renommer Application interne pour éviter boucle ArgoCD
helmrelease.yaml avait le même nom que l'Application parente (nfs-provisioner).
ArgoCD gérait la ressource en double → SharedResourceWarning + OutOfSync.
Renommé en nfs-subdir-external-provisioner, identique au pattern monitoring.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 22:04:23 +02:00
alkatrazz
b7dde7c5ee fix: monitoring namespace — PodSecurity privileged pour node-exporter
node-exporter requiert hostNetwork, hostPID et hostPath — bloqué par
la policy baseline:latest de Talos. Label privileged appliqué.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 21:46:54 +02:00
alkatrazz
655ca4dc8c feat: NFS provisioner + persistance Prometheus et Grafana
- k8s/infra/nfs-provisioner/ : nfs-subdir-external-provisioner v4.0.18
  StorageClass "nfs" (default), ReclaimPolicy=Retain, server=192.168.10.1
  path=/srv/data/nfs/k8s (export RAID5 déjà existant)
- k8s/apps-of-apps/apps/nfs-provisioner.yaml : Application ArgoCD
- monitoring/values.yaml : persistance activée
  Prometheus: 20Gi sur nfs, Grafana: 2Gi sur nfs

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 21:22:05 +02:00
alkatrazz
857351bcf9 fix: monitoring — supprimer storageSpec (emptyDir implicite)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 20:39:55 +02:00
alkatrazz
36ca8f0179 fix: monitoring — emptyDir pour Prometheus (pas de StorageClass)
Longhorn à installer ensuite pour la persistance.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 20:37:33 +02:00
alkatrazz
7887341ad7 fix: helmrelease monitoring — multi-source correct (sources uniquement, valueFiles)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 20:34:11 +02:00
alkatrazz
7409c6fa1c fix: ArgoCD — SSH URL repo + clé SSH pour auth GitHub
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 20:31:00 +02:00
alkatrazz
d7b33bb34a feat: bootstrap ArgoCD + structure GitOps k8s
- k8s/argocd-bootstrap/values.yaml : ArgoCD Helm values (ingress Traefik,
  resources limités, dex désactivé)
- k8s/apps-of-apps/ : root Application + monitoring Application
- k8s/infra/monitoring/ : kube-prometheus-stack v85.0.2 (Grafana, Prometheus,
  AlertManager, node-exporter daemonset)
  - Scrape additionnels : storage-01:9100, gpu-01:9100 (node), :9101 (ROCm),
    llama-server :1234/:1236/:1237
  - AlertManager webhook → http://192.168.10.1:9093/webhook (Hermes monitor)
  - Ressources dimensionnées pour compute 8GB
  - kubeEtcd/Scheduler/ControllerManager/Proxy désactivés (Talos)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 20:26:49 +02:00