cloudformation.yaml) to bootstrap IAM resources that allow Karpenter to create and manage nodes and respond to interruption events.
This page describes each section of that template so you can:
- Understand what Karpenter is authorized to do with your EKS cluster and AWS resources
- Create equivalent IAM resources manually when adding Karpenter to an existing cluster
Downloading the template
Template overview
The template is organized into three groups of resources:| Section | Purpose |
|---|---|
| Node authorization | Creates KarpenterNodeRole and attaches it to an instance profile that Karpenter generates at runtime |
| Controller authorization | Creates five IAM managed policies attached to the Karpenter controller service account |
| Interruption handling | Creates an SQS queue and EventBridge rules to route EC2 lifecycle events to Karpenter |
bob-karpenter-demo, the node role would be KarpenterNodeRole-bob-karpenter-demo.
Node authorization
KarpenterNodeRole
This IAM role is attached to the instance profiles Karpenter generates when launching EC2 nodes. It grants nodes the permissions they need to join the cluster and operate.| Policy | Purpose |
|---|---|
AmazonEKS_CNI_Policy | Permissions for the Amazon VPC CNI Plugin to configure EKS worker nodes |
AmazonEKSWorkerNodePolicy | Allows worker nodes to connect to EKS clusters |
AmazonEC2ContainerRegistryPullOnly | Allows pulling images from Amazon ECR |
AmazonSSMManagedInstanceCore | Enables AWS Systems Manager core functions on EC2 instances |
If you have an existing node role you want to reuse, you can skip this step and pass the existing role to your EC2NodeClasses. Make sure the controller’s
iam:PassRole permission covers the role attached to the generated instance profiles.Controller authorization
The Karpenter controller’s IAM permissions are split across five managed policies. When usingeksctl, these policies are attached to the karpenter service account’s IAM role via IRSA or EKS Pod Identity.
KarpenterControllerNodeLifecyclePolicy
Manages EC2 instance and launch template lifecycle operations.AllowScopedEC2InstanceAccessActions
AllowScopedEC2InstanceAccessActions
Allows
RunInstances and CreateFleet to access (but not create) image, snapshot, security-group, subnet, and capacity-reservation resources, scoped to the AWS partition and region.AllowScopedEC2LaunchTemplateAccessActions
AllowScopedEC2LaunchTemplateAccessActions
Allows
RunInstances and CreateFleet to access launch templates that have the kubernetes.io/cluster/${ClusterName}=owned and karpenter.sh/nodepool tags. This ensures Karpenter can only use launch templates it provisioned itself.AllowScopedEC2InstanceActionsWithTags
AllowScopedEC2InstanceActionsWithTags
AllowScopedResourceCreationTagging
AllowScopedResourceCreationTagging
Allows
CreateTags on fleet, instance, volume, network-interface, launch-template, and spot-instances-request resources only during RunInstances, CreateFleet, or CreateLaunchTemplate calls. Prevents Karpenter from tagging resources arbitrarily after creation.AllowScopedResourceTagging
AllowScopedResourceTagging
Allows
CreateTags on instances after creation, restricted to instances Karpenter owns (identified by kubernetes.io/cluster/${ClusterName} and karpenter.sh/nodepool tags). Only the eks:eks-cluster-name, karpenter.sh/nodeclaim, and Name tag keys may be modified.AllowScopedDeletion
AllowScopedDeletion
Allows
TerminateInstances and DeleteLaunchTemplate on resources that have both karpenter.sh/nodepool and kubernetes.io/cluster/${ClusterName} tags set, ensuring Karpenter can only delete resources it owns.KarpenterControllerIAMIntegrationPolicy
Manages IAM instance profile operations so Karpenter can auto-generate profiles for EC2NodeClasses.AllowPassingInstanceRole
AllowPassingInstanceRole
Grants
iam:PassRole on the KarpenterNodeRole so EC2 can use it when assigning permissions to generated instance profiles during node launch.AllowScopedInstanceProfileCreationActions
AllowScopedInstanceProfileCreationActions
Grants
iam:CreateInstanceProfile scoped to requests tagged with kubernetes.io/cluster/${ClusterName}=owned, eks:eks-cluster-name=${ClusterName}, topology.kubernetes.io/region, and a karpenter.k8s.aws/ec2nodeclass tag.AllowScopedInstanceProfileTagActions
AllowScopedInstanceProfileTagActions
Grants
iam:TagInstanceProfile restricted to instance profiles owned by Karpenter for this cluster (enforced via both ResourceTag and RequestTag conditions).AllowScopedInstanceProfileActions
AllowScopedInstanceProfileActions
Grants
iam:AddRoleToInstanceProfile, iam:RemoveRoleFromInstanceProfile, and iam:DeleteInstanceProfile on instance profiles tagged with kubernetes.io/cluster/${ClusterName}=owned and the current region. If you configure Karpenter to use a new role via an EC2NodeClass, ensure that role is also covered by your iam:PassRole permission.KarpenterControllerEKSIntegrationPolicy
Enables Karpenter to discover the Kubernetes cluster’s external API endpoint.If you are not using an EKS control plane, you must specify the cluster endpoint explicitly using the
CLUSTER_ENDPOINT environment variable or --cluster-endpoint CLI flag.KarpenterControllerInterruptionPolicy
Grants read/delete access to the SQS interruption queue.KarpenterControllerResourceDiscoveryPolicy
Provides read-only access for resource discovery.AllowRegionalReadActions
AllowRegionalReadActions
Allows read-only EC2 Describe actions scoped to the current region:
AllowSSMReadActions
AllowSSMReadActions
Allows
ssm:GetParameter for AWS service SSM parameters (used to discover the latest EKS-optimized AMI IDs):AllowPricingReadActions
AllowPricingReadActions
Allows
pricing:GetProducts globally (pricing data is not available in every region):Set
ISOLATED_VPC=true if your cluster cannot reach the AWS pricing endpoint. Karpenter will fall back to on-demand pricing estimates.AllowUnscopedInstanceProfileListAction and AllowInstanceProfileReadActions
AllowUnscopedInstanceProfileListAction and AllowInstanceProfileReadActions
Allows
iam:ListInstanceProfiles globally and iam:GetInstanceProfile on all instance profiles to check whether a profile has been provisioned for an EC2NodeClass:Interruption handling
This section creates an SQS queue and EventBridge rules that route EC2 lifecycle events to Karpenter. Karpenter uses these events to proactively reschedule workloads before instances are reclaimed.Interruption handling is optional. Enable it by setting the
INTERRUPTION_QUEUE environment variable to the SQS queue name (matching your cluster name). See Settings.Supported events
| Event | Source | Description |
|---|---|---|
| AWS Health Event | aws.health | Scheduled maintenance and AWS health notifications |
| EC2 Spot Instance Interruption Warning | aws.ec2 | 2-minute warning before a Spot instance is reclaimed |
| EC2 Instance Rebalance Recommendation | aws.ec2 | Signal that a Spot instance is at elevated interruption risk |
| EC2 Instance State-change Notification | aws.ec2 | Instance state transitions (pending, running, stopping, terminated) |
KarpenterInterruptionQueue
An SQS standard queue named after your cluster with a 5-minute message retention period and server-side encryption enabled:KarpenterInterruptionQueuePolicy
Allowsevents.amazonaws.com and sqs.amazonaws.com to send messages to the queue. Denies all non-HTTPS connections to enforce encryption in transit:
EventBridge rules
Four EventBridge rules route events into the interruption queue:Manual IAM setup
If you are adding Karpenter to an existing cluster without usingcloudformation.yaml, create the five controller policies described above and attach them to the IAM role used by Karpenter’s service account. You can use IRSA or EKS Pod Identity: