Prerequisites
Before you begin you must have:- AWS CLI configured
kubectl,talosctl, andhelminstalled
Step 1: Create IAM role for Cluster Autoscaler
Cluster Autoscaler uses the IAM role attached to the EC2 instances where it runs. In this guide, the Cluster Autoscaler will be configured to run on the control plane nodes, so the IAM role must be attached to the control plane once its created. To create the IAM role and attach it to your control plane machines, you need:- An IAM policy that defines the permissions required by Cluster Autoscaler
- An IAM role that uses the policy
- An instance profile that allows EC2 instances to assume the IAM role
1.1: Define environment variables
First, define the variables used throughout the IAM setup:1.2: Create IAM policy
Next, create an IAM policy that grants Cluster Autoscaler permission to:- Adjust Auto Scaling Group capacity
- Discover tagged node groups
- Describe EC2 and ASG resources
1.3: Create IAM role and instance profile
First, create a trust policy that allows EC2 instances to assume the role:Step 2: Launch control plane
With IAM configured, you can now launch the control plane machines. These control plane instances are not managed by an Auto Scaling Group. They are created manually and will run Cluster Autoscaler.2.1: Define environment variables
Start by defining the AWS region, Talos version, architecture, instance type, and the number of control plane machines to create.For high availability, we recommend creating three control plane machines.
2.2: Retrieve the official Talos AMI
Fetch the Talos AWS AMI for your region and architecture from the official Talos release metadata. If you need to customize your AMI—for example, by adding custom labels or extensions, you must create your own AMI and bake those customizations into it. For more information, refer to the Register AWS Machines in Omni documentation.2.3: Generate control plane join configuration
Generate the join configuration that registers the Talos nodes with Omni on boot. Encode it for use as EC2 user data:2.4: Launch three control plane instances
Launch the control plane EC2 instances using:- The Talos AMI
- The IAM instance profile created in Step 1
- The join configuration as user data
We do not recommend horizontally autoscaling control plane machines. If your control plane needs more capacity, scale vertically instead.
Step 3: Create Machine Classes
A Machine Class defines a pool of infrastructure that Omni can use when creating cluster nodes. In this step, you’ll create separate Machine Classes for the control plane and worker nodes.3.1: Create the control plane Machine Class
To define a Machine Class for your control plane nodes:- Create the control plane machine class definition:
cluster-autoscaler-controlplane that matches machines labeled omni.sidero.dev/platform = aws.
If you are using custom labels, or prefer to create a Machine Class based on a different machine label, replace
omni.sidero.dev/platform = aws with your preferred label. The label you specify must already exist on the machines you want this Machine Class to match. - Apply the definition:
- Verify that it was created:
3.2: Create the worker Machine Class
Next, repeat the process for the worker nodes:- Create the worker machine class definition::
- Apply the definition:
- Verify:
Step 4: Create the cluster
Next, create a cluster that uses the Machine Classes you defined in Step 3. To create a cluster:- Run this command to create a cluster template:
- Apply the template:
- Download the cluster’s
kubeconfigonce the cluster becomes healthy:
- Monitor your cluster status from your Omni dashboard or by running:
Step 5: Enable KubeSpan (required for hybrid or on-prem autoscaling)
If your autoscaled worker nodes are not launched in the same private AWS network as your control plane nodes (for example, in hybrid cloud or on-prem environments), you must enable KubeSpan. KubeSpan creates an encrypted WireGuard mesh between cluster nodes. This allows nodes running in different networks to securely discover and communicate with each other. To enable KubeSpan, add the following patch to theCluster document section of your cluster template:
Step 6: Create Launch Template and Auto Scaling Group (workers)
Cluster Autoscaler scales worker machines by adjusting the size of an AWS Auto Scaling Group (ASG). To enable this, you need to create:- A Launch Template, which defines how worker nodes are configured and launched
- An Auto Scaling Group, which uses the Launch Template to create and terminate worker nodes
- Tags, which allow Cluster Autoscaler to automatically discover and manage the Auto Scaling Group
6.1: Create Launch Template
The Launch Template defines which AMI and instance type your worker machines will use:6.2: Create Auto Scaling Group
Run this command to create a autoscaling group:6.3: Tag the Auto Scaling Group for Cluster Autoscaler
These tags allow Cluster Autoscaler to discover and manage the node group:6.4: Verify the Auto Scaling Group created a worker node
Once the Auto Scaling Group is created, it would automatically launch one worker machine to match its desired capacity. To confirm AWS created an instance:Step 7: Install Cluster Autoscaler
Cluster Autoscaler runs as a Kubernetes Deployment inside your cluster. It continuously monitors unscheduled pods and adjusts your Auto Scaling Group capacity when additional nodes are required. Run this to install Cluster Autoscaler using Helm and configure it to automatically discover and manage your AWS Auto Scaling Groups.Step 8: Verify Cluster Autoscaler is working
Confirm that the Cluster Autoscaler pod is running:Step 9: Test automatic scaling
Deploy a workload that requires additional capacity:- Pods entering
Pendingstate - Cluster Autoscaler increasing Auto Scaling Group capacity
- New worker nodes joining the cluster
- Pods transitioning to Running