Deploy Snapshot Controller

This guide will walk you through deploying the Snapshot Controller and the v1beta1 Volume Snapshot CRDs.

Note

When Volume Snapshot got promoted to Beta in Kubernetes 1.17, the CSI external-snapshotter sidecar got split into two controllers: a snapshot-controller and a CSI external-snapshotter sidecar.

The Snapshot Controller watches the Kubernetes API server for VolumeSnapshot and VolumeSnapshotContent CR objects. The CSI external-snapshotter sidecar only watches the Kubernetes API server for VolumeSnapshotContent CR objects. The Snapshot Controller creates the VolumeSnapshotContent CR object which triggers the CSI external-snapshotter sidecar to create a snapshot on the storage system.

Moreover, in Alpha version, the VolumeSnapshot, VolumeSnapshotContent and VolumeSnapshotClass CRDs used to be created by the external-snapshotter sidecar. In Beta, these CRDs must be deployed by applying manifests, for cloud providers that don’t ship with the CRDs pre-installed.

Choose one of the following options to deploy the Snapshot Controller and the v1beta1 Volume Snapshot CRDs:

Option 1: Deploy Snapshot Controller Automatically (preferred)

Choose one of the following options, based on your cloud provider.

Deploy the Snapshot Controller and the v1beta1 Volume Snapshot CRDs by following the on-screen instructions on the rok-deploy user interface.

If rok-deploy is not already running, start it with:

root@rok-tools:~# rok-deploy --run-from snapshotcontroller
../../_images/snapshotcontroller.png

Proceed to the Summary section.

Rok does not currently support automatic deployment on Azure Cloud. Please follow the instructions in the Option 2: Deploy Snapshot Controller Manually section to deploy the Snapshot Controller and the v1beta1 Volume Snapshot CRDs manually.
Rok does not currently support automatic deployment on Google Cloud. Please follow the instructions in the Option 2: Deploy Snapshot Controller Manually section to deploy the Snapshot Controller and the v1beta1 Volume Snapshot CRDs manually.

Option 2: Deploy Snapshot Controller Manually

If you want to deploy the Snapshot Controller and the v1beta1 Volume Snapshot CRDs manually, follow the instructions below.

Procedure

  1. Apply the kustomization:

    root@rok-tools:~/ops/deployments# rok-deploy --apply rok/snapshot-controller/overlays/deploy
  1. Apply the kustomization:

    root@rok-tools:~/ops/deployments# rok-deploy --apply rok/snapshot-controller/overlays/deploy
GKE clusters have the Snapshot Controller and the v1beta1 Volume Snapshot CRDs predeployed, so there is nothing to do.

Verify

  1. Verify that the Snapshot Controller is up-and-running. Ensure that field READY is 1/1:

    root@rok-tools:~# kubectl get sts -n kube-system snapshot-controller NAME READY AGE snapshot-controller 1/1 1m
  2. Verify that you have successfully deployed the v1beta1 VolumeSnapshot CRD:

    root@rok-tools:~# kubectl get crd \ > -o json volumesnapshots.snapshot.storage.k8s.io \ > | jq -e ".spec.versions[].name \ > | select(. == \"v1beta1\")" > /dev/null \ > && echo OK \ > || echo FAIL OK
  3. Verify that you have successfully deployed the v1beta1 VolumeSnapshotContent CRD:

    root@rok-tools:~# kubectl get crd \ > -o json volumesnapshotcontents.snapshot.storage.k8s.io \ > | jq -e ".spec.versions[].name \ > | select(. == \"v1beta1\")" > /dev/null \ > && echo OK \ > || echo FAIL OK
  4. Verify that you have successfully deployed the v1beta1 VolumeSnapshotClass CRD:

    root@rok-tools:~# kubectl get crd \ > -o json volumesnapshotclasses.snapshot.storage.k8s.io \ > | jq -e ".spec.versions[].name \ > | select(. == \"v1beta1\")" > /dev/null \ > && echo OK \ > || echo FAIL OK
  1. Verify that the Snapshot Controller is up-and-running. Ensure that field READY is 1/1:

    root@rok-tools:~# kubectl get sts -n kube-system snapshot-controller NAME READY AGE snapshot-controller 1/1 1m
  2. Verify that you have successfully deployed the v1beta1 VolumeSnapshot CRD:

    root@rok-tools:~# kubectl get crd \ > -o json volumesnapshots.snapshot.storage.k8s.io \ > | jq -e ".spec.versions[].name \ > | select(. == \"v1beta1\")" > /dev/null \ > && echo OK \ > || echo FAIL OK
  3. Verify that you have successfully deployed the v1beta1 VolumeSnapshotContent CRD:

    root@rok-tools:~# kubectl get crd \ > -o json volumesnapshotcontents.snapshot.storage.k8s.io \ > | jq -e ".spec.versions[].name \ > | select(. == \"v1beta1\")" > /dev/null \ > && echo OK \ > || echo FAIL OK
  4. Verify that you have successfully deployed the v1beta1 VolumeSnapshotClass CRD:

    root@rok-tools:~# kubectl get crd \ > -o json volumesnapshotclasses.snapshot.storage.k8s.io \ > | jq -e ".spec.versions[].name \ > | select(. == \"v1beta1\")" > /dev/null \ > && echo OK \ > || echo FAIL OK
  1. Verify that GKE has deployed the v1beta1 VolumeSnapshot CRD:

    root@rok-tools:~# kubectl get crd \ > -o json volumesnapshots.snapshot.storage.k8s.io \ > | jq -e ".spec.versions[].name \ > | select(. == \"v1beta1\")" > /dev/null \ > && echo OK \ > || echo FAIL OK
  2. Verify that GKE has deployed the v1beta1 VolumeSnapshotContent CRD:

    root@rok-tools:~# kubectl get crd \ > -o json volumesnapshotcontents.snapshot.storage.k8s.io \ > | jq -e ".spec.versions[].name \ > | select(. == \"v1beta1\")" > /dev/null \ > && echo OK \ > || echo FAIL OK
  3. Verify that GKE has deployed the v1beta1 VolumeSnapshotClass CRD:

    root@rok-tools:~# kubectl get crd \ > -o json volumesnapshotclasses.snapshot.storage.k8s.io \ > | jq -e ".spec.versions[].name \ > | select(. == \"v1beta1\")" > /dev/null \ > && echo OK \ > || echo FAIL OK

Summary

You have successfully deployed the Snapshot Controller and the v1beta1 Volume Snapshot CRDs on your cluster.

What’s Next

The next step is to deploy Rok Disk Manager.