Container Storage Interface (CSI) Support

Apart from direct infrastructure integration, K10 also supports invoking volume snapshots operations via the Container Storage Interface (CSI). To ensure that this works correctly, please ensure the following requirements are met.

Note

Support for the Container Storage Interface (CSI) is currently only available for preview. We welcome your feedback on this feature and expect it to become generally available in the near future.

Requirements

  • Kubernetes v1.14.0 or higher

  • The VolumeSnapshotDataSource feature has been enabled in the Kubernetes cluster

  • A CSI driver that has Volume Snapshot support. Please look at the list of CSI drivers to confirm snapshot support.

CSI Snapshot Configuration

  1. Ensure that the csi-snapshotter container for all CSI drivers you might have installed has a minimum version of v1.2.1. If your CSI driver ships with an older version that has known bugs, it might be possible to transparently upgrade in place using the following code.

    # For example, if you installed the GCP Persistent Disk CSI driver
    # in namespace ${DRIVER_NS} with a statefulset (or deployment)
    # name ${DRIVER_NAME}, you can check the snapshotter version as below:
    $ kubectl get statefulset ${DRIVER_NAME} --namespace=${DRIVER_NS} \
        -o jsonpath='{range .spec.template.spec.containers[*]}{.image}{"\n"}{end}'
    gcr.io/gke-release/csi-provisioner:v1.0.1-gke.0
    gcr.io/gke-release/csi-attacher:v1.0.1-gke.0
    quay.io/k8scsi/csi-snapshotter:v1.0.1
    gcr.io/dyzz-csi-staging/csi/gce-pd-driver:latest
    
    # Snapshotter version is old (v1.0.1), let's update it to the required version.
    $ kubectl set image statefulset/${DRIVER_NAME} csi-snapshotter=quay.io/k8scsi/csi-snapshotter:v1.2.1 \
      --namespace=${DRIVER_NS}
    
  2. For each CSI driver, ensure that a VolumeSnapshotClass has been added with K10 annotation and deletionPolicy set to Retain.

    Whenever K10 detects volumes that were provisioned via a CSI driver, it will look for a VolumeSnapshotClass with K10 annotation for the identified CSI driver and use it to create snapshots.

    Note

    Currently, if no VolumeSnapshotClass or more than one has the K10 annotation, snapshot operations will fail.

    If a VolumeSnapshotClass already exists, you can easily annotate it using:

    $ kubectl annotate volumesnapshotclass ${VSC_NAME} k10.kasten.io/is-snapshot-class=true
    

    The code below illustrates how to create a VolumeSnapshotClass for K10.

    # Create a VolumeSnapshotClass
    $ cat <<EOF | kubectl create -f --
      apiVersion: snapshot.storage.k8s.io/v1alpha1
      kind: VolumeSnapshotClass
      metadata:
        annotations:
          k10.kasten.io/is-snapshot-class: "true"
        name: k10-snapshot-class
      snapshotter: pd.csi.storage.gke.io
      deletionPolicy: Retain
    
    # List the VolumeSnapshotClasses with K10 annotation
    $ kubectl get volumesnapshotclass -o json | \
        jq '.items[] | select (.metadata.annotations["k10.kasten.io/is-snapshot-class"]=="true") | .metadata.name'
    k10-snapshot-class
    
  3. If you want to migrate applications across between clusters, please ensure that the VolumeSnapshotClass names match between the clusters. As the VolumeSnapshotClass is also used for restoring volumes, an identical name is required.