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
[Feature] Ability to set grace period / force delete children. #875
Comments
hi @ikreymer wondering how it suppose to work - should it be part of Also, what is the use care here ? In which cases it is desired ? |
I was suggesting above that this would work as an optional field in the Sync response, similar to how The idea is that some deletions may need to have more quickly then others, for example, if pods are being gracefully shutdown or canceled by the user. The use case would be to allow the user to cancel an operation and allow pods to be quickly shut down, bypassing the normal grace period. Since the default can already be set in the pod, I don't think it makes sense to make it part of the CR |
I actually wonder how to handle that : |
I think 2), with same grace period value for all resources being deleted, is a reasonable compromise without adding too much complexity. (For our use case, currently working around this by sending an out-of-band message to pods that they should exit immediately). |
For example, if you have 3 pods, and want 1 deleted with grace period 0, and 2 and 3 delete with grace period 10,
So child 1 will be deleted with grace period 0, pods 2 and 3 with grace period 9 after 1 second delay, so seems pretty close to the original goal of deleting 3 pods at same time but with different grace periods. This is more complex then our use case, though. |
what I actually meant in 2️⃣ - it will be the same value for |
closed by mistake |
Yes, that's what I understood as well! But I think that still works, as in the example above, if you need different grace periods, you can still handle it with multiple responses as above before setting |
In certain circumstances, the controller may want to delete children more quickly / force delete instead of using the default grace period. Perhaps there's a way to support the equivalent of the kubectl
--grace-period
option as part of the Sync response hook?If
gracePeriod
is set as part of the Sync response, and any children need to being deleted from that response, the controller would use the specified grace period. (If no children are being deleted, the gracePeriod is ignored)That way, can set grace period of 0 if necessary.
The text was updated successfully, but these errors were encountered: