From 060aefbd0b51f006af3e5e675cbeb11f74edbe44 Mon Sep 17 00:00:00 2001 From: Viktor Barzin Date: Fri, 5 Jun 2026 19:55:03 +0000 Subject: [PATCH] storage: migrate changedetection off proxmox-lvm to NFS (LUN-cap relief) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit changedetection uses a file-based JSON datastore (url-watches.json + per-watch dirs + brotli snapshots) — no embedded DB, NFS-safe. Frees one proxmox-csi SCSI-LUN slot. Part of harden-proxmox-csi+NFS plan. - swap changedetection-data-proxmox -> nfs_volume module - data copied + verified (HTTP 200, 4 watches loaded); excluded 200MB test cruft - block PVC removed; block LV retained per SC policy (code-dfjn cleanup) Co-Authored-By: Claude Opus 4.8 --- stacks/changedetection/main.tf | 39 ++++++++++------------------------ 1 file changed, 11 insertions(+), 28 deletions(-) diff --git a/stacks/changedetection/main.tf b/stacks/changedetection/main.tf index 07d98c99..7974e884 100644 --- a/stacks/changedetection/main.tf +++ b/stacks/changedetection/main.tf @@ -63,33 +63,16 @@ module "tls_secret" { tls_secret_name = var.tls_secret_name } -resource "kubernetes_persistent_volume_claim" "data_proxmox" { - wait_until_bound = false - metadata { - name = "changedetection-data-proxmox" - namespace = kubernetes_namespace.changedetection.metadata[0].name - annotations = { - "resize.topolvm.io/threshold" = "10%" - "resize.topolvm.io/increase" = "100%" - "resize.topolvm.io/storage_limit" = "8Gi" - } - } - spec { - access_modes = ["ReadWriteOnce"] - storage_class_name = "proxmox-lvm" - resources { - requests = { - storage = "4Gi" - } - } - } - lifecycle { - # The autoresizer expands requests.storage up to storage_limit and - # PVCs can't shrink. Without this, every TF apply tries to revert - # to the spec value, K8s rejects the shrink, and the PVC ends up - # in Terminating-but-in-use limbo. - ignore_changes = [spec[0].resources[0].requests] - } +# Datastore on NFS. Migrated off proxmox-lvm 2026-06-05 for LUN-cap relief — +# changedetection uses a file-based JSON datastore (no embedded DB), NFS-safe. +# See docs/plans/2026-06-05-block-storage-harden-nfs-design.md +module "nfs_changedetection" { + source = "../../modules/kubernetes/nfs_volume" + name = "changedetection-data-nfs" + namespace = kubernetes_namespace.changedetection.metadata[0].name + nfs_server = var.nfs_server + nfs_path = "/srv/nfs/changedetection" + storage = "8Gi" } resource "kubernetes_deployment" "changedetection" { @@ -188,7 +171,7 @@ resource "kubernetes_deployment" "changedetection" { volume { name = "data" persistent_volume_claim { - claim_name = kubernetes_persistent_volume_claim.data_proxmox.metadata[0].name + claim_name = module.nfs_changedetection.claim_name } } }