EKS 기반 Agentic AI 해결방안
📅 작성일: 2025-02-05 | 수정일: 2026-02-14 | ⏱️ 읽는 시간: 약 21분
이 문서를 읽기 전에 Agentic AI 워크로드의 기술적 도전과제를 먼저 읽어보시기 바랍니다. 해당 문서에서 4가지 핵심 도전과제와 Kubernetes 기반 오픈소스 생태계에 대해 설명합니다.
개요
Agentic AI 플랫폼의 4가지 핵심 도전과제(GPU 모니터링, 동적 스케일링, 비용 컨트롤, FM 파인튜닝)는 Amazon EKS와 AWS 관리형 서비스의 통합을 통해 효과적으로 해결할 수 있습니다.
이 문서에서는 EKS Auto Mode + Karpenter 중심의 구체적인 해결 방안과 AWS 인프라와의 통합 아키텍처를 다룹니다.
Amazon EKS와 Karpenter: Kubernetes의 장점 극대화
Kubernetes가 AI 플랫폼의 기반이라면, Amazon EKS와 Karpenter의 조합은 Kubernetes의 장점을 극대화하여 완전 자동화된 최적의 인프라를 구현합니다.
EKS + Karpenter + AWS 인프라 통합 아키텍처
왜 EKS + Karpenter인가?
| Aspect | Traditional Cluster Autoscaler | Karpenter on EKS |
|---|---|---|
| Scaling Speed | 60-90 seconds (ASG-based) | 10-30 seconds (direct EC2 API) |
| Instance Selection | Limited by ASG pre-configuration | Dynamic selection from 600+ EC2 types |
| GPU Workloads | Requires separate ASGs per GPU type | Single NodePool handles all GPU types |
| Spot Optimization | Manual fallback configuration | Automatic spot-to-on-demand fallback |
| Cost Efficiency | Limited consolidation | Aggressive bin-packing and consolidation |
| AWS Integration | Indirect via ASG | Direct EC2/Spot API calls |
| Configuration | ASG + IAM + Launch Templates | Simple NodePool CRD |
Karpenter: AI 인프라 자동화의 핵심
Karpenter는 기존 Cluster Autoscaler의 한계를 극복하고, AI 워크로드에 최적화된 노드 프로비저닝을 제공합니다.
Karpenter는 v1.0 이상에서 GA(Generally Available) 상태로, 프로덕션 환경에서 안정적으로 사용할 수 있습니다. v1 API는 이전 버전과 호환되지 않으므로, 새로운 배포 시 v1 API를 사용하는 것을 권장합니다.
주요 변경사항:
- API 버전:
karpenter.sh/v1beta1→karpenter.sh/v1 - NodePool과 EC2NodeClass가 안정화된 API로 제공
- 향후 버전 간 호환성 보장
| Feature | Benefit for Agentic AI |
|---|---|
| Zero-touch Nodes | No manual AMI updates or node group management |
| Automatic Scaling | Built-in autoscaling without Karpenter configuration |
| Security Patching | Automatic OS and Kubernetes security updates |
| Storage Automation | Dynamic PV provisioning for model caching and vector stores |
| Network Policies | Integrated network security for multi-tenant agents |
Karpenter가 제공하는 핵심 가치
| Comparison | Cluster Autoscaler | Karpenter |
|---|---|---|
| Provisioning Time | 5-10 min | 2-3 min |
| Instance Selection | Fixed types in Node Group | Dynamic based on workload |
| GPU Support | Manual Node Group config | Automatic NodePool matching |
| Cost Optimization | Limited | Auto Spot, Consolidation |
EKS Auto Mode: 완전 자동화의 완성
EKS Auto Mode는 Karpenter를 포함한 핵심 컴포넌트들을 자동으로 구성하고 관리하여, AI 인프라 자동화의 마지막 퍼즐을 완성합니다.
EKS Auto Mode vs 수동 구성 비교
| Your Situation | Recommendation |
|---|---|
| New EKS cluster for Agentic AI | **Karpenter** (native AWS integration) |
| Existing cluster with CA | **Migrate to Karpenter** (worth the effort) |
| Need GPU autoscaling | **Karpenter** (required for GPU efficiency) |
| Simple CPU-only workloads | **EKS Auto Mode** (easiest option) |
| Multi-tenant platform | **Karpenter** (better isolation and cost attribution) |
| Regulated industries | **EKS Auto Mode** (compliance-friendly) |
EKS Auto Mode의 AI 워크로드 이점
GPU 워크로드를 위한 EKS Auto Mode 설정
EKS Auto Mode에서 GPU 워크로드를 위한 커스텀 NodePool을 추가할 수 있습니다.
# EKS Auto Mode에서 GPU NodePool 추가
apiVersion: karpenter.sh/v1
kind: NodePool
metadata:
name: gpu-inference-pool
spec:
template:
metadata:
labels:
node-type: gpu-inference
eks-auto-mode: "true"
spec:
requirements:
- key: karpenter.sh/capacity-type
operator: In
values: ["spot", "on-demand"]
- key: node.kubernetes.io/instance-type
operator: In
values:
- g5.xlarge
- g5.2xlarge
- g5.4xlarge
- g5.12xlarge
- p4d.24xlarge
- key: karpenter.k8s.aws/instance-gpu-count
operator: Gt
values: ["0"]
nodeClassRef:
group: karpenter.k8s.aws
kind: EC2NodeClass
name: default # EKS Auto Mode 기본 NodeClass 활용
limits:
nvidia.com/gpu: 50
disruption:
consolidationPolicy: WhenEmptyOrUnderutilized
consolidateAfter: 30s
EKS Auto Mode는 새로운 AI 플랫폼 구축 시 권장되는 옵션입니다.
- Karpenter 설치 및 구성 자동화로 초기 구축 시간 80% 단축
- 핵심 컴포넌트 자동 업그레이드로 운영 부담 대폭 감소
- GPU NodePool만 커스텀 정의하면 즉시 AI 워크로드 배포 가능
EKS Auto Mode는 NVIDIA GPU를 포함한 가속 컴퓨팅 인스턴스를 완벽히 지원합니다. 기본 NodeClass에 GPU 드라이버가 포함된 AMI가 자동으로 선택되며, 필요시 커스텀 NodeClass로 EFA 네트워크 등 고급 설정을 추가할 수 있습니다.
re:Invent 2024/2025 신규 기능:
- EKS Hybrid Nodes (GA): 온프레미스 GPU 인프라를 EKS 클러스터에 통합하여 하이브리드 AI 워크로드 지원
- Enhanced Pod Identity v2: 크로스 계정 IAM 역할 지원으로 멀티 계정 환경에서 안전한 AWS 서비스 접근, 세션 태그 및 조건부 정책 지원 강화
- Native Inferentia/Trainium Support: EKS Auto Mode에서 AWS Inferentia2 및 Trainium 칩 네이티브 지원, Neuron SDK 자동 구성
- CloudWatch GPU Metrics: GPU 사용률, 메모리, 온도 등 GPU 메트릭 자동 수집 및 CloudWatch 통합, DCGM 메트릭 네이티브 지원
- Provisioned Control Plane: 대규모 AI 학습 워크로드를 위한 사전 프로비저닝된 컨트롤 플레인 용량 (XL, 2XL, 4XL 티어)
- Container Network Observability: Pod 간 통신 패턴 및 네트워크 성능 모니터링, VPC Flow Logs 통합
- CloudWatch Control Plane Metrics: 컨트롤 플레인 헬스 선제적 모니터링, API 서버 응답 시간 및 etcd 성능 메트릭
EKS Auto Mode는 기본 GPU 지원을 제공하지만, 다음 구성은 수동 설정이 필요합니다:
자동 구성되지 않는 항목:
- NVIDIA Device Plugin: GPU 리소스 스케줄링을 위한 디바이스 플러그인 수동 설치 필요
- DCGM Exporter: GPU 메트릭 수집을 위한 DCGM Exporter 별도 배포 필요
- GPU 최적화 AMI: 특정 GPU 드라이버 버전이나 CUDA 버전이 필요한 경우 커스텀 AMI 구성 필요
- MIG (Multi-Instance GPU): GPU 파티셔닝을 위한 MIG 모드 수동 활성화 필요
- EFA (Elastic Fabric Adapter): 분산 학습을 위한 고속 네트워크 인터페이스 수동 구성 필요
권장 접근 방식:
- EKS Auto Mode로 클러스터 생성
- NVIDIA GPU Operator를 통해 GPU 스택 자동 설치
- 커스텀 NodeClass로 고급 GPU 설정 추가
# NVIDIA GPU Operator 설치로 GPU 스택 자동화
helm install gpu-operator nvidia/gpu-operator \
--namespace gpu-operator \
--create-namespace \
--set driver.enabled=true \
--set toolkit.enabled=true \
--set devicePlugin.enabled=true \
--set dcgmExporter.enabled=true \
--set migManager.enabled=true
Karpenter vs Cluster Autoscaler 상세 비교
Karpenter는 Node Group 없이 워크로드 요구사항을 직접 분석하여 최적의 인스턴스를 선택합니다. GPU 워크로드의 경우 프로비저닝 시간이 50% 이상 단축되고, Consolidation을 통해 비용이 20-30% 절감됩니다.
도전과제별 Karpenter 해결 방안 매핑
이 문서는 Agentic AI Platform 도입을 검토하는 기술 의사결정자와 솔루션 아키텍트를 대상으로 합니다. Kubernetes 기반 AI 인프라의 필요성과 EKS + Karpenter를 활용한 구체적인 구현 방안을 제공합니다.
도전과제 1: GPU 모니터링 및 리소스 스케줄링
Karpenter 기반 해결 방안
Karpenter NodePool을 활용하면 GPU 워크로드에 최적화된 노드를 자동으로 프로비저닝하고 관리할 수 있습니다.
- GPU NodePool 설정
- EC2NodeClass 설정
apiVersion: karpenter.sh/v1
kind: NodePool
metadata:
name: gpu-inference-pool
spec:
template:
metadata:
labels:
node-type: gpu-inference
workload: genai
spec:
requirements:
- key: kubernetes.io/arch
operator: In
values: ["amd64"]
- key: karpenter.sh/capacity-type
operator: In
values: ["on-demand", "spot"]
- key: node.kubernetes.io/instance-type
operator: In
values:
- p4d.24xlarge # 8x A100 40GB
- p5.48xlarge # 8x H100 80GB
- g5.48xlarge # 8x A10G 24GB
- key: karpenter.k8s.aws/instance-gpu-count
operator: Gt
values: ["0"]
nodeClassRef:
group: karpenter.k8s.aws
kind: EC2NodeClass
name: gpu-nodeclass
taints:
- key: nvidia.com/gpu
value: "true"
effect: NoSchedule
limits:
nvidia.com/gpu: 100
disruption:
consolidationPolicy: WhenEmptyOrUnderutilized
consolidateAfter: 30s
weight: 100
apiVersion: karpenter.k8s.aws/v1
kind: EC2NodeClass
metadata:
name: gpu-nodeclass
spec:
role: KarpenterNodeRole-${CLUSTER_NAME}
amiSelectorTerms:
- alias: al2023@latest
subnetSelectorTerms:
- tags:
karpenter.sh/discovery: ${CLUSTER_NAME}
securityGroupSelectorTerms:
- tags:
karpenter.sh/discovery: ${CLUSTER_NAME}
blockDeviceMappings:
- deviceName: /dev/xvda
ebs:
volumeSize: 500Gi
volumeType: gp3
iops: 10000
throughput: 500
encrypted: true
instanceStorePolicy: RAID0
userData: |
#!/bin/bash
nvidia-smi -pm 1
modprobe efa
Karpenter의 GPU 워크로드 최적화 기능
| Feature | Benefit | Configuration |
|---|---|---|
| Spot + On-Demand Mix | 70% cost savings with automatic fallback | `capacity-type: [spot, on-demand]` |
| Multi-Instance Support | Select optimal GPU type per workload | `instance-family: [g5, g6, p4d, p5]` |
| Consolidation | Bin-pack pods to minimize GPU waste | `consolidationPolicy: WhenUnderutilized` |
| Graceful Disruption | Respect PDBs during node replacement | `budgets: nodes: 10%` |
| Fast Scaling | Provision GPU nodes in under 60 seconds | Direct EC2 API calls |
| Custom AMIs | Pre-loaded models and drivers | `amiSelectorTerms` |
보조 솔루션: NVIDIA GPU Operator
Karpenter와 함께 NVIDIA GPU Operator를 사용하여 GPU 드라이버 및 모니터링 스택을 자동화합니다.
apiVersion: nvidia.com/v1
kind: ClusterPolicy
metadata:
name: cluster-policy
spec:
operator:
defaultRuntime: containerd
driver:
enabled: true
version: "550.127.05" # Latest stable for H100/H200 (driver 550.90.07+ required for H100/H200)
toolkit:
enabled: true
devicePlugin:
enabled: true
dcgmExporter:
enabled: true
migManager:
enabled: true
도전과제 2: Agentic AI 요청 동적 라우팅 및 스케일링
Karpenter + KEDA 연동 해결 방안
Karpenter와 KEDA를 연동하면 워크로드 스케일링과 노드 프로비저닝이 자동으로 연계됩니다.
- KEDA ScaledObject
- Gateway API HTTPRoute
apiVersion: keda.sh/v1alpha1
kind: ScaledObject
metadata:
name: vllm-gpu-scaler
namespace: ai-inference
spec:
scaleTargetRef:
name: vllm-deployment
minReplicaCount: 2
maxReplicaCount: 20
triggers:
- type: prometheus
metadata:
serverAddress: http://prometheus.observability.svc:9090
metricName: vllm_pending_requests
threshold: "50"
query: |
sum(vllm_pending_requests{namespace="ai-inference"})
- type: prometheus
metadata:
serverAddress: http://prometheus.observability.svc:9090
metricName: gpu_utilization
threshold: "70"
query: |
avg(DCGM_FI_DEV_GPU_UTIL{namespace="ai-inference"})
advanced:
horizontalPodAutoscalerConfig:
behavior:
scaleUp:
stabilizationWindowSeconds: 0
policies:
- type: Percent
value: 100
periodSeconds: 15
scaleDown:
stabilizationWindowSeconds: 300
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: ai-model-routing
namespace: ai-inference
spec:
parentRefs:
- name: ai-gateway
namespace: ai-gateway
rules:
- matches:
- path:
type: PathPrefix
value: /v1/chat/completions
headers:
- name: x-model-id
value: "gpt-4"
backendRefs:
- name: vllm-gpt4
port: 8000
weight: 80
- name: vllm-gpt4-canary
port: 8000
weight: 20
- matches:
- path:
type: PathPrefix
value: /v1/chat/completions
headers:
- name: x-model-id
value: "claude-3"
backendRefs:
- name: vllm-claude
port: 8000