EKS Auto Mode [Bug]: Auto Mode was not able to create a node pool with EC2NodeClass
- Dominant language
- Shell
- Stars
- 5.4k
- Forks
- 334
- PR merge metrics
- No merged PRs in 30d
Description
I have been able to create NodePool using the built-in NodeClass. However, it was not able to create a node pool with EC2NodeClass.
Environments:
EKS: v1.31
Auto-Mode: enabled
Karpenter Controler: No (because it's included in the Auto Mode)
Karpenter CRDs: yes (Default Auto Mode does not have EC2NodeClass installed)
Reason to use EC2NodeClass:
- Not able to EBS snapshots with the built-in eks NodeClass
=======================
EC2NodeClass.yaml
```yaml
apiVersion: karpenter.k8s.aws/v1
kind: EC2NodeClass
metadata:
annotations:
meta.helm.sh/release-name: cpu-x86-karpenter
meta.helm.sh/release-namespace: karpenter-resources
labels:
app.kubernetes.io/managed-by: Helm
name: cpu-x86
spec:
amiFamily: Bottlerocket
amiSelectorTerms:
- alias: bottlerocket@latest
blockDeviceMappings:
- deviceName: /dev/xvda
ebs:
deleteOnTermination: true
encrypted: true
volumeSize: 100Gi
volumeType: gp3
detailedMonitoring: true
metadataOptions:
httpEndpoint: enabled
httpProtocolIPv6: disabled
httpPutResponseHopLimit: 2
httpTokens: required
role: xxx-eks-auto-20250110154059234000000002
securityGroupSelectorTerms:
- tags:
aws:eks:cluster-name: xxxx
subnetSelectorTerms:
- tags:
karpenter.sh/discovery: xxxx
tags:
Name: karpenter-cpu-x86
```
Nodepool.yaml
```yaml
apiVersion: karpenter.sh/v1
kind: NodePool
metadata:
annotations:
meta.helm.sh/release-name: cpu-x86-karpenter
meta.helm.sh/release-namespace: karpenter-resources
labels:
app.kubernetes.io/managed-by: Helm
name: cpu-x86
spec:
disruption:
budgets:
- nodes: 10%
consolidateAfter: 300s
consolidationPolicy: WhenEmpty
limits:
cpu: 100
memory: 1000Gi
template:
metadata:
labels:
auto-mode/group-name: cpu-x86
auto-mode/kind: ec2-node-class
spec:
expireAfter: 360h
nodeClassRef:
group: karpenter.k8s.aws
kind: EC2NodeClass
name: cpu-x86
requirements:
- key: karpenter.k8s.aws/instance-family
operator: In
values:
- m5
- key: karpenter.k8s.aws/instance-size
operator: In
values:
- xlarge
- 2xlarge
- 4xlarge
- 8xlarge
- key: kubernetes.io/arch
operator: In
values:
- amd64
- key: kubernetes.io/os
operator: In
values:
- linux
- key: karpenter.sh/capacity-type
operator: In
values:
- spot
- on-demand
terminationGracePeriod: 48h
```
Am I missing anything?
Thanks!
Contributor guide
Research direction
Start with the EC2NodeClass.yaml and Nodepool.yaml manifests and reproduce the failure on EKS v1.31 with Auto Mode enabled. Inspect the resulting NodePool and EC2NodeClass status or events to identify why the custom class is not creating nodes; done means the EC2NodeClass-backed NodePool provisions successfully and supports the stated EBS snapshot use case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, yaml
- Domain
- cloud, infrastructure
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100