This example demonstrates enabling CloudPilot AI's workload rebalance feature for automatic cost optimization and resource efficiency on your EKS cluster.
By default, optimization is not enabled. You can enable rebalance by modifying the variables in terraform.tfvars and re-applying.
- CloudPilot AI agent installation
- Automatic workload rebalancing (when enabled)
- Cost optimization through intelligent scheduling
- Minimal configuration for quick setup
- Cost Reduction: Automatically moves workloads to more cost-effective nodes
- Resource Efficiency: Optimizes resource utilization across the cluster
- Spot Instance Support: Intelligently uses spot instances when appropriate
- Zero Downtime: Performs rebalancing without service interruption
- Terraform - Version 1.0 or later
- AWS CLI - Install and configure the AWS CLI with credentials that have EKS cluster management permissions. Required for EKS-related operations such as updating kubeconfig. If you haven't created an EKS cluster yet, see the example setup: eks-ondemand
- Kubectl - For cluster operations and component management
- CloudPilot AI API key - See CloudPilot AI API Key Documentation for setup instructions
-
Configure your variables:
cp terraform.tfvars.example terraform.tfvars
Edit
terraform.tfvarswith your values:cloudpilot_api_key: Your CloudPilot AI API keycluster_name: Your EKS cluster nameregion: AWS region where your cluster is locatedrestore_node_number: Current node count for restoration
-
Apply the configuration:
terraform init terraform plan terraform apply
This installs the CloudPilot AI agent without enabling optimization.
When you're ready to enable workload rebalancing, edit terraform.tfvars:
enable_rebalance = trueThen re-apply:
terraform plan
terraform applyAfter enabling rebalance, you can:
- View optimization results in the CloudPilot AI dashboard
- Monitor cost savings and efficiency improvements
- Track workload movements and node utilization
See the main.tf file for the complete configuration.