Skip to content

EKS Karpenter tutorial CloudFormation deployment fails

0

I'm deploying the getting-started-with-karpenter cloudformation file from the official Getting Started with Karpenter tutorial with:

curl -fsSL https://raw.githubusercontent.com/aws/karpenter-provider-aws/v1.8.1/website/content/en/preview/getting-started/getting-started-with-karpenter/cloudformation.yaml -o /tmp/cloud-formation-template.yaml
aws cloudformation deploy --stack-name Karpenter-my-name --template-file /tmp/cloud-formation-template.yaml --capabilities CAPABILITY_NAMED_IAM --parameter-overrides ClusterName=my-name --region us-east-1

And I get the following error:

Waiting for changeset to be created..
Waiting for stack create/update to complete

Failed to create/update the stack. Run the following command
to fetch the list of events leading up to the failure
aws cloudformation describe-stack-events --stack-name Karpenter-my-name

Unfortunately when I run the suggested debug command I get the following error:

An error occurred (ValidationError) when calling the DescribeStackEvents operation: Stack [Karpenter-my-name] does not exist

So uh... what's going on? Can also confirm if the tutorial is not working for them? Can someone please fix said tutorial if so; it's always a bad look when the tutorial doesn't work.

asked 9 months ago215 views

3 Answers
1

Hi @Zach,

I just tried this stack and it applied successfully for me.. In your deploy command you used --region us-east-1 but not on the describe-stack, maybe that's why the stack isn't found ?

aws cloudformation describe-stack-events --stack-name Karpenter-my-name --region us-east-1

You could also go in the cloudformation console to confirm, there should be a stack somewhere :) If you used the --disable-rollback you would have the stack stopped at the failure. This stack creates SQS, IAM Role, Policies, and Event rules, maybe it's a permission error?

AWS

answered 9 months ago

  • Thanks, that was in fact my (dumb) error.

0

[+] I have replicated your scenario in my testing environment by deploying Karpenter to my EKS cluster with specific configurations for my cluster and region using the following commands:

==================

curl -fsSL https://raw.githubusercontent.com/aws/karpenter-provider-aws/v1.8.1/website/content/en/preview/getting-started/getting-started-with-karpenter/cloudformation.yaml -o /tmp/cloud-formation-template.yaml

aws cloudformation deploy --stack-name Karpenter-my-name --template-file /tmp/cloud-formation-template.yaml --capabilities CAPABILITY_NAMED_IAM --parameter-overrides ClusterName=my-cluster-name --region my-region

===================

[+] However , my cloud formation Stack was deployed successfully as mentioned below:

===================

Waiting for changeset to be created.. Waiting for stack create/update to complete Successfully created/updated stack - Karpenter-my-name

===================

[+] When I describe the stack using the following command i can see the stack details as mentioned below:

===================

aws cloudformation describe-stack-events --stack-name Karpenter-my-name

{ "StackId": "arn:aws:cloudformation:us-west-2:<Account_ID>:stack/Karpenter-my-name/00f3c100-b322-11f0-a8b9-0a7b4c7dd303", "EventId": "ScheduledChangeRule-CREATE_COMPLETE-2025-10-27T10:46:50.290Z", "StackName": "Karpenter-my-name" }

===================

[+] In your case, you're deploying the CloudFormation stack to the us-east-1 region. The error you're encountering as "An error occurred (ValidationError) when calling the DescribeStackEvents operation: Stack [Karpenter-my-name] does not exist"

[+] This likely occurs because you haven't specified the region in your describe command and your AWS credentials are configured for a different default region.

[+] To resolve this, Could please try the describe command with the region specified as mentioned below:

===================

aws cloudformation describe-stack-events --stack-name Karpenter-my-name --region us-east-1

===================

[+] Additionally, you can add the --disable-rollback flag to your CloudFormation deploy command to prevent automatic rollback on failure, which will help preserve the stack for debugging as mentioned below:

===================

aws cloudformation deploy --stack-name Karpenter-my-name --template-file /tmp/cloud-formation-template.yaml --capabilities CAPABILITY_NAMED_IAM --parameter-overrides ClusterName=my-name --region us-east-1 --disable-rollback

===================

[+] Additionally, for more detailed analysis of the issue, you can consider reaching out to AWS Premium Support [1]

Reference: [1] https://aws.amazon.com/premiumsupport/

AWS

answered 9 months ago

-1

The issue you're experiencing with the Karpenter CloudFormation deployment could be due to several factors:

  1. The CloudFormation stack failed to create and was automatically rolled back, which is why you're seeing the "Stack does not exist" error when trying to describe stack events.

  2. There might be issues with IAM permissions, service quotas, or configuration parameters in your deployment.

To troubleshoot this issue, I recommend the following steps:

  1. Check if you have sufficient permissions to create all the resources defined in the CloudFormation template, including IAM roles and policies.

  2. Try adding the --no-fail-on-empty-changeset flag to your CloudFormation deploy command to prevent failures when no changes are detected.

  3. Add the --disable-rollback flag to your CloudFormation deploy command to prevent automatic rollback on failure, which will help preserve the stack for debugging:

aws cloudformation deploy --stack-name Karpenter-my-name --template-file /tmp/cloud-formation-template.yaml --capabilities CAPABILITY_NAMED_IAM --parameter-overrides ClusterName=my-name --region us-east-1 --disable-rollback
  1. Ensure your EKS cluster is running a supported Kubernetes version. The latest EKS versions (1.25 through 1.33) are supported, so make sure your cluster version is compatible.

  2. Verify that you've created the necessary service-linked roles for your AWS account.

  3. If you're running multiple replicas of Karpenter, try reducing the Karpenter deployment replicas to one, as multiple replicas can sometimes cause conflicts.

If the issue persists, you might need to examine the CloudFormation events more closely by using the AWS Management Console to view the stack creation failure details, as the CLI command isn't working due to the stack being automatically deleted after failure.
Sources
Deploying Karpenter Nodes with Multus on Amazon EKS | Containers
Troubleshoot cluster scaling in Amazon EKS with Karpenter autoscaler | AWS re:Post
Supported Kubernetes versions - AWS Batch

answered 9 months ago

  • The most useful part of this AI answer seemed to be the --disable-rollback hint, but it didn't actually work / I still got the "does not exist" error.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.