Skip to content

EKS Auto Mode [Bug]: Auto Mode was not able to create a node pool with EC2NodeClass #2524

Open
@sangnguyen7

Description

@sangnguyen7

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

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

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions