A lightweight, battle-tested tool that minimizes resource waste in Kubernetes clusters with minimal setup. Leveraging Prometheus metrics, it identifies idle APIs and workloads, enabling one-time deployment, easy customization to your environment, and silent reclamation of unused resources — efficiently reducing cloud costs.
Named after Norganas, the Finger of Oblivion, a mysterious entity imprisoned within the Amber Temple in the Curse of Strahd D&D adventure. Though open to interpretation, Norganas represents a neutral force trading forgotten memories for new skills. Similarly, this tool silently removes stale Kubernetes workloads, freeing resources for fresh deployments.
Despite its proven effectiveness, norganas-kube-prune is a bare-bones utility that requires careful customization to fit your specific cluster setup and operational needs. Use at your own discretion.
Key Features • Requirements • How To Use • Know Limitations • Related Projects • License
For safety, norganas’ automatic resource purging was replaced with a reporting mechanism that generates a “to-purge” list. This list can be sent to external repositories—such as an Azure file share in the current implementation—enabling easy integration with notification systems for auditing or contesting, as well as automation pipelines for orchestrating resource deletion.
- Fetches ingress volumetry through Prometheus monitoring (
http_requests_totalmetric). - Filters purging scope to releases tagged with labels.
- Logs purging events for observability and auditing.
- Uses Azure File Share as persistent file server and datalake for logs and release lists.
- Supports gathering cluster node capacity and allocation info alongside workload metrics.
- Automates idle workload cleanup to enhance Kubernetes cluster cost-effectiveness.
-
Kubernetes cluster with Helm installed
-
Prometheus monitoring configured, scraping ingress controller metrics
-
A proper ServiceAccount with the required permissions
-
*Access to Azure File Share for list and log storage
-
*Azure DevOps Pipelines configured for the Purger process
*See Know Limitations.
- Setup the specifications at config.json and values.yaml.
- Deploy the norganas-kube-prune cronjob in your Kubernetes cluster.
- Ensure Prometheus is scraping the ingress controller metrics correctly.
- Configure the Azure File Share secrets and access for uploading release lists and logs.
- Setup the Purger Azure Pipeline to consume the file share lists and delete the releases.
- Monitor logs and metrics for purging activity in Seq and Prometheus dashboards.
This solution was originally tailored to address a specific need: purging stale, idle workloads in non-production Kubernetes clusters for cost optimization. While effective for this scenario, its current implementation has limitations that should be considered when applying it more broadly:
- Hardcoded configurations — Destinations for release lists (e.g., database or object storage) and log storage are fixed; dynamic runtime flags or environment-based selection are not yet implemented.
- Basic observability hooks — While purging events are logged, integration with external log sinks (e.g., ELK, Loki) or forwarding to centralized auditing systems is not available out of the box.
- Limited alerting integrations — No built-in support for connecting to external alerting systems (e.g., PagerDuty, OpsGenie, Slack webhooks).
- No bundled dashboards — There are no pre-built Grafana dashboards or Prometheus recording rules provided for easy monitoring of purge activities or workload idleness.
- Manual scaling — The tool does not yet support dynamic scaling or adaptive scheduling based on cluster conditions or workload types.
These limitations can be addressed through future enhancements, such as adding configurable flags, log forwarding capabilities, richer alerting service integrations, and packaged observability assets (Grafana dashboards, Prometheus rules).
- KEDA (Kubernetes Event-Driven Autoscaling) — Event-driven autoscaling in Kubernetes.
- Karpenter — Workload-driven Kubernetes cluster Autoscaler.
- Helm — Kubernetes package manager.
- Prometheus.io — Metrics and monitoring for systems and services.
- Kubecost — Real-time cost visibility and insights in Kubernetes.
- Kube-Janitor — TTL for Kubernetes resources.
GitHub @brunohaf
