|  | 
| 3 | 3 | sidebar_label: "EKS Auto Mode" | 
| 4 | 4 | sidebar_position: 5 | 
| 5 | 5 | ---   | 
|  | 6 | +# Amazon EKS Auto Mode: A Hands-On Guide | 
|  | 7 | +#### *Automate compute, networking, and storage in your Kubernetes clusters with step-by-step instructions.* | 
|  | 8 | +## Introduction | 
| 6 | 9 | 
 | 
|  | 10 | +Amazon EKS Auto Mode takes over the heavy lifting of your cluster’s data plane—provisioning and scaling compute, networking, and storage—so you can focus on your applications. In this guide, you’ll learn what Auto Mode does, why it matters, how to enable it (via CloudFormation, CLI or Console), and how to verify it’s working with two simple workloads (nginx and an Alpine writer). | 
|  | 11 | + | 
|  | 12 | + | 
|  | 13 | + | 
|  | 14 | +--- | 
|  | 15 | + | 
|  | 16 | +## What Is Amazon EKS Auto Mode? | 
|  | 17 | + | 
|  | 18 | +EKS Auto Mode extends AWS’s managed control plane by fully automating: | 
|  | 19 | + | 
|  | 20 | +1. **Compute:** Automatically launches EC2 nodes when pods can’t be scheduled, and drains/terminates under-utilized nodes. | 
|  | 21 | +2. **Networking:** Provisions and configures Application and Network Load Balancers for Services and Ingresses. | 
|  | 22 | +3. **Storage:** Creates, attaches, encrypts, and cleans up EBS volumes for your PVCs. | 
|  | 23 | + | 
|  | 24 | +### Key Features | 
|  | 25 | + | 
|  | 26 | +* **Streamlined Operations:** Immutable, locked-down AMIs with SELinux and read-only root filesystems; nodes refresh every 21 days. | 
|  | 27 | +* **Cost Efficiency:** Dynamically consolidates workloads to reduce idle capacity. | 
|  | 28 | +* **Security & Compliance:** No SSH/SSM access; regular node cycling and automated patching. | 
|  | 29 | +* **Managed Add-Ons:** Built-in GPU drivers, DNS caching, network policies and EBS CSI—no manual installs. | 
|  | 30 | + | 
|  | 31 | +--- | 
|  | 32 | + | 
|  | 33 | +## Prerequisites | 
|  | 34 | + | 
|  | 35 | +* An AWS account with EKS (IAM) permissions | 
|  | 36 | +* AWS CLI or `eksctl` installed & configured | 
|  | 37 | +* `kubectl` installed | 
|  | 38 | + | 
|  | 39 | +--- | 
|  | 40 | + | 
|  | 41 | +## 1. Create Your Cluster | 
|  | 42 | + | 
|  | 43 | +### A. CloudFormation | 
|  | 44 | + | 
|  | 45 | +Use this template [eks-auto-mode.yam](./cloudformation/eks-auto-mode.yaml) to spin up an EKS cluster with Auto Mode enabled: | 
|  | 46 | + | 
|  | 47 | + | 
|  | 48 | +### B. eksctl | 
|  | 49 | + | 
|  | 50 | +```bash | 
|  | 51 | +# eksctl | 
|  | 52 | +eksctl create cluster \ | 
|  | 53 | +  --name my-auto-cluster \ | 
|  | 54 | +  --region us-west-2 \ | 
|  | 55 | +  --enable-auto-mode | 
|  | 56 | +``` | 
|  | 57 | + | 
|  | 58 | +### C. AWS Management Console | 
|  | 59 | + | 
|  | 60 | +1. Open the [EKS console](https://console.aws.amazon.com/eks/home#/clusters) | 
|  | 61 | +2. Choose **Quick configuration (with EKS Auto Mode – new)** | 
|  | 62 | +    | 
|  | 63 | +3. Create or select the recommended IAM roles for cluster & nodes   | 
|  | 64 | +    *Cluster IAM roles are created automatically, but you can customize them if needed.* | 
|  | 65 | +     | 
|  | 66 | +    *Node IAM roles are created automatically, but you can customize them if needed.* | 
|  | 67 | +     | 
|  | 68 | +4. Fill in VPC, subnets, and other settings | 
|  | 69 | +5. Review & **Create** | 
|  | 70 | + | 
|  | 71 | +--- | 
|  | 72 | + | 
|  | 73 | +## 2. Verify Auto Mode Is Active | 
|  | 74 | + | 
|  | 75 | +1. **Configure kubeconfig** | 
|  | 76 | + | 
|  | 77 | +   ```bash | 
|  | 78 | +   aws eks --region us-west-2 update-kubeconfig --name my-auto-cluster | 
|  | 79 | +   ``` | 
|  | 80 | +2. **Check for managed CRDs** | 
|  | 81 | + | 
|  | 82 | +   ```bash | 
|  | 83 | +   kubectl get crd | 
|  | 84 | +   ``` | 
|  | 85 | +3. **Inspect NodePools & NodeClasses** | 
|  | 86 | + | 
|  | 87 | +   ```bash | 
|  | 88 | +   kubectl get nodepools | 
|  | 89 | +   kubectl get nodeclasses | 
|  | 90 | +   kubectl get nodeclaims | 
|  | 91 | +   ``` | 
|  | 92 | + | 
|  | 93 | +At this point, no nodes exist until you deploy pods that need them. | 
|  | 94 | + | 
|  | 95 | +--- | 
|  | 96 | + | 
|  | 97 | +## 3. Test with nginx Deployment | 
|  | 98 | + | 
|  | 99 | +1. **Deploy nginx** | 
|  | 100 | + | 
|  | 101 | +   ```bash | 
|  | 102 | +   kubectl create deployment nginx --image=nginx | 
|  | 103 | +   ``` | 
|  | 104 | +2. **Observe a new node spin up** | 
|  | 105 | + | 
|  | 106 | +   ```bash | 
|  | 107 | +   kubectl get pods | 
|  | 108 | +   kubectl get nodes | 
|  | 109 | +   ``` | 
|  | 110 | +3. **Tear down & confirm cleanup** | 
|  | 111 | + | 
|  | 112 | +   ```bash | 
|  | 113 | +   kubectl delete deployment nginx | 
|  | 114 | +   kubectl get nodes  # should return “No resources found” | 
|  | 115 | +   ``` | 
|  | 116 | + | 
|  | 117 | +--- | 
|  | 118 | + | 
|  | 119 | +## 4. Test with Persistent Volume (Alpine-Writer) | 
|  | 120 | + | 
|  | 121 | +Use this manifest (`alpine-writer.yaml`): | 
|  | 122 | + | 
|  | 123 | +```yaml | 
|  | 124 | +apiVersion: apps/v1 | 
|  | 125 | +kind: Deployment | 
|  | 126 | +metadata: | 
|  | 127 | +  name: alpine-writer | 
|  | 128 | +spec: | 
|  | 129 | +  replicas: 1 | 
|  | 130 | +  selector: | 
|  | 131 | +    matchLabels: | 
|  | 132 | +      app: alpine-writer | 
|  | 133 | +  template: | 
|  | 134 | +    metadata: | 
|  | 135 | +      labels: | 
|  | 136 | +        app: alpine-writer | 
|  | 137 | +    spec: | 
|  | 138 | +      containers: | 
|  | 139 | +      - name: alpine-writer | 
|  | 140 | +        image: alpine | 
|  | 141 | +        command: ["/bin/sh","-c","while true; do date >> /mnt/data/date.txt; sleep 1; done"] | 
|  | 142 | +        volumeMounts: | 
|  | 143 | +        - name: data-volume | 
|  | 144 | +          mountPath: /mnt/data | 
|  | 145 | +      volumes: | 
|  | 146 | +      - name: data-volume | 
|  | 147 | +        persistentVolumeClaim: | 
|  | 148 | +          claimName: alpine-writer-pvc | 
|  | 149 | +--- | 
|  | 150 | +apiVersion: v1 | 
|  | 151 | +kind: PersistentVolumeClaim | 
|  | 152 | +metadata: | 
|  | 153 | +  name: alpine-writer-pvc | 
|  | 154 | +spec: | 
|  | 155 | +  storageClassName: gp2 | 
|  | 156 | +  accessModes: | 
|  | 157 | +    - ReadWriteOnce | 
|  | 158 | +  resources: | 
|  | 159 | +    requests: | 
|  | 160 | +      storage: 1Gi | 
|  | 161 | +  volumeMode: Filesystem | 
|  | 162 | +``` | 
|  | 163 | +
 | 
|  | 164 | +1. **Apply the manifest** | 
|  | 165 | +
 | 
|  | 166 | +   ```bash | 
|  | 167 | +   kubectl apply -f alpine-writer.yaml | 
|  | 168 | +   ``` | 
|  | 169 | +2. **Verify pod and PVC** | 
|  | 170 | + | 
|  | 171 | +   ```bash | 
|  | 172 | +   kubectl get po | 
|  | 173 | +   kubectl get pvc | 
|  | 174 | +   ``` | 
|  | 175 | +3. **Inspect the underlying volume** | 
|  | 176 | + | 
|  | 177 | +   ```bash | 
|  | 178 | +   kubectl describe pvc alpine-writer-pvc | 
|  | 179 | +   ``` | 
|  | 180 | +4. **Cleanup** | 
|  | 181 | + | 
|  | 182 | +   ```bash | 
|  | 183 | +   kubectl delete deployment alpine-writer | 
|  | 184 | +   kubectl delete pvc alpine-writer-pvc | 
|  | 185 | +   ``` | 
|  | 186 | + | 
|  | 187 | +--- | 
|  | 188 | + | 
|  | 189 | +## 5. Customization & Tips | 
|  | 190 | + | 
|  | 191 | +* **Custom NodePools / NodeClasses** | 
|  | 192 | +  Create additional NodePools for Spot instances, GPU workloads, or specialized storage without editing the defaults. | 
|  | 193 | +* **DaemonSets** | 
|  | 194 | +  Use DaemonSets to inject logging, monitoring, or security agents across all nodes. | 
|  | 195 | +* **Unsupported Features** | 
|  | 196 | +  Auto Mode currently doesn’t support per-pod security groups, advanced AWS CNI options (warm IP pools, prefix delegation), or custom ENI configurations. | 
|  | 197 | + | 
|  | 198 | +--- | 
|  | 199 | + | 
|  | 200 | +## Conclusion | 
|  | 201 | + | 
|  | 202 | +With EKS Auto Mode, the cluster’s data plane becomes a fully managed appliance: nodes, networking, and storage spring to life only when needed, then retire when idle—all underpinned by AWS best practices. By following the steps above, you’ll have a production-ready EKS experience in minutes, complete with automated scaling, patching, and security. | 
0 commit comments