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
{{ message }}
Repository navigation
Commit b647ce7
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: docs/src/backup_volumesnapshot.md
+47Lines changed: 47 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -103,9 +103,56 @@ As you can see, the `backup` section contains both the `volumeSnapshot` stanza
103
103
both volume snapshot and object store backup strategies simultaneously
104
104
to take physical backups.
105
105
106
+
The `volumeSnapshot.className` option allows you to reference the default
107
+
`VolumeSnapshotClass` object used for all the storage volumes you have
108
+
defined in your PostgreSQL cluster.
109
+
110
+
!!! Info
111
+
In case you are using a different storage class for `PGDATA` and
112
+
WAL files, you can specify a separate `VolumeSnapshotClass` for
113
+
that volume through the `walClassName` option (by default set to
114
+
`className`).
115
+
106
116
Once a cluster is defined for volume snapshot backups, you need to define
107
117
a `ScheduledBackup` resource that requests such backups on a periodic basis.
108
118
119
+
## Persistence of volume snapshot objects
120
+
121
+
By default, `VolumeSnapshot` objects created by CloudNativePG are retained after
122
+
deleting the `Backup` object that originated them, or the `Cluster` they refer to.
123
+
Such behavior is controlled by the `.spec.backup.volumeSnapshot.snapshotOwnerReference`
124
+
option which accepts the following values:
125
+
126
+
-`none`: no ownership is set, meaning that `VolumeSnapshot` objects persist
127
+
after the `Backup` and/or the `Cluster` resources are removed
128
+
-`backup`: the `VolumeSnapshot` object is owned by the `Backup` resource that
129
+
originated it, and when the backup object is removed, the volume snapshot is
130
+
also removed
131
+
-`cluster`: the `VolumeSnapshot` object is owned by the `Cluster` resource that
132
+
is backed up, and when the Postgres cluster is removed, the volume snapshot is
133
+
also removed
134
+
135
+
In case a `VolumeSnapshot` is deleted, the `deletionPolicy` specified in the
136
+
`VolumeSnapshotContent` is evaluated:
137
+
138
+
- if set to `Retain`, the `VolumeSnapshotContent` object is kept
139
+
- if set to `Delete`, the `VolumeSnapshotContent` object is removed as well
140
+
141
+
!!! Warning
142
+
`VolumeSnapshotContent` object do not keep all the information regarding the
143
+
backup and the cluster they refer to (like the annotations and labels that
144
+
are contained in the `VolumeSnapshot` object). Although possible, it might not be
145
+
straightforward to restore from just this kind of objects. For this reason,
146
+
our recommendation is to always backup the `VolumeSnapshot` definitions somewhere,
147
+
even using a Kubernetes level data protection solution.
148
+
149
+
The value in `VolumeSnapshotContent` is determined by the `deletionPolicy` set
150
+
in the corresponding `VolumeSnapshotClass` definition, the one that you
151
+
have referenced in the `.spec.backup.volumeSnapshot.className` option.
152
+
153
+
Please refer to the [Kubernetes documentation on Volume Snapshot Classes](https://kubernetes.io/docs/concepts/storage/volume-snapshot-classes/)
154
+
for details on this standard behavior.
155
+
109
156
## Example
110
157
111
158
The following example shows how to configure volume snapshot base backups on an
0 commit comments