Giter VIP home page Giter VIP logo

egrosdou01 / k8s-cleaner Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gianlucam76/k8s-cleaner

0.0 0.0 0.0 1.44 MB

Cleaner is a Kubernetes controller that identifies unused or unhealthy resources, helping you maintain a streamlined and efficient Kubernetes cluster. It provides flexible scheduling, label filtering, Lua-based selection criteria, resource removal or update and notifications via Slack, Webex and Discord.

Home Page: https://projectsveltos.github.io/sveltos/

License: Apache License 2.0

Shell 0.89% Go 89.47% Makefile 7.38% Dockerfile 0.52% Smarty 1.73%

k8s-cleaner's Introduction

CI Go Report Card Slack License Twitter Follow

All Contributors

The Kubernetes controller 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 your own custom resources) and provides sophisticated filtering capabilities, including label-based selection and custom Lua-based criteria. Cleaner can also be used to identify unhealthy resources.

k8s-cleaner keeps you in the loop with handy notifications through:

  1. Slack Slack
  2. Webex Webex
  3. Discord Discord
  4. Teams Teams
  5. reports

Each notification contains list of all resources successfully deleted (or modified) by k8s-cleaner. Choose what works best for you!

Currently k8s-cleaner has rich set of working examples to identify and list unused:

There are also examples to identify unhealthy resources:

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. To validate the Cleaner configuration, have a look here.

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.

For a complete list of features with examples, have a look at the link.

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.

How to work with us

  • 👉 For feature requests and bugs, file an issue.
  • 👉 To get updates ⭐️ star this repository.
  • 👉 Working examples can be found in the examples section.

Getting Started Guide

Validate Cleaner Configuration

To verify the correctness of the Cleaner configuration, follow the comprehensive instructions provided in the documentation: here and here.

In essence, the Cleaner YAML file alongside the YAML files representing matching and non-matching resources need to get provided, and then by executing the simple make ut command the resutls will appear. This will validate whether your configuration correctly identifies and manages the desired resources.

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.

To add an example, simply create a new file in the example directory with a descriptive name and put your Cleaner configuration within the file. Once you've added your example, feel free to submit a pull request to share it with the community.

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

Code of Conduct

This project adheres to the CNCF Code of Conduct

By participating, you are expected to honor this code.

Contributors

Gianluca Mardente
Gianluca Mardente

💻
Oliver Bähler
Oliver Bähler

💻
Eleni Grosdouli
Eleni Grosdouli

📖

k8s-cleaner's People

Contributors

gianlucam76 avatar egrosdou01 avatar allcontributors[bot] avatar kosmas avatar egrosdou avatar oliverbaehler avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.