I am new to Rancher and Longhorn and so far I am absolutely LOVING this stuff! I am having a weird issue when restoring volumes from backup. Actually the restore itself is easy and it works, but I see errors when trying to reuse them in Rancher.
So if I restore a volume from a backup, I then go (in Rancher) to luster/Storage/Persistent Volumes and create a volume selecting Longhorn as the plugin and the storage class, and correctly configuring the capacity/size to the same value as the actual size of the volume restored. When I create this volume I don’t see any errors etc, but when I create a persistent volume claim (project/Workloads/Volumes) and select the persistent volume I just created, the pvc is stuck in ‘pending’ state and I get the following error in the events:
Cannot bind to requested volume "wp-app": storageClassName does not match
So it doesn’t work and I can’t use that pvc when deploying Wordpress in this example.
However, I watched a Rancher meetup video from September (on Youtube) about Longhorn, and following that I tried creating the persistent volume the kubectl/yaml way with this yaml:
apiVersion: v1 kind: PersistentVolume metadata: name: wp-app spec: capacity: storage: 1Gi volumeMode: Filesystem accessModes: - ReadWriteOnce persistentVolumeReclaimPolicy: Delete csi: driver: io.rancher.longhorn fsType: ext4 volumeAttributes: numberOfReplicas: '3' staleReplicaTimeout: '20' volumeHandle: wp-app
This way all works and when I create the pvc the state changes to ‘bound’, after which I can launch the app and select the pvc etc.
So the question is, is it a bug in Rancher when linking persistent volumes to Longhorn volumes, or in Longhorn? Am I doing it wrongly? Is it possible to do this through the UI instead of the yaml way?
Thanks a lot in advance!