노드 가용성 모니터링이 어려운 이유

Block 2: 노드 라이프사이클 & 모니터링

"Auto Mode에서 노드가 갑자기 사라지는데, 왜 사라졌는지 파악하기 어렵습니다"
"Spot 인터럽트인지, Consolidation인지, Drift 교체인지 구분이 안 됩니다"

핵심 과제

  • 노드 종료 원인 가시성 부족 — 왜 이 노드가 사라졌는지 로그 추적 필요
  • Karpenter 이벤트 추적 어려움 — Consolidation, Drift, Expiry 구분 필요
  • Spot 인터럽트 사전 감지 필요 — 2분 경고 내에 Pod 안전 이동
이 블록에서 학습할 내용: 노드 상태 시각화, kubectl 진단, Prometheus 쿼리, Spot 대응, expireAfter 전략, AlertManager 알림 구성

노드 상태 대시보드 시뮬레이터

실시간 노드 상태 모니터링 및 이벤트 추적

kubectl 진단 명령어

노드 상태 및 Karpenter 이벤트 확인

kubectl get nodepools
NAME NODECLASS NODES READY AGE general-purpose default 8 8 5d system default 2 2 5d gpu-workload gpu 0 0 5d
kubectl get nodeclaims -o wide
NAME TYPE ZONE CAP-TYPE NODE READY AGE nc-abc123 m5.xlarge ap-ne-2a on-demand ip-10-0-1-5 True 2h nc-def456 c5.2xlarge ap-ne-2b spot ip-10-0-2-8 True 45m nc-ghi789 m5.2xlarge ap-ne-2c on-demand ip-10-0-3-2 True 3h nc-jkl012 r5.xlarge ap-ne-2a spot ip-10-0-1-9 True 1h
kubectl get nodes -L karpenter.sh/nodepool,karpenter.sh/capacity-type
NAME STATUS ROLES AGE NODEPOOL CAPACITY-TYPE ip-10-0-1-5 Ready 2h general-purpose on-demand ip-10-0-2-8 Ready 45m general-purpose spot ip-10-0-3-2 Ready 3h general-purpose on-demand ip-10-0-1-9 Ready 1h general-purpose spot
kubectl get events --sort-by='.lastTimestamp' | grep karpenter
12m Normal Launched nodeclaim/nc-abc123 Launched node ip-10-0-1-5 10m Normal Registered nodeclaim/nc-abc123 Registered node 5m Normal Consolidating nodeclaim/nc-xyz789 Consolidating node (underutilized) 3m Warning SpotInterrupted nodeclaim/nc-old123 Spot instance interrupted 2m Normal Drifted nodeclaim/nc-def456 NodeClass changed
kubectl get pods -A --field-selector=status.phase=Pending
NAMESPACE NAME READY STATUS AGE default web-app-7d9f8b6c5-xyz 0/1 Pending 2m production api-server-5c8d7e-abc 0/1 Pending 1m monitoring prometheus-0 0/1 Pending 30s

Prometheus 쿼리: 노드 모니터링

핵심 Karpenter 메트릭 쿼리

karpenter_nodes_total

NodePool별 총 노드 수 추적

general-purpose
8
system
2
gpu-workload
0
karpenter_pods_pending

스케줄 대기 중인 Pod 수 (프로비저닝 필요 신호)

Current
3
Alert 조건: karpenter_pods_pending > 10 for 5m
sum(karpenter_nodes_total{capacity_type="spot"}) / sum(karpenter_nodes_total) * 100

전체 노드 중 Spot 인스턴스 비율

Spot 비율
40%
60%
On-Demand
40%
Spot
histogram_quantile(0.99, karpenter_nodeclaims_startup_duration_seconds)

노드 프로비저닝 P99 지연 시간

P50
45s
P90
72s
P99
98s

Spot 인터럽트 시뮬레이션

2분 경고 ~ 안전한 Pod 이동 전체 시퀀스

expireAfter 전략 비교

환경별 노드 최대 수명 설정

168h
24h 48h 72h 168h 240h 336h

프로덕션 권장

안정성과 보안 패치 속도의 균형

보안 패치 속도
안정성

NodePool YAML

apiVersion: karpenter.sh/v1 kind: NodePool metadata: name: general-purpose spec: disruption: consolidationPolicy: WhenEmptyOrUnderutilized consolidateAfter: 1m # 프로덕션 권장 값 expireAfter: 168h # 7일

AMI 업데이트 & Drift 감지

NodeClass 변경 시 자동 노드 교체 흐름

1
NodeClass 변경
(AMI 업데이트)
2
Drift 감지
(자동)
3
신규 노드
프로비저닝
4
Pod 안전 이동
(PDB 준수)
5
구 노드
종료

AL2023 vs Bottlerocket 비교

특성 AL2023 Bottlerocket
부팅 시간 40-60초 20-30초
보안 표준 강화 (immutable)
SSH 접근 가능 제한적
패키지 관리 yum/dnf API 기반 업데이트
권장 사용처 디버깅 필요 환경 프로덕션, 보안 중요

AlertManager 알림 규칙

Karpenter 및 노드 상태 알림 구성

PrometheusRule YAML

apiVersion: monitoring.coreos.com/v1 kind: PrometheusRule metadata: name: karpenter-alerts spec: groups: - name: karpenter rules: # Selected alerts will appear here

Day-2 운영 체크리스트

EKS Auto Mode 운영 준비 상태 점검

Disruption & 안정성

  • Disruption Budget 설정 완료
  • PodDisruptionBudget 적용
  • Spot 인터럽트 알림 구성
  • expireAfter 정책 설정
  • 노드 모니터링 대시보드 구축

최적화 & 비용

  • AMI 업데이트 자동화
  • 비용 태깅 (CostCenter, Team)
  • Multi-AZ 배포 확인
  • Topology Spread Constraints 적용
  • 정기 비용 리뷰 스케줄
Tip: 체크리스트 항목을 클릭하여 완료 표시할 수 있습니다. 모든 항목을 점검 후 프로덕션 배포를 진행하세요.

Block 2 요약 & 퀴즈

노드 라이프사이클 & 모니터링 핵심 내용 정리

노드 모니터링

kubectl, Prometheus 쿼리로 노드 상태 및 이벤트 추적

Spot 대응

2분 경고 내 Pod 안전 이동, PDB 준수

운영 전략

expireAfter, Drift, AlertManager 알림

1. Spot 인스턴스 종료 전 경고 시간은?
2. 프로덕션 환경의 권장 expireAfter 값은?
3. 노드 종료 원인을 파악할 수 있는 kubectl 명령은?