vmware-tanzu / velero

Backup and migrate Kubernetes applications and their persistent volumes
https://velero.io
Apache License 2.0
8.78k stars 1.41k forks source link

make upload pod not prebind pvc,because I am using lvm localpv whose volumeBindingMode mode is WaitForFirstConsumer sc #7416

Closed 13567436138 closed 9 months ago

13567436138 commented 9 months ago

Describe the problem/challenge you have

^Croot@storage-b-01:~# kubectl get pod -n velero rook-ceph-backup-pv-pvc-3-bqgz2 -o yaml
apiVersion: v1
kind: Pod
metadata:
  creationTimestamp: "2024-02-10T09:07:52Z"
  labels:
    velero.io/data-upload: rook-ceph-backup-pv-pvc-3-bqgz2
    velero.io/exposer-pod-group: snapshot-exposer
  name: rook-ceph-backup-pv-pvc-3-bqgz2
  namespace: velero
  ownerReferences:
  - apiVersion: velero.io/v2alpha1
    controller: true
    kind: DataUpload
    name: rook-ceph-backup-pv-pvc-3-bqgz2
    uid: 7d1605ba-778c-4200-9b09-82abdb1f2d07
  resourceVersion: "347297"
  uid: 0d3bbc01-9183-46c4-a93b-b0181365913e
spec:
  containers:
  - command:
    - /velero-helper
    - pause
    image: registry.cn-hangzhou.aliyuncs.com/hxpdocker/velero:v1.13.0
    imagePullPolicy: Never
    name: 7d1605ba-778c-4200-9b09-82abdb1f2d07
    resources: {}
    terminationMessagePath: /dev/termination-log
    terminationMessagePolicy: File
    volumeMounts:
    - mountPath: /7d1605ba-778c-4200-9b09-82abdb1f2d07
      name: 7d1605ba-778c-4200-9b09-82abdb1f2d07
    - mountPath: /var/run/secrets/kubernetes.io/serviceaccount
      name: kube-api-access-jj78n
      readOnly: true
  dnsPolicy: ClusterFirst
  enableServiceLinks: true
  preemptionPolicy: PreemptLowerPriority
  priority: 0
  restartPolicy: Always
  schedulerName: default-scheduler
  securityContext: {}
  serviceAccount: velero-server
  serviceAccountName: velero-server
  terminationGracePeriodSeconds: 0
  tolerations:
  - effect: NoExecute
    key: node.kubernetes.io/not-ready
    operator: Exists
    tolerationSeconds: 300
  - effect: NoExecute
    key: node.kubernetes.io/unreachable
    operator: Exists
    tolerationSeconds: 300
  topologySpreadConstraints:
  - labelSelector:
      matchLabels:
        velero.io/exposer-pod-group: snapshot-exposer
    maxSkew: 1
    topologyKey: kubernetes.io/hostname
    whenUnsatisfiable: ScheduleAnyway
  volumes:
  - name: 7d1605ba-778c-4200-9b09-82abdb1f2d07
    persistentVolumeClaim:
      claimName: rook-ceph-backup-pv-pvc-3-bqgz2
  - name: kube-api-access-jj78n
    projected:
      defaultMode: 420
      sources:
      - serviceAccountToken:
          expirationSeconds: 3607
          path: token
      - configMap:
          items:
          - key: ca.crt
            path: ca.crt
          name: kube-root-ca.crt
      - downwardAPI:
          items:
          - fieldRef:
              apiVersion: v1
              fieldPath: metadata.namespace
            path: namespace
status:
  conditions:
  - lastProbeTime: null
    lastTransitionTime: "2024-02-10T09:17:53Z"
    message: '0/4 nodes are available: pod has unbound immediate PersistentVolumeClaims.
      preemption: 0/4 nodes are available: 4 No preemption victims found for incoming
      pod..'
    reason: Unschedulable
    status: "False"
    type: PodScheduled
  phase: Pending
  qosClass: BestEffort
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: openebs-lvmpv
allowVolumeExpansion: true
parameters:
  storage: "lvm"
  volgroup: "openebs-lvm"
provisioner: local.csi.openebs.io
volumeBindingMode: WaitForFirstConsumer
allowedTopologies:
- matchLabelExpressions:
  - key: kubernetes.io/hostname
    values:
       - master-01
       - worker-01
       - worker-02
       - worker-03

https://github.com/vmware-tanzu/velero/discussions/7415

Describe the solution you'd like

Anything else you would like to add:

Environment:

Vote 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.

ywk253100 commented 9 months ago

Could you explain a bit more why this is related to WaitForFirstConsumer?

According to the following error from #7415, it is more likely an issue of the volume provisioner?

Warning   ProvisioningFailed                 persistentvolumeclaim/rook-ceph-backup-pv-pvc-3-gf76l   failed to provision volume with StorageClass "openebs-lvmpv": rpc error: code = Unimplemented desc =
13567436138 commented 9 months ago

but it is prebind

Lyndon-Li commented 9 months ago

lvm-localpv CSI driver doesn't support to clone volume from another source (snapshot or another volume), so the backupPVC provision failed (the driver returned error code Unimplemented):

  Normal   WaitForFirstConsumer  3m35s                persistentvolume-controller                                                         waiting for first consumer to be created before binding
  Warning  ProvisioningFailed    3m34s                local.csi.openebs.io_openebs-lvm-controller-0_24a6e4e0-6bde-4212-b01f-8cabaf937638  failed to provision volume with StorageClass "openebs-lvmpv": error getting handle for DataSource Type VolumeSnapshot by Name rook-ceph-backup-pv-pvc-3-pnp6h: snapshot rook-ceph-backup-pv-pvc-3-pnp6h not bound
  Normal   Provisioning          86s (x8 over 3m34s)  local.csi.openebs.io_openebs-lvm-controller-0_24a6e4e0-6bde-4212-b01f-8cabaf937638  External provisioner is provisioning volume for claim "velero/rook-ceph-backup-pv-pvc-3-pnp6h"
  Warning  ProvisioningFailed    85s (x7 over 3m33s)  local.csi.openebs.io_openebs-lvm-controller-0_24a6e4e0-6bde-4212-b01f-8cabaf937638  failed to provision volume with StorageClass "openebs-lvmpv": rpc error: code = Unimplemented desc =
  Normal   ExternalProvisioning  3s (x17 over 3m35s)  persistentvolume-controller                                                         Waiting for a volume to be created either by the external provisioner 'local.csi.openebs.io' or manually by the system administrator. If volume creation is delayed, please verify that the provisioner is running and correctly registered.

Alternatively, you can use zfs-localpv CSI driver

13567436138 commented 9 months ago

ok I will try