CKAD field manual

k8s Karpenter YAML example

HPA adds Pods. Karpenter adds nodes. A NodePool is the policy. A NodeClass is the cloud account.

New towers rise on scaffolding while others come down in the distance; an officer watches from the rooftop. New towers rise on scaffolding while others come down in the distance; an officer watches from the rooftop.
Inspect
kubectl get nodepool
kubectl get nodeclaim
kubectl describe nodepool default
kubectl get nodes -l karpenter.sh/nodepool
NodePool
apiVersion: karpenter.sh/v1
kind: NodePool
metadata:
  name: default
spec:
  template:
    spec:
      nodeClassRef:
        group: karpenter.k8s.aws
        kind: EC2NodeClass
        name: default
      requirements:
        - key: kubernetes.io/arch
          operator: In
          values: ["amd64"]
        - key: karpenter.sh/capacity-type
          operator: In
          values: ["on-demand"]
  limits:
    cpu: "100"
  disruption:
    consolidationPolicy: WhenEmptyOrUnderutilized
    consolidateAfter: 1m

Fields

nodeClassRef
Points at the cloud NodeClass (EC2NodeClass, AKSNodeClass, …). Must already exist.
requirements
What nodes this pool may create. arch, capacity-type, instance-category.
limits
Ceiling for the whole pool. cpu: 100 = stop provisioning past 100 cores.
disruption
WhenEmptyOrUnderutilized + consolidateAfter. This is what deletes idle nodes.

Watch

  • Not a CKAD object. HPA cannot help if the cluster has no room. That is this page.
  • NodePool is the policy. NodeClass is cloud-specific. Both must exist or pods stay Pending.
  • apiVersion is karpenter.sh/v1. Older provisioners.karpenter.sh is gone.

Official docs Karpenter NodePool

Practice these objects on a live cluster →