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: docs/modules/ROOT/examples/usage/operator.txt
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -11,6 +11,7 @@ OPTIONS:
11
11
--annotation value the annotation to be used for filtering (default: "k8up.io/backup") [$BACKUP_ANNOTATION]
12
12
--backupcommandannotation value set the annotation name that identify the backup commands on Pods (default: "k8up.io/backupcommand") [$BACKUP_BACKUPCOMMANDANNOTATION]
13
13
--fileextensionannotation value set the annotation name where the file extension is stored for backup commands (default: "k8up.io/file-extension") [$BACKUP_FILEEXTENSIONANNOTATION]
14
+
--global-backoff-limit value set the backoff limit for all backup jobs (default: 6) [$BACKUP_GLOBAL_BACKOFF_LIMIT]
14
15
--global-failed-jobs-history-limit value set the number of old, failed jobs to keep when cleaning up, applies to all job types (default: 3) [$BACKUP_GLOBAL_FAILED_JOBS_HISTORY_LIMIT]
15
16
--global-successful-jobs-history-limit value set the number of old, successful jobs to keep when cleaning up, applies to all job types (default: 3) [$BACKUP_GLOBAL_SUCCESSFUL_JOBS_HISTORY_LIMIT]
16
17
--global-concurrent-archive-jobs-limit value set the limit of concurrent archive jobs (default: unlimited) [$BACKUP_GLOBAL_CONCURRENT_ARCHIVE_JOBS_LIMIT]
Copy file name to clipboardExpand all lines: docs/modules/ROOT/pages/how-tos/backup.adoc
+67Lines changed: 67 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -219,3 +219,70 @@ spec:
219
219
podConfigRef:
220
220
name: podconfig
221
221
----
222
+
223
+
== Target specific PVCs or PreBackupPods
224
+
225
+
An optional labelSelectors field can be specified to target PVCs or PreBackupPods matching those expressions.
226
+
You can specify multiple selectors - as long as at least one matches, the PVC/PreBackupPod will be included in the backup.
227
+
228
+
Keep in mind that does NOT apply to terms within an individual labelSelector - this will be processed as usual, as we use the standard K8s API for this.
229
+
To find out how selectors themselves work, you can consult the upstream Kubernetes documentation: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/
230
+
231
+
Below you can find a practical example. It would back up any resources with "my-label-key" defined OR "another-label-key" with one of the accepted values.
232
+
233
+
[source,yaml]
234
+
----
235
+
apiVersion: k8up.io/v1
236
+
kind: Backup
237
+
metadata:
238
+
name: backup-test
239
+
spec:
240
+
labelSelectors:
241
+
- matchExpressions:
242
+
- key: my-label-key
243
+
operator: Exists
244
+
- matchExpressions:
245
+
- key: another-label-key
246
+
operator: In
247
+
values:
248
+
- acceptable-value
249
+
- another-acceptable-value
250
+
failedJobsHistoryLimit: 2
251
+
successfulJobsHistoryLimit: 2
252
+
backend:
253
+
repoPasswordSecretRef:
254
+
name: backup-repo
255
+
key: password
256
+
s3:
257
+
endpoint: http://minio:9000
258
+
bucket: backups
259
+
accessKeyIDSecretRef:
260
+
name: minio-credentials
261
+
key: username
262
+
secretAccessKeySecretRef:
263
+
name: minio-credentials
264
+
key: password
265
+
266
+
----
267
+
268
+
If you'd like to only target entities having both labels, you can use a single labelSelector.
269
+
This change will cause the backup to select only entities matching both conditions.
Copy file name to clipboardExpand all lines: docs/modules/ROOT/pages/references/api-reference.adoc
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -257,6 +257,8 @@ KeepJobs is used property is not specified.
257
257
information about the snapshots to. This is in addition to the prometheus
258
258
pushgateway.
259
259
| *`tags`* __string array__ | Tags is a list of arbitrary tags that get added to the backup via Restic's tagging system
260
+
| *`labelSelectors`* __link:https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.20/#labelselector-v1-meta[$$LabelSelector$$] array__ | LabelSelectors is a list of selectors that we filter for.
261
+
When defined, only PVCs and PreBackupPods matching them are backed up.
260
262
|===
261
263
262
264
@@ -299,6 +301,8 @@ KeepJobs is used property is not specified.
299
301
information about the snapshots to. This is in addition to the prometheus
300
302
pushgateway.
301
303
| *`tags`* __string array__ | Tags is a list of arbitrary tags that get added to the backup via Restic's tagging system
304
+
| *`labelSelectors`* __link:https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.20/#labelselector-v1-meta[$$LabelSelector$$] array__ | LabelSelectors is a list of selectors that we filter for.
305
+
When defined, only PVCs and PreBackupPods matching them are backed up.
0 commit comments