Skip to content

Commit 3e1543a

Browse files
docs: Add documentation for storage/size based retention policy
Signed-off-by: Parthiba-Hazra <[email protected]>
1 parent 025c70b commit 3e1543a

File tree

1 file changed

+27
-5
lines changed

1 file changed

+27
-5
lines changed

Diff for: docs/retention_policy.md

+27-5
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ The checkpoint retention policy in the CheckpointRestoreOperator allows users to
88
## Applying a Retention Policy
99

1010
To apply a retention policy, you need to create a `CheckpointRestoreOperator` resource. Below is an example configuration:
11+
1112
```yaml
1213
`apiVersion: criu.org/v1
1314
kind: CheckpointRestoreOperator
@@ -26,19 +27,30 @@ spec:
2627
maxCheckpointsPerNamespace: 50
2728
maxCheckpointsPerPod: 30
2829
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
2934
# containerPolicies:
3035
# - namespace: namespace
3136
# pod: pod_name
3237
# container: container_name
3338
# 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
3441
# podPolicies:
3542
# - namespace: namespace
3643
# pod: pod_name
3744
# 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
3847
# namespacePolicies:
3948
# - 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`
4152
```
53+
4254
A sample configuration file is available under `./config/samples/_v1_checkpointrestoreoperator.yaml`.
4355

4456
## Understanding Policy Fields
@@ -49,18 +61,28 @@ A sample configuration file is available under `./config/samples/_v1_checkpointr
4961
- `maxCheckpointsPerNamespace`: Maximum number of checkpoints per namespace.
5062
- `maxCheckpointsPerPod`: Maximum number of checkpoints per pod.
5163
- `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.
5369
- `namespace`: Namespace of the container.
5470
- `pod`: Pod name of the container.
5571
- `container`: Container name.
5672
- `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.
5876
- `namespace`: Namespace of the pod.
5977
- `pod`: Pod name.
6078
- `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.
6282
- `namespace`: Namespace name.
6383
- `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.
6486

6587
## Policy Hierarchy and Specificity
6688

@@ -73,7 +95,7 @@ The CheckpointRestoreOperator uses a hierarchical approach to apply retention po
7395

7496
### Policy Application
7597

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.
7799
- **Namespace Policy:** If a namespace policy is defined, it overrides the global policy for that specific namespace.
78100
- **Pod Policy:** If a pod policy is defined, it overrides both the namespace and global policies for that specific pod.
79101
- **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

Comments
 (0)