Skip to content

Commit ab9956f

Browse files
committed
docs(eks-v2-alpha): clarify v2 capacity architecture
1 parent 2bde1a0 commit ab9956f

File tree

1 file changed

+75
-24
lines changed

1 file changed

+75
-24
lines changed

packages/@aws-cdk/aws-eks-v2-alpha/README.md

Lines changed: 75 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -39,33 +39,84 @@ const cluster = new eks.Cluster(this, 'hello-eks', {
3939

4040
## Architecture
4141

42-
```text
43-
+-----------------------------------------------+
44-
| EKS Cluster | kubectl | |
45-
| -----------------|<--------+| Kubectl Handler |
46-
| AWS::EKS::Cluster (Optional) |
47-
| +--------------------+ +-----------------+ |
48-
| | | | | |
49-
| | Managed Node Group | | Fargate Profile | |
50-
| | | | | |
51-
| +--------------------+ +-----------------+ |
52-
+-----------------------------------------------+
53-
^
54-
| connect self managed capacity
55-
+
56-
+--------------------+
57-
| Auto Scaling Group |
58-
+--------------------+
42+
```text +-----------------+
43+
kubectl | |
44+
+------------>| Kubectl Handler |
45+
| | (Optional) |
46+
| +-----------------+
47+
+-------------------------------------+-------------------------------------+
48+
| EKS Cluster (Auto Mode) |
49+
| AWS::EKS::Cluster |
50+
| |
51+
| +---------------------------------------------------------------------+ |
52+
| | Auto Mode Compute (Managed by EKS) (Default) | |
53+
| | | |
54+
| | - Automatically provisions EC2 instances | |
55+
| | - Auto scaling based on pod requirements | |
56+
| | - No manual node group configuration needed | |
57+
| | | |
58+
| +---------------------------------------------------------------------+ |
59+
| |
60+
+---------------------------------------------------------------------------+
5961
```
60-
6162
In a nutshell:
6263

63-
- EKS Cluster - The cluster endpoint created by EKS.
64-
- Managed Node Group - EC2 worker nodes managed by EKS.
65-
- Fargate Profile - Fargate worker nodes managed by EKS.
66-
- Auto Scaling Group - EC2 worker nodes managed by the user.
67-
- Kubectl Handler (Optional) - Custom resource (i.e Lambda Function) for invoking kubectl commands on the
68-
cluster - created by CDK
64+
- **Auto Mode** (Default) – The fully managed capacity mode in EKS.
65+
EKS automatically provisions and scales EC2 capacity based on pod requirements.
66+
It manages internal *system* and *general-purpose* NodePools, handles networking and storage setup, and removes the need for user-managed node groups or Auto Scaling Groups.
67+
```ts
68+
const cluster = new eks.Cluster(this, 'AutoModeCluster', {
69+
version: eks.KubernetesVersion.V1_33,
70+
// Auto Mode is enabled by default
71+
});
72+
```
73+
74+
- **Managed Node Groups** – The semi-managed capacity mode.
75+
EKS provisions and manages EC2 nodes on your behalf but you configure the instance types, scaling ranges, and update strategy.
76+
AWS handles node health, draining, and rolling updates while you retain control over scaling and cost optimization.
77+
78+
You can also define *Fargate Profiles* that determine which pods or namespaces run on Fargate infrastructure.
79+
80+
```ts
81+
const cluster = new eks.Cluster(this, 'ManagedNodeCluster', {
82+
version: eks.KubernetesVersion.V1_33,
83+
defaultCapacityType: eks.DefaultCapacityType.NODEGROUP,
84+
});
85+
86+
// Add a Fargate Profile for specific workloads (e.g., default namespace)
87+
cluster.addFargateProfile('FargateProfile', {
88+
selectors: [
89+
{ namespace: 'default' }, // Run pods in 'default' on Fargate
90+
],
91+
});
92+
```
93+
94+
- **Fargate Mode** – The Fargate capacity mode.
95+
EKS runs your pods directly on AWS Fargate without provisioning EC2 nodes.
96+
```ts
97+
const cluster = new eks.FargateCluster(this, 'FargateCluster', {
98+
version: eks.KubernetesVersion.V1_33,
99+
});
100+
```
101+
102+
- **Self-Managed Nodes** – The fully manual capacity mode.
103+
You create and manage EC2 instances (via an Auto Scaling Group) and connect them to the cluster manually.
104+
This provides maximum flexibility for custom AMIs or configurations but also the highest operational overhead.
105+
```ts
106+
const cluster = new eks.Cluster(this, 'SelfManagedCluster', {
107+
version: eks.KubernetesVersion.V1_33,
108+
});
109+
110+
// Add self-managed Auto Scaling Group
111+
cluster.addAutoScalingGroupCapacity('self-managed-asg', {
112+
instanceType: ec2.InstanceType.of(ec2.InstanceClass.T3, ec2.InstanceSize.MEDIUM),
113+
minCapacity: 1,
114+
maxCapacity: 5,
115+
});
116+
```
117+
118+
- **Kubectl Handler (Optional)** – A Lambda-backed custom resource created by the AWS CDK to execute `kubectl` commands (like `apply` or `patch`) during deployment.
119+
Regardless of the capacity mode, this handler may still be created to apply Kubernetes manifests as part of CDK provisioning.
69120

70121
## Provisioning cluster
71122

0 commit comments

Comments
 (0)