Skip to content

Commit 362ac9c

Browse files
Merge pull request #139 from anveshmuppeda/dev
Adding new : Amazon EKS Auto Mode: A Hands-On Guide
2 parents c06e42b + d6dd2f4 commit 362ac9c

File tree

6 files changed

+237
-0
lines changed

6 files changed

+237
-0
lines changed

docs/eks-guides/006-eks-auto-mode.md

Lines changed: 196 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,200 @@
33
sidebar_label: "EKS Auto Mode"
44
sidebar_position: 5
55
---
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
69

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+
![EKS Auto Mode](./img/eks-auto-mode.png)
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+
![EKS Console](./img/eks-auto-mode-create.png)
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+
![Cluster IAM Roles](./img/eks-auto-cluster-role.png)
66+
*Node IAM roles are created automatically, but you can customize them if needed.*
67+
![Node IAM Role](./img/eks-auto-node-role.png)
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.
288 KB
Loading
383 KB
Loading
622 KB
Loading
308 KB
Loading
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: alpine-writer
5+
spec:
6+
replicas: 1
7+
selector:
8+
matchLabels:
9+
app: alpine-writer
10+
template:
11+
metadata:
12+
labels:
13+
app: alpine-writer
14+
spec:
15+
containers:
16+
- name: alpine-writer
17+
image: alpine
18+
command: ["/bin/sh", "-c", "while true; do echo $(date) >> /mnt/data/date.txt; sleep 1; done"]
19+
volumeMounts:
20+
- name: data-volume
21+
mountPath: /mnt/data
22+
volumes:
23+
- name: data-volume
24+
persistentVolumeClaim:
25+
claimName: alpine-writer-pvc
26+
---
27+
apiVersion: v1
28+
kind: PersistentVolumeClaim
29+
metadata:
30+
name: alpine-writer-pvc
31+
spec:
32+
storageClassName: gp2
33+
accessModes:
34+
- ReadWriteOnce # the volume can be mounted as read-write by a single node.
35+
resources:
36+
requests:
37+
storage: 1Gi
38+
volumeMode: Filesystem
39+
# Filesystem is the default mode used when volumeMode parameter is omitted.
40+
# A volume with volumeMode: Filesystem is mounted into Pods into a directory. If the volume is backed by a block device and the device is empty, Kubernetes creates a filesystem on the device before mounting it for the first time.
41+
# You can set the value of volumeMode to Block to use a volume as a raw block device. Such volume is presented into a Pod as a block device, without any filesystem on it. This mode is useful to provide a Pod the fastest possible way to access a volume, without any filesystem layer between the Pod and the volume.

0 commit comments

Comments
 (0)