Skip to content

installer: add a test to ensure that CSI is working as expected prior to installing Gitpod #10614

Open
@jenting

Description

@jenting

Is your feature request related to a problem? Please describe

Add a test to ensure that the CSI is working as expected prior to installing Gitpod

Describe the behaviour you'd like

Have a pre-installed/preflight test to ensure that the CSI is working as expected prior to installing Gitpod
The required CSI criteria are similar to #10201, here are the test criteria:

  • Have a storage class with Delete policy? 🤔
  • Have a volume snapshot class with Delete policy? 🤔
  • Support CSI snapshot backup/restore without a problem.
    • Create Pod csi-test-pod with PVC csi-test-pvc, and write some data to the PVC csi-test-pvc.
      ---
      apiVersion: v1
      kind: Pod
      metadata:
        name: csi-test-pod
      spec:
        containers:
          - name: web-server
            image: nginx
            volumeMounts:
              - name: pvc
                mountPath: /var/lib/www/html
        volumes:
          - name: pvc
            persistentVolumeClaim:
              claimName: csi-test-pvc
              readOnly: false
      ---
      apiVersion: v1
      kind: PersistentVolumeClaim
      metadata:
        name: csi-test-pvc
      spec:
        accessModes:
          - ReadWriteOnce
        resources:
          requests:
            storage: 1Gi
        storageClassName: <name-from-config-storageClass>
    • Create VolumeSnapshot csi-test-vs for the PVC csi-test-pvc, it can back up the snapshot success, and the VolumeSnapshotContent be created.
      ---
      # 1.17 <= K8s <= v1.19
      # apiVersion: snapshot.storage.k8s.io/v1beta1
      # K8s >= v1.20
      apiVersion: snapshot.storage.k8s.io/v1
      kind: VolumeSnapshot
      metadata:
        name: csi-test-vs
      spec:
        volumeSnapshotClassName: <name-from-config-snapshotClass>
        source:
          persistentVolumeClaimName: csi-test-pvc
    • Delete Pod csi-test-pod and PVC csi-test-pvc.
      kubectl delete pvc csi-test-pvc
      kubectl delete pod csi-test-pod
    • Create another Pod csi-test-pod-restore and PVC csi-test-pvc-restore with data source as VolumeSnapshot csi-test-vs, and check the PVC csi-test-pvc-restore with correct data content.
      ---
      apiVersion: v1
      kind: Pod
      metadata:
       name: csi-test-pod-restore
      spec:
       containers:
         - name: web-server
           image: nginx
           volumeMounts:
             - name: pvc
               mountPath: /var/lib/www/html
       volumes:
         - name: pvc
           persistentVolumeClaim:
             claimName: csi-test-pvc-restore
             readOnly: false
      ---
      apiVersion: v1
      kind: PersistentVolumeClaim
      metadata:
        name: csi-test-pvc-restore
      spec:
        storageClassName: <name-from-config-storageClass>
        dataSource:
          name: csi-test-vs
          kind: VolumeSnapshot
          apiGroup: snapshot.storage.k8s.io
        accessModes:
          - ReadWriteOnce
        resources:
          requests:
            storage: 1Gi
  • Add CSI driver requirement to the Notion's Product Compatibility Matrix

Describe alternatives you've considered

N/A

Additional context

#10201
#7901

Metadata

Metadata

Assignees

No one assigned

    Labels

    meta: never-staleThis issue can never become staleteam: workspaceIssue belongs to the Workspace team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions