Files
homelab/k8s/infrastructure/longhorn/longhorn-wffc-storageclass.yaml
T

27 lines
1.1 KiB
YAML
Raw Normal View History

# longhorn-wffc — Longhorn StorageClass with WaitForFirstConsumer binding.
#
# WaitForFirstConsumer defers PV binding until the pod is scheduled, ensuring the
# volume is provisioned on a node where the pod can actually run. Critical for HA:
# with 3-replica volumes spread across 3 nodes, the scheduler needs to see which
# nodes already have replicas before placing the pod, avoiding situations where
# the pod lands on a node that can't reach any replica.
#
# numberOfReplicas=3 provides true HA: each volume has 3 copies across 3 nodes.
# If one node fails, the remaining 2 nodes still have the data and can serve it.
# volumeBindingMode is immutable, so this is a distinct SC from the chart's default.
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: longhorn-wffc
annotations:
storageclass.kubernetes.io/is-default-class: "true"
provisioner: driver.longhorn.io
allowVolumeExpansion: true
reclaimPolicy: Delete
volumeBindingMode: WaitForFirstConsumer
parameters:
numberOfReplicas: "3"
staleReplicaTimeout: "30"
fromBackup: ""
dataLocality: "best-effort"