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: content/en/blog/_posts/2023-05-08-volume-group-snapshot-alpha.md
+37-28Lines changed: 37 additions & 28 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
2
layout: blog
3
-
title: "Introducing Volume Group Snapshot"
3
+
title: "Kubernetes 1.27: Introducing An API For Volume Group Snapshots"
4
4
date: 2023-05-08T10:00:00-08:00
5
5
slug: kubernetes-1-27-volume-group-snapshot-alpha
6
6
---
@@ -11,17 +11,17 @@ Volume group snapshot is introduced as an Alpha feature in Kubernetes v1.27.
11
11
This feature introduces a Kubernetes API that allows users to take a crash consistent
12
12
snapshot for multiple volumes together. It uses a label selector to group multiple
13
13
PersistentVolumeClaims for snapshotting.
14
-
This new feature is only supported for CSI volume drivers.
14
+
This new feature is only supported for [CSI](https://kubernetes-csi.github.io/docs/) volume drivers.
15
15
16
-
## What is Volume Group Snapshot
16
+
## An overview of volume group snapshots
17
17
18
18
Some storage systems provide the ability to create a crash consistent snapshot of
19
19
multiple volumes. A group snapshot represents “copies” from multiple volumes that
20
20
are taken at the same point-in-time. A group snapshot can be used either to rehydrate
21
21
new volumes (pre-populated with the snapshot data) or to restore existing volumes to
22
22
a previous state (represented by the snapshots).
23
23
24
-
## Why add Volume Group Snapshots to Kubernetes?
24
+
## Why add volume group snapshots to Kubernetes?
25
25
26
26
The Kubernetes volume plugin system already provides a powerful abstraction that
27
27
automates the provisioning, attaching, mounting, resizing, and snapshotting of block
@@ -30,9 +30,9 @@ and file storage.
30
30
Underpinning all these features is the Kubernetes goal of workload portability:
31
31
Kubernetes aims to create an abstraction layer between distributed applications and
32
32
underlying clusters so that applications can be agnostic to the specifics of the
33
-
cluster they run on and application deployment requires no “cluster specific” knowledge.
33
+
cluster they run on and application deployment requires no cluster specific knowledge.
34
34
35
-
There is already a [VolumeSnapshot API](https://github.com/kubernetes/enhancements/tree/master/keps/sig-storage/177-volume-snapshot)
35
+
There is already a [VolumeSnapshot](/docs/concepts/storage/volume-snapshots/) API
36
36
that provides the ability to take a snapshot of a persistent volume to protect against
37
37
data loss or data corruption. However, there are other snapshotting functionalities
38
38
not covered by the VolumeSnapshot API.
@@ -45,25 +45,26 @@ If snapshots for the data volume and the logs volume are taken at different time
45
45
the application will not be consistent and will not function properly if it is restored
46
46
from those snapshots when a disaster strikes.
47
47
48
-
It is true that we can quiesce the application first, take an individual snapshot from
48
+
It is true that you can quiesce the application first, take an individual snapshot from
49
49
each volume that is part of the application one after the other, and then unquiesce the
50
-
application after all the individual snapshots are taken. This way we will get application
51
-
consistent snapshots.
52
-
However, application quiesce is time consuming. Sometimes it may not be possible to
53
-
quiesce an application. Taking individual snapshots one after another may also take
54
-
longer time compared to taking a consistent group snapshot. Some users may not want
55
-
to do application quiesce very frequently for these reasons. For example, a user may
56
-
want to run weekly backups with application quiesce and nightly backups without
57
-
application quiesce but with consistent group support which provides crash consistency
58
-
across all volumes in the group.
50
+
application after all the individual snapshots are taken. This way, you would get
51
+
application consistent snapshots.
52
+
53
+
However, sometimes it may not be possible to quiesce an application or the application
54
+
quiesce can be too expensive so you want to do it less frequently. Taking individual
55
+
snapshots one after another may also take longer time compared to taking a consistent
56
+
group snapshot. Some users may not want to do application quiesce very often for these
57
+
reasons. For example, a user may want to run weekly backups with application quiesce
58
+
and nightly backups without application quiesce but with consistent group support which
59
+
provides crash consistency across all volumes in the group.
59
60
60
61
## Kubernetes Volume Group Snapshots API
61
62
62
63
Kubernetes Volume Group Snapshots introduce [three new API objects](https://github.com/kubernetes-csi/external-snapshotter/blob/master/client/apis/volumegroupsnapshot/v1alpha1/types.go) for managing snapshots:
63
64
64
65
`VolumeGroupSnapshot`
65
66
: Created by a Kubernetes user (or perhaps by your own automation) to request
66
-
creation of a volume group snapshot for multiple volumes.
67
+
creation of a volume group snapshot for multiple persistent volume claims.
67
68
It contains information about the volume group snapshot operation such as the
68
69
timestamp when the volume group snapshot was taken and whether it is ready to use.
69
70
The creation and deletion of this object represents a desire to create or delete a
@@ -81,41 +82,49 @@ was created with a one-to-one mapping.
81
82
: Created by cluster administrators to describe how volume group snapshots should be
82
83
created. including the driver information, the deletion policy, etc.
83
84
84
-
The Volume Group Snapshot objects are defined as CustomResourceDefinitions (CRDs).
85
+
These three API kinds are defined as CustomResourceDefinitions (CRDs).
85
86
These CRDs must be installed in a Kubernetes cluster for a CSI Driver to support
86
87
volume group snapshots.
87
88
88
89
## How do I use Kubernetes Volume Group Snapshots
89
90
90
-
Volume Group Snapshot feature is implemented in the
group snapshots meant adding or changing several components:
93
94
94
-
*Kubernetes Volume Group Snapshot CRDs
95
+
*Added new CustomResourceDefinitions for VolumeGroupSnapshot and two supporting APIs.
95
96
* Volume group snapshot controller logic is added to the common snapshot controller.
96
97
* Volume group snapshot validation webhook logic is added to the common snapshot validation webhook.
97
-
*Logic to make CSI calls is added to CSI Snapshotter sidecar controller.
98
+
*Adding logic to make CSI calls into the snapshotter sidecar controller.
98
99
99
100
The volume snapshot controller, CRDs, and validation webhook are deployed once per
100
101
cluster, while the sidecar is bundled with each CSI driver.
101
102
102
103
Therefore, it makes sense to deploy the volume snapshot controller, CRDs, and validation
103
-
webhook as a cluster addon. It is strongly recommended that Kubernetes distributors
104
+
webhook as a cluster addon. I strongly recommend that Kubernetes distributors
104
105
bundle and deploy the volume snapshot controller, CRDs, and validation webhook as part
105
106
of their Kubernetes cluster management process (independent of any CSI Driver).
106
107
107
108
### Creating a new group snapshot with Kubernetes
108
109
109
110
Once a VolumeGroupSnapshotClass object is defined and you have volumes you want to
110
-
snapshot together, you may create a new group snapshot by creating a VolumeGroupSnapshot
111
+
snapshot together, you may request a new group snapshot by creating a VolumeGroupSnapshot
111
112
object.
112
113
113
114
The source of the group snapshot specifies whether the underlying group snapshot
114
115
should be dynamically created or if a pre-existing VolumeGroupSnapshotContent
115
-
should be used. One of the following members in the source must be set.
116
+
should be used.
117
+
118
+
A pre-existing VolumeGroupSnapshotContent is created by a cluster administrator.
119
+
It contains the details of the real volume group snapshot on the storage system which
120
+
is available for use by cluster users.
121
+
122
+
One of the following members in the source of the group snapshot must be set.
116
123
117
-
* Selector - Selector is a label query over persistent volume claims that are to be grouped together for snapshotting. This labelSelector will be used to match the label added to a PVC.
118
-
* VolumeGroupSnapshotContentName - specifies the name of a pre-existing VolumeGroupSnapshotContent object representing an existing volume group snapshot.
124
+
*`selector` - a label query over PersistentVolumeClaims that are to be grouped
125
+
together for snapshotting. This labelSelector will be used to match the label
126
+
added to a PVC.
127
+
*`volumeGroupSnapshotContentName` - specifies the name of a pre-existing VolumeGroupSnapshotContent object representing an existing volume group snapshot.
119
128
120
129
For dynamic provisioning, a selector must be set so that the snapshot controller can
121
130
find PVCs with the matching labels to be snapshotted together.
@@ -187,7 +196,7 @@ snapshots that are part of a group snapshot.
187
196
188
197
## As a storage vendor, how do I add support for group snapshots to my CSI driver?
189
198
190
-
To implement the volume group snapshot feature, a CSI driver MUST:
199
+
To implement the volume group snapshot feature, a CSI driver **must**:
191
200
192
201
* Implement a new group controller service.
193
202
* Implement group controller RPCs: `CreateVolumeGroupSnapshot`, `DeleteVolumeGroupSnapshot`, and `GetVolumeGroupSnapshot`.
@@ -216,7 +225,7 @@ The alpha implementation of volume group snapshots for Kubernetes has the follow
216
225
limitations:
217
226
218
227
* Does not support reverting an existing PVC to an earlier state represented by a snapshot that is part of a group snapshot (only supports provisioning a new volume from a snapshot).
219
-
* No application consistency guarantees beyond any guarantees provided by the storage system (e.g. crash consistency).
228
+
* No application consistency guarantees beyond any guarantees provided by the storage system (e.g. crash consistency). See this [doc](https://github.com/kubernetes/community/blob/master/wg-data-protection/data-protection-workflows-white-paper.md#quiesce-and-unquiesce-hooks) for more discussions on application consistency.
0 commit comments