Skip to content

Conversation

@MusicDin
Copy link
Member

@MusicDin MusicDin commented Nov 27, 2025

Adds CSI volume snapshot documentation:

  • New Helm chart values
  • Examples for VolumeSnapshotClass and VolumeSnapshot
  • Explanation of Kubernetes snapshot primitives

Related PR:

Signed-off-by: Din Music <din.music@canonical.com>
@github-actions github-actions bot added the Documentation Documentation needs updating label Nov 27, 2025
@MusicDin MusicDin requested a review from Copilot November 27, 2025 10:35
Copilot finished reviewing on behalf of MusicDin November 27, 2025 10:36
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds comprehensive documentation for CSI volume snapshot support in the LXD CSI driver, enabling users to create and manage snapshots of persistent volumes in Kubernetes.

Key changes:

  • Adds Helm chart configuration options for the CSI snapshotter and snapshot controller components
  • Provides VolumeSnapshotClass and VolumeSnapshot configuration examples with various use cases
  • Documents the Kubernetes snapshot primitives (VolumeSnapshotClass, VolumeSnapshot, VolumeSnapshotContent) and their role in the CSI architecture

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
doc/reference/driver_csi.md Adds Helm chart values for CSI snapshotter sidecar and snapshot controller configuration
doc/howto/storage_csi.md Adds how-to sections for VolumeSnapshotClass and VolumeSnapshot configuration with examples for default classes and retention policies
doc/explanation/csi.md Updates capability table to mark volume snapshots as supported and documents snapshot-related Kubernetes primitives
doc/.custom_wordlist.txt Adds CRDs, VolumeSnapshotClass, and VolumeSnapshotContent to the custom wordlist for spell checking

Signed-off-by: Din Music <din.music@canonical.com>
…t values

Signed-off-by: Din Music <din.music@canonical.com>
…on examples

Signed-off-by: Din Music <din.music@canonical.com>
Signed-off-by: Din Music <din.music@canonical.com>
@MusicDin MusicDin marked this pull request as ready for review November 27, 2025 11:27
@tomponline
Copy link
Member

I'll wait for @minaelee review of this.

metadata:
name: lxd-csi-snapshotclass
driver: lxd.csi.canonical.com # Name of the LXD CSI driver.
deletionPolicy: Delete # Possible values are "Retain" and "Delete" (default).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deletion Policy is mandatory, otherwise you get a The VolumeSnapshotClass "lxd-csi-snapshotclass" is invalid: deletionPolicy: Required value

`node.csiLivenessProbe.image.tag` | string | Chart release dependent | CSI liveness probe image tag
`node.csiLivenessProbe.image.pullPolicy` | string | `IfNotPresent` | CSI liveness probe image pull policy
`node.csiLivenessProbe.resources` | object | `{}` | CSI liveness probe resource limits and requests
`snapshotter.enabled` | bool | `false` | Whether to enable support for volume snapshots. If enabled, CSI snapshot controller is deployed along with CSI driver itself.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice to include an example of how to install the helm chart with that option on


