Yash Verma / Cloud runbook

Karpenter commands

11 commands from the cloud runbook. Fill in a placeholder once and every command uses it.

View controller logs

Tails the logs of the Karpenter controller pod.

kubectl logs -f -n kube-system -l app.kubernetes.io/name=karpenter

Current install guides use kube-system; older installs used a karpenter namespace.

logs, debugging

List NodeClaims

Shows all NodeClaims provisioned by Karpenter.

kubectl get nodeclaims

nodes, claims

View disruption logs

Filters Karpenter logs specifically for scale-down and disruption events.

kubectl logs -n kube-system -l app.kubernetes.io/name=karpenter | grep -i disrupt

scaling, disruption, logs

List NodePools

Shows all Karpenter NodePool configurations.

kubectl get nodepools

nodepool, config

Describe a NodeClaim

Shows detailed info about a specific NodeClaim including instance type.

kubectl describe nodeclaim <nodeclaim-name>

describe, instance

List EC2NodeClasses

Shows all EC2NodeClass resources used by Karpenter for AWS configuration.

kubectl get ec2nodeclasses

aws, nodeclass, config

NodePool CPU limits and usage

Shows each NodePool's CPU limit next to the CPU it has provisioned.

kubectl get nodepools -o custom-columns=NAME:.metadata.name,CPU_LIMIT:.spec.limits.cpu,CPU_USED:.status.resources.cpu

nodepools, limits, capacity

Watch nodes being created and removed

Streams NodeClaim changes as Karpenter provisions and consolidates nodes.

kubectl get nodeclaims -w

nodeclaims, watch, consolidation

Why a pending pod got no node

Shows a pod's scheduling events, where Karpenter reports why no NodePool fits it.

kubectl get events -n <namespace> --field-selector involvedObject.name=<pod-name> --sort-by=.lastTimestamp

pending, scheduling, events

Protect a pod from voluntary disruption

Stops Karpenter from consolidating, expiring or replacing the node this pod runs on.

kubectl annotate pod <pod-name> -n <namespace> karpenter.sh/do-not-disrupt=true

Remove it with the same command and a trailing minus: karpenter.sh/do-not-disrupt-

disruption, annotation

Show a NodePool's disruption settings

Prints the consolidation policy and disruption budgets of a NodePool.

kubectl get nodepool <nodepool-name> -o jsonpath='{.spec.disruption}'

disruption, budgets, nodepools