-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Introduced storage/size based global, container, pod, and namespace-level policies #6
base: main
Are you sure you want to change the base?
feat: Introduced storage/size based global, container, pod, and namespace-level policies #6
Conversation
I noticed that a lot of the code in the controller was repetitive, barring slight differences (container vs pod vs namespace). I think it would make sense for us to generate the file instead of writing it by hand, both to preserve developer sanity and to enable easier verification of the behaviour. In go-criu, we generate the bindings for CRIU's magic values here. Maybe something similar can be used here? Also, I would pick Python over Go for this, since it's just simpler. |
63947e4
to
3e1543a
Compare
5f3bc75
to
7a799f3
Compare
7a799f3
to
aec27f5
Compare
@Parthiba-Hazra Would you be able to rebase this pull request on the main branch? |
0f4f3aa
to
8c53d87
Compare
# containerPolicies: | ||
# - namespace: <namespace> | ||
# pod: <pod_name> | ||
# container: <container_name> | ||
# maxCheckpoints: 5 | ||
# maxCheckpointSize: 10 | ||
# maxTotalSize: 100 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be better to use format similar to other resource limits in Kubernetes:
https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#meaning-of-memory
Limits and requests for memory are measured in bytes. You can express memory as a plain integer or as a fixed-point number using one of these quantity suffixes: E, P, T, G, M, k. You can also use the power-of-two equivalents: Ei, Pi, Ti, Gi, Mi, Ki.
- Introduced global, container, pod, and namespace-level policies for checkpoint retention, based on storage/size limits. - Updated CRD definitions to store the storage/size based policies. - Updated the sample configuration of CheckpointRestoreOperator with storage/checkpoint-size based policies Signed-off-by: Parthiba-Hazra <[email protected]>
- Enhance generate_checkpoint_tar.sh to optionally generate tar files larger than 5MB - Update GitHub Actions workflow to test storage quota garbage collection policies Signed-off-by: Parthiba-Hazra <[email protected]>
Signed-off-by: Parthiba-Hazra <[email protected]>
…ntions - Updated size policies from int-based values to resource.Quantity for consistency with Kubernetes resource limits. - Enabled the use of units such as Ki, Mi, Gi for max checkpoint size and total size policies. Signed-off-by: Parthiba-Hazra <[email protected]>
8c53d87
to
c322bf4
Compare
maxCheckpointSize resource.Quantity = resource.MustParse("1Ei") | ||
maxTotalSizePerPod resource.Quantity = resource.MustParse("1Ei") | ||
maxTotalSizePerContainer resource.Quantity = resource.MustParse("1Ei") | ||
maxTotalSizePerNamespace resource.Quantity = resource.MustParse("1Ei") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if 1 exabyte is a very sane default value. We could potentially restrict this to something a little more reasonable, like 100 gigabytes or so? cc @rst0git
Introduced storage/size based global, container, pod, and namespace-level policies for checkpoint retention.
maxCheckpointSize
,maxTotalSizePerContainer
) are defined in Megabyte (MB)