Discuss your project

Blog

Who spends what on EKS: Karpenter node pools and cost per pool in Grafana

Mher Poghosyan · 29 November 2026 · 7 min read

The AWS bill tells you what an EKS cluster costs. It does not tell you who spends it. Compute is one big EC2 line, and when it grows, the honest answer to “why?” is often a guess.

On the service team of an iGaming and crypto company, our lead engineer, Mher Poghosyan, made Karpenter part of the EKS stack of the company-wide Terragrunt platform, with node interruption handling through SQS, and broke down production EKS costs by node pool in Grafana dashboards. This article explains the three parts: NodePools for different kinds of workloads, the interruption queue, and how to attribute cost to a node pool.

Why the node pool is the right unit

You pay for nodes, not for pods. Karpenter labels every node it creates with karpenter.sh/nodepool and tags the EC2 instance with the same key. If NodePools follow kinds of workloads, cost per pool answers a business question: what do the stateless services cost, what do stateful workloads cost, what does the nightly batch cost.

Putting Karpenter into the EKS stack, rather than installing it by hand per cluster, means every cluster built from the stack gets node autoscaling, interruption handling and the same labels from the start. How that platform cut a new environment from 2–3 days to 30 minutes is a separate article.

NodePools for different workloads

A typical split looks like this:

NodePool For Capacity Disruption
general stateless services spot and on-demand consolidate underused nodes
critical stateful and latency-sensitive on-demand only only empty nodes, one at a time
batch jobs spot only consolidate quickly

The general pool, in the Karpenter v1 API:

apiVersion: karpenter.sh/v1
kind: NodePool
metadata:
  name: general
spec:
  template:
    spec:
      nodeClassRef:
        group: karpenter.k8s.aws
        kind: EC2NodeClass
        name: default
      requirements:
        - key: karpenter.sh/capacity-type
          operator: In
          values: ["spot", "on-demand"]
        - key: karpenter.k8s.aws/instance-category
          operator: In
          values: ["c", "m", "r"]
        - key: karpenter.k8s.aws/instance-generation
          operator: Gt
          values: ["5"]
      expireAfter: 720h
  limits:
    cpu: "400"               # a hard ceiling for this pool
  disruption:
    consolidationPolicy: WhenEmptyOrUnderutilized
    consolidateAfter: 1m
---
apiVersion: karpenter.k8s.aws/v1
kind: EC2NodeClass
metadata:
  name: default
spec:
  role: KarpenterNodeRole-<cluster-name>
  amiSelectorTerms:
    - alias: al2023@latest   # pin a tested version in production
  subnetSelectorTerms:
    - tags:
        karpenter.sh/discovery: <cluster-name>
  securityGroupSelectorTerms:
    - tags:
        karpenter.sh/discovery: <cluster-name>

The critical pool differs in three places: capacity-type is on-demand only, it has a taint so that only workloads that ask for it land there, and its disruption settings are conservative:

  template:
    spec:
      taints:
        - key: workload/critical
          effect: NoSchedule
  disruption:
    consolidationPolicy: WhenEmpty
    consolidateAfter: 10m
    budgets:
      - nodes: "1"

A workload opts in with a node selector and a toleration:

nodeSelector:
  karpenter.sh/nodepool: critical
tolerations:
  - key: workload/critical
    operator: Exists
    effect: NoSchedule

Two settings deserve attention. limits stops a runaway deployment from scaling a pool without bound; it is the closest thing to a budget inside the cluster. And an AMI alias of latest means a new AMI release makes Karpenter replace your nodes, so production should pin a version you have tested.

Interruption handling through SQS

Spot capacity comes with a two-minute warning before EC2 reclaims the instance. AWS also schedules maintenance events, and instances can be stopped or terminated outside Kubernetes. Without interruption handling, Karpenter finds out when the node is already gone, and pods die without a clean drain.

With it, EventBridge sends these events to an SQS queue. Karpenter reads the queue and taints, drains and replaces the node ahead of the interruption. In Terraform, the queue and rules look like this:

resource "aws_sqs_queue" "karpenter" {
  name                      = "karpenter-${var.cluster_name}"
  message_retention_seconds = 300
  sqs_managed_sse_enabled   = true
}

data "aws_iam_policy_document" "karpenter_queue" {
  statement {
    actions   = ["sqs:SendMessage"]
    resources = [aws_sqs_queue.karpenter.arn]
    principals {
      type        = "Service"
      identifiers = ["events.amazonaws.com", "sqs.amazonaws.com"]
    }
  }
}

