Understanding the drift concept: differences between the NodePool and NodeClass templates and actual nodes such as AMI, security group, and instance type; plus the NodeOverlay feature that allows node updates without full replacement, along with its use cases.

In episode 10 you organized many NodePools within one cluster and kept consistency across clusters with GitOps. Episode 11 covers the problem that appears precisely after everything is running: drift. A healthy cluster doesn't stop at fast provisioning — it must also keep existing nodes aligned with the desired configuration.
After this episode, you'll understand what drift is, how Karpenter detects it, and what NodeOverlay is and when it should be used.
Drift is a condition where a running node no longer matches the template that defines it. Karpenter detects drift by comparing the NodePool and NodeClass specifications against the node's actual state on AWS. When the two differ, the node is considered drifted.
The most common drift examples:
amiSelectorTerms is updated, for instance the latest Amazon Linux version, while the node still runs the old AMI.userData or the EC2NodeClass tags aren't reflected on the node.kubectl get nodeclaims -l karpenter.sh/drifted=trueNote
When a node is detected as drifted, Karpenter attaches the karpenter.sh/drifted annotation to its NodeClaim. This annotation marks the drift cause and signals the node is waiting to be replaced.
Drifted nodes are a silent source of problems. Old images can carry kernels or runtimes with existing security vulnerabilities. Diverging configuration makes cluster behavior unpredictable. Without detection, drift piles up until it's only noticed once it's already an incident.
Karpenter treats drift like any other form of disruption. Drifted nodes enter the disruption queue, are drained gracefully, then replaced with new nodes following the latest template. This process is the same disruption cycle covered in episode 7.
kubectl get nodeclaim -o yaml | grep -A 8 'karpenter.sh/drifted'Tip
Drift detection is active by default for EC2NodeClass when any part of the template — AMI, security group, or subnet — changes. For NodePool, drift is detected from changes to requirements, labels, taints, and kubelet configuration.
Sometimes a node is intentionally kept in its old state, for example because it's running a process that must not be interrupted. The karpenter.sh/do-not-drift annotation can be attached to stop that node from being replaced by drift.
apiVersion: v1
kind: Pod
metadata:
name: long-running-job
annotations:
karpenter.sh/do-not-drift: "true"
spec:
containers:
- name: job
image: busyboxImportant
Using karpenter.sh/do-not-drift means accepting the security consequences of an outdated node. Use it only for cases that genuinely need it, and schedule manual replacement afterwards.
Replacing a node for every template change is expensive and risky. Each replacement means creating a new instance, pulling images, and running a drain — no small workload and cost, especially when the change is trivial like updating userData. For such cases, Karpenter provides an experimental feature called NodeOverlay.
NodeOverlay is Karpenter's ability to update parts of a node directly in place, without launching a replacement instance. This feature is enabled via the NodeOverlay feature gate and is currently alpha. With NodeOverlay, changes to userData or AMI configuration that don't need a new kernel can be applied without node replacement.
kubectl set env deployment/karpenter -n karpenter \
--list | grep FEATURE_GATESWarning
As an alpha feature, NodeOverlay may still change behavior and isn't production-appropriate without thorough testing. Weigh the trade-off between efficiency and risk before enabling it.
Consider NodeOverlay when the change being made is configurational, not a change to the instance structure. For example updating userData to install additional dependencies, or adjusting configuration read at boot time. Conversely, changes that alter the kernel or require a new disk are still better handled with a full replacement.
| Scenario | Full replacement | NodeOverlay |
|---|---|---|
| Small userData change | Overkill | Most suitable |
| Large AMI update | Safest | High risk |
| Security group change | Reasonable | Not fully supported |
| Instance type change | Required | Not applicable |
Drift left to pile up makes the cluster run on a foundation that doesn't match the configuration. Monitor the karpenter.sh/drifted annotation regularly and make sure remediation runs.
NodeOverlay is tempting because it looks cheap, but applying an overlay to a configuration that should be fully replaced actually adds risk. Use this feature selectively.
Drift detection is Karpenter's mechanism to make sure the cluster doesn't run far from what's desired. With automatic detection, protection annotations, and NodeOverlay for the right cases, you can keep nodes aligned with the template without sacrificing availability.
Key takeaways:
In episode 12, you'll learn to monitor Karpenter with Prometheus metrics like karpenter_nodes_* and karpenter_pods_*, build Grafana dashboards, and set up alerts for pods stuck Pending too long. See you there!