Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
sangnguyen7 opened this issue Jan 21, 2025 · 4 comments

Comments

@sangnguyen7
Copy link

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!

@mikestef9
Copy link
Contributor

See EKS docs https://docs.aws.amazon.com/eks/latest/userguide/create-node-class.html

Kind is different with Auto Mode

@sangnguyen7
Copy link
Author

Thanks @mikestef9! yes, I was able to create a NodePool using the default NodeClass kind. However, NodeClass doesn't support using EBS Snapshots with Bottlerocket as documented here: https://github.com/aws-samples/bottlerocket-images-cache/tree/main

This is why I'm trying to use EC2NodeClass on EKS Auto Mode to achieve EBS snapshot functionality.

@mikestef9
Copy link
Contributor

That's not possible. Sounds like this more a feature request where you need snapshotID supported on NodeClass with Auto Mode? We've heard that from a number of users so far and evaluating adding it.

@sangnguyen7
Copy link
Author

@mikestef9, yes that's correct. Currently, it seems NodeClass does not have that feature. And you're saying that it's not possible to use EC2NodeClass on Auto Mode ? Or do you know anyway to achieve that on an Auto Mode enabled cluster?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants