Files
homelab/k8s/infra/longhorn/longhorn-storageclass.yaml
T
rock 3462096311 fix(longhorn): isolate GPU worker from general storage scheduling
- Remove expand-replicas-job (blindly forced all volumes to 3 replicas,
  ignoring StorageClass settings)
- Add diskSelector: 'storage' to longhorn and longhorn-cnpg StorageClasses
  so replicas only land on CP nodes (cp-1, cp-2, cp-3)
- Tag all CP node disks with 'storage' via PostSync job
  (disk names are runtime-discovered, can't hardcode in Node CRs)
- Disable scheduling on worker-1 Node CR — only longhorn-llm-local
  (diskSelector: 'llm') can use it
- worker-1 is GPU-only: llm-models and comfyui use dedicated SCs
2026-09-11 09:33:52 +09:00

24 lines
1004 B
YAML

# Longhorn StorageClass - single unified `longhorn` storage class for the whole
# cluster. This is the only Longhorn class anything should reference.
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: longhorn
annotations:
storageclass.kubernetes.io/is-default-class: "true"
description: "Longhorn distributed storage - 3 replicas, CP nodes only"
argocd.argoproj.io/sync-options: Replace=true,Force=true
provisioner: driver.longhorn.io
allowVolumeExpansion: true
reclaimPolicy: Delete
volumeBindingMode: Immediate # Immediate binding for StatefulSets (matches deployed config)
parameters:
numberOfReplicas: "3" # HA across all 3 CP nodes
diskSelector: "storage" # Only schedule on CP node disks, not GPU worker
staleReplicaTimeout: "30"
fromBackup: ""
dataLocality: "disabled" # Match deployed config (not best-effort)
fsType: "ext4"
disableRevisionCounter: "true" # Performance optimization
unmapMarkSnapChainRemoved: "ignored"