A [VolumeSnapshot &#8599;](https://kubernetes.io/docs/concepts/storage/volume-snapshots) represents a user request for a snapshot of a specific PVC.
Each volume snapshot references a VolumeSnapshotClass and a source PVC.
The snapshot controller invokes the CSI driver to create a snapshot from a source volume using the parameters defined in this class.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The snapshot controller invokes the CSI driver to create a snapshot from a source volume using the parameters defined in this class.
The snapshot controller invokes the CSI driver to create a snapshot from a source volume, using the parameters defined in this class.

```

*This resource requires the VolumeSnapshot CRDs to be installed and the snapshot controller to be running.*
*Using the Helm chart, this is enabled by setting `snapshotter.enabled` to `true`.*
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is "this resource"? Do you mean "Using a VolumeSnapshotClass" or something different?

```

*This resource requires the VolumeSnapshot CRDs to be installed and the snapshot controller to be running.*
*Using the Helm chart, this is enabled by setting `snapshotter.enabled` to `true`.*
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
*Using the Helm chart, this is enabled by setting `snapshotter.enabled` to `true`.*
In the {ref}`Helm chart <howto-storage-csi-deploy-helm>`, enable the snapshot controller by by setting `snapshotter.enabled` to `true`.

#### Default VolumeSnapshotClass

The default VolumeSnapshotClass is used when `volumeSnapshotClassName` is not explicitly set in the VolumeSnapshot configuration.
You can mark a Kubernetes VolumeSnapshotClass as the default by setting the `snapshot.storage.kubernetes.io/is-default-class: "true"` annotation.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
You can mark a Kubernetes VolumeSnapshotClass as the default by setting the `snapshot.storage.kubernetes.io/is-default-class: "true"` annotation.
To mark a Kubernetes VolumeSnapshotClass as the default, set the `snapshot.storage.kubernetes.io/is-default-class: "true"` annotation.

In how-tos, prefer direct, imperative instructions over merely describing what is possible.

#### Prevent volume snapshot deletion
By default, the volume snapshot is deleted when the corresponding VolumeSnapshot is removed.
Setting the deletion policy to `Retain` prevents the CSI driver from deleting the underlying LXD volume snapshot, allowing for manual cleanup or data recovery later.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Setting the deletion policy to `Retain` prevents the CSI driver from deleting the underlying LXD volume snapshot, allowing for manual cleanup or data recovery later.
To prevent the CSI driver from deleting the underlying LXD volume, set the deletion policy to `Retain`. This allows for manual cleanup or data recovery later.

In how-tos, prefer direct, imperative instructions over merely describing what is possible.

### VolumeSnapshot configuration

A VolumeSnapshot requests a snapshot of the volume bound to the referenced PVC.
The fields `spec.volumeSnapshotClassName` and `spec.source.persistentVolumeClaimName` select the LXD CSI snapshot class to handle the snapshot and the PVC to snapshot, respectively.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The fields `spec.volumeSnapshotClassName` and `spec.source.persistentVolumeClaimName` select the LXD CSI snapshot class to handle the snapshot and the PVC to snapshot, respectively.
Set the fields `spec.volumeSnapshotClassName` and `spec.source.persistentVolumeClaimName` to the LXD CSI snapshot class to handle the snapshot and the PVC to snapshot, respectively.

Are the values lxd-csi-snapshotclass and lxd-csi-pvc in the code below meant to be examples, or preset options? Are there other options?

persistentVolumeClaimName: lxd-csi-pvc
```

*This resource requires the VolumeSnapshot CRDs to be installed and the snapshot controller to be running.*
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These lines 383 and 384 duplicate lines 335-336 above. We can use a substitution to copy it so that any updates can be made in a single place. This would mean adding the lines to doc/substitutions.yaml then using {{<substitution_name>}} within this page in both places.

```{include}


```

`node.csiLivenessProbe.image.tag` | string | Chart release dependent | CSI liveness probe image tag
`node.csiLivenessProbe.image.pullPolicy` | string | `IfNotPresent` | CSI liveness probe image pull policy
`node.csiLivenessProbe.resources` | object | `{}` | CSI liveness probe resource limits and requests
`snapshotter.enabled` | bool | `false` | Whether to enable support for volume snapshots. If enabled, CSI snapshot controller is deployed along with CSI driver itself.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
`snapshotter.enabled` | bool | `false` | Whether to enable support for volume snapshots. If enabled, CSI snapshot controller is deployed along with CSI driver itself.
`snapshotter.enabled` | bool | `false` | Whether to enable support for volume snapshots. If enabled, the CSI snapshot controller is deployed along with the CSI driver.

`node.csiLivenessProbe.image.pullPolicy` | string | `IfNotPresent` | CSI liveness probe image pull policy
`node.csiLivenessProbe.resources` | object | `{}` | CSI liveness probe resource limits and requests
`snapshotter.enabled` | bool | `false` | Whether to enable support for volume snapshots. If enabled, CSI snapshot controller is deployed along with CSI driver itself.
`snapshotter.installCRDs` | bool | `true` | Whether to install required volume snapshot CRDs. The value is ignored if `snapshotter.enabled` is false. Should be disabled if CRDs are installed manually or by other CSI driver.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
`snapshotter.installCRDs` | bool | `true` | Whether to install required volume snapshot CRDs. The value is ignored if `snapshotter.enabled` is false. Should be disabled if CRDs are installed manually or by other CSI driver.
`snapshotter.installCRDs` | bool | `true` | Whether to install required volume snapshot CRDs. The value is ignored if `snapshotter.enabled` is false. Should be disabled if CRDs are installed manually or by other CSI drivers.

"Should be disabled" as in the user should disable it, or it should be disabled automatically?

@MusicDin MusicDin marked this pull request as draft November 29, 2025 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Documentation Documentation needs updating

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants