Skip to content

Star

k8s-cleaner logo

Kubernetes Controller Cleaner

What is k8s-cleaner?

The Kubernetes controller Cleaner (k8s-cleaner) identifies, removes, or updates stale/orphaned or unhealthy resources to maintain a clean and efficient Kubernetes cluster.

It is designed to handle any Kubernetes resource types (including custom Kubernetes resources) and provides sophisticated filtering capabilities, including label-based selection and custom Lua-based criteria.

Features and Capabilities

1️⃣ Schedule: Specify the frequency at which the k8s-cleaner should scan the cluster and identify stale resources. Utilise the Cron syntax to define recurring schedules.

2️⃣ DryRun: Enable safe testing of the k8s-cleaner filtering logic without affecting actual resource configurations. Resources matching the criteria will get identified, but no changes will get applied.

3️⃣ Label Filtering: Select resources based on user-defined labels, filtering out unwanted or outdated components. Refine the selection based on label key, operation (equal, different, etc.), and value.

4️⃣ Lua-based Selection Criteria: Leverage the Lua scripting language to create complex and dynamic selection criteria, catering to specific resource management needs. Define custom logic to identify and handle stale resources.

5️⃣ Notifications: Stay informed! The k8s-cleaner keeps users in the loop about every cleaned-up resource, whether removed or optimized. Get detailed notification lists and pick your preferred channel: Slack, Webex, Discord, Teams or reports.

Benefits

💪 Resource Removal: Efficiently remove stale resources from your cluster, reclaiming unused resources and improving resource utilisation.

💪 Resource Updates: Update outdated resources to ensure they align with the latest configurations and maintain consistent functionality.

💪 Reduced Resource Bloat: Minimize resource bloat and maintain a clean and organized cluster, improving overall performance and stability.

By combining the flexibility of scheduling, the accuracy of label filtering, the power of Lua-based criteria, and the ability to remove or update stale resources, the k8s-cleaner empowers users to effectively manage Kubernetes environments and optimise resource usage.

Contribute

We encourage everyone to contribute to the example directory by adding new Cleaner configurations 💡. This will help the community benefit from different expertise and build a stronger knowledge base of the Cleaner use cases.

🤝 Together we can expand the range of Cleaner applications and make it an even more valuable tool for managing Kubernetes resources efficiently.

Support us

If you like the project, please give us a if you haven't done so yet. Your support means a lot to us. Thank you 🙏.

⭐ k8s-cleaner