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
  2. Mark your progress:

    root@rok-tools:~/ops/deployments# export DATE=$(date -u "+%Y-%m-%dT%H.%M.%SZ")
    root@rok-tools:~/ops/deployments# git tag \ > -a deploy/${DATE?}/release-2.0/snapshotcontroller \ > -m "Deploy Snapshot Controller"
  3. Save your state:

    root@rok-tools:~/ops/deployments# rok-j2 deploy/env.snapshotcontroller.j2 \ > -o deploy/env.snapshotcontroller
  4. Commit your changes:

    root@rok-tools:~/ops/deployments# git commit -am "Deploy Snapshot Controller"
AKS clusters have the Snapshot Controller and the v1beta1 Volume Snapshot CRDs predeployed, so there is nothing to do.
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 -ne "input? | .spec.versions[] \ > | select(.name == \"v1beta1\" and .served == true)" > /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 -ne "input? | .spec.versions[] \ > | select(.name == \"v1beta1\" and .served == true)" > /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 -ne "input? | .spec.versions[] \ > | select(.name == \"v1beta1\" and .served == true)" > /dev/null \ > && echo OK \ > || echo FAIL OK
  1. Verify that AKS has deployed the v1beta1 VolumeSnapshot CRD:

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

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

    root@rok-tools:~# kubectl get crd \ > -o json volumesnapshotclasses.snapshot.storage.k8s.io \ > | jq -ne "input? | .spec.versions[] \ > | select(.name == \"v1beta1\" and .served == true)" > /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 -ne "input? | .spec.versions[] \ > | select(.name == \"v1beta1\" and .served == true)" > /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 -ne "input? | .spec.versions[] \ > | select(.name == \"v1beta1\" and .served == true)" > /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 -ne "input? | .spec.versions[] \ > | select(.name == \"v1beta1\" and .served == true)" > /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 create an IAM role for EBS CSI Driver.