Onboarding your EKS clusters to Copilot for EKS Cluster Autoscaler
Prerequisites
- You must be logged in to your nOps account.
- You must have an EKS Cluster with AWS nodegroups.
Steps to Configure Your EKS Cluster for BC+, Container Rightsizing, and Container Insights
Install the nOps Agent Stack
To install the nOps Agent click on the cluster's Configure to Optimize to begin data collection.
- API Key Setup : Generate a new API key for the nOps Agent Stack.
- Copy the custom command and run it in your command line.
- On Successful, Click Test Connectivity to confirm connectivity with the nOps Agent Stack.
How to Enable Container Rightsizing
After Installing the nOps Agent Stack, you can start configuring container rightsizing to optimize resource usage and reduce costs.
The nOps Container Insights Agent, a core part of the nOps Kubernetes Agent Stack, will now start collecting data on the actual resource consumption of your Kubernetes workloads. This data is used to generate rightsizing recommendations, helping you optimize CPU and memory allocations for better efficiency.
For detailed steps on enabling container rightsizing, refer to the Container Rightsizing Documentation.
Steps to Configure Your EKS Cluster for Price Efficiency
Install Compute Copilot Lambda
For instrunctions on how to install Compute Copilot Lambda, please, refer to the Compute Copilot for Auto Scaling Groups (ASG) documentation.
Configure ASGs associated with the Cluster
-
Navigate to Optimize → EKS Optimization.
-
Choose the EKS cluster you want to cost-optimize and click on Manage Configuration button.
-
In the Price Efficiency section , select Manage ASGs
-
Select the ASG you want to configure:
-
Open Configure Modal. The details section of Auto Scaling Group will be prefilled.
-
The AWS Lambda configuration section will show the version detail and current status of the Lambda Stack to confirm it is properly configured on the AWS account.
-
You can create or choose an existing ASG template in the Spot detail section.
noteUnlike Compute Copilot for Karpenter, Compute Copilot for Cluster Autoscaler does not require an agent. The Helm command for installing an agent—found in the configuration tab for clusters using the Cluster Autoscaler—is for deploying the nOps Agent Stack, which provides container utilization metrics, rightsizing data, and up-to-date information for your cluster’s dashboard.
-
-
Create an ASG Template:
- Give the ASG template a unique name.
- Select the CPU architecture based on the AMIs of the ASG you are going to attach the template to.
- By default Dynamic min VCpuCount & MemoryMiB is checked, setting the minimum vCPU and RAM requirements based on the size of the On-Demand EC2 instance being replaced.You can disable this option and set the CPU or Memory suitable for your workload from the Instance Requirements list.
- You can also directly choose instance families. Compute Copilot will select the most optimal choice for price and stability out of the provided options.
- Now click Create
-
(Optional) Set the Minimum Number of On-demand Instances Minimum Number of On-Demand Instances defines the number of On-Demand instances that should be left in the ASG and not replaced with Spot. ASG Lambda won’t do any On-Demand to Spot replacement if it has fewerf On-Demands instances than specified in this config setting.
-
(Optional) Set the Spot percentage and Max Spot Instances using the draggable bars.
- Spot percentage defines the desired percentage of spot instances.
- Max Spot Instances defines the maximum number of Spot instances to be created by Compute Copilot.
-
Click Configure and repeat these steps for all ASGs in the cluster.
What to Expect After Configuring your Cluster for Price Efficiency
Compute Copilot will start running your workloads on Spot Instances. You can navigate to the cluster's dashboard to view the instances being launched by Compute Copilot.
Price Efficiency with Cluster Autoscaler
Cluster Autoscaler is a key feature that dynamically adjusts the number of nodes in a node group within an EKS cluster to accommodate changes in resource requirements for pods. When a scaling decision is made, Cluster Autoscaler communicates with the associated Auto Scaling Group (ASG) to adjust the DesiredCapacity
, prompting the ASG to automatically scale the cluster nodes.
Compute Copilot for Cluster Autoscaler fully manages the ASGs that belong to your cluster for additional savings and reliability. Here’s how it works:
- ASGs managed by Copilot are now converted to Mixed Instances Policy (MIP) ASGs, allowing nOps Compute Copilot to define Spot Instance Types this ASG can launch.
- Compute Copilot Lambda keeps Managed ASG MIP in sync with the latest Spot Market recommendations by nOps, taking into account your Reserved Instances data. As a result, during scale-out events, Copilot-Managed ASG launches a Spot instance that is cheaper than the On Demand instance this ASG was launching before configuring it to Compute Copilot.
- If there are OnDemand instances available for Spot migration running, or there are Spot instances that are at risk of interruption, Compute Copilot Lambda initiates an Instance Refresh to bring the ASG to the state approved by nOps Spot Market recommendations.
By combining the automation capabilities of Cluster Autoscaler with the intelligent instance management of Compute Copilot, this solution offers a seamless and cost-effective approach to optimizing AWS EKS workloads and reduce costs.
FAQ
-
What is the architecture of the CloudFormation Stack?
- The stack automates the process of creating and managing IAM roles for EKS clusters, ensuring the proper roles are associated with the service account used by the nOps Agent Stack.
note- Optional IAM User Support: The template can also handle situations where an IAM user might be needed, making it suitable for environments lacking OIDC identity providers.
- Onboarding Confirmation: The Lambdas send a request to nOps to confirm CloudFormation onboarding.
-
What is the architecture of the nOps Terraform module?
- The Terraform module is hosted in the public Terraform Registry, allowing customers to use it as a source in their own Terraform configurations.
For each AWS account and region where clusters exist, customers apply the Terraform module. This process:
- Creates an S3 bucket and IAM roles for each cluster, enabling the agent to export data.
- Creates a cross-account role for the backend, allowing it to copy data into the platform.
Additionally, nOps APIs ensure that:
- Each cluster has the necessary IAM roles for agent installation.
- The S3 bucket is registered in the backend table, triggering the data copy workflows.