Skip to main content

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

spotter_cli-1.0.3.tar.gz (562.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

spotter_cli-1.0.3-py3-none-any.whl (36.0 kB view details)

Uploaded Python 3

File details

Details for the file spotter_cli-1.0.3.tar.gz.

File metadata

  • Download URL: spotter_cli-1.0.3.tar.gz
  • Upload date:
  • Size: 562.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.8.11

File hashes

Hashes for spotter_cli-1.0.3.tar.gz
Algorithm Hash digest
SHA256 17c0473c20ce854299809ab5c0a4523c9b120330c90f5245498322bd1f75f00c
MD5 529d4ec1b8768d6bcaffc1288165867a
BLAKE2b-256 8724816bdf3445bbf9026b73cf9f2b97763748663cb07db78b6edeb77187a3d3

See more details on using hashes here.

File details

Details for the file spotter_cli-1.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for spotter_cli-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 1195d33222cd5869afe129ced0d0f529ff805401c1e350b3a57a6f635e8653e8
MD5 97b23dee433529e1263e16e55630d17d
BLAKE2b-256 f0b0bc3908c2dce8e94bc51b7ef5398b50429a35702455899c54845bb4a797f4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page