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: cmd/operator/main.go
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -83,6 +83,7 @@ var (
83
83
&cli.StringFlag{Destination: &cfg.Config.PodExecRoleName, Name: "podexecrolename", EnvVars: []string{"BACKUP_PODEXECROLENAME"}, Value: "pod-executor", Usage: "set the role name that should be used for pod command execution"},
84
84
85
85
&cli.BoolFlag{Destination: &cfg.Config.EnableLeaderElection, Name: "enable-leader-election", EnvVars: []string{"BACKUP_ENABLE_LEADER_ELECTION"}, Value: true, DefaultText: "enabled", Usage: "enable leader election within the operator Pod"},
86
+
&cli.BoolFlag{Destination: &cfg.Config.EnableRelaxedScheduling, Name: "enable-relaxed-scheduling", EnvVars: []string{"BACKUP_ENABLE_RELAXED_SCHEDULING"}, Value: false, DefaultText: "disabled", Usage: "enable relaxed scheduling of backup jobs relying on the Kubernetes scheduler"},
86
87
&cli.BoolFlag{Destination: &cfg.Config.SkipWithoutAnnotation, Name: "skip-pvcs-without-annotation", EnvVars: []string{"BACKUP_SKIP_WITHOUT_ANNOTATION"}, Value: false, DefaultText: "disabled", Usage: "skip selecting PVCs that don't have the BACKUP_ANNOTATION"},
&cli.StringFlag{Destination: &cfg.Config.OperatorNamespace, Name: "operator-namespace", EnvVars: []string{"BACKUP_OPERATOR_NAMESPACE"}, Required: true, Usage: "set the namespace in which the K8up operator itself runs"},
Copy file name to clipboardExpand all lines: docs/modules/ROOT/examples/usage/operator.txt
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -47,8 +47,10 @@ OPTIONS:
47
47
--podexecaccountname value, --serviceaccount value set the service account name that should be used for the pod command execution (default: "pod-executor") [$BACKUP_PODEXECACCOUNTNAME]
48
48
--podexecrolename value set the role name that should be used for pod command execution (default: "pod-executor") [$BACKUP_PODEXECROLENAME]
49
49
--enable-leader-election enable leader election within the operator Pod (default: enabled) [$BACKUP_ENABLE_LEADER_ELECTION]
50
+
--enable-relaxed-scheduling enable relaxed scheduling of backup jobs relying on the Kubernetes scheduler (default: disabled) [$BACKUP_ENABLE_RELAXED_SCHEDULING]
50
51
--skip-pvcs-without-annotation skip selecting PVCs that don't have the BACKUP_ANNOTATION (default: disabled) [$BACKUP_SKIP_WITHOUT_ANNOTATION]
51
52
--checkschedule value the default check schedule (default: "0 0 * * 0") [$BACKUP_CHECKSCHEDULE]
52
53
--operator-namespace value set the namespace in which the K8up operator itself runs [$BACKUP_OPERATOR_NAMESPACE]
54
+
--insecure-allow-podexec-spdy-fallback enable fallback to SPDY connections for data streaming used by application aware backups. Might need to be enabled if the cluster has Kubernetes version 1.30 or lower. K8up uses WebSockets by default. CAUTION: Has been observed to cause silent data corruption in some network setups, use at own risk! (default: false) [$INSECURE_ALLOW_PODEXEC_SPDY_FALLBACK]
53
55
--vardir value the var data dir for read/write k8up data or temp file in the backup pod (default: "/k8up") [$VAR_DIR]
Copy file name to clipboardExpand all lines: docs/modules/ROOT/examples/usage/restic.txt
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -18,6 +18,7 @@ OPTIONS:
18
18
--fileExtensionAnnotation value Defines the file extension to use for STDOUT backups. [$FILEEXTENSION_ANNOTATION]
19
19
--backucontainerannotation value set the annotation name that specify the backup container inside the Pod (default: "k8up.io/backupcommand-container") [$BACKUP_CONTAINERANNOTATION]
20
20
--skipPreBackup If the job should skip the backup command and only backup volumes. (default: false) [$SKIP_PREBACKUP]
21
+
--skipSnapshotSync If set, skip synchronizing Snapshot custom resources to the cluster after backup or prune operations. Webhook notifications are still sent. (default: false) [$BACKUP_SKIP_SNAPSHOT_SYNC]
21
22
--promURL value Sets the URL of a prometheus push gateway to report metrics. [$PROM_URL]
22
23
--clusterName value Sets the Kubernetes cluster name for grouping metrics in push gateway [$CLUSTER_NAME]
23
24
--webhookURL value, --statsURL value Sets the URL of a server which will retrieve a webhook after the action completes. [$STATS_URL]
@@ -69,4 +70,5 @@ OPTIONS:
69
70
--caCert value The certificate authority file path [$CA_CERT_FILE]
70
71
--clientCert value The client certificate file path [$CLIENT_CERT_FILE]
71
72
--clientKey value The client private key file path [$CLIENT_KEY_FILE]
73
+
--insecure-allow-podexec-spdy-fallback enable fallback to SPDY connections for data streaming used by application aware backups. Might need to be enabled if the cluster has Kubernetes version 1.30 or lower. K8up uses WebSockets by default. CAUTION: Has been observed to cause silent data corruption in some network setups, use at own risk! (default: false) [$INSECURE_ALLOW_PODEXEC_SPDY_FALLBACK]
K8up has two scheduling modes for backup pods. Both scheduling modes respect the `k8up.io/hostname` annotation on a PVC (see: xref:references/annotations.adoc[Annotations]).
4
+
5
+
== Classic Scheduling (default)
6
+
7
+
K8s does not prevent mounting an RWO PVC to multiple pods, if they are scheduled on the same host.
8
+
K8up uses this fact to provide the ability to back up RWO PVCs.
9
+
10
+
For a given backup in a namespace K8up will list all the PVCs.
11
+
The PVCs are then grouped depending on their type:
12
+
13
+
* all RWX PVCs are grouped together
14
+
* RWO PVCs are grouped by k8s node where they are currently mounted
15
+
16
+
K8up will then deploy backup jobs according to the grouping, a single job for all RWX PVCs and a job for each K8s node.
17
+
The jobs themselves loop over the mounted PVCs and do a file backup via restic.
18
+
19
+
== Relaxed Scheduling
20
+
21
+
In the relaxed scheduling mode, the backup pod scheduling is handled by the Kubernetes scheduler. This mode is intended for the use with storage provisioners that handle node affinity and topology well for their provisioned volumes.
22
+
23
+
For a given backup in a namespace K8up will list all the PVCs and schedule one backup job for each PVC. K8up will not set a node selector for the backup pods unless explicitly requested through the `k8up.io/hostname` annotation on a PVC. This allows the Kubernetes scheduler to more freely select an appropriate node to run the backup on.
24
+
25
+
Relaxed scheduling can be enabled via the operator flag `--enable-relaxed-scheduling` or environment variable `BACKUP_ENABLE_RELAXED_SCHEDULING` (see: xref:references/operator-config-reference.adoc[Operator Configuration]).
Copy file name to clipboardExpand all lines: docs/modules/ROOT/pages/explanations/backup.adoc
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,9 +21,9 @@ It does not work in some cases though.
21
21
More precise, it does not work when files are kept open for a long period of time, like databases do.
22
22
It does also not work for content that is not stored in the cluster, like a managed database that is offered by a service provider.
23
23
24
-
NOTE: If the PVC has the `RWO` access mode, the backup `Pod` needs to be scheduled onto the same node, on which the `Pod` (which uses the respective `PVC`) runs.
24
+
NOTE: If the PVC has the `RWO` access mode, the backup `Pod` needs to be scheduled onto the same node, on which the `Pod` (which uses the respective `PVC`) runs. This happens explicitly or implicitly depending on the backup pod scheduling mode (see: xref:explanations/backup-pod-scheduling.adoc[Backup Pod Scheduling]).
25
25
26
-
Read xref:references/annotations.adoc[] to learn more about how the backup process can be influenced.
26
+
Read xref:references/annotations.adoc[] to learn more about how the backup process can be influenced and xref:explanations/backup-pod-scheduling.adoc[Backup Pod Scheduling] to learn more about the two backup pod scheduling modes.
Copy file name to clipboardExpand all lines: docs/modules/ROOT/pages/references/api-reference.adoc
+12-9Lines changed: 12 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -246,13 +246,13 @@ This is for advanced use-cases only. Please only set this if you know what you'r
246
246
Value must be positive integer if given.
247
247
| *`keepJobs`* __integer__ | KeepJobs amount of jobs to keep for later analysis.
248
248
249
-
250
249
Deprecated: Use FailedJobsHistoryLimit and SuccessfulJobsHistoryLimit respectively.
251
250
| *`failedJobsHistoryLimit`* __integer__ | FailedJobsHistoryLimit amount of failed jobs to keep for later analysis.
252
251
KeepJobs is used property is not specified.
253
252
| *`successfulJobsHistoryLimit`* __integer__ | SuccessfulJobsHistoryLimit amount of successful jobs to keep for later analysis.
254
253
KeepJobs is used property is not specified.
255
254
| *`promURL`* __string__ | PromURL sets a prometheus push URL where the backup container send metrics to
255
+
| *`clusterName`* __string__ | ClusterName sets the kubernetes cluster name to send to pushgateway for grouping metrics
256
256
| *`statsURL`* __string__ | StatsURL sets an arbitrary URL where the restic container posts metrics and
257
257
information about the snapshots to. This is in addition to the prometheus
258
258
pushgateway.
@@ -290,13 +290,13 @@ This is for advanced use-cases only. Please only set this if you know what you'r
290
290
Value must be positive integer if given.
291
291
| *`keepJobs`* __integer__ | KeepJobs amount of jobs to keep for later analysis.
292
292
293
-
294
293
Deprecated: Use FailedJobsHistoryLimit and SuccessfulJobsHistoryLimit respectively.
295
294
| *`failedJobsHistoryLimit`* __integer__ | FailedJobsHistoryLimit amount of failed jobs to keep for later analysis.
296
295
KeepJobs is used property is not specified.
297
296
| *`successfulJobsHistoryLimit`* __integer__ | SuccessfulJobsHistoryLimit amount of successful jobs to keep for later analysis.
298
297
KeepJobs is used property is not specified.
299
298
| *`promURL`* __string__ | PromURL sets a prometheus push URL where the backup container send metrics to
299
+
| *`clusterName`* __string__ | ClusterName sets the kubernetes cluster name to send to pushgateway for grouping metrics
300
300
| *`statsURL`* __string__ | StatsURL sets an arbitrary URL where the restic container posts metrics and
301
301
information about the snapshots to. This is in addition to the prometheus
302
302
pushgateway.
@@ -371,9 +371,9 @@ This is for advanced use-cases only. Please only set this if you know what you'r
371
371
| *`activeDeadlineSeconds`* __integer__ | ActiveDeadlineSeconds specifies the duration in seconds relative to the startTime that the job may be continuously active before the system tries to terminate it.
372
372
Value must be positive integer if given.
373
373
| *`promURL`* __string__ | PromURL sets a prometheus push URL where the backup container send metrics to
374
+
| *`clusterName`* __string__ | ClusterName sets the kubernetes cluster name to send to pushgateway for grouping metrics
374
375
| *`keepJobs`* __integer__ | KeepJobs amount of jobs to keep for later analysis.
375
376
376
-
377
377
Deprecated: Use FailedJobsHistoryLimit and SuccessfulJobsHistoryLimit respectively.
378
378
| *`failedJobsHistoryLimit`* __integer__ | FailedJobsHistoryLimit amount of failed jobs to keep for later analysis.
379
379
KeepJobs is used property is not specified.
@@ -408,9 +408,9 @@ This is for advanced use-cases only. Please only set this if you know what you'r
408
408
| *`activeDeadlineSeconds`* __integer__ | ActiveDeadlineSeconds specifies the duration in seconds relative to the startTime that the job may be continuously active before the system tries to terminate it.
409
409
Value must be positive integer if given.
410
410
| *`promURL`* __string__ | PromURL sets a prometheus push URL where the backup container send metrics to
411
+
| *`clusterName`* __string__ | ClusterName sets the kubernetes cluster name to send to pushgateway for grouping metrics
411
412
| *`keepJobs`* __integer__ | KeepJobs amount of jobs to keep for later analysis.
412
413
413
-
414
414
Deprecated: Use FailedJobsHistoryLimit and SuccessfulJobsHistoryLimit respectively.
415
415
| *`failedJobsHistoryLimit`* __integer__ | FailedJobsHistoryLimit amount of failed jobs to keep for later analysis.
416
416
KeepJobs is used property is not specified.
@@ -738,7 +738,6 @@ Value must be positive integer if given.
738
738
| *`retention`* __xref:{anchor_prefix}-github.1485827954.workers.dev-k8up-io-k8up-v2-api-v1-retentionpolicy[$$RetentionPolicy$$]__ | Retention sets how many backups should be kept after a forget and prune
739
739
| *`keepJobs`* __integer__ | KeepJobs amount of jobs to keep for later analysis.
740
740
741
-
742
741
Deprecated: Use FailedJobsHistoryLimit and SuccessfulJobsHistoryLimit respectively.
743
742
| *`failedJobsHistoryLimit`* __integer__ | FailedJobsHistoryLimit amount of failed jobs to keep for later analysis.
744
743
KeepJobs is used property is not specified.
@@ -775,7 +774,6 @@ Value must be positive integer if given.
775
774
| *`retention`* __xref:{anchor_prefix}-github.1485827954.workers.dev-k8up-io-k8up-v2-api-v1-retentionpolicy[$$RetentionPolicy$$]__ | Retention sets how many backups should be kept after a forget and prune
776
775
| *`keepJobs`* __integer__ | KeepJobs amount of jobs to keep for later analysis.
777
776
778
-
779
777
Deprecated: Use FailedJobsHistoryLimit and SuccessfulJobsHistoryLimit respectively.
780
778
| *`failedJobsHistoryLimit`* __integer__ | FailedJobsHistoryLimit amount of failed jobs to keep for later analysis.
781
779
KeepJobs is used property is not specified.
@@ -889,16 +887,19 @@ This is for advanced use-cases only. Please only set this if you know what you'r
| *`restoreTimeFilter`* __string__ | Simple filter to define a timestamp (prefix, YYYY-MM-DD hh:mm:ss) for snapshot selection instead of latest (or latest if nothing matches)
892
891
| *`snapshot`* __string__ |
893
892
| *`keepJobs`* __integer__ | KeepJobs amount of jobs to keep for later analysis.
894
893
895
-
896
894
Deprecated: Use FailedJobsHistoryLimit and SuccessfulJobsHistoryLimit respectively.
897
895
| *`failedJobsHistoryLimit`* __integer__ | FailedJobsHistoryLimit amount of failed jobs to keep for later analysis.
898
896
KeepJobs is used property is not specified.
899
897
| *`successfulJobsHistoryLimit`* __integer__ | SuccessfulJobsHistoryLimit amount of successful jobs to keep for later analysis.
900
898
KeepJobs is used property is not specified.
901
899
| *`tags`* __string array__ | Tags is a list of arbitrary tags that get added to the backup via Restic's tagging system
900
+
| *`paths`* __string array__ | Paths is a list of paths that are contained with in a snapshot and can be filtered by
901
+
| *`delete`* __boolean__ | Delete ensures the state after restoring a snapshot is identical to the snapshot
902
+
Deletes files from target if they do not exist in snapshot
902
903
|===
903
904
904
905
@@ -931,16 +932,19 @@ This is for advanced use-cases only. Please only set this if you know what you'r
| *`restoreTimeFilter`* __string__ | Simple filter to define a timestamp (prefix, YYYY-MM-DD hh:mm:ss) for snapshot selection instead of latest (or latest if nothing matches)
934
936
| *`snapshot`* __string__ |
935
937
| *`keepJobs`* __integer__ | KeepJobs amount of jobs to keep for later analysis.
936
938
937
-
938
939
Deprecated: Use FailedJobsHistoryLimit and SuccessfulJobsHistoryLimit respectively.
939
940
| *`failedJobsHistoryLimit`* __integer__ | FailedJobsHistoryLimit amount of failed jobs to keep for later analysis.
940
941
KeepJobs is used property is not specified.
941
942
| *`successfulJobsHistoryLimit`* __integer__ | SuccessfulJobsHistoryLimit amount of successful jobs to keep for later analysis.
942
943
KeepJobs is used property is not specified.
943
944
| *`tags`* __string array__ | Tags is a list of arbitrary tags that get added to the backup via Restic's tagging system
945
+
| *`paths`* __string array__ | Paths is a list of paths that are contained with in a snapshot and can be filtered by
946
+
| *`delete`* __boolean__ | Delete ensures the state after restoring a snapshot is identical to the snapshot
947
+
Deletes files from target if they do not exist in snapshot
944
948
|===
945
949
946
950
@@ -1153,7 +1157,6 @@ ScheduleSpec defines the schedules for the various job types.
0 commit comments