Skip to content


This pattern demonstrates how to provision Karpenter on a serverless cluster (serverless data plane) using Fargate Profiles.


See here for the prerequisites and steps to deploy this pattern.


  1. Test by listing the nodes in the cluster. You should see four Fargate nodes in the cluster:

    kubectl get nodes
    NAME                                                STATUS   ROLES    AGE     VERSION   Ready    <none>   5m20s   v1.28.2-eks-f8587cb   Ready    <none>   5m2s    v1.28.2-eks-f8587cb    Ready    <none>   5m3s    v1.28.2-eks-f8587cb   Ready    <none>   5m12s   v1.28.2-eks-f8587cb
  2. Provision the Karpenter EC2NodeClass and NodePool resources which provide Karpenter the necessary configurations to provision EC2 resources:

    kubectl apply -f karpenter.yaml
  3. Once the Karpenter resources are in place, Karpenter will provision the necessary EC2 resources to satisfy any pending pods in the scheduler's queue. You can demonstrate this with the example deployment provided. First deploy the example deployment which has the initial number replicas set to 0:

    kubectl apply -f example.yaml
  4. When you scale the example deployment, you should see Karpenter respond by quickly provisioning EC2 resources to satisfy those pending pod requests:

    kubectl scale deployment inflate --replicas=3
  5. Listing the nodes should now show some EC2 compute that Karpenter has created for the example deployment:

    kubectl get nodes
    NAME                                                STATUS   ROLES    AGE   VERSION   Ready    <none>   13m   v1.28.2-eks-f8587cb   Ready    <none>   12m   v1.28.2-eks-f8587cb    Ready    <none>   12m   v1.28.2-eks-f8587cb   Ready    <none>   13m   v1.28.2-eks-f8587cb           Ready    <none>   29s   v1.28.2-eks-a5df82a # <== EC2 created by Karpenter


Scale down the deployment to de-provision Karpenter created resources first:

kubectl delete -f example.yaml
terraform destroy -target="module.eks_blueprints_addons" -auto-approve
terraform destroy -target="module.eks" -auto-approve
terraform destroy -auto-approve

See here for more details on cleaning up the resources created.