From 7ad0e578aef02d96f1861630295c567693737b43 Mon Sep 17 00:00:00 2001 From: Viktor Barzin Date: Tue, 26 May 2026 02:49:43 +0000 Subject: [PATCH] f1-stream: migrate PVC from proxmox-lvm to NFS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Wave 1 LUN-cap relief. The PVC stores 5 small JSON state files (health_state, schedule, scraped_links, sessions, streams) and a lost+found — total 30KB, no DB, regenerable from upstream APIs. Standard scale-to-0 → rsync → swap pattern (deployment was at replicas=1). Pod came back up on k8s-node4 (now Ready again). Net: -1 SCSI LUN on k8s-node1 (was the previous host). --- stacks/f1-stream/main.tf | 37 +++++++++---------------------------- 1 file changed, 9 insertions(+), 28 deletions(-) diff --git a/stacks/f1-stream/main.tf b/stacks/f1-stream/main.tf index b2c0fc8b..b87a1e6f 100644 --- a/stacks/f1-stream/main.tf +++ b/stacks/f1-stream/main.tf @@ -78,33 +78,14 @@ resource "kubernetes_manifest" "chrome_service_client_secret" { depends_on = [kubernetes_namespace.f1-stream] } -resource "kubernetes_persistent_volume_claim" "data_proxmox" { - wait_until_bound = false - metadata { - name = "f1-stream-data-proxmox" - namespace = kubernetes_namespace.f1-stream.metadata[0].name - annotations = { - "resize.topolvm.io/threshold" = "10%" - "resize.topolvm.io/increase" = "100%" - "resize.topolvm.io/storage_limit" = "5Gi" - } - } - spec { - access_modes = ["ReadWriteOnce"] - storage_class_name = "proxmox-lvm" - resources { - requests = { - storage = "1Gi" - } - } - } - 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] - } +module "nfs_data_host" { + source = "../../modules/kubernetes/nfs_volume" + name = "f1-stream-data-host" + namespace = kubernetes_namespace.f1-stream.metadata[0].name + nfs_server = var.nfs_server + nfs_path = "/srv/nfs/f1-stream" + storage = "1Gi" + access_modes = ["ReadWriteOnce"] } resource "kubernetes_deployment" "f1-stream" { @@ -196,7 +177,7 @@ resource "kubernetes_deployment" "f1-stream" { volume { name = "data" persistent_volume_claim { - claim_name = kubernetes_persistent_volume_claim.data_proxmox.metadata[0].name + claim_name = module.nfs_data_host.claim_name } } }