Written by Maxime Roth Fessler, Backend Developer at TrackIt
At AWS re:Invent 2024, the spotlight was on the groundbreaking Auto Mode feature for Amazon Elastic Kubernetes Service (EKS). But what does this new approach bring to Kubernetes management? This deep dive into EKS Auto Mode explores its capabilities and benefits through a hands-on demonstration. Using Terraform, the guide below walks through each step of deploying an EKS Auto Mode cluster, showcasing how this new feature streamlines operations and enhances the cloud-native experience.
Contents
Understanding EKS Auto Mode: Features and Benefits
EKS Auto Mode simplifies running an EKS cluster by handling complex tasks like managing the Kubernetes control plane, maintaining controllers for load balancing and auto-scaling, and configuring IAM roles and policies. It also streamlines IAM setup for CSI (Container Storage Interface) drivers, enabling persistent storage while reducing operational overhead.
Key Features:
- Streamlined Management: Provides production-ready clusters with minimal operational overhead.
- Application Availability: Dynamically scales nodes based on application demands, reducing manual capacity planning (powered by Karpenter for autoscaling).
- Efficiency: Optimizes compute costs by terminating unused instances and consolidating workloads.
- Security: Uses immutable AMIs with locked-down software and regular node cycling for enhanced security.
- Automated Upgrades: Keeps clusters and components up-to-date with the latest patches.
- Managed Components: Includes built-in support for essential Kubernetes and AWS features.
- Customizable NodePools and NodeClasses: Allows for tailored configurations to meet specific workload requirements.
How EKS Auto Mode Updates the Cluster Automatically
EKS Auto Mode simplifies Kubernetes version upgrades by handling control plane updates and node replacements while maintaining workload availability through pod disruption budgets. Components such as the Amazon EBS CSI driver are managed as integrated services, eliminating the need for manual installation or updates.
This approach differs from standard EKS clusters, where components like the EBS CSI driver are typically installed and managed as add-ons. In EKS Auto Mode, AWS oversees the lifecycle of these components, ensuring they remain up to date and properly configured.
For example, when deploying an application with Auto Mode, the StorageClass references the provisioner ebs.csi.eks.amazonaws.com, which AWS manages as part of the service. In a standard EKS cluster, the provisioner ebs.csi.aws.com is used instead, requiring manual installation and management of the EBS CSI driver.
Automated Updates:
- Nodes are replaced with the new Kubernetes version.
- Components like CoreDNS, KubeProxy, AWS Load Balancer Controller, Karpenter, and AWS EBS CSI Driver are automatically updated.
User Responsibilities:
- Updating apps and workloads.
- Managing self-deployed add-ons and controllers.
- Updating Amazon EKS Add-ons.
Tutorial: EKS Auto Mode
Create the cluster
A closer look at cluster creation provides a better understanding of the EKS Auto Mode concept. This walkthrough covers deployment using Terraform.
Note: The provided configuration is simplified for demonstration purposes and is not intended for production use.
Configuration
The Terraform code used in this tutorial is available in this repository: https://github.com/MaximeMRF/eks-auto-mode-tutorial.
Before getting started, make sure the AWS CLI is properly configured and that both kubectl and Terraform are installed.
Begin by reviewing the terraform.tfvars file to ensure the variables align with project requirements. For instance, availability zones (AZs) may need to be adjusted from Europe to the US.
Next, open the eks.tf file. In the cluster_compute_config object, the enabled property is set to true, indicating that Auto Mode is activated for compute, network, and storage.
This configuration also creates a node pool named “general-purpose”. EKS automatically selects the nodes and instance sizes while scaling them using Karpenter, removing the need for manual setup.
Deployment of the cluster
To set up the project and install dependencies, run the following command:
terraform init |
Next, generate the execution plan:
terraform plan |
Finally, deploy the configuration:
terraform apply -auto-approve |
Once the cluster is ready, update the kubectl configuration to access it. Adjust the cluster name and region based on the defined variables:
aws eks update-kubeconfig –name eks-auto-mode-cluster –region eu-north-1 |
Understanding the Auto-scaling
The cluster is now running. Listing the nodes with kubectl will show no active nodes yet, as no pods have been deployed.
To see how nodes are created when pods are scheduled, apply the deploy.yml file from the repository. This will launch a BusyBox container that runs indefinitely.
kubectl apply -f deploy.yml |
Listing the nodes again will now show that EKS has created a node to run the container.
kubectl get nodes |
As more pods are added, EKS will either launch new nodes or assign them to existing ones with available resources, all without the need for manual scaling configuration.
How EKS Auto Mode Manages Storage
Without Auto Mode, IAM permissions must be configured manually by retrieving and attaching the AmazonEBSCSIDriverPolicy to the cluster’s node role, allowing the EBS CSI driver to manage volumes. Auto Mode includes a built-in CSI driver with preconfigured permissions.
To test volume management with Auto Mode, use the preconfigured YAML file available in the kubernetes-objects folder of the repository.
How EKS Auto Mode Handles Load Balancing
EKS Auto Mode simplifies load balancing by removing the need for manual IAM policy creation and attachment, as these are preconfigured. It includes a built-in controller for provisioning load balancers with the necessary permissions.
Without Auto Mode, IAM policies must be manually created and attached to enable the AWS Load Balancer Controller (LBC). Auto Mode also requires defining an IngressClass and IngressClassParams, which are optional when using LBC. The IngressClass specifies the controller, with Auto Mode using eks.amazonaws.com/alb. This setup streamlines ALB management and reduces manual configuration.
Conclusion
EKS Auto Mode simplifies Kubernetes cluster management by automating tasks such as resource scaling, system patching, and security enforcement. This allows teams to focus on application development rather than infrastructure maintenance. It provides a production-ready environment that is efficient, secure, and continuously updated—without the operational complexity.
About TrackIt
TrackIt is an international AWS cloud consulting, systems integration, and software development firm headquartered in Marina del Rey, CA.
We have built our reputation on helping media companies architect and implement cost-effective, reliable, and scalable Media & Entertainment workflows in the cloud. These include streaming and on-demand video solutions, media asset management, and archiving, incorporating the latest AI technology to build bespoke media solutions tailored to customer requirements.
Cloud-native software development is at the foundation of what we do. We specialize in Application Modernization, Containerization, Infrastructure as Code and event-driven serverless architectures by leveraging the latest AWS services. Along with our Managed Services offerings which provide 24/7 cloud infrastructure maintenance and support, we are able to provide complete solutions for the media industry.