You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: book/src/external-snapshotter.md
+11-5Lines changed: 11 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,13 +34,17 @@ To use the snapshot beta and GA feature, a snapshot controller is also required.
34
34
35
35
### Description
36
36
37
-
Starting with the Beta version, the snapshot controller will be watching the Kubernetes API server for `VolumeSnapshot` and `VolumeSnapshotContent` CRD objects. The CSI `external-snapshotter` sidecar only watches the Kubernetes API server for `VolumeSnapshotContent` CRD objects. The CSI `external-snapshotter` sidecar is also responsible for calling the CSI RPCs CreateSnapshot, DeleteSnapshot, and ListSnapshots.
37
+
The CSI `external-snapshotter` sidecar watches the Kubernetes API server for `VolumeSnapshotContent` CRD objects. The CSI `external-snapshotter` sidecar is also responsible for calling the CSI RPCs `CreateSnapshot`, `DeleteSnapshot`, and `ListSnapshots`.
38
38
39
-
#### VolumeSnapshotClass Parameters
39
+
Volume Group Snapshot support can be enabled with the `--enable-volume-group-snapshots` option. When enabled, the CSI `external-snapshotter` sidecar watches the API server for `VolumeGroupSnapshotContent` CRD object, and will be responsible for calling the CSI RPCs `CreateVolumeGroupSnapshot`, `DeleteVolumeGroupSnapshot` and `GetVolumeGroupSnapshot`.
40
+
41
+
#### VolumeSnapshotClass and VolumeGroupSnapshotClass Parameters
40
42
41
43
When provisioning a new volume snapshot, the CSI `external-snapshotter` sets the `map<string, string> parameters` field in the CSI `CreateSnapshotRequest` call to the key/values specified in the `VolumeSnapshotClass` it is handling.
42
44
43
-
The CSI `external-snapshotter` also reserves the parameter keys prefixed with `csi.storage.k8s.io/`. Any `VolumeSnapshotClass` keys prefixed with `csi.storage.k8s.io/` are not passed to the CSI driver as an opaque `parameter`.
45
+
When volume group snapshot support is enabled, the `map<string, string> parameters` field is set in the CSI `CreateVolumeGroupSnapshotRequest` call to the key/values specified in the `VolumeGroupSnapshotClass` it is handling.
46
+
47
+
The CSI `external-snapshotter` also reserves the parameter keys prefixed with `csi.storage.k8s.io/`. Any `VolumeSnapshotClass` or `VolumeGroupSnapshotClass` keys prefixed with `csi.storage.k8s.io/` are not passed to the CSI driver as an opaque `parameter`.
44
48
45
49
The following reserved `VolumeSnapshotClass` parameter keys trigger behavior in the CSI `external-snapshotter`:
46
50
@@ -51,9 +55,9 @@ The following reserved `VolumeSnapshotClass` parameter keys trigger behavior in
51
55
52
56
For more information on how secrets are handled see [Secrets & Credentials](secrets-and-credentials.md).
#### VolumeSnapshot, VolumeSnapshotContent, VolumeGroupSnapshot and VolumeGroupSnapshotContent Parameters
55
59
56
-
The CSI `external-snapshotter` (v4.0.0+) introduces the `--extra-create-metadata` flag, which automatically sets the following `map<string, string> parameters` in the CSI `CreateSnapshotRequest`:
60
+
The CSI `external-snapshotter` (v4.0.0+) introduces the `--extra-create-metadata` flag, which automatically sets the following `map<string, string> parameters` in the CSI `CreateSnapshotRequest` and `CreateVolumeGroupSnapshotRequest`:
57
61
58
62
*`csi.storage.k8s.io/volumesnapshot/name`
59
63
*`csi.storage.k8s.io/volumesnapshot/namespace`
@@ -69,6 +73,8 @@ For detailed information about volume snapshot and restore functionality, see [V
69
73
70
74
CSI drivers that support provisioning volume snapshots and the ability to provision new volumes using those snapshots should use this sidecar container, and advertise the CSI `CREATE_DELETE_SNAPSHOT` controller capability.
71
75
76
+
CSI drivers that support provisioning volume group snapshots should use this side container too, and advertise the CSI `CREATE_DELETE_GET_VOLUME_GROUP_SNAPSHOT` controller capability.
77
+
72
78
For detailed information (binary parameters, RBAC rules, etc.), see [https://github.com/kubernetes-csi/external-snapshotter/blob/release-6.2/README.md](https://github.com/kubernetes-csi/external-snapshotter/blob/release-6.2/README.md).
Copy file name to clipboardExpand all lines: book/src/group-snapshot.md
+69-21Lines changed: 69 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,9 @@
4
4
5
5
Status | Min K8s Version | Max K8s Version | snapshot-controller Version | snapshot-validation-webhook Version | CSI external-snapshotter sidecar Version | external-provisioner Version
6
6
--|--|--|--|--|--|--
7
-
Alpha | 1.27 | - | 7.0+ | 7.0+ | 7.0+ | 3.5+
7
+
Alpha | 1.27 | - | 7.0+ | 7.0+ | 7.0+ | 4.0+
8
+
9
+
**IMPORTANT**: The validation logic for VolumeGroupSnapshots and VolumeGroupSnapshotContents has been replaced by CEL validation rules. The validating webhook is now only being used for VolumeGroupSnapshotClasses to ensure that there's at most one class per CSI Driver. The validation webhook is deprecated and will be removed in the next release
8
10
9
11
## Overview
10
12
@@ -14,12 +16,16 @@ are taken at the same point-in-time. A group snapshot can be used either to rehy
14
16
new volumes (pre-populated with the snapshot data) or to restore existing volumes to
15
17
a previous state (represented by the snapshots).
16
18
17
-
Kubernetes CSI currently enables CSI Drivers to expose the following functionality via the Kubernetes API:
19
+
Kubernetes CSI currently enables CSI Drivers to expose the following
20
+
functionality via the Kubernetes API:
18
21
19
-
1. Creation and deletion of volume group snapshots via [Kubernetes native API](https://github.com/kubernetes-csi/external-snapshotter/tree/master/client/apis/volumegroupsnapshot/v1alpha1).
20
-
2. Creation of new volumes pre-populated with the data from a snapshot that is part of the volume group snapshot via Kubernetes [dynamic volume provisioning](https://kubernetes.io/docs/concepts/storage/dynamic-provisioning/).
22
+
1. Creation and deletion of volume group snapshots via [Kubernetes native
## Implementing Volume Group Snapshot Functionality in Your CSI Driver
28
+
## Implementing Volume Group Snapshot Functionality in your CSI Driver
23
29
24
30
To implement the volume group snapshot feature, a CSI driver MUST:
25
31
@@ -31,13 +37,21 @@ For details, see the [CSI spec](https://github.com/container-storage-interface/
31
37
32
38
## Sidecar Deployment
33
39
34
-
The Kubernetes CSI development team maintains the [external-snapshotter](external-snapshotter.md) Kubernetes CSI [Sidecar Containers](sidecar-containers.md). This sidecar container implements the logic for watching the Kubernetes API objects and issuing the appropriate CSI volume group snapshot calls against a CSI endpoint. For more details, see [external-snapshotter documentation](external-snapshotter.md).
With the introduction of Volume Group Snapshot, the user can create and delete a group snapshot using Kubernetes APIs.
49
+
With the introduction of Volume Group Snapshot, the user can create and delete a
50
+
group snapshot using Kubernetes APIs.
39
51
40
-
The schema definition for the custom resources (CRs) can be found [here](https://github.com/kubernetes-csi/external-snapshotter/tree/master/client/config/crd). The CRDs should be installed by the Kubernetes distributions.
52
+
The schema definition for the custom resources (CRs) can be found
The CRDs should be installed by the Kubernetes distributions.
41
55
42
56
There are 3 APIs:
43
57
@@ -63,21 +77,34 @@ created. including the driver information, the deletion policy, etc.
63
77
64
78
## Controller
65
79
66
-
* The controller logic for volume group snapshot is added to the snapshot controller and the CSI external-snapshotter sidecar.
80
+
* The controller logic for volume group snapshot is added to the snapshot
81
+
controller and the CSI external-snapshotter sidecar.
67
82
68
-
The snapshot controller is deployed by the Kubernetes distributions and is responsible for watching the VolumeGroupSnapshot CRD objects and manges the creation and deletion lifecycle of volume group snapshots.
83
+
The snapshot controller is deployed by the Kubernetes distributions and is
84
+
responsible for watching the VolumeGroupSnapshot CRD objects and manges the
85
+
creation and deletion lifecycle of volume group snapshots.
69
86
70
-
The CSI external-snapshotter sidecar watches Kubernetes VolumeGroupSnapshotContent CRD objects and triggers CreateVolumeGroupSnapshot/DeleteVolumeGroupSnapshot against a CSI endpoint.
87
+
The CSI external-snapshotter sidecar watches Kubernetes
88
+
VolumeGroupSnapshotContent CRD objects and triggers
89
+
CreateVolumeGroupSnapshot/DeleteVolumeGroupSnapshot against a CSI endpoint.
71
90
72
91
## Snapshot Validation Webhook
73
92
74
-
The validating webhook server is updated to validate volume group snapshot objects. This SHOULD be installed by the Kubernetes distros along with the snapshot-controller, not end users. It SHOULD be installed in all Kubernetes clusters that has the volume group snapshot feature enabled. See [Snapshot Validation Webhook](snapshot-validation-webhook.md) for more details on how to use the webhook.
93
+
The validating webhook server is updated to validate volume group snapshot
94
+
objects. This SHOULD be installed by the Kubernetes distros along with the
95
+
snapshot-controller, not end users. It SHOULD be installed in all Kubernetes
96
+
clusters that has the volume group snapshot feature enabled. See [Snapshot
97
+
Validation Webhook](snapshot-validation-webhook.md) for more details on how to
98
+
use the webhook.
75
99
76
100
## Kubernetes Cluster Setup
77
101
78
-
See the Deployment section of [Snapshot Controller](snapshot-controller.md) on how to set up the snapshot controller and CRDs.
102
+
See the Deployment section of [Snapshot Controller](snapshot-controller.md) on
103
+
how to set up the snapshot controller and CRDs.
79
104
80
-
See the Deployment section of [Snapshot Validation Webhook](snapshot-validation-webhook.md) for more details on how to use the webhook.
105
+
See the Deployment section of [Snapshot Validation
106
+
Webhook](snapshot-validation-webhook.md) for more details on how to use the
107
+
webhook.
81
108
82
109
## Test Volume Group Snapshot Feature
83
110
@@ -88,32 +115,53 @@ Create a _StorageClass_:
88
115
kubectl create -f storageclass.yaml
89
116
```
90
117
91
-
Create _PVC_:
118
+
Create _PVCs_:
92
119
```
120
+
# This will create a PVC named hpvc
93
121
kubectl create -f pvc.yaml
94
-
kubectl create -f pvc2.yaml
122
+
123
+
# This will create a PVC named hpvc-2
124
+
sed "s/hpvc/hpvc-2/" pvc.yaml | kubectl create -f -
Copy file name to clipboardExpand all lines: book/src/sidecar-containers.md
+5-2Lines changed: 5 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,11 @@
1
1
# Kubernetes CSI Sidecar Containers
2
2
3
-
Kubernetes CSI Sidecar Containers are a set of standard containers that aim to simplify the development and deployment of CSI Drivers on Kubernetes.
3
+
Kubernetes CSI Sidecar Containers are a set of standard containers that aim to
4
+
simplify the development and deployment of CSI Drivers on Kubernetes.
4
5
5
-
These containers contain common logic to watch the Kubernetes API, trigger appropriate operations against the “CSI volume driver” container, and update the Kubernetes API as appropriate.
6
+
These containers contain common logic to watch the Kubernetes API, trigger
7
+
appropriate operations against the “CSI volume driver” container, and update the
8
+
Kubernetes API as appropriate.
6
9
7
10
The containers are intended to be bundled with third-party CSI driver containers and deployed together as pods.
Copy file name to clipboardExpand all lines: book/src/snapshot-controller.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,10 +34,14 @@ For more information on the CSI external-snapshotter sidecar, see [this external
34
34
35
35
The snapshot controller will be watching the Kubernetes API server for `VolumeSnapshot` and `VolumeSnapshotContent` CRD objects. The CSI `external-snapshotter` sidecar only watches the Kubernetes API server for `VolumeSnapshotContent` CRD objects. The snapshot controller will be creating the `VolumeSnapshotContent` CRD object which triggers the CSI `external-snapshotter` sidecar to create a snapshot on the storage system.
36
36
37
+
The snapshot controller will be watching for `VolumeGroupSnapshot` and `VolumeGroupSnapshotContent` CRD objects when Volume Group Snapshot support is enabled via the `--enable-volume-group-snapshots` option.
38
+
37
39
For detailed snapshot beta design changes, see the design doc [here](https://github.com/kubernetes/enhancements/blob/master/keps/sig-storage/177-volume-snapshot/README.md).
38
40
39
41
For detailed information about volume snapshot and restore functionality, see [Volume Snapshot & Restore](snapshot-restore-feature.md).
40
42
43
+
For detailed information about volume group snapshot and restore functionality, see [Volume Snapshot & Restore](group-snapshot.md).
44
+
41
45
For detailed information (binary parameters, RBAC rules, etc.), see [https://github.com/kubernetes-csi/external-snapshotter/blob/release-6.2/README.md](https://github.com/kubernetes-csi/external-snapshotter/blob/release-6.2/README.md).
Alpha | 1.13 | 1.16 | | | 1.0.1 <= version < 2.0 | 1.0.1 <= version < 1.5
9
9
Beta | 1.17 | - | 2.0+ | 3.0+ | 2.0+ | 1.5+
10
10
11
+
**IMPORTANT**: The validation logic for VolumeSnapshots and VolumeSnapshotContents has been replaced by CEL validation rules. The validating webhook is now only being used for VolumeSnapshotClasses to ensure that there's at most one class per CSI Driver. The validation webhook is deprecated and will be removed in the next release.
12
+
11
13
## Overview
12
14
13
15
Many storage systems provide the ability to create a "snapshot" of a persistent volume. A snapshot represents a point-in-time copy of a volume. A snapshot can be used either to provision a new volume (pre-populated with the snapshot data) or to restore the existing volume to a previous state (represented by the snapshot).
0 commit comments