Hello HN community!<p>I'm excited to share K8s Cleaner, a tool designed to help you clean up your Kubernetes clusters.<p>As Kubernetes environments grow, they often accumulate unused resources, leading to confusion, waste, and clutter. K8s-cleaner simplifies the process of identifying and removing unnecessary components.<p>The tool scans your Kubernetes clusters for unused or orphaned resources—including pods, services, ingresses, and secrets—and removes them safely. You can fully customize which resources to scan and delete, maintaining complete control over what stays and what goes.<p>Getting Started:<p>Visit <a href="https://sveltos.projectsveltos.io/k8sCleaner.html" rel="nofollow">https://sveltos.projectsveltos.io/k8sCleaner.html</a> and click the "Getting Started" button to try K8s-cleaner.<p>Key Features:<p>- Easy to Use: No complex setup or configuration required—perfect for developers and operators alike
- Open Source: Modify the code to better fit your specific needs
- Community Driven: We welcome your feedback, feature ideas, and bug reports to help improve K8s-cleaner for everyone<p>I'm here to answer questions, address feedback, and discuss ideas for future improvements.<p>Looking forward to your thoughts! And make sure your all you kubernetes clusters are sparkling clean for the holidays. :-)<p>Simone
For resources that are supposed to be cleaned up automatically, fixing your operator/finalizer is a better approach. Using this tool is just kicking the can down the road, which may cause even bigger problem.<p>If you have resources that need to be regularly created and deleted, I feel a cronjob running `kubectl delete -l <your-label-selector>` should be more than enough, and less risker than installing a 3rd party software with cluster wide list/delete permission.
How does it work in an IaC/CD scenario, with things like Terraform or ArgoCD creating and syncing resources lifecycle inside the cluster? A stale resource, as identified and cleaned by K8s Cleaner, would be recreated in the next sync cycle, right?
I've been using it for a bit now and very happy with it. The stale-persistent-volume-claim detection has been almost a 100% hit in my case; it's a real game-changer for cleaning up disk space.<p>Kubernetes clutter can quickly become a headache, and having a tool like this to identify and remove unused resources has made my workflow so much smoother.
When I saw the headline I was pretty excited, but looking at your examples, I'm really curious about why you decided to make everything work via CRDs? Also having to write code inside those CRD for the cleanup logic seems like a pretty steep learning curve and honestly I'd be pretty scared to end up writing something that would delete my entire cluster.<p>Any reason why you chose this approach over something like a CLI tool you can run on your cluster?
why isn't this just a cli tool? I don't see any reason it needs to be installed on a cluster. There should at least be an option to scan a cluster from the cli.
I've been saying for a while that most of the time we didn't replace pets with cattle bit pet servers with pet clusters.
The need for a tool like this proves my point