Spot 인스턴스 전략

지원 버전: EKS 1.29+, EKS Auto Mode GA 마지막 업데이트: 2026년 2월 19일

< 이전: 스케일링 동작 | 목차 | 다음: 운영 및 관리 >


이 문서에서는 EKS Auto Mode에서 Spot 인스턴스를 효과적으로 활용하여 비용을 최적화하는 전략을 설명합니다.

Spot vs On-Demand 혼합 전략

안정성과 비용 효율성을 모두 달성하기 위한 혼합 전략입니다.

# spot-ondemand-mixed.yaml
apiVersion: karpenter.sh/v1
kind: NodePool
metadata:
  name: mixed-capacity
spec:
  template:
    spec:
      requirements:
        - key: karpenter.k8s.aws/instance-category
          operator: In
          values: ["m", "c", "r"]
        - key: karpenter.k8s.aws/instance-generation
          operator: Gt
          values: ["5"]
        # Spot과 On-Demand 모두 허용
        - key: karpenter.sh/capacity-type
          operator: In
          values: ["spot", "on-demand"]
      nodeClassRef:
        group: eks.amazonaws.com
        kind: NodeClass
        name: default
  disruption:
    consolidationPolicy: WhenEmptyOrUnderutilized
    consolidateAfter: 1m
---
# Pod에서 Spot 선호 설정
apiVersion: apps/v1
kind: Deployment
metadata:
  name: spot-friendly-app
spec:
  replicas: 10
  selector:
    matchLabels:
      app: spot-friendly
  template:
    metadata:
      labels:
        app: spot-friendly
    spec:
      # Spot 인스턴스 선호
      affinity:
        nodeAffinity:
          preferredDuringSchedulingIgnoredDuringExecution:
            - weight: 100
              preference:
                matchExpressions:
                  - key: karpenter.sh/capacity-type
                    operator: In
                    values: ["spot"]
      # 중요 워크로드는 On-Demand 필수
      # requiredDuringSchedulingIgnoredDuringExecution:
      #   nodeSelectorTerms:
      #     - matchExpressions:
      #         - key: karpenter.sh/capacity-type
      #           operator: In
      #           values: ["on-demand"]
      containers:
        - name: app
          image: my-app:latest
          resources:
            requests:
              cpu: 500m
              memory: 512Mi

Spot 인스턴스 다양화

인터럽트 위험을 분산하기 위해 다양한 인스턴스 타입을 사용합니다.

Spot 인터럽트 대응

워크로드별 Spot 적합성

워크로드 유형
Spot 적합성
권장 설정

상태 없는 웹 서비스

높음

Spot 우선, On-Demand 폴백

배치 처리

매우 높음

Spot 전용

CI/CD 파이프라인

높음

Spot 전용

개발/테스트 환경

매우 높음

Spot 전용

데이터베이스

낮음

On-Demand 필수

실시간 스트리밍

낮음

On-Demand 필수

GPU/ML 추론

중간

혼합 (중요도에 따라)

비용 절감 사례

Spot 인터럽트 핸들링 모범 사례

1. 애플리케이션 레벨 대응

2. 클러스터 레벨 대응


< 이전: 스케일링 동작 | 목차 | 다음: 운영 및 관리 >

마지막 업데이트