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.
Fast Forward
If you have already deployed the Snapshot Controller and the v1beta1
Volume Snapshot CRDs, expand this box to fast-forward.
- Proceed to the Verify section.
Choose one of the following options to deploy the Snapshot Controller and the
v1beta1
Volume Snapshot CRDs:
- Option 1: Deploy Snapshot Controller Automatically (preferred).
- Option 2: Deploy Snapshot Controller Manually.
Overview
What You’ll Need¶
- A configured management environment.
- Your clone of the Arrikto GitOps repository.
- An existing Kubernetes cluster.
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:
Proceed to the Summary section.
v1beta1
Volume Snapshot CRDs manually.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¶
Apply the kustomization:
root@rok-tools:~/ops/deployments# rok-deploy --apply rok/snapshot-controller/overlays/deploy
Apply the kustomization:
root@rok-tools:~/ops/deployments# rok-deploy --apply rok/snapshot-controller/overlays/deploy
v1beta1
Volume
Snapshot CRDs predeployed, so there is nothing to do.Verify¶
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 1mVerify 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 OKVerify 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 OKVerify 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
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 1mVerify 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 OKVerify 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 OKVerify 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
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 OKVerify 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 OKVerify 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