-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to take CSI snapshot with Velero and having hard time to find information about how to do it #8542
Comments
I haven't tried the hostpath CSI driver. It seems for some reason the CSI plugin was skipped during your backup |
Here is output from |
@pew-x2 Could you re-try by installing velero and your workload in different namespaces? |
I cleared kuberentes and reinstalled. And get the same error.
Output from
bundle-2024-12-23-09-40-06.tar.gz Is storage classes and snapshot classes namespaced or are they global? Here is the last part of the log
|
Thanks for the recreate, I believe you missed the step to label the VolumeSnapshotClass Your recreate without VSC labeling would only work if #8294 is solved. |
Please help us improve the docs in the meantime. Where would you expect the instruction to add label to live if not here. |
This is probably caused by my insufficient knowledge about snapshots: But I have the impression that I've installed a custom snapshot class which is labeled as you are suggesting. Could it be that I've added the VolumeSnapshotClass to the wrong namespace? I had the impression that there were not namespaced.
I didn't add that to later description since I was thinking that was implied. But I still having problem with understand what "natvie snapshotter" is and how to trigger it (if I now have actually added the label correctly). |
"native snapshotter" in velero context is using VolumeSnapshotLocation defined using cloud storage plugins such as https://github.com/vmware-tanzu/velero-plugin-for-aws/blob/main/volumesnapshotlocation.md which does not use k8s CSI snapshot apis but "natively" trigger calls to aws using aws SDK functions implemented in the plugin. |
Can you give us yaml of the PVC and PV? Relevant code sections velero/pkg/backup/item_backupper.go Lines 574 to 578 in 9d6f4d2
|
values.yamlThis is how they are added in helm. I'm hoping this is quite basic pattern. But pasting in the helm template bellow anyway if that is relevant. volumeMounts:
- name: db-backup-stage-pv
mountPath: "/tmp/backup"
volumes:
- name: db-backup-stage-pv
persistentVolumeClaim:
claimName: db-backup-stage-pv-claim Part of the Helm template where the values are used resources:
{{- toYaml .Values.db.resources | nindent 12 }}
{{- with .Values.db.volumeMounts }}
volumeMounts:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.db.volumes }}
volumes:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.db.nodeSelector }} StoreageClass, VolumeSnapshot, PV and PVC---
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: csi-hostpath-sc
provisioner: hostpath.csi.k8s.io
reclaimPolicy: Delete
volumeBindingMode: Immediate
---
apiVersion: snapshot.storage.k8s.io/v1
kind: VolumeSnapshotClass
metadata:
name: csi-hostpath-sc
labels:
velero.io/csi-volumesnapshot-class: "true"
driver: hostpath.csi.k8s.io
deletionPolicy: Delete
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: db-backup-stage-pv
labels:
type: db-backup
spec:
storageClassName: csi-hostpath-sc
persistentVolumeReclaimPolicy: Recycle
capacity:
storage: 250Mi
accessModes:
- ReadWriteOnce
hostPath:
path: "/mnt/pwrmap/data"
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: db-backup-stage-pv-claim
annotations:
velero.io/csi-volumesnapshot-class: "csi-hostpath-sc"
spec:
storageClassName: csi-hostpath-sc
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 200Mi
selector:
matchLabels:
type: db-backup |
Per demo it should be implementable but we need to get some answers first. |
What steps did you take and what happened:
I'm failing to understand how to take a snapshot of a PersistentVolume using CSI in Velero v1.15.
What did you expect to happen:
I expected to get a snapshot when running backup that would backup the files of the persistent volume.
Using docker desktop Kubernetes to try to learn hor Velero works.
Installed an external snapshotter, external-snapshotter
kubectl apply -f https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/release
Installed CSI driver
https://github.com/kubernetes-csi/csi-driver-host-path.git
enabled CSI when installing Velero
The following information will help us better understand what's going on:
This is the log I get when I try to run the backup:
Here is the snapshot classes and storageclass
Anything else you would like to add:
Environment:
velero version
): v1.15.0velero client config get features
): "" returnedkubectl version
): v1.30.5/etc/os-release
): Mac OSX 14.6.1Vote on this issue!
This is an invitation to the Velero community to vote on issues, you can see the project's top voted issues listed here.
Use the "reaction smiley face" up to the right of this comment to vote.
The text was updated successfully, but these errors were encountered: