Skip to content

[Bug] CapacityReservationId doesn't work #8320

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

Open
Shellmode opened this issue Mar 29, 2025 · 1 comment
Open

[Bug] CapacityReservationId doesn't work #8320

Shellmode opened this issue Mar 29, 2025 · 1 comment
Labels

Comments

@Shellmode
Copy link

Shellmode commented Mar 29, 2025

What were you trying to accomplish?

Use eksctl to create a nodegroup with capacity block reservation.

BTW, great to have this feature at #8207

What happened?

The cloudformation template created by eksctl doesn't contain CapacityReservationId field.

How to reproduce it?

Use following commands to reproduce (But I think it might be difficult to have a real CapacityReservationId for dev team to debug)

## Change to your own
VPCID="vpc-123456789012"
SUBNET="subnet-123456789012"
CLUSTER_NAME="test-cluster"
AWS_DEFAULT_REGION="ap-southeast-3" # not sure if it's region related, so keep to my problem region
K8S_VERSION="1.32"

cat << EOF > al2-gpu-p5en.48xlarge-nodegroup.yaml
apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig

metadata:
  name: ${CLUSTER_NAME}
  region: ${AWS_DEFAULT_REGION}

managedNodeGroups:
- name: p5en-ng-efa-al2
  instanceType: p5en.48xlarge
  amiFamily: AmazonLinux2
  privateNetworking: true
  efaEnabled: true
  capacityReservation:
    capacityReservationTarget:
      capacityReservationId: "cr-1234567890"  # Replace with a real Capacity Block ID
  instanceMarketOptions:
    marketType: capacity-block
  iam:
    attachPolicyARNs:
    - arn:aws:iam::aws:policy/AmazonEKSWorkerNodePolicy
    - arn:aws:iam::aws:policy/AmazonEKS_CNI_Policy
    - arn:aws:iam::aws:policy/AmazonEC2ContainerRegistryReadOnly
    - arn:aws:iam::aws:policy/AmazonSSMManagedInstanceCore
    - arn:aws:iam::aws:policy/CloudWatchAgentServerPolicy        
  desiredCapacity: 1
  minSize: 1
  maxSize: 1
  volumeSize: 200
  tags:
    "eks/node-type": "gpu"
  labels:
    eks/node-type: gpu
    eks/gpu-type: nvidia
    nvidia.com/gpu.present: "true"
  taints:
  - key: nvidia.com/gpu
    effect: "NoSchedule"
  subnets:
      - ${SUBNET} 
  ssh: # use existing EC2 key
    publicKeyName: testkey
      
EOF

The cloudformation template created by eksctl is just like this, missing CapacityReservationId field, which makes the stack failed

{
...
           "LaunchTemplate": {
            "Type": "AWS::EC2::LaunchTemplate",
            "Properties": {
                "LaunchTemplateData": {
                    ...
                    "CapacityReservationSpecification": {
                        "CapacityReservationTarget": {}
                    },
                    ...
...
}

I have to download the template, edit it and create a new one.

Logs

Anything else we need to know?

Versions

$ eksctl info
eksctl version: 0.206.0
kubectl version: v1.32.0-eks-5ca49cb
OS: linux
Copy link
Contributor

Hello Shellmode 👋 Thank you for opening an issue in eksctl project. The team will review the issue and aim to respond within 1-5 business days. Meanwhile, please read about the Contribution and Code of Conduct guidelines here. You can find out more information about eksctl on our website

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

No branches or pull requests

1 participant