노드를 고르고, 줄이고, 바꾸는 규칙
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: kubernetes.io/arch operator: In values: ["amd64", "arm64"]
nodeClassRef: group: eks.amazonaws.com kind: NodeClass name: default requirements: - key: eks.amazonaws.com/instance-category operator: In values: ["c", "m", "r"] - key: karpenter.sh/capacity-type operator: In values: ["on-demand"]
system, general-purpose: On-Demand만, C/M/R 계열, 5세대 이상. 수정 불가WhenEmptyWhenEmptyOrUnderutilizedBalancedBalanced 추가, opt-inBalanced 추가, 기존 NodePool 동작은 그대로Balanced, built-in pool도 BalancedBalanced인 drift가 생깁니다.aws eks update-cluster-config \
--name $CLUSTER \
--kube-scheduler-config \
'{"nodeResourcesFit":{"scoringStrategy":
{"type":"MostAllocated"}}}'
resize subresource.spec.resources도 Pod 재생성 없이 resize| 워크로드 | CPU req=limit | Guaranteed | restartCount | containerID |
|---|---|---|---|---|
| Deployment (Pod 2개) | 200m → 50m | 유지 | 0 → 0 | 동일 |
| StatefulSet | 200m → 50m | 유지 | 0 → 0 | 동일 |
| DaemonSet | 200m → 50m | 유지 | 0 → 0 | 동일 |
pods/resize로 축소, memory 고정disruption: consolidationPolicy: Balanced budgets: - nodes: "10%" - nodes: "0" schedule: "0 0 * * 1-5" # UTC duration: 9h reasons: ["Underutilized", "Drifted"]
nodes: 10% 하나. Auto Mode 기본도 같습니다.expireAfter에 의한 교체는 budget과 무관하게 진행됩니다.spec.weight, spec.limits, spec.disruption.*al2023@v20261012처럼 pin. @latest는 새 AMI마다 전체 Drift라 프로덕션 비권장advancedCompute 변경도 in-place 없이 Drift| 항목 | Self-managed v1.15 | Auto Mode |
|---|---|---|
expireAfter 기본 | 720h (30일) | 336h (14일) |
| 최대 수명 | 상한 없음, Never 허용 | 21일 강제 |
terminationGracePeriod | CRD 기본값 없음 (무제한 대기) | NodeClaim에 24h 적용 |
expireAfter + terminationGracePeriod. Auto Mode는 긴 drain을 더해도 21일 상한이 우선합니다.| 경로 | 방식 | budget | 대체 노드 |
|---|---|---|---|
| Drift | graceful, consolidation보다 먼저 평가 | 적용 | 필요하면 먼저 준비 |
| Consolidation | graceful, requests 기준 재배치 | 적용 | 필요하면 먼저 준비 |
| Expiration | forceful, 정책 나이에 도달하면 시작 | 무시 | Ready를 기다리지 않음 |
kubectl delete node | 수동 삭제, -l이면 일괄 | 무시 | 보장 없음 |
expireAfter를 바꾸면 기존 NodeClaim은 Drift로 교체됩니다.settings.interruptionQueue로 연결interruptionQueue가 없으면 interruption 처리가 꺼집니다.SendSpotInstanceInterruptions 포함. Spot 중단 리허설은 self-managed 노드에서 합니다.pod-deletion-cost로 조정하는 방식은 deprecatedterminationGracePeriod를 설정하면 blocking PDB나 do-not-disrupt가 있어도 Drift 교체가 진행됩니다. Auto Mode는 21일 최대 수명에서 blocking PDB가 있으면 개입이 필요할 수 있습니다.