Automate Kubernetes Cluster Naps
Ktharatt is a simple Kubernetes operator that applies sleep schedules to Karpenter-managed nodepools.
Get Started
💸 The Problem
Karpenter does a great job autoscaling workloads in real-time, but it doesn’t help you scale down idle clusters during nights or weekends. Your cloud bill doesn’t sleep, even when your engineers do.
💡 The Solution
- Define a
SleepSchedulecustom resource with a cron expression - At the defined time, Nodes are drained automatically, workloads evicted gracefully
- Nodepools will not be selected for provisioning during the sleep period
- When sleep ends, Nodepools wakes up and starts provisioning
🚀 Installation
helm repo add ktharatt https://riyasyash.github.io/ktharatt-charts
helm install ktharatt ktharatt/ktharatt
Once installed, create your first schedule like this:
apiVersion: schedule.ktharatt.io/v1alpha1
kind: Sleep
metadata:
name: off-work-hours
spec:
nodepools:
- harness-ccm-default-spot
- default
timezone: Asia/Kolkata
schedule: "00 22 * * *"
duration: 12
---
apiVersion: schedule.ktharatt.io/v1alpha1
kind: Sleep
metadata:
name: weekend-schedule
spec:
nodepools:
- harness-ccm-default-spot
- default
timezone: Asia/Kolkata
schedule: "0 0 * * 6,0"
duration: 23