# ============================================================
# Velocity-OS — K3s StorageClasses + PersistentVolumes
# Target: RTX 6000 Blackwell workstation NVMe drive
# ============================================================
---
# StorageClass: local-nvme (no provisioner — manually bound PVs)
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: local-nvme
provisioner: kubernetes.io/no-provisioner
volumeBindingMode: WaitForFirstConsumer
reclaimPolicy: Retain

---
# PV: PostgreSQL data (50Gi on NVMe)
apiVersion: v1
kind: PersistentVolume
metadata:
  name: pv-postgres-data
  labels:
    app: postgres
spec:
  capacity:
    storage: 50Gi
  accessModes: [ReadWriteOnce]
  persistentVolumeReclaimPolicy: Retain
  storageClassName: local-nvme
  local:
    path: /opt/dlami/nvme/data/postgres
  nodeAffinity:
    required:
      nodeSelectorTerms:
        - matchExpressions:
            - key: kubernetes.io/hostname
              operator: In
              values: [velocity-workstation]

---
# PV: AI model cache (500Gi — Wan 2.2, Qwen-Image, Qwen3.6)
apiVersion: v1
kind: PersistentVolume
metadata:
  name: pv-model-cache
  labels:
    app: model-cache
spec:
  capacity:
    storage: 500Gi
  accessModes: [ReadOnlyMany]
  persistentVolumeReclaimPolicy: Retain
  storageClassName: local-nvme
  local:
    path: /opt/dlami/nvme/models
  nodeAffinity:
    required:
      nodeSelectorTerms:
        - matchExpressions:
            - key: kubernetes.io/hostname
              operator: In
              values: [velocity-workstation]

---
# PV: Generated asset store (200Gi)
apiVersion: v1
kind: PersistentVolume
metadata:
  name: pv-asset-store
  labels:
    app: asset-store
spec:
  capacity:
    storage: 200Gi
  accessModes: [ReadWriteMany]
  persistentVolumeReclaimPolicy: Retain
  storageClassName: local-nvme
  local:
    path: /opt/dlami/nvme/assets
  nodeAffinity:
    required:
      nodeSelectorTerms:
        - matchExpressions:
            - key: kubernetes.io/hostname
              operator: In
              values: [velocity-workstation]

---
# PVCs
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: pvc-postgres-data
  namespace: velocity-os
spec:
  accessModes: [ReadWriteOnce]
  storageClassName: local-nvme
  resources:
    requests:
      storage: 50Gi
  selector:
    matchLabels:
      app: postgres
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: pvc-model-cache
  namespace: velocity-os
spec:
  accessModes: [ReadOnlyMany]
  storageClassName: local-nvme
  resources:
    requests:
      storage: 500Gi
  selector:
    matchLabels:
      app: model-cache
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: pvc-asset-store
  namespace: velocity-os
spec:
  accessModes: [ReadWriteMany]
  storageClassName: local-nvme
  resources:
    requests:
      storage: 200Gi
  selector:
    matchLabels:
      app: asset-store
