open-policy-agent / gatekeeper

🐊 Gatekeeper - Policy Controller for Kubernetes
https://open-policy-agent.github.io/gatekeeper/
Apache License 2.0
3.72k stars 764 forks source link

Automated Resource Cleanup #3673

Open mparram opened 3 weeks ago

mparram commented 3 weeks ago

Describe the solution you'd like

I’d like to request an automated resource Cleanup feature for Gatekeeper, similar to the Cleanup functionality in Kyverno. Kyverno allows users to automatically delete resources like empty ReplicaSets after a set period, which helps keep clusters organized and avoids clutter from unused resources.

Adding this feature to Gatekeeper would allow users to Automatically remove empty or unused resources after a specified time and reduce manual cleanup tasks and improve cluster performance.

It's something that can be done manually through cron jobs, but it would be good to consider such functionality as an additional feature in Gatekeeper.

Anything else you would like to add:

References:

sozercan commented 3 weeks ago

@mparram Have you had a chance to review https://github.com/gianlucam76/k8s-cleaner? Is there a particular reason you believe Gatekeeper is a better fit for this task compared to dedicated projects like k8s-cleaner?