Skip to main contentAWS Startups
  1. Prompt Library
  2. Karpenter + KEDA: Cost-Optimized EKS with Spot Instances

Karpenter + KEDA: Cost-Optimized EKS with Spot Instances

Deploy production-ready EKS with Karpenter auto-scaling, KEDA pod management, and Spot instance prioritization. Includes Bottlerocket OS, encryption, and multi-AZ high availability—optimized for cost.

  • Infrastructure-as-Code

Prompt

Deploy Cost-Optimized Karpenter on EKS with Bottlerocket, Spot Instances, and KEDA

Act as a DevOps engineer and help me deploy Karpenter on an EKS cluster with the following requirements:

Cluster Elasticity & Scaling:

Configure Karpenter to make the cluster as elastic as possible
Set up KEDA to manage pod scaling based on CPU usage
Karpenter should handle node provisioning based on pod demands
Node Provisioning Strategy:

Provision general-purpose nodes only
Prioritize Spot instances and check Spot availability first
Fall back to On-Demand instances only when Spot is unavailable
Enable consolidation for cost optimization
Security & Hardening:

Use Bottlerocket OS for all nodes
Disable SSH access completely
Enable EBS volume encryption
High Availability:

Deploy across multiple availability zones to maximize Spot availability
Implementation:

Use Terraform with the official EKS module to provision the EKS cluster infrastructure
Use MCP (Model Context Protocol) to connect to the Kubernetes API for deployment and configuration
Provide all necessary Terraform configurations for EKS cluster setup
Provide all necessary Kubernetes manifests, Karpenter NodePool/EC2NodeClass configurations, and KEDA ScaledObject definitions
Include any required IAM roles, policies, and service account configurations
Please create a complete, production-ready setup with all configuration files needed.

Error Management:

Use MCP to connect to the Kubernetes API and verify if the EKS cluster exists
If the cluster doesn't exist, ask me if I want to create it and provide the creation steps using Terraform
Check the Kubernetes cluster version and verify compatibility with Karpenter
Recommend the appropriate Karpenter version based on the cluster version
If there's a version incompatibility, suggest either upgrading the cluster or using a compatible Karpenter version

How to use?

BETA
  1. Set up your AWS environment and cost controls
  2. Install the AWS CLI
    • Download and install the AWS CLI for your operating system.
  3. Copy the prompt
    • Click “Copy Prompt” to copy the prompt into your clipboard.
  4. Test your prompt
    • Paste the prompt into your AI tool (e.g., Kiro CLI) and run it to generate the results.
  5. Review, deploy, and monitor
    • Review the generated resources and estimated costs.
    • Deploy to a development environment first.
    • Monitor performance and spend before moving to production.

By using these prompts, you agree to this disclaimer.