# StorageClass for the persistent buildkit cache. # - numberOfReplicas: 1 -> the cache is written ONCE across the cluster (1x disk, # NOT the 3x triple-replication of the default 'longhorn' SC). This is deliberate: # a buildkit cache is throwable/recreatable, so replicating it 3x wastes disk that # node 2 (already 76%) can't afford. 1 replica survives single-node loss via # dataLocality: best-effort (re-replicates only when a node actually dies). # - dataLocality: best-effort -> keep the single replica on the same node as the # pod (fast local reads), replicate only if that node fails. # Auto-revert safety net: the buildkit-cache-monitor cron reverts buildkit to the # ephemeral (no-PVC) driver if any node crosses the critical disk threshold. # See monitoring/buildkit-cache-monitor.sh. apiVersion: storage.k8s.io/v1 kind: StorageClass metadata: name: buildkit-single-1r annotations: description: "Single-replica Longhorn (buildkit cache) - 1x disk, durable across node loss" provisioner: driver.longhorn.io allowVolumeExpansion: true reclaimPolicy: Delete volumeBindingMode: Immediate parameters: numberOfReplicas: "1" staleReplicaTimeout: "30" fsType: "ext4" dataLocality: "best-effort" dataEngine: "v1"