Skip to content

Commit 6179cef

Browse files
committed
Address review comments
1 parent 6d847b0 commit 6179cef

File tree

1 file changed

+37
-28
lines changed

1 file changed

+37
-28
lines changed

content/en/blog/_posts/2023-05-08-volume-group-snapshot-alpha.md

Lines changed: 37 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
layout: blog
3-
title: "Introducing Volume Group Snapshot"
3+
title: "Kubernetes 1.27: Introducing An API For Volume Group Snapshots"
44
date: 2023-05-08T10:00:00-08:00
55
slug: kubernetes-1-27-volume-group-snapshot-alpha
66
---
@@ -11,17 +11,17 @@ Volume group snapshot is introduced as an Alpha feature in Kubernetes v1.27.
1111
This feature introduces a Kubernetes API that allows users to take a crash consistent
1212
snapshot for multiple volumes together. It uses a label selector to group multiple
1313
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.
1515

16-
## What is Volume Group Snapshot
16+
## An overview of volume group snapshots
1717

1818
Some storage systems provide the ability to create a crash consistent snapshot of
1919
multiple volumes. A group snapshot represents “copies” from multiple volumes that
2020
are taken at the same point-in-time. A group snapshot can be used either to rehydrate
2121
new volumes (pre-populated with the snapshot data) or to restore existing volumes to
2222
a previous state (represented by the snapshots).
2323

24-
## Why add Volume Group Snapshots to Kubernetes?
24+
## Why add volume group snapshots to Kubernetes?
2525

2626
The Kubernetes volume plugin system already provides a powerful abstraction that
2727
automates the provisioning, attaching, mounting, resizing, and snapshotting of block
@@ -30,9 +30,9 @@ and file storage.
3030
Underpinning all these features is the Kubernetes goal of workload portability:
3131
Kubernetes aims to create an abstraction layer between distributed applications and
3232
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.
3434

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
3636
that provides the ability to take a snapshot of a persistent volume to protect against
3737
data loss or data corruption. However, there are other snapshotting functionalities
3838
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
4545
the application will not be consistent and will not function properly if it is restored
4646
from those snapshots when a disaster strikes.
4747

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
4949
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.
5960

6061
## Kubernetes Volume Group Snapshots API
6162

6263
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:
6364

6465
`VolumeGroupSnapshot`
6566
: 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.
6768
It contains information about the volume group snapshot operation such as the
6869
timestamp when the volume group snapshot was taken and whether it is ready to use.
6970
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.
8182
: Created by cluster administrators to describe how volume group snapshots should be
8283
created. including the driver information, the deletion policy, etc.
8384

84-
The Volume Group Snapshot objects are defined as CustomResourceDefinitions (CRDs).
85+
These three API kinds are defined as CustomResourceDefinitions (CRDs).
8586
These CRDs must be installed in a Kubernetes cluster for a CSI Driver to support
8687
volume group snapshots.
8788

8889
## How do I use Kubernetes Volume Group Snapshots
8990

90-
Volume Group Snapshot feature is implemented in the
91+
Volume group snapshots are implemented in the
9192
[external-snapshotter](https://github.com/kubernetes-csi/external-snapshotter) repository. Implementing volume
9293
group snapshots meant adding or changing several components:
9394

94-
* Kubernetes Volume Group Snapshot CRDs
95+
* Added new CustomResourceDefinitions for VolumeGroupSnapshot and two supporting APIs.
9596
* Volume group snapshot controller logic is added to the common snapshot controller.
9697
* 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.
9899

99100
The volume snapshot controller, CRDs, and validation webhook are deployed once per
100101
cluster, while the sidecar is bundled with each CSI driver.
101102

102103
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
104105
bundle and deploy the volume snapshot controller, CRDs, and validation webhook as part
105106
of their Kubernetes cluster management process (independent of any CSI Driver).
106107

107108
### Creating a new group snapshot with Kubernetes
108109

109110
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
111112
object.
112113

113114
The source of the group snapshot specifies whether the underlying group snapshot
114115
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.
116123

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.
119128

120129
For dynamic provisioning, a selector must be set so that the snapshot controller can
121130
find PVCs with the matching labels to be snapshotted together.
@@ -187,7 +196,7 @@ snapshots that are part of a group snapshot.
187196

188197
## As a storage vendor, how do I add support for group snapshots to my CSI driver?
189198

190-
To implement the volume group snapshot feature, a CSI driver MUST:
199+
To implement the volume group snapshot feature, a CSI driver **must**:
191200

192201
* Implement a new group controller service.
193202
* Implement group controller RPCs: `CreateVolumeGroupSnapshot`, `DeleteVolumeGroupSnapshot`, and `GetVolumeGroupSnapshot`.
@@ -216,7 +225,7 @@ The alpha implementation of volume group snapshots for Kubernetes has the follow
216225
limitations:
217226

218227
* 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.
220229

221230
## What’s next?
222231

0 commit comments

Comments
 (0)