Skip to content
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

Support --cascade option on deletion. #145

Open
fullykubed opened this issue Jun 18, 2024 · 4 comments
Open

Support --cascade option on deletion. #145

fullykubed opened this issue Jun 18, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@fullykubed
Copy link

When Kubernetes removes certain controllers like StatefulSets, you have the ability to control whether it also deletes the underlying resources such as the Pods / PVCs (reference).

It would be nice to be able to configure this setting to be able to retain some resources after deleting the main controllers.

@alekc
Copy link
Owner

alekc commented Jun 19, 2024

Tbh I am against this. The whole purpose of IAC is to manage explicit resources declared in the code, so anything outside it, should be managed through an explicit IAC declaration. I do not see any good example when this --cascade would be useful, do you have any use case?

@fullykubed
Copy link
Author

fullykubed commented Jun 19, 2024

I agree. However, the purpose of this is actually to aid in making updates to controllers.

Many Kubernetes controllers such as StatefulSets have immutable fields. For example, in StatefulSets, .spec.volumeClaimTemplates is immutable.

As a result, the only way to update this field is to delete the StatefulSet and create a new one. The only way to do that without deleting all of the Pods and PVCs is via --cascade=orphan.

This impacts many controllers, both ones built-in to Kubernetes and third-party controllers as well.

Having the ability to specify --cascade would easy a burden that currently requires intervention outside of IAC.

Now in a perfect world, we would also be able to apply this only on "recreate" and not on full "delete," but my understanding is that is not very straightforward?

@stevehipwell
Copy link
Contributor

@fullykubed now that #165 has been merged you should be able to easily add the orphan cascade option to the delete_cascade input.

@fullykubed
Copy link
Author

@stevehipwell Thanks for the heads up.

@alekc Would it be fine to add orphan to the list of available options for delete_cascade?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants