Repository navigation
Storage Configuration
This cluster implements multiple storage solutions to address different use cases.
Two primary storage systems are configured:
- Longhorn: Distributed block storage for high availability
- NFS CSI Driver: For connecting to external NFS shares
Longhorn provides distributed, replicated block storage across the cluster nodes.
- Data replication across multiple nodes
- Snapshot and backup capabilities
- Web UI for storage management
- Volume expansion
- Built-in monitoring
Longhorn is deployed through ArgoCD using the manifests in the appropriate directory. The setup includes:
- StorageClass for dynamic provisioning
- Default storage policy
- Ingress for the dashboard
To use Longhorn storage in applications, specify the storage class:
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: example-pvc
spec:
accessModes:
- ReadWriteOnce
storageClassName: longhorn
resources:
requests:
storage: 1GiFor more information, visit the Longhorn documentation.
The NFS CSI Driver enables connecting to external NFS shares.
The NFS CSI Driver is deployed via manifests in the manifests/csi-driver-nfs directory:
csi-driver-nfs/
├── daemonset.yaml # Node driver components
├── deployment.yaml # Controller components
├── rbac.yaml # Permissions
└── storageclass.yaml # NFS storage class definitions
The NFS storage class configuration maps to your external NFS servers:
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: nfs-csi
provisioner: nfs.csi.k8s.io
parameters:
server: 192.168.1.100 # Your NFS server IP
share: /exports # Export path
# Additional parameters as neededTo use NFS storage, reference the nfs-csi storage class:
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: nfs-pvc
spec:
accessModes:
- ReadWriteMany # NFS supports multi-read/write
storageClassName: nfs-csi
resources:
requests:
storage: 5GiFor more information, visit the Kubernetes CSI NFS Driver documentation.
Choose the appropriate storage class based on your needs:
- Longhorn: For data requiring high availability and replication
- NFS: For shared read-write access or connecting to existing data
For Longhorn volumes, use Longhorn's built-in backup functionality:
- Access the Longhorn UI
- Configure a backup target (S3, NFS)
- Create scheduled or manual backups
For NFS volumes, backups should be handled at the NFS server level.
- Longhorn: Performance depends on network speed between nodes
- NFS: Performance depends on NFS server capabilities and network
Common issues:
-
PVC Stuck in Pending:
- Check storage class existence:
kubectl get sc - Verify provisioner pods:
kubectl get pods -n longhorn-systemorkubectl get pods -l app=csi-nfs-controller
- Check storage class existence:
-
I/O Errors:
- For Longhorn: Check replica health in Longhorn UI
- For NFS: Verify NFS server connectivity and exports
For more detailed troubleshooting, see the documentation links at the end of this page.