Interview Prep/AWS/EKS in Production

How do you design Karpenter NodePools for production?

AdvancedProductionEKS in Production
Answer

Separate NodePools by purpose (general, Spot batch, GPU), each with broad instance requirements so Karpenter has choice, limits to cap spend, and disruption settings:

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: "1000"}
  disruption:
    consolidationPolicy: WhenEmptyOrUnderutilized
    consolidateAfter: 1m
    budgets: [{nodes: "10%"}]

Pods still need PodDisruptionBudgets, or consolidation will evict them freely.

aws All AWS questions Roadmap: EKS, ECS & serverless on AWS

More on EKS in Production