Deploying Snapshot and Clones Workloads

This example is more complex and is composed of six different stages:

  • Stage 1: Create VolumeSnapshotClass.
  • Stage 2: Create Example PVC and POD.
  • Stage 3: Take a Snapshot from the PVC created in Stage #2.
  • Stage 4: Create a PVC from the Snapshot created in Stage #3 and create a POD that uses it.
  • Stage 5: Create a PVC from the PVC created in Stage #4 and create a POD that uses it.
  • Stage 6: Uninstall Snapshot Workloads.

The examples are dependent on one another, so you must run them in order.

For Helm to deploy the snaps chart in stages, we introduce the mandatory variable snaps.stage The chart supports the following stages:

  • snapshot-class
  • example-pvc
  • snapshot-from-pvc
  • pvc-from-snapshot
  • pvc-from-pvc

Stage 1: Create VolumeSnapshotClass

Create a VolumeSnapshotClass:

Bash
Copy

Stage 2: Create Example PVC and POD

Running the following command:

Bash
Copy

Will output:

Bash
Copy

Verify that PV, PVC are created and in Bounded state, and that POD is in Running state.

Bash
Copy

Stage 3: Take a Snapshot from the PVC created in Stage 2

Create a snapshot from the previously created PVC named example-pvc.

Bash
Copy

Will output:

Bash
Copy

Verify that VolumeSnapshot and VolumeSnapshotContent were created, and READYTOUSE status is true.

Bash
Copy

Stage 4: Create a PVC from the Snapshot created in Stage 3 and create a POD that uses it

Create a PVC from the previously taken Snapshot named example-snapshot.

Bash
Copy

Will output:

Bash
Copy

Verify that PV, PVC are created and in Bounded state, and that POD is in Running state.

Bash
Copy

We see the PV, PVC and PODs from Stage #2 as well.

Stage 5: Create a PVC from the PVC created in Stage 3 and create a POD that uses it

Create a PVC from the previously taken Snapshot named example-snapshot.

Bash
Copy

Will output:

Bash
Copy

Verify that PV, PVC were created and in Bounded state, and that POD is in Running state.

Bash
Copy

We see the PV, PVC and PODs from Stages #2 and #4 as well.

Stage 6: Uninstall Snapshot Workloads

If we list the releases installed, we will see:

Bash
Copy

The installation must be in reverse order of the deployment.

After each uninstall, we need to verify that all related resources were released before continuing to the next uninstall.

Uninstall pvc-from-pvc:

Bash
Copy

In order to verify that all resources are deleted, the following command should return no entry:

Bash
Copy

Uninstall pvc-from-snapshot:

Bash
Copy

In order to verify that all resources are deleted, the following command should return no entry:

Bash
Copy

Uninstall snapshot-from-pvc:

Bash
Copy

In order to verify that all resources are deleted, the following command should return no entry:

Bash
Copy

Uninstall example-pvc:

Bash
Copy

Verify that all resources are gone:

Bash
Copy

Delete VolumeSnapshotClass:

Bash
Copy
Type to search, ESC to discard
Type to search, ESC to discard
Type to search, ESC to discard