- 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
43 lines
1.8 KiB
YAML
43 lines
1.8 KiB
YAML
# StorageClass specifically for CNPG (CloudNativePG) PostgreSQL clusters
|
|
# Fixes the "read-only filesystem" issue by mounting with postgres UID/GID
|
|
apiVersion: storage.k8s.io/v1
|
|
kind: StorageClass
|
|
metadata:
|
|
name: longhorn-cnpg
|
|
namespace: longhorn-system
|
|
annotations:
|
|
storageclass.kubernetes.io/is-default-class: "false"
|
|
# StorageClass.parameters is immutable. mkfsParams below was added after
|
|
# this class already existed, so every sync failed with
|
|
# parameters: Invalid value: {...}: field is immutable
|
|
# and the Application sat OutOfSync permanently — ArgoCD retrying a change
|
|
# the API server can never accept.
|
|
#
|
|
# Replace=true makes ArgoCD delete and recreate instead of patching. Safe
|
|
# for a StorageClass: it is consulted only at provisioning time, so bound
|
|
# PVs and their data are untouched. New PVCs briefly fail if one is created
|
|
# during the window.
|
|
#
|
|
# Note what this does NOT do: the nine CNPG volumes already provisioned were
|
|
# formatted without mkfsParams and keep that format. Only volumes created
|
|
# after this recreate get it. Existing volumes that need to expand still
|
|
# need handling separately.
|
|
argocd.argoproj.io/sync-options: Replace=true,Force=true
|
|
provisioner: driver.longhorn.io
|
|
allowVolumeExpansion: true
|
|
parameters:
|
|
numberOfReplicas: "3"
|
|
diskSelector: "storage" # Only schedule on CP node disks, not GPU worker
|
|
staleReplicaTimeout: "30"
|
|
fromBackup: ""
|
|
dataLocality: "best-effort"
|
|
fsType: "ext4"
|
|
# Mount options to ensure PostgreSQL can write
|
|
mkfsParams: "-O ^64bit,^metadata_csum"
|
|
mountOptions:
|
|
- "noatime"
|
|
# Critical: mount with postgres UID/GID (26:26) to avoid permission issues
|
|
- "uid=26"
|
|
- "gid=26"
|
|
reclaimPolicy: Delete
|
|
volumeBindingMode: Immediate |