Query icon
If icon
Commands icon
SlackIncomingWebhook icon
Log icon
Schedule icon
Webhook icon

Kubernetes Orphaned Volume and Cloud Storage FinOps Reclaimer

Automated Cloud FinOps reclaimer for Kubernetes. Profiles unattached PersistentVolumes in DuckDB, calculates dollar waste, and recovers storage.

Categories
BusinessCloudInfrastructure

In dynamic Kubernetes environments (EKS, GKE, AKS), developers and CI/CD pipelines frequently provision StatefulSets, databases, and message brokers that allocate persistent cloud block storage (such as AWS EBS gp3/io2 or GCP Persistent Disks). When namespaces or Helm releases are uninstalled, Kubernetes deletes the pods, but underlying PersistentVolumes (PVs) often remain in Available or Released state due to persistentVolumeReclaimPolicy: Retain. Cloud providers charge full monthly rates for unattached disks indefinitely, silently costing engineering organizations thousands of dollars in abandoned cloud storage spend.

This blueprint implements an autonomous Cloud FinOps reclamation gate. It inspects cluster volume inventories, joins volume storage tiers with cloud rate models in DuckDB to calculate exact monthly dollar drain, evaluates unattached age thresholds, executes pre-eviction safety snapshots, and dispatches an itemized financial recovery card to engineering leadership.

How it works

  1. audit_orphaned_storage (io.kestra.plugin.jdbc.duckdb.Query) joins cluster storage inventories with cloud block storage pricing tiers (gp3, io2, gp2) in DuckDB to compute unattached capacity, monthly dollar waste, and annual cost projections.
  2. evaluate_waste_threshold (io.kestra.plugin.core.flow.If) evaluates whether orphaned volume count exceeds zero.
  3. execute_reclamation_plan (io.kestra.plugin.scripts.shell.Commands) executes pre-deletion safety snapshots and initiates volume reclamation if dry_run is set to false; otherwise, it emits a non-destructive audit log.
  4. notify_finops_savings_card (io.kestra.plugin.slack.notifications.SlackIncomingWebhook) dispatches a financial recovery scorecard to Slack with exact monthly and annual dollar savings.

What you get

  • Automated discovery of abandoned cloud storage volumes left by deleted Kubernetes pods.
  • Accurate financial waste quantification calculated via in-memory DuckDB pricing joins.
  • Safety-first execution with default dry_run: true mode to prevent unintentional data loss.
  • Zero-setup demo execution via the seed_demo_data toggle with pre-packaged orphaned disk scenarios.

Who it's for

  • Cloud FinOps practitioners and Engineering Managers auditing monthly cloud infrastructure spend.
  • Platform Engineers maintaining multi-tenant Kubernetes clusters and storage classes.
  • DevOps teams automating post-deployment resource cleanup in staging and preview environments.

Why orchestrate this with Kestra

Storage reclamation requires coordination across cloud provider APIs, financial rate calculations, safety snapshot verification, and stakeholder reporting. Kestra combines DuckDB SQL modeling, declarative flow logic, and chatops alerting into an observable, repeatable governance workflow.

Pitfalls

  • Inadvertent volume deletion: Ensure dry_run: true is verified across several audit cycles before enabling active automated deletion in production clusters.
  • Retain policy compliance: Some enterprise disaster recovery policies intentionally retain unattached volumes; tag volumes with finops: exempt to exclude them from automated sweeps.
  • Snapshot storage costs: Retaining pre-deletion snapshots indefinitely creates secondary storage waste; ensure underlying snapshot lifecycle policies expire retained backups after 30 days.

Prerequisites

  • Kubernetes cluster read access and cloud provider storage management permissions.
  • Slack incoming webhook endpoint for FinOps notifications.

Secrets

  • SLACK_WEBHOOK_URL: Slack incoming webhook URL for dispatching FinOps savings cards.
  • FINOPS_WEBHOOK_KEY: Secret authentication key for event-driven cleanup triggers.

Quick start

  1. Execute the flow with seed_demo_data: true to observe simulated orphaned storage discovery and financial savings calculation.
  2. Configure SLACK_WEBHOOK_URL in your Kestra namespace.
  3. Enable the weekly schedule trigger for automated Monday morning cloud storage audits.

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.