resource "aws_sqs_queue_policy" "karpenter" {
  queue_url = aws_sqs_queue.karpenter.id
  policy    = data.aws_iam_policy_document.karpenter_queue.json
}

locals {
  karpenter_events = {
    health       = { source = ["aws.health"], "detail-type" = ["AWS Health Event"] }
    spot         = { source = ["aws.ec2"], "detail-type" = ["EC2 Spot Instance Interruption Warning"] }
    rebalance    = { source = ["aws.ec2"], "detail-type" = ["EC2 Instance Rebalance Recommendation"] }
    state-change = { source = ["aws.ec2"], "detail-type" = ["EC2 Instance State-change Notification"] }
  }
}

resource "aws_cloudwatch_event_rule" "karpenter" {
  for_each      = local.karpenter_events
  name          = "karpenter-${var.cluster_name}-${each.key}"
  event_pattern = jsonencode(each.value)
}

resource "aws_cloudwatch_event_target" "karpenter" {
  for_each = local.karpenter_events
  rule     = aws_cloudwatch_event_rule.karpenter[each.key].name
  arn      = aws_sqs_queue.karpenter.arn
}

These rules follow Karpenter’s reference template. Its current version also has a rule for capacity reservation interruptions, so compare when you set this up. Then point Karpenter at the queue in its Helm values:

settings:
  clusterName: <cluster-name>
  interruptionQueue: karpenter-<cluster-name>

The controller role needs sqs:ReceiveMessage, sqs:DeleteMessage and sqs:GetQueueUrl on that queue. Three practical notes:

Cost per node pool: two data sources

The Grafana side needs two inputs: which pool each node belongs to, and what each node costs. There are two common ways to get them. We describe both as options; which one fits depends on the question you need answered.

Option 1: metrics from the cluster. kube-state-metrics exports node labels, but only the ones you allow:

--metric-labels-allowlist=nodes=[karpenter.sh/nodepool,karpenter.sh/capacity-type]

OpenCost exports what each node costs per hour as the Prometheus metric node_total_hourly_cost. Joined on the node name, the two give hourly cost per pool:

sum by (label_karpenter_sh_nodepool) (
  node_total_hourly_cost
  * on (node) group_left (label_karpenter_sh_nodepool)
  kube_node_labels
)

Multiply by 730 for a monthly run rate. For money actually spent over a period, sum hourly samples with a subquery:

sum by (label_karpenter_sh_nodepool) (
  sum_over_time((
    node_total_hourly_cost
    * on (node) group_left (label_karpenter_sh_nodepool)
    kube_node_labels
  )[30d:1h])
)

The most useful panel next to cost is how much of each pool is actually requested:

sum by (label_karpenter_sh_nodepool) (
  sum by (node) (kube_pod_container_resource_requests{resource="cpu"})
  * on (node) group_left (label_karpenter_sh_nodepool) kube_node_labels
)
/
sum by (label_karpenter_sh_nodepool) (
  kube_node_status_allocatable{resource="cpu"}
  * on (node) group_left (label_karpenter_sh_nodepool) kube_node_labels
)

This option is close to real time and works per pod and per namespace too. Its weak spot is price accuracy: by default the numbers are list prices, so discounts such as Savings Plans are not in them, and spot prices should be checked against the bill.

Option 2: the AWS bill. Since Karpenter tags every instance with karpenter.sh/nodepool, activate that key as a cost allocation tag in AWS Billing. Cost Explorer can then group EC2 cost by node pool, and the Cost and Usage Report, queried through Athena, can feed the same Grafana dashboard. These are the exact amounts you pay, with discounts and real spot prices, but they arrive daily and with a delay.

In practice the two work well together: cluster metrics for daily decisions, the bill to check the totals once a month.

What the breakdown lets you decide

What node pools do not show

Node cost is only part of the EKS bill. The control plane fee per cluster, EBS volumes, load balancers, NAT gateways and cross-zone data transfer do not belong to any node pool. Show them as separate panels, so the dashboard total matches the bill and nobody stops trusting it.

DaemonSets are another hidden cost: every node pays for the CNI, the log shipper, monitoring agents and, if you run an ambient service mesh, ztunnel (see our article about a zero-trust Istio mesh). Many small nodes multiply that overhead, which is one more reason to let Karpenter choose larger instances where it can.

Checklist

NodePools and EC2NodeClasses are plain Kubernetes objects, so they can live in git and ship like any other app; our ApplicationSet article shows one way to structure that. If your EKS bill keeps growing and nobody can say why, tell us what is in the way.

#aws#kubernetes#karpenter#finops