kubernetes-csi / external-snapshotter

Sidecar container that watches Kubernetes Snapshot CRD objects and triggers CreateSnapshot/DeleteSnapshot against a CSI endpoint.
Apache License 2.0
501 stars 374 forks source link

SnapshotMisbound error when creating VolumeGroupSnapshot #1201

Open xing-yang opened 2 days ago

xing-yang commented 2 days ago

What happened: The following error was encountered when creating a VolumeGroupSnapshot.

snapshot-controller : I1119 15:53:22.943351 4189728 event.go:377] Event(v1.ObjectReference{Kind:"VolumeSnapshot", Namespace:"default", Name:"snapshot-d4846dd4e3638b5b2c9754b0fb43cbbda319c7b1bcfd3fee430af1bce54aa4d1", UID:"a9101402-5e43-41cc-a240-8bee464d6f2f", APIVersion:"snapshot.storage.k8s.io/v1", ResourceVersion:"29727", FieldPath:""}): type: 'Warning' reason: 'SnapshotMisbound' VolumeSnapshotContent is not bound to the VolumeSnapshot correctly

More details here: https://gist.githubusercontent.com/gnufied/98adc0d974f4ba7222314d48f42b3ae5/raw/46118872bbb1c65864811ba7c88f60352e761989/gistfile1.txt

What you expected to happen:

How to reproduce it:

Anything else we need to know?:

Environment:

yati1998 commented 2 days ago

Can you please re-verify this? I have faces this error earlier but later saw that it was some rbac issue. We need to check if proper rbacs are used.

yati1998 commented 2 days ago

I was able to create and delete the snapshots properly with latest branch including beta pr and webhook changes

yati@dhcp53-199:~/csi-driver-host-path/examples$ kubectl get volumegroupsnapshot
NAME                           READYTOUSE   VOLUMEGROUPSNAPSHOTCLASS      VOLUMEGROUPSNAPSHOTCONTENT                              CREATIONTIME   AGE
new-groupsnapshot-testmaster   true         csi-hostpath-groupsnapclass   groupsnapcontent-ea2dc037-0b24-48be-b748-1c481003b2d1   11s            12s
yati@dhcp53-199:~/csi-driver-host-path/examples$ kubectl get volumegroupsnapshotcontent
NAME                                                    READYTOUSE   DELETIONPOLICY   DRIVER                VOLUMEGROUPSNAPSHOTCLASS      VOLUMEGROUPSNAPSHOTNAMESPACE   VOLUMEGROUPSNAPSHOT            AGE
groupsnapcontent-ea2dc037-0b24-48be-b748-1c481003b2d1   true         Delete           hostpath.csi.k8s.io   csi-hostpath-groupsnapclass   default                        new-groupsnapshot-testmaster   17s
yati@dhcp53-199:~/csi-driver-host-path/examples$ kubectl get volumesnapshot
NAME                                                                        READYTOUSE   SOURCEPVC            SOURCESNAPSHOTCONTENT   RESTORESIZE   SNAPSHOTCLASS   SNAPSHOTCONTENT                                                                CREATIONTIME   AGE
snapshot-a6ddfaedc4af87a109c36f2c2c08b7c9a00e4d8a1fc14fd3649865d255ed8b13   true         csi-pvc-testmaster                           1Gi                           snapcontent-a6ddfaedc4af87a109c36f2c2c08b7c9a00e4d8a1fc14fd3649865d255ed8b13   29s            29s
yati@dhcp53-199:~/csi-driver-host-path/examples$ kubectl get volumesnapshotcontent
NAME                                                                           READYTOUSE   RESTORESIZE   DELETIONPOLICY   DRIVER                VOLUMESNAPSHOTCLASS   VOLUMESNAPSHOT                                                              VOLUMESNAPSHOTNAMESPACE   AGE
snapcontent-a6ddfaedc4af87a109c36f2c2c08b7c9a00e4d8a1fc14fd3649865d255ed8b13   true         1073741824    Delete           hostpath.csi.k8s.io                         snapshot-a6ddfaedc4af87a109c36f2c2c08b7c9a00e4d8a1fc14fd3649865d255ed8b13   default                   35s
yati1998 commented 1 day ago
yati@dhcp53-199:~/csi-driver-host-path/examples$ kubectl get volumegroupsnapshot -oyaml
apiVersion: v1
items:
- apiVersion: groupsnapshot.storage.k8s.io/v1alpha1
  kind: VolumeGroupSnapshot
  metadata:
    creationTimestamp: "2024-11-21T07:30:27Z"
    generation: 1
    name: static-vg
    namespace: default
    resourceVersion: "13042"
    uid: 86088ef8-3c7e-40ff-9c18-e46803443c10
  spec:
    source:
      volumeGroupSnapshotContentName: static-vgs
    volumeGroupSnapshotClassName: csi-hostpath-groupsnapclass
  status:
    boundVolumeGroupSnapshotContentName: static-vgs
    creationTime: "2024-11-21T07:23:53Z"
    readyToUse: true
kind: List

result for static provisioning as well

xing-yang commented 1 day ago

@yati1998 A more detailed bug is opened here: https://github.com/kubernetes-csi/external-snapshotter/issues/1203