Files
homelab/k8s/infra/longhorn/longhorn-paperless-storageclass.yaml
Story Crater Bot 2f9fc3ed96 fix: add Replace=true sync-option to paperless-media StorageClass
parameters is immutable on StorageClass, so ArgoCD's default patch sync kept failing after the nodeSelector removal ("field is immutable"). Same fix already used by longhorn-cnpg-storageclass.yaml.
2026-08-25 11:47:33 -07:00

33 lines
1.5 KiB
YAML

# Dedicated StorageClass for paperless-ngx document media, backed by the 4TB
# USB HDD on talos-cp-3 (see longhorn-add-disks-job.yaml). Single disk, single
# node — no Longhorn replica is possible, so numberOfReplicas is 1 by
# necessity, not choice. diskSelector pins placement to the tagged disk only,
# so a volume from this class never lands on cp-3's regular (already
# DiskPressure) default pool. reclaimPolicy is Retain, not Delete: a PVC
# accident here has no replica to fall back on, so an accidental delete must
# not also take the underlying volume with it.
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: longhorn-paperless-media
annotations:
# StorageClass.parameters is immutable - any future edit here needs
# delete+recreate, not patch. Same fix as longhorn-cnpg-storageclass.yaml;
# safe since a StorageClass is only consulted at provisioning time.
argocd.argoproj.io/sync-options: Replace=true,Force=true
provisioner: driver.longhorn.io
allowVolumeExpansion: true
reclaimPolicy: Retain
volumeBindingMode: WaitForFirstConsumer
parameters:
numberOfReplicas: "1"
# diskSelector alone is sufficient: only cp-3 has a disk tagged
# paperless-media, so placement is already pinned. A nodeSelector value
# here must be a Longhorn *node* tag (set via nodes.longhorn.io spec.tags),
# not a Kubernetes hostname - "talos-cp-3" was never a node tag, which made
# every provision attempt fail with "specified node tag talos-cp-3 does
# not exist".
diskSelector: "paperless-media"
staleReplicaTimeout: "30"
fsType: "ext4"