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/retention_policy.md
+27-5
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,7 @@ The checkpoint retention policy in the CheckpointRestoreOperator allows users to
8
8
## Applying a Retention Policy
9
9
10
10
To apply a retention policy, you need to create a `CheckpointRestoreOperator` resource. Below is an example configuration:
11
+
11
12
```yaml
12
13
`apiVersion: criu.org/v1
13
14
kind: CheckpointRestoreOperator
@@ -26,19 +27,30 @@ spec:
26
27
maxCheckpointsPerNamespace: 50
27
28
maxCheckpointsPerPod: 30
28
29
maxCheckpointsPerContainer: 10
30
+
maxCheckpointSize: 4# Maximum size of a single checkpoint in MB
31
+
maxTotalSizePerNamespace: 1000# Maximum total size of checkpoints per namespace in MB
32
+
maxTotalSizePerPod: 500# Maximum total size of checkpoints per pod in MB
33
+
maxTotalSizePerContainer: 100# Maximum total size of checkpoints per container in MB
29
34
# containerPolicies:
30
35
# - namespace: namespace
31
36
# pod: pod_name
32
37
# container: container_name
33
38
# maxCheckpoints: 5
39
+
# maxCheckpointSize: 6 # Maximum size of a single checkpoint in MB
40
+
# maxTotalSize: 20 # Maximum total size of checkpoints for the container in MB
34
41
# podPolicies:
35
42
# - namespace: namespace
36
43
# pod: pod_name
37
44
# maxCheckpoints: 10
45
+
# maxCheckpointSize: 8 # Maximum size of a single checkpoint in MB
46
+
# maxTotalSize: 50 # Maximum total size of checkpoints for the pod in MB
38
47
# namespacePolicies:
39
48
# - namespace: namespace
40
-
# maxCheckpoints: 15`
49
+
# maxCheckpoints: 15
50
+
# maxCheckpointSize: 10 # Maximum size of a single checkpoint in MB
51
+
# maxTotalSize: 200 # Maximum total size of checkpoints for the namespace in MB`
41
52
```
53
+
42
54
A sample configuration file is available under `./config/samples/_v1_checkpointrestoreoperator.yaml`.
43
55
44
56
## Understanding Policy Fields
@@ -49,18 +61,28 @@ A sample configuration file is available under `./config/samples/_v1_checkpointr
49
61
-`maxCheckpointsPerNamespace`: Maximum number of checkpoints per namespace.
50
62
-`maxCheckpointsPerPod`: Maximum number of checkpoints per pod.
51
63
-`maxCheckpointsPerContainer`: Maximum number of checkpoints per container.
52
-
-`containerPolicies` (optional): Specific retention policies for containers.
64
+
-`maxCheckpointSize`: Maximum size of a single checkpoint in MB.
65
+
-`maxTotalSizePerNamespace`: Maximum total size of checkpoints per namespace in MB.
66
+
-`maxTotalSizePerPod`: Maximum total size of checkpoints per pod in MB.
67
+
-`maxTotalSizePerContainer`: Maximum total size of checkpoints per container in MB.
68
+
-`containerPolicies`: (Optional) Specific retention policies for containers.
53
69
-`namespace`: Namespace of the container.
54
70
-`pod`: Pod name of the container.
55
71
-`container`: Container name.
56
72
-`maxCheckpoints`: Maximum number of checkpoints for the container.
57
-
-`podPolicies` (optional): Specific retention policies for pods.
73
+
-`maxCheckpointSize`: Maximum size of a single checkpoint in MB.
74
+
-`maxTotalSize`: Maximum total size of checkpoints for the container in MB.
75
+
-`podPolicies`: (Optional) Specific retention policies for pods.
58
76
-`namespace`: Namespace of the pod.
59
77
-`pod`: Pod name.
60
78
-`maxCheckpoints`: Maximum number of checkpoints for the pod.
61
-
-`namespacePolicies` (optional): Specific retention policies for namespaces.
79
+
-`maxCheckpointSize`: Maximum size of a single checkpoint in MB.
80
+
-`maxTotalSize`: Maximum total size of checkpoints for the pod in MB.
81
+
-`namespacePolicies`: (Optional) Specific retention policies for namespaces.
62
82
-`namespace`: Namespace name.
63
83
-`maxCheckpoints`: Maximum number of checkpoints for the namespace.
84
+
-`maxCheckpointSize`: Maximum size of a single checkpoint in MB.
85
+
-`maxTotalSize`: Maximum total size of checkpoints for the namespace in MB.
64
86
65
87
## Policy Hierarchy and Specificity
66
88
@@ -73,7 +95,7 @@ The CheckpointRestoreOperator uses a hierarchical approach to apply retention po
73
95
74
96
### Policy Application
75
97
76
-
-**Global Policy:** If no other policies are defined, the global policy will be applied. In the example above, the global policy limits checkpoints to 50 per namespace, 30 per pod, and 10 per container.
98
+
-**Global Policy:** If no other policies are defined, the global policy will be applied. In the example above, the global policy limits checkpoints to 50 per namespace, 30 per pod, 10 per container, with additional constraints on checkpoint size and total size.
77
99
-**Namespace Policy:** If a namespace policy is defined, it overrides the global policy for that specific namespace.
78
100
-**Pod Policy:** If a pod policy is defined, it overrides both the namespace and global policies for that specific pod.
79
101
-**Container Policy:** If a container policy is defined, it is the most specific and overrides pod, namespace, and global policies for that specific container.
0 commit comments