Skip to content
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

external-snapshotter choose which version? #159

Open
huntkalio opened this issue Sep 24, 2024 · 6 comments
Open

external-snapshotter choose which version? #159

huntkalio opened this issue Sep 24, 2024 · 6 comments

Comments

@huntkalio
Copy link

huntkalio commented Sep 24, 2024

I wan't to use snaptshot , I found it relay: CSI Snapshotter,

Which version of external-snapshotter controller and it's crds should I use?

@chengxiangdong
Copy link
Collaborator

Current versions of CSI Snapshotter are all supported, with newer versions offering more features and functionalities.
The example we provide has been tested on before version 7.0.

@huntkalio
Copy link
Author

ok,thanks.

@huntkalio huntkalio reopened this Sep 27, 2024
@huntkalio
Copy link
Author

huntkalio commented Sep 27, 2024

@chengxiangdong I test it with external-snapshotter and its crd version 8.1.0.When create snapshot, it failed with

 could not sync content "snapcontent-bee9d218-0f5a-45a3-9068-xxxxx: failed to add VolumeSnapshotBeingCreated annotation on the content snapcontent-bee9d218-0f5a-45a3-9068-xxxxx: "snapshot controller failed to update snapcontent-bee9d218-0f5a-45a3-9068-xxxxxon API server: VolumeSnapshotContent.snapshot.storage.k8s.io \"snapcontent-bee9d218-0f5a-45a3-9068-xxxxx\" is invalid: spec: Invalid value: \"object\": sourceVolumeMode is required once set"

Does sourceVolumeMode is not support ?

@chengxiangdong
Copy link
Collaborator

Hi @huntkalio ,
SourceVolumeMode is the mode of the volume whose snapshot is taken.
Can be either Filesystem or Block, and EVS should use Block.

@huntkalio
Copy link
Author

huntkalio commented Sep 29, 2024

Hi @huntkalio , SourceVolumeMode is the mode of the volume whose snapshot is taken. Can be either Filesystem or Block, and EVS should use Block.

this error occur when creat VolumeSnapshot like ‘https://github.com/huaweicloud/huaweicloud-csi-driver/blob/master/examples/evs-csi-plugin/kubernetes/snapshot/snapshot-create.yaml’。

The VolumeSnapshotContent resource is created auto by snap csi controller? How to set SourceVolumeMode in VolumeSnapshot?
Does it need set in VolumeSnapshotClass parameters @chengxiangdong

apiVersion: snapshot.storage.k8s.io/v1
kind: VolumeSnapshotContent
metadata:
  creationTimestamp: '2024-09-29T03:05:19Z'
  finalizers:
    - snapshot.storage.kubernetes.io/volumesnapshotcontent-bound-protection
  generation: 1
  managedFields:
    - apiVersion: snapshot.storage.k8s.io/v1
      fieldsType: FieldsV1
      fieldsV1:
        f:status:
          .: {}
          f:error:
            .: {}
            f:message: {}
            f:time: {}
          f:readyToUse: {}
      manager: csi-snapshotter
      operation: Update
      subresource: status
      time: '2024-09-29T03:05:19Z'
    - apiVersion: snapshot.storage.k8s.io/v1
      fieldsType: FieldsV1
      fieldsV1:
        f:metadata:
          f:finalizers:
            .: {}
            v:"snapshot.storage.kubernetes.io/volumesnapshotcontent-bound-protection": {}
        f:spec:
          .: {}
          f:deletionPolicy: {}
          f:driver: {}
          f:source:
            .: {}
            f:volumeHandle: {}
          f:sourceVolumeMode: {}
          f:volumeSnapshotClassName: {}
          f:volumeSnapshotRef: {}
      manager: snapshot-controller
      operation: Update
      time: '2024-09-29T03:05:19Z'
  name: snapcontent-20731ac4-d110-480d-ab80-xxxxx
  resourceVersion: '10839456'
  uid: d8e61280-c2f5-4fb6-a423-6898b35ac67c
spec:
  deletionPolicy: Delete
  driver: evs.csi.huaweicloud.com
  source:
    volumeHandle: 8549af04-abd4-469d-9b48-yyyyy
  sourceVolumeMode: Filesystem
  volumeSnapshotClassName: huaweicloud-evs-snapshot
  volumeSnapshotRef:
    apiVersion: snapshot.storage.k8s.io/v1
    kind: VolumeSnapshot
    name: new-snapshot-demo
    namespace: default
    resourceVersion: '10839446'
    uid: 20731ac4-d110-480d-ab80-xxxxx
status:
  error:
    message: >-
      Failed to check and update snapshot content: failed to add
      VolumeSnapshotBeingCreated annotation on the content
      snapcontent-20731ac4-d110-480d-ab80-xxxxx: "snapshot controller
      failed to update snapcontent-20731ac4-d110-480d-ab80-xxxxx on API
      server: VolumeSnapshotContent.snapshot.storage.k8s.io
      \"snapcontent-20731ac4-d110-480d-ab80-xxxxx\" is invalid: spec:
      Invalid value: \"object\": sourceVolumeMode is required once set"
    time: '2024-09-29T03:05:19Z'
  readyToUse: false

@huntkalio
Copy link
Author

huntkalio commented Sep 29, 2024

finaly, I solve this by (update csi-snapshotter version same with snapshotter controller ):

  1. update https://github.com/huaweicloud/huaweicloud-csi-driver/blob/master/deploy/evs-csi-plugin/kubernetes/csi-evs-controller.yaml k8s.gcr.io/sig-storage/csi-snapshotter:v4.2.1 to v8.0.1
  2. update https://github.com/huaweicloud/huaweicloud-csi-driver/blob/master/deploy/evs-csi-plugin/kubernetes/rbac-csi-evs-controller.yaml csi-snapshotter-role like below
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: csi-snapshotter-role
rules:
  - apiGroups: [""]
    resources: ["events"]
    verbs: ["list", "watch", "create", "update", "patch"]
  - apiGroups: ["snapshot.storage.k8s.io"]
    resources: ["volumesnapshotclasses"]
    verbs: ["get", "list", "watch"]
  - apiGroups: ["snapshot.storage.k8s.io"]
    resources: ["volumesnapshots"]
    verbs: ["get", "list", "watch", "update", "patch", "create"]
  - apiGroups: ["snapshot.storage.k8s.io"]
    resources: ["volumesnapshotcontents"]
    verbs: ["get", "list", "watch", "update", "patch", "create"]
  - apiGroups: ["snapshot.storage.k8s.io"]
    resources: ["volumesnapshotcontents/status"]
    verbs: ["update", "patch"]
  - apiGroups: ["groupsnapshot.storage.k8s.io"]
    resources: ["volumegroupsnapshotclasses"]
    verbs: ["get", "list", "watch"]
  - apiGroups: ["groupsnapshot.storage.k8s.io"]
    resources: ["volumegroupsnapshotcontents"]
    verbs: ["get", "list", "watch", "update", "patch"]
  - apiGroups: ["groupsnapshot.storage.k8s.io"]
    resources: ["volumegroupsnapshotcontents/status"]
    verbs: ["update", "patch"]
  - apiGroups: ["coordination.k8s.io"]
    resources: ["leases"]
    verbs: ["get", "watch", "list", "delete", "update", "create"]

from https://github.com/kubernetes-csi/external-snapshotter/blob/v8.1.0/deploy/kubernetes/csi-snapshotter/rbac-csi-snapshotter.yaml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants