-
Notifications
You must be signed in to change notification settings - Fork 971
docs: Add CSI volume snapshot documentation #17085
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Din Music <din.music@canonical.com>
There was a problem hiding this 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>
5feaa30 to
ad45f82
Compare
|
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). |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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 ↗](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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 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`.* |
There was a problem hiding this comment.
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`.* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| *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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 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.* |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| `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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| `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?
Adds CSI volume snapshot documentation:
Related PR: