Files
homelab/k8s/bootstrap/phase1-storage/storageclasses.yaml
T

28 lines
855 B
YAML

# StorageClasses — Applied after Longhorn installation
# The default 'longhorn' SC is created by Helm chart
# These are additional specialized classes
---
# CNPG-specific StorageClass with postgres UID/GID mount options
# Fixes "read-only filesystem" error when PostgreSQL (UID 26) tries to write
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: longhorn-cnpg
annotations:
storageclass.kubernetes.io/is-default-class: "false"
argocd.argoproj.io/sync-options: Prune=false # Allow ArgoCD adoption
provisioner: driver.longhorn.io
allowVolumeExpansion: true
parameters:
numberOfReplicas: "3"
staleReplicaTimeout: "30"
fromBackup: ""
dataLocality: "best-effort"
fsType: "ext4"
mountOptions:
- "noatime"
- "uid=26" # postgres user
- "gid=26" # postgres group
reclaimPolicy: Delete
volumeBindingMode: Immediate