Production-grade spot instance scheduling for EKS worker nodes
Project description
Spotter
Production-grade spot instance scheduling for EKS worker nodes
Spotter intelligently manages EC2 spot instances as EKS worker nodes, automatically finding the cheapest ARM64 instances across availability zones while handling interruptions gracefully. Achieves 70-80% cost savings over on-demand instances.
Features
- Real-time Pricing Analysis: Continuous spot price monitoring with automatic instance selection
- Multi-AZ Distribution: Optimal instance placement across availability zones
- Interruption Resilience: Automatic replacement with fallback instance types
- ARM64 Optimization: Targets modern ARM64 families (c7g, c8g, m7g, m8g, r7g, r8g)
- EKS Integration: Native integration via CloudFormation launch templates
Architecture
Core Components
Spotter Lambda
- Analyzes spot pricing every 10 minutes
- Stores top 6 cheapest instances per AZ in SSM parameters
- Filters for ARM64, current-generation, non-burstable instances
InstanceRunner Lambda
- Launches instances based on pricing recommendations
- Handles spot interruption events with same-AZ replacement
- Implements intelligent fallback on Capacity issues
Installation
Prerequisites
- AWS CLI configured with appropriate permissions
- SAM CLI installed
- EKS cluster with kubectl access
- EC2 Spot service-linked role
pip install spotter-cli
Quick Start
# Bootstrap Infrastructure
$ spotter bootstrap --region us-west-2
# Onboard EKS Cluster
$ spotter onboard my-cluster --region us-west-2
# Launch Instances
$ spotter scale my-cluster --count 3 --region us-west-2
Scale to count
--scale-to-count will scale up or down to the count specified
$ spotter scale my-cluster --count 7 --scale-to-count --region us-west-2
Rebalancing
rebalance will make the instance spread across AZ's
$ spotter rebalance my-cluster --region us-west-2
Commands
bootstrap Deploy Spotter infrastructure
destroy Destroy Spotter infrastructure
onboard Onboard an EKS cluster to spotter
list-clusters List onboarded clusters
offboard Remove a cluster from Spotter
scale Scale Spotter instances for a cluster
list-instances Show current instance status for a cluster
rebalance Rebalance instances across availability zones
refresh-prices Refresh spot pricing data
pricing View spot pricing data
Data Storage
Pricing data stored in SSM parameters:
/spotter/prices/{az}- Top 6 instances per availability zone/spotter/settings/{cluster}- Cluster configuration
Monitoring & Troubleshooting
CloudWatch Logs
/aws/lambda/Spotter- Pricing analysis logs/aws/lambda/InstanceRunner- Instance launch logs
Troubleshooting
See docs/troubleshooting.md for comprehensive troubleshooting guidance.
Cleanup
Remove all Spotter resources:
spotter destroy --region us-west-2
For cluster-specific cleanup:
spotter offboard my-cluster --region us-west-2
Vibe coded with Amazon Q
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file spotter_cli-1.0.1.tar.gz.
File metadata
- Download URL: spotter_cli-1.0.1.tar.gz
- Upload date:
- Size: 560.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3f92d880a11c7af9a2672bc52ae294060453b09b20b06b29af5510dfee71bb4f
|
|
| MD5 |
599fa06f243a6d2e233912b4034aec67
|
|
| BLAKE2b-256 |
4685d7a85c8d7ae75568dac3efc5a53dd4c4c56ea3daba3117d9146d6e9f261e
|
File details
Details for the file spotter_cli-1.0.1-py3-none-any.whl.
File metadata
- Download URL: spotter_cli-1.0.1-py3-none-any.whl
- Upload date:
- Size: 29.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
df7181f7b7f7e7705604147b90838fcbf37dec69eceef2f4dd0508e1f1c1f7ca
|
|
| MD5 |
eaf4c38bd75de9aad85390bfcb4f4a5a
|
|
| BLAKE2b-256 |
93e47b4b7c200214a275d74fd80019d006123b95a75a1bb13d3f320e013074e5
|